@aplus-frontend/ui 0.4.4 → 0.4.6
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/index.mjs +51 -49
- package/es/src/ap-field/date/index.vue.d.ts +1 -0
- package/es/src/ap-field/date/index.vue.mjs +22 -15
- package/es/src/ap-field/interface.d.ts +5 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +55 -55
- package/es/src/ap-table/constants.d.ts +3 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/es/src/ap-table/hooks/use-table-column-state.mjs +92 -92
- package/es/src/business/ap-select-layout/select-layout.vue2.mjs +52 -56
- package/es/src/business/ap-summary/ap-summary.vue.d.ts +0 -1
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +36 -35
- package/es/src/business/ap-summary/index.d.ts +0 -3
- package/es/src/business/batch-input-group/form-item.vue.d.ts +10 -1
- package/es/src/business/batch-input-group/form-item.vue.mjs +50 -49
- package/es/src/business/batch-input-group/interface.d.ts +5 -0
- package/es/src/index.mjs +48 -46
- package/es/src/locale/lang/en.mjs +3 -0
- package/es/src/locale/lang/zh-cn.mjs +3 -0
- package/es/src/scroll-bar/index.d.ts +1 -0
- package/es/src/scroll-bar/index.mjs +4 -0
- package/es/src/scroll-bar/index.vue.d.ts +6 -5
- package/es/src/scroll-bar/index.vue.mjs +51 -38
- package/es/src/scroll-bar/interface.d.ts +1 -1
- package/es/src/scroll-bar/internal.vue.d.ts +1 -1
- package/es/src/scroll-bar/utils/index.d.ts +7 -0
- package/es/src/scroll-bar/utils/index.mjs +16 -11
- package/lib/index.js +1 -1
- package/lib/src/ap-field/date/index.vue.d.ts +1 -0
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +5 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/constants.d.ts +3 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +2 -2
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- package/lib/src/business/ap-select-layout/select-layout.vue2.js +1 -1
- package/lib/src/business/ap-summary/ap-summary.vue.d.ts +0 -1
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/business/ap-summary/index.d.ts +0 -3
- package/lib/src/business/batch-input-group/form-item.vue.d.ts +10 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/interface.d.ts +5 -0
- package/lib/src/index.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/scroll-bar/index.d.ts +1 -0
- package/lib/src/scroll-bar/index.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +6 -5
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/interface.d.ts +1 -1
- package/lib/src/scroll-bar/internal.vue.d.ts +1 -1
- package/lib/src/scroll-bar/utils/index.d.ts +7 -0
- package/lib/src/scroll-bar/utils/index.js +1 -1
- package/package.json +1 -1
- package/theme/ap-table/ap-table.css +4 -4
- package/theme/ap-table/ap-table.less +4 -4
- package/theme/ap-table-modal/index.css +4 -4
- package/theme/index.css +4 -4
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isDef as
|
|
3
|
-
import
|
|
4
|
-
import { useInjectApTable as
|
|
5
|
-
import { isObject as
|
|
6
|
-
function
|
|
7
|
-
|
|
1
|
+
import { ref as D, shallowRef as G, unref as f, computed as W, watchEffect as X } from "vue";
|
|
2
|
+
import { isDef as q } from "../../utils/index.mjs";
|
|
3
|
+
import H, { customCloneColumnStates as B, getColumnStateString as L } from "../components/setting/utils.mjs";
|
|
4
|
+
import { useInjectApTable as P } from "../context.mjs";
|
|
5
|
+
import { isObject as N, mergeWith as F, isBoolean as Q, omit as U, isNumber as b } from "lodash-unified";
|
|
6
|
+
function u(r, o) {
|
|
7
|
+
r.forEach((n) => {
|
|
8
8
|
var i;
|
|
9
|
-
n
|
|
9
|
+
o(n), (i = n.children) != null && i.length && u(n.children, o);
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!
|
|
12
|
+
function V(r, o) {
|
|
13
|
+
if (!o)
|
|
14
14
|
return {};
|
|
15
|
-
const
|
|
16
|
-
return
|
|
15
|
+
const n = r.getItem(o);
|
|
16
|
+
return n ? JSON.parse(n) : {};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
18
|
+
function I(r, o) {
|
|
19
|
+
if (N(r) && N(o))
|
|
20
|
+
return F({}, r, o, I);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
return i ? i.fixed :
|
|
22
|
+
const E = Number.MAX_SAFE_INTEGER;
|
|
23
|
+
function Y(r, o, n, i) {
|
|
24
|
+
return i ? i.fixed : o ? o.fixed : n && "fixed" in n ? n.fixed : Q(r.fixed) ? r.fixed ? "left" : void 0 : r.fixed;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
), { columnsBackup:
|
|
30
|
-
function
|
|
31
|
-
const e =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
),
|
|
26
|
+
const re = (r, o, n) => {
|
|
27
|
+
const i = D(n), c = G(
|
|
28
|
+
B(n)
|
|
29
|
+
), { columnsBackup: x, updateColumns: a } = P(), T = r.persistenceType || "localStorage", S = window[T];
|
|
30
|
+
function O() {
|
|
31
|
+
const e = V(
|
|
32
|
+
S,
|
|
33
|
+
f(o)
|
|
34
|
+
), t = F(
|
|
35
35
|
{},
|
|
36
|
-
|
|
36
|
+
r.defaultValue || {},
|
|
37
37
|
e,
|
|
38
|
-
|
|
39
|
-
), s =
|
|
40
|
-
function
|
|
41
|
-
return
|
|
42
|
-
var
|
|
43
|
-
const
|
|
44
|
-
key:
|
|
45
|
-
label:
|
|
38
|
+
I
|
|
39
|
+
), s = f(x);
|
|
40
|
+
function l(j, h, z) {
|
|
41
|
+
return j.map((d) => {
|
|
42
|
+
var y, A;
|
|
43
|
+
const v = (h == null ? void 0 : h[d.key]) || {}, g = {
|
|
44
|
+
key: d.key,
|
|
45
|
+
label: d.title,
|
|
46
46
|
show: !0,
|
|
47
|
-
fixed:
|
|
48
|
-
|
|
49
|
-
e[
|
|
50
|
-
(
|
|
51
|
-
|
|
47
|
+
fixed: Y(
|
|
48
|
+
d,
|
|
49
|
+
e[d.key],
|
|
50
|
+
(y = r.defaultValue) == null ? void 0 : y[d.key],
|
|
51
|
+
z
|
|
52
52
|
),
|
|
53
53
|
disabled: !1,
|
|
54
|
-
...
|
|
54
|
+
...U(v, ["children", "fixed"])
|
|
55
55
|
};
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
) : void 0,
|
|
61
|
-
}).sort(
|
|
56
|
+
return g.children = (A = d.children) != null && A.length ? l(
|
|
57
|
+
d.children,
|
|
58
|
+
v.children,
|
|
59
|
+
g
|
|
60
|
+
) : void 0, g;
|
|
61
|
+
}).sort(J);
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return l(s || [], t);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const s =
|
|
67
|
-
let
|
|
68
|
-
return e.fixed === "right" &&
|
|
65
|
+
function J(e, t) {
|
|
66
|
+
const s = b(e.order) ? e.order : E;
|
|
67
|
+
let l = b(t.order) ? t.order : E;
|
|
68
|
+
return e.fixed === "right" && t.fixed !== "right" && (l = s - 1), t.fixed === "left" && e.fixed !== "left" && (l = s - 1), s - l;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const m = W(() => f(i).every((e) => e.show));
|
|
71
71
|
function C() {
|
|
72
|
-
const e =
|
|
73
|
-
|
|
74
|
-
!
|
|
72
|
+
const e = f(i);
|
|
73
|
+
u(e, (t) => {
|
|
74
|
+
!t.disabled && (t.show = !0);
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const e =
|
|
79
|
-
|
|
80
|
-
!
|
|
77
|
+
function p() {
|
|
78
|
+
const e = f(i);
|
|
79
|
+
u(e, (t) => {
|
|
80
|
+
!t.disabled && (t.show = !1);
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
83
|
+
function M() {
|
|
84
|
+
f(m) ? p() : C();
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
s.key === e && (s.show =
|
|
86
|
+
function R(e, t) {
|
|
87
|
+
u(f(i), (s) => {
|
|
88
|
+
s.key === e && (s.show = q(t) ? t : !s.show);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
o.value = e;
|
|
93
|
-
}
|
|
94
|
-
function M(e) {
|
|
91
|
+
function w(e) {
|
|
95
92
|
i.value = e;
|
|
96
93
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
function _(e) {
|
|
95
|
+
c.value = e;
|
|
96
|
+
}
|
|
97
|
+
function k(e) {
|
|
98
|
+
if (f(o)) {
|
|
99
|
+
const t = L(e);
|
|
100
|
+
S.setItem(f(o), JSON.stringify(t));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
return
|
|
104
|
-
var
|
|
105
|
-
const e =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
return X(() => {
|
|
104
|
+
var t;
|
|
105
|
+
const e = O();
|
|
106
|
+
w(e), (t = r.onChange) == null || t.call(r, e), a == null || a(
|
|
107
|
+
H(
|
|
108
|
+
f(x),
|
|
109
|
+
f(e)
|
|
110
110
|
)
|
|
111
|
-
),
|
|
111
|
+
), c.value = B(e), k(e);
|
|
112
112
|
}), {
|
|
113
|
-
columnState:
|
|
113
|
+
columnState: i,
|
|
114
114
|
selectAll: C,
|
|
115
|
-
unSelectAll:
|
|
116
|
-
toggleSelect:
|
|
117
|
-
setColumnState:
|
|
118
|
-
isAllSelected:
|
|
119
|
-
toggleSelectAll:
|
|
120
|
-
columnStateBackup:
|
|
121
|
-
setColumnStateBackup:
|
|
122
|
-
cacheColumnStateIfNeeded:
|
|
115
|
+
unSelectAll: p,
|
|
116
|
+
toggleSelect: R,
|
|
117
|
+
setColumnState: w,
|
|
118
|
+
isAllSelected: m,
|
|
119
|
+
toggleSelectAll: M,
|
|
120
|
+
columnStateBackup: c,
|
|
121
|
+
setColumnStateBackup: _,
|
|
122
|
+
cacheColumnStateIfNeeded: k
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
125
|
export {
|
|
126
|
-
|
|
126
|
+
re as useTableColumnState
|
|
127
127
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, ref as d, computed as M, onMounted as O, openBlock as p, createElementBlock as m, normalizeClass as a, unref as t, createVNode as u, Transition as W, withCtx as v, withDirectives as g, createElementVNode as s, toDisplayString as E, createTextVNode as $, Fragment as z, renderList as R, renderSlot as x, vShow as N, createCommentVNode as j } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { IconApLeftarrow as G, IconApMenu as H } from "@aplus-frontend/icon";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { Tooltip as w, TypographyText as J } from "@aplus-frontend/antdv";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
6
|
+
import { useNamespace as K } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
import { ApFieldText as P } from "../../ap-field/text/index.mjs";
|
|
8
|
+
const Q = ["onClick"], ae = /* @__PURE__ */ I({
|
|
10
9
|
__name: "select-layout",
|
|
11
10
|
props: {
|
|
12
11
|
title: {},
|
|
@@ -17,45 +16,42 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
17
16
|
},
|
|
18
17
|
emits: ["onSelect", "afterEnter", "afterLeave"],
|
|
19
18
|
setup(A, { emit: B }) {
|
|
20
|
-
const { b: h, be: y, bem: i } =
|
|
19
|
+
const { b: h, be: y, bem: i } = K("ap-select-layout"), o = A, C = B, S = d(), f = d(o.defaultFold), k = d(!o.defaultFold), T = d(), b = d(), F = d(), c = d(o.defaultValue), L = () => {
|
|
21
20
|
f.value = !f.value, T.value = !1, b.value = !1;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return (l = g.value) == null ? void 0 : l.filter((e) => {
|
|
30
|
-
var r, n;
|
|
31
|
-
return o != null && o.onSearch ? (r = o.onSearch) == null ? void 0 : r.call(o, e, c.value) : (n = e == null ? void 0 : e.name) == null ? void 0 : n.includes(c.value);
|
|
21
|
+
}, V = (n) => {
|
|
22
|
+
F.value = n, C("onSelect", n);
|
|
23
|
+
}, U = M(() => {
|
|
24
|
+
var n;
|
|
25
|
+
return (n = S.value) == null ? void 0 : n.filter((e) => {
|
|
26
|
+
var r, l;
|
|
27
|
+
return o != null && o.onSearch ? (r = o.onSearch) == null ? void 0 : r.call(o, e, c.value) : (l = e == null ? void 0 : e.name) == null ? void 0 : l.includes(c.value);
|
|
32
28
|
});
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
29
|
+
}), q = (n) => {
|
|
30
|
+
k.value = !0, C("afterEnter", n);
|
|
31
|
+
}, D = (n) => {
|
|
32
|
+
k.value = !1, C("afterLeave", n);
|
|
37
33
|
};
|
|
38
|
-
return
|
|
39
|
-
o.request().then((
|
|
34
|
+
return O(() => {
|
|
35
|
+
o.request().then((n) => {
|
|
40
36
|
var r;
|
|
41
|
-
|
|
42
|
-
let e = (r =
|
|
43
|
-
(
|
|
37
|
+
S.value = n;
|
|
38
|
+
let e = (r = S.value) == null ? void 0 : r.filter(
|
|
39
|
+
(l) => l.name.includes(c.value)
|
|
44
40
|
);
|
|
45
|
-
|
|
41
|
+
V(e == null ? void 0 : e[0]);
|
|
46
42
|
});
|
|
47
|
-
}), (
|
|
43
|
+
}), (n, e) => {
|
|
48
44
|
var r;
|
|
49
45
|
return p(), m("div", {
|
|
50
46
|
class: a(t(h)())
|
|
51
47
|
}, [
|
|
52
|
-
|
|
48
|
+
u(W, {
|
|
53
49
|
mode: "out-in",
|
|
54
|
-
onAfterEnter:
|
|
55
|
-
onAfterLeave:
|
|
50
|
+
onAfterEnter: q,
|
|
51
|
+
onAfterLeave: D
|
|
56
52
|
}, {
|
|
57
53
|
default: v(() => [
|
|
58
|
-
|
|
54
|
+
g(s("div", {
|
|
59
55
|
class: a(t(h)("side"))
|
|
60
56
|
}, [
|
|
61
57
|
s("div", {
|
|
@@ -65,15 +61,15 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
65
61
|
s("div", {
|
|
66
62
|
class: a(t(i)("side", "header", "imgWrap"))
|
|
67
63
|
}, [
|
|
68
|
-
|
|
64
|
+
u(t(w), {
|
|
69
65
|
open: T.value,
|
|
70
|
-
"onUpdate:open": e[0] || (e[0] = (
|
|
66
|
+
"onUpdate:open": e[0] || (e[0] = (l) => T.value = l)
|
|
71
67
|
}, {
|
|
72
|
-
title: v(() => e[
|
|
68
|
+
title: v(() => e[3] || (e[3] = [
|
|
73
69
|
$("收起")
|
|
74
70
|
])),
|
|
75
71
|
default: v(() => [
|
|
76
|
-
|
|
72
|
+
u(t(G), { onClick: L })
|
|
77
73
|
]),
|
|
78
74
|
_: 1
|
|
79
75
|
}, 8, ["open"])
|
|
@@ -85,28 +81,28 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
85
81
|
s("div", {
|
|
86
82
|
class: a(t(i)("side", "body", "search"))
|
|
87
83
|
}, [
|
|
88
|
-
|
|
89
|
-
placeholder: "请输入",
|
|
84
|
+
u(t(P), {
|
|
90
85
|
value: c.value,
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
"onUpdate:value": e[1] || (e[1] = (l) => c.value = l),
|
|
87
|
+
placeholder: "请输入"
|
|
88
|
+
}, null, 8, ["value"])
|
|
93
89
|
], 2),
|
|
94
90
|
s("div", {
|
|
95
91
|
class: a(t(i)("side", "body", "scroll"))
|
|
96
92
|
}, [
|
|
97
|
-
(p(!0), m(
|
|
98
|
-
key:
|
|
99
|
-
class: a(`${t(i)("side", "body", "scroll-item")} ${
|
|
100
|
-
onClick: (
|
|
93
|
+
(p(!0), m(z, null, R(U.value, (l) => g((p(), m("div", {
|
|
94
|
+
key: l.value,
|
|
95
|
+
class: a(`${t(i)("side", "body", "scroll-item")} ${F.value === l ? "active" : ""}`),
|
|
96
|
+
onClick: (X) => V(l)
|
|
101
97
|
}, [
|
|
102
|
-
x(
|
|
103
|
-
|
|
104
|
-
ellipsis: { tooltip:
|
|
105
|
-
content: `${
|
|
98
|
+
x(n.$slots, "itemRender", { item: l }, () => [
|
|
99
|
+
u(t(J), {
|
|
100
|
+
ellipsis: { tooltip: l.name },
|
|
101
|
+
content: `${l.name}`
|
|
106
102
|
}, null, 8, ["ellipsis", "content"])
|
|
107
103
|
])
|
|
108
|
-
], 10,
|
|
109
|
-
[N,
|
|
104
|
+
], 10, Q)), [
|
|
105
|
+
[N, k.value]
|
|
110
106
|
])), 128))
|
|
111
107
|
], 2)
|
|
112
108
|
], 2)
|
|
@@ -126,29 +122,29 @@ const X = ["onClick"], re = /* @__PURE__ */ O({
|
|
|
126
122
|
key: 0,
|
|
127
123
|
class: a(t(i)("content", "header", "imgWrap"))
|
|
128
124
|
}, [
|
|
129
|
-
|
|
125
|
+
u(t(w), {
|
|
130
126
|
open: b.value,
|
|
131
|
-
"onUpdate:open": e[
|
|
127
|
+
"onUpdate:open": e[2] || (e[2] = (l) => b.value = l)
|
|
132
128
|
}, {
|
|
133
|
-
title: v(() => e[
|
|
129
|
+
title: v(() => e[4] || (e[4] = [
|
|
134
130
|
$("展开")
|
|
135
131
|
])),
|
|
136
132
|
default: v(() => [
|
|
137
|
-
|
|
133
|
+
u(t(H), { onClick: L })
|
|
138
134
|
]),
|
|
139
135
|
_: 1
|
|
140
136
|
}, 8, ["open"])
|
|
141
137
|
], 2)) : j("", !0),
|
|
142
138
|
s("div", {
|
|
143
139
|
class: a(t(i)("content", "header", "title"))
|
|
144
|
-
}, E((r =
|
|
140
|
+
}, E((r = F.value) == null ? void 0 : r.name), 3)
|
|
145
141
|
], 2),
|
|
146
|
-
x(
|
|
142
|
+
x(n.$slots, "default")
|
|
147
143
|
], 2)
|
|
148
144
|
], 2);
|
|
149
145
|
};
|
|
150
146
|
}
|
|
151
147
|
});
|
|
152
148
|
export {
|
|
153
|
-
|
|
149
|
+
ae as default
|
|
154
150
|
};
|
|
@@ -2,7 +2,6 @@ import { ApSummaryProps } from './interface';
|
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
declare const _default: DefineComponent<ApSummaryProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApSummaryProps> & Readonly<{}>, {
|
|
4
4
|
size: "middle" | "small";
|
|
5
|
-
summaryTitle: string;
|
|
6
5
|
hasSelect: boolean;
|
|
7
6
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
8
7
|
export default _default;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isNil as
|
|
3
|
-
import { TableSummaryRow as
|
|
4
|
-
import { flattenColumns as
|
|
1
|
+
import { defineComponent as w, computed as y, createVNode as z, Fragment as f, openBlock as m, createBlock as i, unref as r, normalizeClass as x, withCtx as k, createElementBlock as B, renderList as R, normalizeStyle as A, resolveDynamicComponent as D } from "vue";
|
|
2
|
+
import { isNil as F, get as c } from "lodash-unified";
|
|
3
|
+
import { TableSummaryRow as V, TableSummaryCell as E } from "@aplus-frontend/antdv";
|
|
4
|
+
import { flattenColumns as P, formatDataIndex as u } from "./utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { isNumeric as
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { isNumeric as $, toThousand as j, toFixed as q } from "@aplus-frontend/utils";
|
|
7
|
+
import { useLocale as G } from "../../config-provider/hooks/use-locale.mjs";
|
|
8
|
+
import { useNamespace as H } from "../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const Y = /* @__PURE__ */ w({
|
|
9
10
|
name: "ApSummary",
|
|
10
11
|
__name: "ap-summary",
|
|
11
12
|
props: {
|
|
12
13
|
data: {},
|
|
13
14
|
columns: {},
|
|
14
|
-
summaryTitle: {
|
|
15
|
-
default: "合计"
|
|
16
|
-
},
|
|
15
|
+
summaryTitle: {},
|
|
17
16
|
hasSelect: {
|
|
18
17
|
type: Boolean,
|
|
19
18
|
default: !0
|
|
@@ -22,14 +21,16 @@ const Q = /* @__PURE__ */ I({
|
|
|
22
21
|
default: "middle"
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const n =
|
|
24
|
+
setup(h) {
|
|
25
|
+
const n = h, {
|
|
26
|
+
t: T
|
|
27
|
+
} = G(), S = y(() => n.summaryTitle ?? T("ap.apSummary.total")), C = (a) => a === 0, _ = (a, o) => {
|
|
27
28
|
var s;
|
|
28
|
-
if (
|
|
29
|
+
if (!$(a) || o.valueType !== "number")
|
|
29
30
|
return a;
|
|
30
31
|
const e = (s = o.fieldProps) == null ? void 0 : s.field, t = (e == null ? void 0 : e.precision) || 0;
|
|
31
|
-
return (
|
|
32
|
-
},
|
|
32
|
+
return (F(e == null ? void 0 : e.thousands) ? !0 : e == null ? void 0 : e.thousands) ? j(a, t) : q(a, t);
|
|
33
|
+
}, g = y(() => {
|
|
33
34
|
let a = [];
|
|
34
35
|
n.hasSelect && a.push({
|
|
35
36
|
key: "select",
|
|
@@ -37,17 +38,17 @@ const Q = /* @__PURE__ */ I({
|
|
|
37
38
|
align: "left",
|
|
38
39
|
value: ""
|
|
39
40
|
});
|
|
40
|
-
const e =
|
|
41
|
+
const e = P(n.columns).map((t, d) => {
|
|
41
42
|
let s;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
s =
|
|
45
|
-
else if (
|
|
46
|
-
const p = c(n.data, u(t.dataIndex || t.key)),
|
|
43
|
+
const L = c(n.data, u(t.dataIndex || t.key));
|
|
44
|
+
if (C(d))
|
|
45
|
+
s = S.value;
|
|
46
|
+
else if (L && (t.customRender || t.renderText)) {
|
|
47
|
+
const p = c(n.data, u(t.dataIndex || t.key)), N = u(t.dataIndex || t.key), l = t.customRender || t.renderText;
|
|
47
48
|
s = l == null ? void 0 : l({
|
|
48
49
|
value: p,
|
|
49
50
|
record: {
|
|
50
|
-
[
|
|
51
|
+
[N]: p
|
|
51
52
|
},
|
|
52
53
|
text: void 0,
|
|
53
54
|
index: 0,
|
|
@@ -55,32 +56,32 @@ const Q = /* @__PURE__ */ I({
|
|
|
55
56
|
column: {}
|
|
56
57
|
});
|
|
57
58
|
} else
|
|
58
|
-
s =
|
|
59
|
+
s = _(c(n.data, u(t.dataIndex || t.key)), t);
|
|
59
60
|
return {
|
|
60
61
|
key: t.key,
|
|
61
62
|
rowSpan: 1,
|
|
62
63
|
align: t.align,
|
|
63
|
-
value:
|
|
64
|
+
value: z(f, null, [s])
|
|
64
65
|
};
|
|
65
66
|
});
|
|
66
67
|
return a.concat(e);
|
|
67
68
|
}), {
|
|
68
|
-
b:
|
|
69
|
-
e:
|
|
70
|
-
em:
|
|
71
|
-
} =
|
|
72
|
-
return (a, o) => (m(), i(r(
|
|
73
|
-
class:
|
|
69
|
+
b: v,
|
|
70
|
+
e: b,
|
|
71
|
+
em: I
|
|
72
|
+
} = H("ap-summary");
|
|
73
|
+
return (a, o) => (m(), i(r(V), {
|
|
74
|
+
class: x(r(v)())
|
|
74
75
|
}, {
|
|
75
|
-
default:
|
|
76
|
+
default: k(() => [(m(!0), B(f, null, R(g.value, (e, t) => (m(), i(r(E), {
|
|
76
77
|
key: e.key,
|
|
77
|
-
class:
|
|
78
|
+
class: x(`${n.size === "small" ? r(I)("item", "small") : r(b)("item")}`),
|
|
78
79
|
index: t,
|
|
79
|
-
style:
|
|
80
|
+
style: A({
|
|
80
81
|
textAlign: e.align
|
|
81
82
|
})
|
|
82
83
|
}, {
|
|
83
|
-
default:
|
|
84
|
+
default: k(() => [(m(), i(D(e.value)))]),
|
|
84
85
|
_: 2
|
|
85
86
|
}, 1032, ["class", "index", "style"]))), 128))]),
|
|
86
87
|
_: 1
|
|
@@ -88,5 +89,5 @@ const Q = /* @__PURE__ */ I({
|
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
Y as default
|
|
92
93
|
};
|
|
@@ -5,7 +5,6 @@ export * from './utils';
|
|
|
5
5
|
declare const ApSummary: {
|
|
6
6
|
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApSummaryProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
7
7
|
size: "middle" | "small";
|
|
8
|
-
summaryTitle: string;
|
|
9
8
|
hasSelect: boolean;
|
|
10
9
|
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
11
10
|
P: {};
|
|
@@ -16,7 +15,6 @@ declare const ApSummary: {
|
|
|
16
15
|
Defaults: {};
|
|
17
16
|
}, Readonly< ApSummaryProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
18
17
|
size: "middle" | "small";
|
|
19
|
-
summaryTitle: string;
|
|
20
18
|
hasSelect: boolean;
|
|
21
19
|
}>;
|
|
22
20
|
__isFragment?: never;
|
|
@@ -24,7 +22,6 @@ declare const ApSummary: {
|
|
|
24
22
|
__isSuspense?: never;
|
|
25
23
|
} & ComponentOptionsBase<Readonly< ApSummaryProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
26
24
|
size: "middle" | "small";
|
|
27
|
-
summaryTitle: string;
|
|
28
25
|
hasSelect: boolean;
|
|
29
26
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & ( Plugin & (new (...args: any[]) => {
|
|
30
27
|
$props: {
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { ApFormItemBatchInputProps } from './interface';
|
|
1
|
+
import { ApFormItemBatchInputProps, BatchInputGroupProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
declare const _default: DefineComponent<ApFormItemBatchInputProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApFormItemBatchInputProps> & Readonly<{}>, {
|
|
4
4
|
trim: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
bordered: boolean;
|
|
7
|
+
field: Omit< BatchInputGroupProps, "value" | "onUpdate:value">;
|
|
8
|
+
colon: boolean;
|
|
9
|
+
required: boolean;
|
|
10
|
+
hasFeedback: boolean;
|
|
11
|
+
autoLink: boolean;
|
|
12
|
+
validateFirst: boolean;
|
|
13
|
+
defaultSelectedAllKey: boolean;
|
|
5
14
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
6
15
|
export default _default;
|