@aplus-frontend/ui 0.1.39 → 0.1.41
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 +136 -134
- package/es/src/ap-action/group/index.vue.d.ts +1 -1
- package/es/src/ap-download/interface.d.ts +1 -1
- package/es/src/ap-field/date/index.vue.d.ts +1 -1
- package/es/src/ap-field/date-range/index.vue.d.ts +1 -1
- package/es/src/ap-field/number/index.vue.d.ts +1 -1
- package/es/src/ap-field/rate/index.vue.d.ts +1 -1
- package/es/src/ap-field/select/index.vue.d.ts +1 -1
- package/es/src/ap-form/ap-form-item.vue.d.ts +1 -1
- package/es/src/ap-form/index.d.ts +3 -1
- package/es/src/ap-form/index.mjs +8 -4
- package/es/src/ap-form/interface.d.ts +1 -0
- package/es/src/ap-form/items/number/index.vue.d.ts +16 -16
- package/es/src/ap-form/items/text/index.vue.d.ts +12 -12
- package/es/src/ap-form/items/text/password.vue.d.ts +12 -12
- package/es/src/ap-form/items/text-area/index.vue.d.ts +12 -12
- package/es/src/ap-form/modal-form/drawer.vue.d.ts +830 -0
- package/es/src/ap-form/modal-form/drawer.vue.mjs +288 -0
- package/es/src/ap-form/modal-form/drawer.vue2.mjs +4 -0
- package/es/src/ap-table/ap-table.vue.mjs +40 -40
- package/es/src/ap-table/constants.d.ts +209 -209
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/es/src/ap-table/hooks/use-table-paging.mjs +74 -74
- package/es/src/ap-table/utils.d.ts +72 -72
- package/es/src/base-button/index.d.ts +4 -4
- package/es/src/business/ap-label/ApLabel.d.ts +1 -1
- package/es/src/business/index.d.ts +11 -11
- package/es/src/check-card/group.vue.d.ts +1 -1
- package/es/src/config-provider/config-provider-props.d.ts +5 -0
- package/es/src/config-provider/config-provider-props.mjs +4 -0
- package/es/src/config-provider/config-provider.d.ts +90 -3
- package/es/src/config-provider/config-provider.mjs +27 -23
- package/es/src/config-provider/css-var.d.ts +88 -0
- package/es/src/{theme/css-var/index.mjs → config-provider/css-var.mjs} +1 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +5 -0
- package/es/src/config-provider/index.d.ts +486 -9
- package/es/src/index.mjs +107 -105
- package/es/src/theme/antd-global-overwrite/admin/button.css +0 -3
- package/es/src/theme/antd-global-overwrite/admin/index.css +0 -3
- package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -3
- package/es/src/theme/antd-global-overwrite/aplus/index.css +0 -3
- package/es/src/type.d.ts +3 -0
- package/es/src/utils/config-provider-preset.d.ts +3 -3
- package/lib/index.js +1 -1
- package/lib/src/ap-action/group/index.vue.d.ts +1 -1
- package/lib/src/ap-download/interface.d.ts +1 -1
- package/lib/src/ap-field/date/index.vue.d.ts +1 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +1 -1
- package/lib/src/ap-field/number/index.vue.d.ts +1 -1
- package/lib/src/ap-field/rate/index.vue.d.ts +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +1 -1
- package/lib/src/ap-form/ap-form-item.vue.d.ts +1 -1
- package/lib/src/ap-form/index.d.ts +3 -1
- package/lib/src/ap-form/index.js +1 -1
- package/lib/src/ap-form/interface.d.ts +1 -0
- package/lib/src/ap-form/items/number/index.vue.d.ts +16 -16
- package/lib/src/ap-form/items/text/index.vue.d.ts +12 -12
- package/lib/src/ap-form/items/text/password.vue.d.ts +12 -12
- package/lib/src/ap-form/items/text-area/index.vue.d.ts +12 -12
- package/lib/src/ap-form/modal-form/drawer.vue.d.ts +830 -0
- package/lib/src/ap-form/modal-form/drawer.vue.js +1 -0
- package/lib/src/ap-form/modal-form/drawer.vue2.js +1 -0
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +209 -209
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/utils.d.ts +72 -72
- package/lib/src/base-button/index.d.ts +4 -4
- package/lib/src/business/ap-label/ApLabel.d.ts +1 -1
- package/lib/src/business/index.d.ts +11 -11
- package/lib/src/check-card/group.vue.d.ts +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +5 -0
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +90 -3
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/css-var.d.ts +88 -0
- package/lib/src/{theme/css-var/index.js → config-provider/css-var.js} +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +5 -0
- package/lib/src/config-provider/index.d.ts +486 -9
- package/lib/src/index.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/button.css +0 -3
- package/lib/src/theme/antd-global-overwrite/admin/index.css +0 -3
- package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -3
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +0 -3
- package/lib/src/type.d.ts +3 -0
- package/lib/src/utils/config-provider-preset.d.ts +3 -3
- package/package.json +2 -2
- package/es/src/theme/css-var/index.d.ts +0 -7
- package/lib/src/theme/css-var/index.d.ts +0 -7
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { parseFieldValue as
|
|
3
|
-
import { isArray as
|
|
1
|
+
import { ref as x, nextTick as I, unref as o, onMounted as k, computed as V, createVNode as P } from "vue";
|
|
2
|
+
import { parseFieldValue as ee, dataIndexToStr as te } from "../utils.mjs";
|
|
3
|
+
import { isArray as B } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import { useLocale as ae } from "../../config-provider/hooks/use-locale.mjs";
|
|
6
|
-
import { useNamespace as
|
|
6
|
+
import { useNamespace as oe } from "../../config-provider/hooks/use-namespace.mjs";
|
|
7
7
|
const ue = ({
|
|
8
|
-
manual:
|
|
9
|
-
defaultCurrent:
|
|
8
|
+
manual: E = !1,
|
|
9
|
+
defaultCurrent: M = 1,
|
|
10
10
|
defaultPageSize: w = 10,
|
|
11
|
-
request:
|
|
12
|
-
defaultParams:
|
|
13
|
-
defaultData:
|
|
11
|
+
request: N,
|
|
12
|
+
defaultParams: $ = {},
|
|
13
|
+
defaultData: q = [],
|
|
14
14
|
formatParams: C,
|
|
15
15
|
paramsValueTypeMap: y,
|
|
16
16
|
resetFieldsIgnores: D,
|
|
17
|
-
filterFields:
|
|
18
|
-
sortFields:
|
|
19
|
-
showLessItems:
|
|
20
|
-
showTotal:
|
|
17
|
+
filterFields: J,
|
|
18
|
+
sortFields: L,
|
|
19
|
+
showLessItems: b = !1,
|
|
20
|
+
showTotal: Q = !0
|
|
21
21
|
}) => {
|
|
22
|
-
let
|
|
23
|
-
const
|
|
22
|
+
let z = 0, f = {};
|
|
23
|
+
const G = (e) => C ? C(e) : e, c = x(), l = x(M), p = x(w), {
|
|
24
24
|
t: F
|
|
25
25
|
} = ae(), {
|
|
26
|
-
b:
|
|
27
|
-
} =
|
|
26
|
+
b: S
|
|
27
|
+
} = oe("ap-table"), n = x({
|
|
28
28
|
total: 0,
|
|
29
|
-
records:
|
|
29
|
+
records: q,
|
|
30
30
|
loading: !1
|
|
31
31
|
}), O = async (e) => {
|
|
32
32
|
var r;
|
|
33
|
-
const a =
|
|
34
|
-
|
|
33
|
+
const a = G(e), t = Date.now();
|
|
34
|
+
z = t, n.value.loading = !0;
|
|
35
35
|
try {
|
|
36
|
-
const s = await
|
|
37
|
-
|
|
36
|
+
const s = await N({
|
|
37
|
+
...$,
|
|
38
38
|
...a
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
z === t && (n.value.total = s.total || ((r = s.data) == null ? void 0 : r.length) || 0, n.value.records = [...s.data || []]);
|
|
41
41
|
} catch {
|
|
42
|
-
|
|
42
|
+
z === t && (n.value.records = [], n.value.total = 0);
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
n.value.loading = !1;
|
|
45
45
|
}
|
|
46
46
|
}, R = (e) => {
|
|
47
47
|
const a = {};
|
|
48
48
|
return Object.entries(e).forEach(([t, r]) => {
|
|
49
49
|
if (a[t] = r, y && r) {
|
|
50
50
|
const s = y[t];
|
|
51
|
-
s && (a[t] =
|
|
51
|
+
s && (a[t] = ee(s, r));
|
|
52
52
|
}
|
|
53
53
|
}), a;
|
|
54
|
-
},
|
|
54
|
+
}, H = async (e) => {
|
|
55
55
|
var r, s, g, d, m, u, h;
|
|
56
56
|
const a = ((s = (r = c.value) == null ? void 0 : r.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
|
|
57
57
|
Object.entries(a).forEach(([v, i]) => {
|
|
58
58
|
D && D.indexOf(v) > -1 && (t[v] = i);
|
|
59
|
-
}), await ((d = (g = c.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t),
|
|
59
|
+
}), await ((d = (g = c.value) == null ? void 0 : g.apForm) == null ? void 0 : d.resetFields()), (h = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || h.call(u, t), I(() => {
|
|
60
60
|
e == null || e();
|
|
61
61
|
});
|
|
62
|
-
},
|
|
62
|
+
}, T = (e) => {
|
|
63
63
|
f = e;
|
|
64
64
|
const a = R(e);
|
|
65
65
|
O(a);
|
|
66
|
-
},
|
|
67
|
-
|
|
66
|
+
}, K = (e) => {
|
|
67
|
+
T({
|
|
68
68
|
...f,
|
|
69
69
|
...e
|
|
70
70
|
});
|
|
71
71
|
}, j = () => {
|
|
72
72
|
var a, t;
|
|
73
73
|
const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
74
|
-
l.value = 1,
|
|
74
|
+
l.value = 1, T({
|
|
75
75
|
...e,
|
|
76
76
|
current: 1,
|
|
77
77
|
pageSize: f.pageSize || w
|
|
78
78
|
});
|
|
79
|
-
}, K = () => {
|
|
80
|
-
G(j);
|
|
81
79
|
}, U = () => {
|
|
82
|
-
|
|
83
|
-
}, W = (
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
H(j);
|
|
81
|
+
}, W = () => {
|
|
82
|
+
T(f);
|
|
83
|
+
}, X = (e) => {
|
|
84
|
+
const a = o(n).total - e, t = Math.ceil(a / o(p)), r = o(l) > t ? t : o(l);
|
|
85
|
+
K({
|
|
86
86
|
current: r > 0 ? r : 1
|
|
87
87
|
});
|
|
88
88
|
}, A = (e, a, t) => {
|
|
89
89
|
var m, u, h, v;
|
|
90
90
|
const r = ((u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
|
|
91
91
|
l.value = e.current, p.value = e.pageSize;
|
|
92
|
-
const s =
|
|
92
|
+
const s = B(t) ? [...t] : [t], g = {};
|
|
93
93
|
for (const i of s)
|
|
94
|
-
(h =
|
|
94
|
+
(h = o(L)) != null && h.includes(i.field) && (g[te(i.field)] = i.order);
|
|
95
95
|
const d = {};
|
|
96
96
|
for (const i of Object.keys(a))
|
|
97
|
-
(v =
|
|
98
|
-
|
|
97
|
+
(v = o(J)) != null && v.includes(i) && (d[i] = a[i]);
|
|
98
|
+
T({
|
|
99
99
|
...r,
|
|
100
100
|
filter: d,
|
|
101
101
|
sort: g,
|
|
@@ -103,58 +103,58 @@ const ue = ({
|
|
|
103
103
|
pageSize: e.pageSize
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
k(() => {
|
|
107
107
|
var a, t;
|
|
108
108
|
const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
|
|
109
109
|
if (f = {
|
|
110
|
-
current:
|
|
111
|
-
pageSize:
|
|
110
|
+
current: o(l),
|
|
111
|
+
pageSize: o(p),
|
|
112
112
|
...e
|
|
113
|
-
}, !
|
|
113
|
+
}, !E) {
|
|
114
114
|
const r = R(f);
|
|
115
115
|
O(r);
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
const
|
|
119
|
-
function
|
|
120
|
-
e
|
|
118
|
+
const Y = V(() => o(n).total === 0 ? "-" : `${o(l.value)}/${Math.ceil(o(n).total / o(p))}`);
|
|
119
|
+
function Z(e) {
|
|
120
|
+
B(e) && (n.value.records = e, n.value.total = e.length);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
loading: n
|
|
122
|
+
const _ = V(() => ({
|
|
123
|
+
loading: o(n).loading,
|
|
124
124
|
pagination: {
|
|
125
|
-
current:
|
|
126
|
-
pageSize:
|
|
127
|
-
total: n
|
|
128
|
-
showSizeChanger: !
|
|
129
|
-
showQuickJumper: !
|
|
130
|
-
showLessItems:
|
|
125
|
+
current: o(l),
|
|
126
|
+
pageSize: o(p),
|
|
127
|
+
total: o(n).total,
|
|
128
|
+
showSizeChanger: !b,
|
|
129
|
+
showQuickJumper: !b,
|
|
130
|
+
showLessItems: b,
|
|
131
131
|
size: "default",
|
|
132
|
-
showTotal:
|
|
133
|
-
class:
|
|
134
|
-
}, [F("ap.apTable.pagination.totalLeftPrefix"), " ",
|
|
135
|
-
class:
|
|
136
|
-
}, [e]), " ", F("ap.apTable.pagination.totalLeftSuffix"),
|
|
137
|
-
class:
|
|
138
|
-
}, [F("ap.apTable.pagination.totalRightPrefix"), " ",
|
|
139
|
-
class:
|
|
140
|
-
}, [
|
|
132
|
+
showTotal: Q ? (e) => P("span", {
|
|
133
|
+
class: S("pagination-total-wrapper")
|
|
134
|
+
}, [F("ap.apTable.pagination.totalLeftPrefix"), " ", P("span", {
|
|
135
|
+
class: S("pagination-count-text")
|
|
136
|
+
}, [e]), " ", F("ap.apTable.pagination.totalLeftSuffix"), P("span", {
|
|
137
|
+
class: S("pagination--total-right")
|
|
138
|
+
}, [F("ap.apTable.pagination.totalRightPrefix"), " ", P("span", {
|
|
139
|
+
class: S("pagination-count-text")
|
|
140
|
+
}, [o(Y)]), " ", F("ap.apTable.pagination.totalRightSuffix")])]) : void 0
|
|
141
141
|
},
|
|
142
142
|
onChange: A,
|
|
143
|
-
dataSource: n
|
|
143
|
+
dataSource: o(n).records
|
|
144
144
|
}));
|
|
145
145
|
return {
|
|
146
146
|
formRef: c,
|
|
147
147
|
submit: j,
|
|
148
|
-
reset:
|
|
149
|
-
refresh:
|
|
150
|
-
refreshByDelete:
|
|
151
|
-
data:
|
|
148
|
+
reset: U,
|
|
149
|
+
refresh: W,
|
|
150
|
+
refreshByDelete: X,
|
|
151
|
+
data: n,
|
|
152
152
|
current: l,
|
|
153
153
|
pageSize: p,
|
|
154
154
|
handleTableChange: A,
|
|
155
|
-
tableProps:
|
|
156
|
-
dataSource: V(() => n
|
|
157
|
-
setDataSource:
|
|
155
|
+
tableProps: _,
|
|
156
|
+
dataSource: V(() => o(n).records),
|
|
157
|
+
setDataSource: Z
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
160
|
export {
|