@aplus-frontend/ui 6.13.4 → 6.15.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/ap-grid/hooks/use-row-selection.d.ts +6 -5
- package/es/src/ap-grid/hooks/use-row-selection.mjs +71 -56
- package/es/src/ap-grid/index.vue.mjs +7 -10
- package/es/src/ap-grid/utils/table.mjs +8 -8
- package/es/src/ap-list/hooks/use-offline-list.d.ts +3 -0
- package/es/src/ap-list/hooks/use-offline-list.mjs +25 -19
- package/es/src/ap-list/interface.d.ts +3 -5
- package/es/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +153 -116
- package/es/src/business/ap-export-group/convertExportField.d.ts +3 -1
- package/es/src/business/ap-export-group/index.d.ts +3 -3
- package/es/src/business/ap-export-group/interface.d.ts +14 -2
- package/es/src/business/ap-table-modal/interface.d.ts +3 -1
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +32 -30
- package/es/src/design-token/index.mjs +1 -1
- package/es/src/editable-table/hooks/use-get-columns.mjs +18 -18
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-grid/hooks/use-row-selection.d.ts +6 -5
- package/lib/src/ap-grid/hooks/use-row-selection.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/table.js +1 -1
- package/lib/src/ap-list/hooks/use-offline-list.d.ts +3 -0
- package/lib/src/ap-list/hooks/use-offline-list.js +1 -1
- package/lib/src/ap-list/interface.d.ts +3 -5
- package/lib/src/business/ap-export-group/ApExportGroup.vue.d.ts +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/convertExportField.d.ts +3 -1
- package/lib/src/business/ap-export-group/index.d.ts +3 -3
- package/lib/src/business/ap-export-group/interface.d.ts +14 -2
- package/lib/src/business/ap-table-modal/interface.d.ts +3 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
- package/lib/src/design-token/index.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
- package/theme/antdv-override.css +0 -24
- package/theme/antdv-override.less +0 -33
- package/theme/ap-grid/index.css +11 -4
- package/theme/ap-grid/index.less +11 -2
- package/theme/ap-table-modal/index.css +3 -2
- package/theme/ap-table-modal/index.less +3 -2
- package/theme/css-var.css +2 -0
- package/theme/css-var.less +4 -0
- package/theme/index.css +16 -30
- package/theme/reset.css +18 -0
- package/theme/reset.less +26 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TableRowSelection } from '@aplus-frontend/antdv/lib/table/interface';
|
|
2
2
|
import { ComputedRef, Ref } from 'vue';
|
|
3
|
-
import { ApTableProps
|
|
3
|
+
import { ApTableProps } from '../../ap-table';
|
|
4
4
|
import { Recordable } from '../../type';
|
|
5
|
+
import { ApGridRowSelection } from '../interface';
|
|
5
6
|
export interface RowSelectionReturnType<RecordType = any> {
|
|
6
7
|
rowSelection: ComputedRef<TableRowSelection<RecordType>>;
|
|
7
8
|
selectedRows: Ref<Partial<RecordType>[]>;
|
|
@@ -58,12 +59,12 @@ export interface RowSelectionReturnType<RecordType = any> {
|
|
|
58
59
|
unSelectMulti: (items: RecordType[]) => void;
|
|
59
60
|
/**
|
|
60
61
|
* VxeTable 表格checkbox-change事件
|
|
61
|
-
* @param item
|
|
62
62
|
* @param select
|
|
63
|
-
* @param
|
|
63
|
+
* @param selectedRows
|
|
64
|
+
* @param reserveSelectedRows
|
|
64
65
|
* @returns
|
|
65
66
|
*/
|
|
66
|
-
selectChange: (
|
|
67
|
+
selectChange: (select: boolean, selectedRows: RecordType[], reserveSelectedRows: RecordType[]) => void;
|
|
67
68
|
/**
|
|
68
69
|
* VxeTable 表格checkbox-all事件
|
|
69
70
|
* @param item
|
|
@@ -86,7 +87,7 @@ export interface RowSelectionReturnType<RecordType = any> {
|
|
|
86
87
|
*/
|
|
87
88
|
selectMultiByKeys: (keys: (string | number)[]) => void;
|
|
88
89
|
}
|
|
89
|
-
type RowSelectionParams<T> =
|
|
90
|
+
type RowSelectionParams<T> = ApGridRowSelection<T> & {
|
|
90
91
|
/**
|
|
91
92
|
* 数据源(如果是后端分页,则表示当页数据,否则是全量数据)
|
|
92
93
|
*/
|
|
@@ -1,117 +1,132 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { isFunction as
|
|
3
|
-
function
|
|
4
|
-
return !(c != null && c.length) ||
|
|
1
|
+
import { ref as F, computed as M, unref as o } from "vue";
|
|
2
|
+
import { isFunction as v, cloneDeep as h } from "lodash-unified";
|
|
3
|
+
function T(a, c) {
|
|
4
|
+
return !(c != null && c.length) || v(a) ? [] : c.map((d) => ({ [a]: d }));
|
|
5
5
|
}
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
b(a.rowKey, a.defaultSelectedRowKeys)
|
|
6
|
+
const m = (a) => {
|
|
7
|
+
const c = F(
|
|
8
|
+
T(a.rowKey, a.defaultSelectedRowKeys)
|
|
10
9
|
);
|
|
11
|
-
function
|
|
10
|
+
function d(e, t) {
|
|
12
11
|
c.value = t;
|
|
13
12
|
}
|
|
14
|
-
const
|
|
13
|
+
const u = (e) => v(a.rowKey) ? a.rowKey(e) : e[a.rowKey], s = M(() => {
|
|
15
14
|
const e = /* @__PURE__ */ new Map();
|
|
16
15
|
return o(c).forEach((t) => {
|
|
17
|
-
e.set(
|
|
16
|
+
e.set(u(t), t);
|
|
18
17
|
}), e;
|
|
19
18
|
});
|
|
20
|
-
function
|
|
21
|
-
return o(s).has(
|
|
19
|
+
function w(e) {
|
|
20
|
+
return o(s).has(u(e));
|
|
22
21
|
}
|
|
23
22
|
function g(e) {
|
|
23
|
+
if (!f(e))
|
|
24
|
+
return;
|
|
24
25
|
const t = o(s);
|
|
25
|
-
t.set(
|
|
26
|
+
t.set(u(e), e), c.value = [...t.values()];
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function x(e) {
|
|
28
29
|
const t = o(s);
|
|
29
30
|
for (const n of e)
|
|
30
|
-
t.set(
|
|
31
|
+
f(n) && t.set(u(n), n);
|
|
31
32
|
c.value = [...t.values()];
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
34
|
+
function y(e) {
|
|
35
|
+
if (v(a.rowKey))
|
|
35
36
|
return;
|
|
36
37
|
const t = o(s);
|
|
37
38
|
for (const n of e) {
|
|
38
|
-
const
|
|
39
|
-
(
|
|
40
|
-
),
|
|
41
|
-
t.set(
|
|
39
|
+
const l = o(a.dataSource).find(
|
|
40
|
+
(i) => u(i) === n
|
|
41
|
+
), r = { [a.rowKey]: n };
|
|
42
|
+
f(l || r) && t.set(n, l || r);
|
|
42
43
|
}
|
|
43
44
|
c.value = [...t.values()];
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function E(e) {
|
|
47
|
+
if (!f(e))
|
|
48
|
+
return;
|
|
46
49
|
const t = o(s);
|
|
47
|
-
t.delete(
|
|
50
|
+
t.delete(u(e)), c.value = [...t.values()];
|
|
48
51
|
}
|
|
49
|
-
function
|
|
52
|
+
function K(e) {
|
|
50
53
|
const t = o(s);
|
|
51
54
|
for (const n of e)
|
|
52
|
-
t.delete(
|
|
55
|
+
f(n) && t.delete(u(n));
|
|
53
56
|
c.value = [...t.values()];
|
|
54
57
|
}
|
|
55
|
-
function
|
|
58
|
+
function S(e, t) {
|
|
56
59
|
const n = e;
|
|
57
|
-
for (const
|
|
58
|
-
n.set(l
|
|
60
|
+
for (const l of t)
|
|
61
|
+
n.set(u(l), l);
|
|
59
62
|
return n;
|
|
60
63
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
+
function b(e, t, n) {
|
|
65
|
+
const l = o(s);
|
|
66
|
+
e ? S(l, [...n, ...t]) : o(a.dataSource).forEach((r) => {
|
|
67
|
+
const i = u(r);
|
|
68
|
+
t.some((B) => u(B) === i) ? l.set(i, r) : l.delete(i);
|
|
69
|
+
}), c.value = [...l.values()];
|
|
64
70
|
}
|
|
65
71
|
function A(e, t) {
|
|
66
|
-
|
|
72
|
+
const n = h(o(s));
|
|
73
|
+
e ? S(n, t) : o(a.dataSource).forEach((l) => {
|
|
74
|
+
f(l) && n.delete(u(l));
|
|
75
|
+
}), c.value = [...n.values()];
|
|
76
|
+
}
|
|
77
|
+
function f(e) {
|
|
78
|
+
const t = a.shown, n = a.disabled, l = t ? t(e) : !0, r = n ? n(e) : !1;
|
|
79
|
+
return l && !r;
|
|
67
80
|
}
|
|
68
81
|
function C(e, t) {
|
|
69
|
-
const n =
|
|
70
|
-
o(a.dataSource).forEach((
|
|
71
|
-
e.find((
|
|
72
|
-
}),
|
|
82
|
+
const n = h(o(s));
|
|
83
|
+
o(a.dataSource).forEach((l) => {
|
|
84
|
+
e.find((i) => u(i) === u(l)) ? n.set(u(l), l) : n.delete(u(l));
|
|
85
|
+
}), S(n, t), c.value = [...n.values()];
|
|
73
86
|
}
|
|
74
|
-
function
|
|
87
|
+
function D() {
|
|
75
88
|
const e = o(s);
|
|
76
89
|
o(a.dataSource).forEach((t) => {
|
|
77
|
-
e.set(
|
|
90
|
+
f(t) && e.set(u(t), t);
|
|
78
91
|
}), c.value = [...e.values()];
|
|
79
92
|
}
|
|
80
93
|
function R(e) {
|
|
81
|
-
|
|
94
|
+
if (!f(e))
|
|
95
|
+
return;
|
|
96
|
+
const t = o(s), n = u(e);
|
|
82
97
|
t.has(n) ? t.delete(n) : t.set(n, e), c.value = [...t.values()];
|
|
83
98
|
}
|
|
84
|
-
function
|
|
99
|
+
function I() {
|
|
85
100
|
const e = o(s);
|
|
86
101
|
o(a.dataSource).forEach((t) => {
|
|
87
|
-
e.delete(
|
|
102
|
+
f(t) && e.delete(u(t));
|
|
88
103
|
}), c.value = [...e.values()];
|
|
89
104
|
}
|
|
90
|
-
function
|
|
105
|
+
function k() {
|
|
91
106
|
c.value = [];
|
|
92
107
|
}
|
|
93
108
|
return {
|
|
94
109
|
select: g,
|
|
95
|
-
unSelect:
|
|
96
|
-
isSelected:
|
|
97
|
-
selectAll:
|
|
98
|
-
unSelectAll:
|
|
99
|
-
clearAll:
|
|
110
|
+
unSelect: E,
|
|
111
|
+
isSelected: w,
|
|
112
|
+
selectAll: D,
|
|
113
|
+
unSelectAll: I,
|
|
114
|
+
clearAll: k,
|
|
100
115
|
toggleSelect: R,
|
|
101
116
|
selectedRows: c,
|
|
102
|
-
selectMulti:
|
|
103
|
-
unSelectMulti:
|
|
104
|
-
rowSelection:
|
|
117
|
+
selectMulti: x,
|
|
118
|
+
unSelectMulti: K,
|
|
119
|
+
rowSelection: M(() => ({
|
|
105
120
|
...a,
|
|
106
|
-
onChange:
|
|
107
|
-
selectedRowKeys: o(c).map((e) =>
|
|
121
|
+
onChange: d,
|
|
122
|
+
selectedRowKeys: o(c).map((e) => u(e))
|
|
108
123
|
})),
|
|
109
|
-
selectChange:
|
|
124
|
+
selectChange: b,
|
|
110
125
|
selectAllChange: A,
|
|
111
126
|
selectRangeChange: C,
|
|
112
|
-
selectMultiByKeys:
|
|
127
|
+
selectMultiByKeys: y
|
|
113
128
|
};
|
|
114
129
|
};
|
|
115
130
|
export {
|
|
116
|
-
|
|
131
|
+
m as default
|
|
117
132
|
};
|
|
@@ -252,17 +252,14 @@ const Gt = /* @__PURE__ */ $e({
|
|
|
252
252
|
dataSource: Pe,
|
|
253
253
|
rowKey: o.rowKey
|
|
254
254
|
}), Te = ({
|
|
255
|
-
checked: e
|
|
256
|
-
row: t
|
|
255
|
+
checked: e
|
|
257
256
|
}) => {
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
y.selectChange(t, e, r);
|
|
265
|
-
}
|
|
257
|
+
const t = s.value;
|
|
258
|
+
t && t && y.selectChange(
|
|
259
|
+
e,
|
|
260
|
+
t.getCheckboxRecords(),
|
|
261
|
+
t.getCheckboxReserveRecords()
|
|
262
|
+
);
|
|
266
263
|
}, Ne = ({
|
|
267
264
|
checked: e
|
|
268
265
|
}) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { omit as
|
|
1
|
+
import { omit as u, isUndefined as s, isFunction as c, isNumber as C } from "lodash-unified";
|
|
2
2
|
import { isDef as m } from "../../utils/index.mjs";
|
|
3
3
|
const g = 20, w = 50, b = (e) => e.some((t) => !!t.html);
|
|
4
|
-
function
|
|
4
|
+
function v(e) {
|
|
5
5
|
var n;
|
|
6
6
|
const t = {
|
|
7
|
-
...
|
|
7
|
+
...u(e, [
|
|
8
8
|
"columns",
|
|
9
9
|
"request",
|
|
10
10
|
"searchForm",
|
|
@@ -42,7 +42,7 @@ function R(e) {
|
|
|
42
42
|
range: o.range || !1
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig =
|
|
45
|
+
return t.border = e.bordered === !1 ? "inner" : !0, e.expandable && (t.expandConfig = u(e.expandable, [
|
|
46
46
|
"renderContent",
|
|
47
47
|
"width",
|
|
48
48
|
"title"
|
|
@@ -50,10 +50,10 @@ function R(e) {
|
|
|
50
50
|
enabled: !1
|
|
51
51
|
}, t.virtualYConfig = {
|
|
52
52
|
enabled: !1
|
|
53
|
-
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card,
|
|
53
|
+
}) : (f(t, "X", e.virtual), f(t, "Y", e.virtual)), t.round = m(e.round) ? e.round : !e.card, t.headerCellConfig = {
|
|
54
54
|
height: 36,
|
|
55
55
|
...t.headerCellConfig || {}
|
|
56
|
-
}
|
|
56
|
+
}, t.treeConfig && (t.treeConfig = {
|
|
57
57
|
...t.treeConfig || {},
|
|
58
58
|
/**
|
|
59
59
|
* 使用非树层级列表,配合transform
|
|
@@ -62,7 +62,7 @@ function R(e) {
|
|
|
62
62
|
}), t;
|
|
63
63
|
}
|
|
64
64
|
function f(e, t, i) {
|
|
65
|
-
const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1,
|
|
65
|
+
const n = t === "X", o = n ? "x" : "y", r = n ? "virtualXConfig" : "virtualYConfig", l = i == null ? void 0 : i[o], a = l !== !1, d = n ? g : w, h = C(l) && l >= 0 ? l : d;
|
|
66
66
|
e[r] = {
|
|
67
67
|
enabled: a,
|
|
68
68
|
gt: h,
|
|
@@ -94,5 +94,5 @@ function k(e) {
|
|
|
94
94
|
export {
|
|
95
95
|
k as getRowExpandProps,
|
|
96
96
|
K as getRowSelectionProps,
|
|
97
|
-
|
|
97
|
+
v as toVxeProps
|
|
98
98
|
};
|
|
@@ -14,6 +14,9 @@ export declare const useOfflineList: <DataType = Recordable>(params: ApListProps
|
|
|
14
14
|
total: number;
|
|
15
15
|
showSizeChanger: boolean;
|
|
16
16
|
showQuickJumper: boolean;
|
|
17
|
+
showLessItems: boolean | undefined;
|
|
18
|
+
size: "default" | "small";
|
|
19
|
+
pageSizeOptions: (string | number)[];
|
|
17
20
|
}>;
|
|
18
21
|
dataSource: ComputedRef<DataType[]>;
|
|
19
22
|
onChange: (page: number, size: number) => void;
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ref as g, computed as f, unref as n } from "vue";
|
|
2
|
+
import { isDef as s } from "../../utils/index.mjs";
|
|
3
|
+
import { isUndefined as S } from "lodash-unified";
|
|
4
|
+
const C = (e) => {
|
|
5
|
+
const i = g(
|
|
4
6
|
e.pagination && e.pagination.defaultCurrent || 1
|
|
5
|
-
),
|
|
7
|
+
), o = g(
|
|
6
8
|
e.pagination && e.pagination.defaultPageSize || 10
|
|
7
9
|
);
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
+
function d(t, a) {
|
|
11
|
+
i.value = t, o.value = a;
|
|
10
12
|
}
|
|
11
|
-
const
|
|
12
|
-
(
|
|
13
|
-
|
|
13
|
+
const p = f(() => e.dataSource ? e.pagination === !1 ? [...e.dataSource] : e.dataSource.slice(
|
|
14
|
+
(n(i) - 1) * n(o),
|
|
15
|
+
n(i) * n(o)
|
|
14
16
|
) : []);
|
|
15
17
|
return {
|
|
16
|
-
pagination:
|
|
17
|
-
var
|
|
18
|
+
pagination: f(() => {
|
|
19
|
+
var c;
|
|
20
|
+
const { showLessItems: t, showSizeChanger: a, showQuickJumper: r, pageSizeOptions: u } = e.pagination || {};
|
|
18
21
|
return {
|
|
19
|
-
current:
|
|
20
|
-
pageSize:
|
|
21
|
-
total: ((
|
|
22
|
-
showSizeChanger: !
|
|
23
|
-
showQuickJumper: !
|
|
22
|
+
current: n(i),
|
|
23
|
+
pageSize: n(o),
|
|
24
|
+
total: ((c = e.dataSource) == null ? void 0 : c.length) || 0,
|
|
25
|
+
showSizeChanger: s(a) ? a : !t,
|
|
26
|
+
showQuickJumper: s(r) ? r : !t,
|
|
27
|
+
showLessItems: t,
|
|
28
|
+
size: "default",
|
|
29
|
+
pageSizeOptions: S(u) ? ["10", "20", "50", "100"] : u
|
|
24
30
|
};
|
|
25
31
|
}),
|
|
26
|
-
dataSource:
|
|
27
|
-
onChange:
|
|
32
|
+
dataSource: p,
|
|
33
|
+
onChange: d
|
|
28
34
|
};
|
|
29
35
|
};
|
|
30
36
|
export {
|
|
31
|
-
|
|
37
|
+
C as useOfflineList
|
|
32
38
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleValue } from 'vue';
|
|
2
|
-
import { RequestData } from '../ap-table';
|
|
2
|
+
import { ApTablePaginationConfig, RequestData } from '../ap-table';
|
|
3
3
|
import { Recordable } from '../type';
|
|
4
4
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
5
5
|
export type ApListProps<RecordType = any, ParamsType = Recordable> = {
|
|
@@ -49,14 +49,12 @@ export type ApListProps<RecordType = any, ParamsType = Recordable> = {
|
|
|
49
49
|
/**
|
|
50
50
|
* 是否显示分页器(特定的分页器)或者指定默认的当前页和pageSize
|
|
51
51
|
*/
|
|
52
|
-
pagination?: false | {
|
|
53
|
-
defaultCurrent?: number;
|
|
54
|
-
defaultPageSize?: number;
|
|
52
|
+
pagination?: false | (Omit<ApTablePaginationConfig, 'showTotal'> & {
|
|
55
53
|
/**
|
|
56
54
|
* 只有一页时隐藏分页
|
|
57
55
|
*/
|
|
58
56
|
hideOnSinglePage?: boolean;
|
|
59
|
-
};
|
|
57
|
+
});
|
|
60
58
|
/**
|
|
61
59
|
* 是否手动发起第一次网络请求
|
|
62
60
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApExportGroupProps } from './interface';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
declare const _default: DefineComponent<ApExportGroupProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApExportGroupProps> & Readonly<{}>, {
|
|
4
|
-
type: "button" | "dropdown";
|
|
4
|
+
type: "button" | "dropdown" | "group";
|
|
5
5
|
exportField: boolean | {
|
|
6
6
|
key?: string;
|
|
7
7
|
convertField?: {
|