@aplus-frontend/ui 6.14.0 → 6.16.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/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-batch-action/ApBatchAction.vue.d.ts +3 -1
- package/es/src/business/ap-batch-action/ApBatchAction.vue2.mjs +35 -31
- package/es/src/business/ap-batch-action/index.d.ts +9 -3
- package/es/src/business/ap-batch-action/interface.d.ts +4 -0
- 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/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/text/index.vue.d.ts +1 -1
- package/es/src/text/index.vue.mjs +49 -43
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/es/test/setup.d.ts +1 -5
- 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-batch-action/ApBatchAction.vue.d.ts +3 -1
- package/lib/src/business/ap-batch-action/ApBatchAction.vue2.js +1 -1
- package/lib/src/business/ap-batch-action/index.d.ts +9 -3
- package/lib/src/business/ap-batch-action/interface.d.ts +4 -0
- 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/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/text/index.vue.d.ts +1 -1
- package/lib/src/text/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/lib/test/setup.d.ts +1 -5
- package/package.json +1 -1
- 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/index.css +17 -6
- package/theme/text/index.css +3 -0
- package/theme/text/index.less +3 -0
|
@@ -5,7 +5,7 @@ import { ApExportGroupProps } from './interface';
|
|
|
5
5
|
export * from './interface';
|
|
6
6
|
declare const ApExportGroup: {
|
|
7
7
|
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
8
|
-
type: "button" | "dropdown";
|
|
8
|
+
type: "button" | "dropdown" | "group";
|
|
9
9
|
exportField: boolean | {
|
|
10
10
|
key?: string;
|
|
11
11
|
convertField?: {
|
|
@@ -21,7 +21,7 @@ declare const ApExportGroup: {
|
|
|
21
21
|
M: {};
|
|
22
22
|
Defaults: {};
|
|
23
23
|
}, Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
24
|
-
type: "button" | "dropdown";
|
|
24
|
+
type: "button" | "dropdown" | "group";
|
|
25
25
|
exportField: boolean | {
|
|
26
26
|
key?: string;
|
|
27
27
|
convertField?: {
|
|
@@ -34,7 +34,7 @@ declare const ApExportGroup: {
|
|
|
34
34
|
__isTeleport?: never;
|
|
35
35
|
__isSuspense?: never;
|
|
36
36
|
} & ComponentOptionsBase<Readonly< ApExportGroupProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
37
|
-
type: "button" | "dropdown";
|
|
37
|
+
type: "button" | "dropdown" | "group";
|
|
38
38
|
exportField: boolean | {
|
|
39
39
|
key?: string;
|
|
40
40
|
convertField?: {
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { ApBatchActionGroupButtonProps } from '../ap-batch-action-group';
|
|
2
|
+
export type ApExportGroupProps = {
|
|
2
3
|
/**
|
|
3
4
|
* 类型
|
|
4
5
|
*/
|
|
5
|
-
type?: 'button' | 'dropdown';
|
|
6
|
+
type?: 'button' | 'dropdown' | 'group';
|
|
6
7
|
/**
|
|
7
8
|
* 选中行的Key列表
|
|
8
9
|
*/
|
|
9
10
|
selectedRowKeys?: any[];
|
|
11
|
+
/**
|
|
12
|
+
* 类型为group时配置,适用于多导出
|
|
13
|
+
*/
|
|
14
|
+
groupList?: ApExportGroupListItem[];
|
|
15
|
+
/**
|
|
16
|
+
* 类型为group时配置,和批量操作按钮组buttonProps一致
|
|
17
|
+
*/
|
|
18
|
+
buttonProps?: ApBatchActionGroupButtonProps;
|
|
19
|
+
} & ApExportGroupListItem;
|
|
20
|
+
export interface ApExportGroupListItem {
|
|
10
21
|
/**
|
|
11
22
|
* 是否禁用
|
|
12
23
|
*/
|
|
@@ -57,5 +68,6 @@ export declare enum ApExportGroupActionType {
|
|
|
57
68
|
}
|
|
58
69
|
export type ApExportGroupAntMenuInfo = {
|
|
59
70
|
key: string | number;
|
|
71
|
+
option?: ApExportGroupListItem;
|
|
60
72
|
};
|
|
61
73
|
export type ApExportGroupMixedParams<ParamsType> = Partial<ParamsType>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VNode, VNodeChild } from 'vue';
|
|
1
|
+
import { StyleValue, VNode, VNodeChild } from 'vue';
|
|
2
2
|
import { ApTableProps } from '../../ap-table';
|
|
3
3
|
import { ModalProps, TableProps } from '@aplus-frontend/antdv';
|
|
4
4
|
/** table-modal的props类型 */
|
|
@@ -75,6 +75,8 @@ export interface TableLayoutConfig {
|
|
|
75
75
|
leftTitle?: string | VNodeChild;
|
|
76
76
|
/** 右侧标题 */
|
|
77
77
|
rightTitle?: (selectedCount: number) => string | VNodeChild;
|
|
78
|
+
/** 右侧内容样式 */
|
|
79
|
+
rightContentStyle?: StyleValue;
|
|
78
80
|
/** 已经选择item渲染, renderSelectedItem有值才为复杂布局 */
|
|
79
81
|
renderSelectedItem?: (record: any, actions: {
|
|
80
82
|
deleteItem: (record: any) => void;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { defineComponent as v, createElementBlock as o, openBlock as l, normalizeClass as a, unref as t, renderSlot as h, Fragment as
|
|
1
|
+
import { defineComponent as v, createElementBlock as o, openBlock as l, normalizeClass as a, unref as t, renderSlot as h, Fragment as n, createCommentVNode as b, createElementVNode as m, createVNode as p, withCtx as i, createBlock as s, resolveDynamicComponent as c, h as S, normalizeStyle as B, createTextVNode as $, toDisplayString as M, renderList as A } from "vue";
|
|
2
2
|
import "../../../config-provider/index.mjs";
|
|
3
|
-
import { ApTitle as
|
|
4
|
-
import { Button as V, Empty as
|
|
5
|
-
import { useLocale as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
const
|
|
3
|
+
import { ApTitle as T } from "../../ap-title/index.mjs";
|
|
4
|
+
import { Button as V, Empty as k } from "@aplus-frontend/antdv";
|
|
5
|
+
import { useLocale as D } from "../../../config-provider/hooks/use-locale.mjs";
|
|
6
|
+
import { useNamespace as j } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
7
|
+
const q = /* @__PURE__ */ v({
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
|
10
10
|
leftTitle: { type: [String, Object, Number, Boolean, null, Array], default: "" },
|
|
11
11
|
rightTitle: {},
|
|
12
|
+
rightContentStyle: { type: [Boolean, null, String, Object, Array] },
|
|
12
13
|
renderSelectedItem: {},
|
|
13
14
|
selectedList: { default: () => [] }
|
|
14
15
|
},
|
|
15
16
|
emits: ["clear", "deleteItem"],
|
|
16
|
-
setup(
|
|
17
|
-
const { t: d } =
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
}, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } =
|
|
17
|
+
setup(I, { emit: C }) {
|
|
18
|
+
const { t: d } = D(), u = I, y = C, E = () => {
|
|
19
|
+
y("clear");
|
|
20
|
+
}, L = (e) => {
|
|
21
|
+
y("deleteItem", e);
|
|
22
|
+
}, N = (e) => typeof u.rightTitle == "function" ? u.rightTitle(e) : `${d("ap.apTableModal.selected")} (${e})`, { m: r } = j("ap-table-modal");
|
|
22
23
|
return (e, w) => (l(), o("div", {
|
|
23
24
|
class: a([
|
|
24
25
|
e.renderSelectedItem ? t(r)("table-layout") : "",
|
|
25
26
|
{ "complex-layout": !!e.renderSelectedItem }
|
|
26
27
|
])
|
|
27
28
|
}, [
|
|
28
|
-
e.renderSelectedItem ? (l(), o(
|
|
29
|
+
e.renderSelectedItem ? (l(), o(n, { key: 0 }, [
|
|
29
30
|
e.leftTitle ? (l(), o("div", {
|
|
30
31
|
key: 0,
|
|
31
32
|
class: a(t(r)("table-layout-left"))
|
|
32
33
|
}, [
|
|
33
|
-
p(t(
|
|
34
|
-
prefix:
|
|
35
|
-
(l(), s(c(
|
|
34
|
+
p(t(T), { style: { "margin-bottom": "16px" } }, {
|
|
35
|
+
prefix: i(() => [
|
|
36
|
+
(l(), s(c(S(n, [e.leftTitle]))))
|
|
36
37
|
]),
|
|
37
38
|
_: 1
|
|
38
39
|
}),
|
|
@@ -43,22 +44,23 @@ const O = /* @__PURE__ */ v({
|
|
|
43
44
|
], 2)
|
|
44
45
|
], 2)) : b("", !0),
|
|
45
46
|
m("div", {
|
|
46
|
-
class: a(t(r)("table-layout-right"))
|
|
47
|
+
class: a(t(r)("table-layout-right")),
|
|
48
|
+
style: B(e.rightContentStyle)
|
|
47
49
|
}, [
|
|
48
|
-
p(t(
|
|
50
|
+
p(t(T), {
|
|
49
51
|
title: `${t(d)("ap.apTableModal.selected")} (${e.selectedList.length})`
|
|
50
52
|
}, {
|
|
51
|
-
prefix:
|
|
52
|
-
(l(), s(c(
|
|
53
|
+
prefix: i(() => [
|
|
54
|
+
(l(), s(c(S(n, [N(e.selectedList.length)]))))
|
|
53
55
|
]),
|
|
54
|
-
suffix:
|
|
56
|
+
suffix: i(() => [
|
|
55
57
|
p(t(V), {
|
|
56
58
|
type: "link",
|
|
57
59
|
style: { padding: "0px", height: "22px", "border-width": "0px" },
|
|
58
|
-
onClick:
|
|
60
|
+
onClick: E
|
|
59
61
|
}, {
|
|
60
|
-
default:
|
|
61
|
-
$(
|
|
62
|
+
default: i(() => [
|
|
63
|
+
$(M(t(d)("ap.apTableModal.clear")), 1)
|
|
62
64
|
]),
|
|
63
65
|
_: 1
|
|
64
66
|
})
|
|
@@ -68,21 +70,21 @@ const O = /* @__PURE__ */ v({
|
|
|
68
70
|
m("div", {
|
|
69
71
|
class: a(t(r)("table-layout-right-content"))
|
|
70
72
|
}, [
|
|
71
|
-
(l(!0), o(
|
|
73
|
+
(l(!0), o(n, null, A(e.selectedList, (f) => {
|
|
72
74
|
var g;
|
|
73
|
-
return l(), s(c((g = e.renderSelectedItem) == null ? void 0 : g.call(e,
|
|
75
|
+
return l(), s(c((g = e.renderSelectedItem) == null ? void 0 : g.call(e, f, { deleteItem: L })), { key: f });
|
|
74
76
|
}), 128)),
|
|
75
|
-
e.selectedList.length === 0 ? (l(), s(t(
|
|
77
|
+
e.selectedList.length === 0 ? (l(), s(t(k), {
|
|
76
78
|
key: 0,
|
|
77
|
-
image: t(
|
|
79
|
+
image: t(k).PRESENTED_IMAGE_SIMPLE,
|
|
78
80
|
style: { "margin-top": "100px" }
|
|
79
81
|
}, null, 8, ["image"])) : b("", !0)
|
|
80
82
|
], 2)
|
|
81
|
-
],
|
|
83
|
+
], 6)
|
|
82
84
|
], 64)) : h(e.$slots, "default", { key: 1 })
|
|
83
85
|
], 2));
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
88
|
export {
|
|
87
|
-
|
|
89
|
+
q as default
|
|
88
90
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useSlots as
|
|
1
|
+
import { useSlots as C, computed as N, unref as m } from "vue";
|
|
2
2
|
import { omit as y, isFunction as k, isArray as f } from "lodash-unified";
|
|
3
3
|
import { getEditableTableTitle as w, mergeClass as A, getFinalNode as q } from "../utils.mjs";
|
|
4
4
|
import { updateFormProps as v, getFieldProps as E, getTableRenderProps as G } from "../../ap-table/utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
6
|
import { useToken as S } from "@aplus-frontend/antdv/es/theme/internal";
|
|
7
7
|
import { useNamespace as U } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
-
const M = (
|
|
8
|
+
const M = (t, b) => {
|
|
9
9
|
const {
|
|
10
10
|
em: x,
|
|
11
11
|
be: g
|
|
12
|
-
} = U("editable-table"), F =
|
|
13
|
-
return
|
|
14
|
-
const d =
|
|
12
|
+
} = U("editable-table"), F = C(), [, h] = S();
|
|
13
|
+
return N(() => {
|
|
14
|
+
const d = t.columns;
|
|
15
15
|
if (!d)
|
|
16
16
|
return [];
|
|
17
17
|
function c(I) {
|
|
18
18
|
return I.map((e) => ({
|
|
19
19
|
...y(e, ["ellipsis"]),
|
|
20
20
|
children: c(e.children || []),
|
|
21
|
-
title: w(e, g("table-header", "title"), x("header-cell", "required"), F.headerCell, m(h).
|
|
21
|
+
title: w(e, g("table-header", "title"), x("header-cell", "required"), F.headerCell, m(h).colorTextTertiary),
|
|
22
22
|
customRender({
|
|
23
|
-
value:
|
|
23
|
+
value: l,
|
|
24
24
|
...n
|
|
25
25
|
}) {
|
|
26
26
|
const o = k(e.editable) ? e.editable(n.text, n.record, n.index) : !!e.editable;
|
|
@@ -28,35 +28,35 @@ const M = (a, b) => {
|
|
|
28
28
|
return console.warn("can not render table cell because no `valueType` / `customRender` / `customRenderFormItem`"), null;
|
|
29
29
|
let r;
|
|
30
30
|
if (o) {
|
|
31
|
-
const
|
|
32
|
-
value:
|
|
31
|
+
const a = v(e, E(e.fieldProps, {
|
|
32
|
+
value: l,
|
|
33
33
|
...n
|
|
34
34
|
})), i = {};
|
|
35
|
-
|
|
35
|
+
t.onFieldChange && (i[`onUpdate:${a.valuePropName || "value"}`] = (T) => {
|
|
36
36
|
var s;
|
|
37
|
-
return (s =
|
|
37
|
+
return (s = t.onFieldChange) == null ? void 0 : s.call(t, n.index, e.dataIndex, T);
|
|
38
38
|
});
|
|
39
39
|
const R = f(e.dataIndex) ? e.dataIndex : [e.dataIndex];
|
|
40
40
|
r = {
|
|
41
|
-
name: [...f(
|
|
42
|
-
...
|
|
41
|
+
name: [...f(t.name) ? t.name : [t.name], n.index, ...R],
|
|
42
|
+
...a || {},
|
|
43
43
|
field: {
|
|
44
44
|
style: "width: 100%",
|
|
45
|
-
...(
|
|
45
|
+
...(a == null ? void 0 : a.field) || {},
|
|
46
46
|
...i,
|
|
47
|
-
class: A("is-editable",
|
|
47
|
+
class: A("is-editable", a.class)
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
} else
|
|
51
51
|
r = {
|
|
52
52
|
field: G(e, {
|
|
53
|
-
value:
|
|
53
|
+
value: l,
|
|
54
54
|
...n
|
|
55
55
|
})
|
|
56
56
|
};
|
|
57
|
-
const u = q(e, o, r,
|
|
57
|
+
const u = q(e, o, r, l, n.record, m(b));
|
|
58
58
|
return e.customRender ? e.customRender({
|
|
59
|
-
value:
|
|
59
|
+
value: l,
|
|
60
60
|
...n,
|
|
61
61
|
editable: o,
|
|
62
62
|
originalNode: u
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApTextProps } from './interface';
|
|
2
|
-
import { DefineComponent, ComponentOptionsMixin, PublicProps, CSSProperties, ComponentProvideOptions } from 'vue';
|
|
3
2
|
import { LinkProps } from '@aplus-frontend/antdv/es/typography/Link';
|
|
3
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, CSSProperties, ComponentProvideOptions } from 'vue';
|
|
4
4
|
type ApTextSlots = {
|
|
5
5
|
default: any;
|
|
6
6
|
ellipsisSymbol: any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TypographyLink as
|
|
3
|
-
import { isUndefined as
|
|
1
|
+
import { defineComponent as L, useSlots as O, computed as n, unref as o, createVNode as $, isVNode as z, Fragment as D, createElementBlock as d, openBlock as t, normalizeClass as s, createCommentVNode as v, createElementVNode as x, normalizeStyle as E, createBlock as u, resolveDynamicComponent as U, mergeProps as C, withCtx as m, renderSlot as i, createSlots as w, createTextVNode as F, toDisplayString as G, renderList as I, normalizeProps as R, guardReactiveProps as _ } from "vue";
|
|
2
|
+
import { TypographyLink as q, TypographyText as H } from "@aplus-frontend/antdv";
|
|
3
|
+
import { isUndefined as p, omit as f, isString as J } from "lodash-unified";
|
|
4
4
|
import "../config-provider/index.mjs";
|
|
5
|
-
import { useInjectApTextGroup as
|
|
5
|
+
import { useInjectApTextGroup as K } from "./context.mjs";
|
|
6
|
+
import { isDef as M } from "../utils/index.mjs";
|
|
6
7
|
import { useNamespace as Q } from "../config-provider/hooks/use-namespace.mjs";
|
|
7
|
-
const
|
|
8
|
+
const ae = /* @__PURE__ */ L({
|
|
8
9
|
name: "ApText",
|
|
9
10
|
__name: "index",
|
|
10
11
|
props: {
|
|
@@ -65,60 +66,65 @@ const te = /* @__PURE__ */ A({
|
|
|
65
66
|
style: {}
|
|
66
67
|
},
|
|
67
68
|
setup(B) {
|
|
68
|
-
const
|
|
69
|
+
const y = O(), e = B, {
|
|
69
70
|
b: g,
|
|
70
|
-
e:
|
|
71
|
+
e: c,
|
|
71
72
|
em: S,
|
|
72
|
-
m:
|
|
73
|
+
m: P
|
|
73
74
|
} = Q("ap-text"), {
|
|
74
|
-
colon:
|
|
75
|
-
vertical:
|
|
76
|
-
labelStyle:
|
|
77
|
-
} =
|
|
78
|
-
const
|
|
79
|
-
return Object.assign(
|
|
80
|
-
}),
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
75
|
+
colon: a,
|
|
76
|
+
vertical: r,
|
|
77
|
+
labelStyle: N
|
|
78
|
+
} = K(), T = n(() => p(e.colon) ? p(a == null ? void 0 : a.value) ? !0 : a.value : e.colon), V = n(() => p(e.vertical) ? p(r == null ? void 0 : r.value) ? !1 : r.value : e.vertical), h = n(() => {
|
|
79
|
+
const l = o(N) || {};
|
|
80
|
+
return Object.assign(l, e.labelStyle || {}), l;
|
|
81
|
+
}), k = n(() => {
|
|
82
|
+
if (e.label)
|
|
83
|
+
return z(e.label) ? e.label : $(D, null, [e.label]);
|
|
84
|
+
}), j = n(() => {
|
|
85
|
+
const l = M(e.linkProps.ellipsis) ? e.linkProps.ellipsis : !!e.ellipsis;
|
|
86
|
+
return {
|
|
87
|
+
href: J(e.link) ? e.link : void 0,
|
|
88
|
+
...f(e, ["linkProps"]),
|
|
89
|
+
...e.linkProps,
|
|
90
|
+
ellipsis: l
|
|
91
|
+
};
|
|
83
92
|
});
|
|
84
|
-
return (
|
|
85
|
-
class: s([
|
|
86
|
-
[
|
|
93
|
+
return (l, W) => (t(), d("div", {
|
|
94
|
+
class: s([o(g)(), {
|
|
95
|
+
[o(P)("vertical")]: V.value
|
|
87
96
|
}])
|
|
88
|
-
}, [
|
|
97
|
+
}, [k.value ? (t(), d("span", {
|
|
89
98
|
key: 0,
|
|
90
|
-
class: s([
|
|
91
|
-
[
|
|
99
|
+
class: s([o(c)("label"), {
|
|
100
|
+
[o(S)("label", "no-colon")]: !T.value
|
|
92
101
|
}]),
|
|
93
102
|
style: E(h.value)
|
|
94
|
-
}, [(
|
|
95
|
-
class: s(
|
|
96
|
-
}, [
|
|
103
|
+
}, [(t(), u(U(k.value)))], 6)) : v("", !0), x("div", {
|
|
104
|
+
class: s(o(c)("content"))
|
|
105
|
+
}, [l.link ? (t(), u(o(q), C({
|
|
97
106
|
key: 0
|
|
98
|
-
}, {
|
|
99
|
-
|
|
100
|
-
...e.linkProps
|
|
101
|
-
}, {
|
|
102
|
-
onClick: e.onClickContent
|
|
107
|
+
}, j.value, {
|
|
108
|
+
onClick: l.onClickContent
|
|
103
109
|
}), {
|
|
104
|
-
default: m(() => [i(
|
|
110
|
+
default: m(() => [i(l.$slots, "default")]),
|
|
105
111
|
_: 3
|
|
106
|
-
}, 16, ["onClick"])) : (
|
|
112
|
+
}, 16, ["onClick"])) : (t(), u(o(H), C({
|
|
107
113
|
key: 1
|
|
108
|
-
},
|
|
109
|
-
onClick:
|
|
114
|
+
}, o(f)(e, ["label", "colon", "link", "linkProps", "vertical", "labelStyle"]), {
|
|
115
|
+
onClick: l.onClickContent
|
|
110
116
|
}), w({
|
|
111
|
-
default: m(() => [i(
|
|
117
|
+
default: m(() => [i(l.$slots, "default", {}, () => [F(G(l.content || "--"), 1)])]),
|
|
112
118
|
_: 2
|
|
113
|
-
}, [I(
|
|
114
|
-
name:
|
|
115
|
-
fn: m((
|
|
116
|
-
}))]), 1040, ["onClick"])),
|
|
119
|
+
}, [I(o(f)(y, ["default", "addonAfter"]), (X, b) => ({
|
|
120
|
+
name: b,
|
|
121
|
+
fn: m((A) => [i(l.$slots, b, R(_(A || {})))])
|
|
122
|
+
}))]), 1040, ["onClick"])), y.addonAfter ? (t(), d("div", {
|
|
117
123
|
key: 2,
|
|
118
|
-
class: s(
|
|
119
|
-
}, [i(
|
|
124
|
+
class: s(o(c)("content-addon-after"))
|
|
125
|
+
}, [i(l.$slots, "addonAfter")], 2)) : v("", !0)], 2)], 2));
|
|
120
126
|
}
|
|
121
127
|
});
|
|
122
128
|
export {
|
|
123
|
-
|
|
129
|
+
ae as default
|
|
124
130
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.
|
|
1
|
+
declare const _default: "6.16.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
package/es/test/setup.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-unified"),c=require("../../utils/index.js"),h=20,C=50,g=e=>e.some(t=>!!t.html);function m(e){var n;const t={...d.omit(e,["columns","request","searchForm","dataSource","rowKey","value","round"])};if(t.rowConfig={isHover:!0,keyField:e.rowKey,isCurrent:!!e.rowHighlightable},t.columnConfig={},g(e.columns||[])&&(t.rowConfig.useKey=!0,t.columnConfig.useKey=!0),e.adaptive&&(t.autoResize=!0,t.height="100%"),e.columnResizable&&(t.columnConfig.resizable=!0),e.rowSelection){const o=e.rowSelection===!0?{}:e.rowSelection;o.type==="radio"?t.radioConfig={highlight:!0,checkMethod({row:r}){return o.disabled?!o.disabled(r):!0},visibleMethod({row:r}){return o.shown?o.shown(r):!0},checkRowKey:(n=o.defaultSelectedRowKeys)==null?void 0:n[0],reserve:d.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys}:t.checkboxConfig={highlight:!0,checkMethod({row:r}){return o.disabled?!o.disabled(r):!0},visibleMethod({row:r}){return o.shown?o.shown(r):!0},reserve:d.isUndefined(o.preserveSelectedRowKeys)?!0:o.preserveSelectedRowKeys,range:o.range||!1}}return t.border=e.bordered===!1?"inner":!0,e.expandable&&(t.expandConfig=d.omit(e.expandable,["renderContent","width","title"])),e.footer&&(t.showFooter=!0,d.isFunction(e.footer)?t.footerMethod=e.footer:t.footerData=e.footer),e.virtual===!1?(t.virtualXConfig={enabled:!1},t.virtualYConfig={enabled:!1}):(u(t,"X",e.virtual),u(t,"Y",e.virtual)),t.round=c.isDef(e.round)?e.round:!e.card,t.headerCellConfig={height:36,...t.headerCellConfig||{}},t.treeConfig&&(t.treeConfig={...t.treeConfig||{},transform:!0}),t}function u(e,t,i){const n=t==="X",o=n?"x":"y",r=n?"virtualXConfig":"virtualYConfig",s=i==null?void 0:i[o],f=s!==!1,l=n?h:C,a=d.isNumber(s)&&s>=0?s:l;e[r]={enabled:f,gt:a,oSize:(i==null?void 0:i.oSize)||0}}function w(e){return e===!0?"left":e}function b(e,t){const i=e===!0||!e.type?"checkbox":e.type,n=e===!0?60:e.columnWidth||60;let o=e===!0?void 0:w(e.fixed);return o||(o===!1?o=void 0:o=t.some(r=>r.fixed==="left"||r.fixed===!0)?"left":void 0),{type:i,width:n,fixed:o}}function y(e){const t=(e==null?void 0:e.width)||"auto";return{type:"expand",title:e==null?void 0:e.title,width:t}}exports.getRowExpandProps=y;exports.getRowSelectionProps=b;exports.toVxeProps=m;
|
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),f=require("../../utils/index.js"),d=require("lodash-unified"),l=e=>{const i=n.ref(e.pagination&&e.pagination.defaultCurrent||1),u=n.ref(e.pagination&&e.pagination.defaultPageSize||10);function s(t,o){i.value=t,u.value=o}const g=n.computed(()=>e.dataSource?e.pagination===!1?[...e.dataSource]:e.dataSource.slice((n.unref(i)-1)*n.unref(u),n.unref(i)*n.unref(u)):[]);return{pagination:n.computed(()=>{var c;const{showLessItems:t,showSizeChanger:o,showQuickJumper:r,pageSizeOptions:a}=e.pagination||{};return{current:n.unref(i),pageSize:n.unref(u),total:((c=e.dataSource)==null?void 0:c.length)||0,showSizeChanger:f.isDef(o)?o:!t,showQuickJumper:f.isDef(r)?r:!t,showLessItems:t,size:"default",pageSizeOptions:d.isUndefined(a)?["10","20","50","100"]:a}}),dataSource:g,onChange:s}};exports.useOfflineList=l;
|
|
@@ -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
|
*/
|
|
@@ -17,7 +17,9 @@ declare function __VLS_template(): {
|
|
|
17
17
|
rootEl: HTMLDivElement;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
-
declare const __VLS_component: DefineComponent<ApBatchActionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApBatchActionProps> & Readonly<{}>, {
|
|
20
|
+
declare const __VLS_component: DefineComponent<ApBatchActionProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ApBatchActionProps> & Readonly<{}>, {
|
|
21
|
+
showSelected: boolean;
|
|
22
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
21
23
|
headerRef: HTMLDivElement;
|
|
22
24
|
}, HTMLDivElement>;
|
|
23
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),B=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const V=require("../../config-provider/hooks/use-namespace.js"),k=require("../../config-provider/hooks/use-locale.js"),w={key:0,class:"selected-desc"},C={class:"selected-desc-conut"},E={class:"selected-desc-clean"},D=e.defineComponent({__name:"ApBatchAction",props:{selectedRowKeys:{},clearAll:{},showSelected:{type:Boolean,default:!0}},setup(_){const{b:o}=V.useNamespace("ap-batch-action"),{t:r}=k.useLocale(),a=_,c=e.useSlots(),A=e.computed(()=>{var t;return((t=a.selectedRowKeys)==null?void 0:t.length)||0}),s=e.ref(!1),d=e.ref();return e.watch(()=>c.header,()=>{setTimeout(()=>{var l,i,p,h,f,m,n,v,y,S,N;const t=(l=c.header)==null?void 0:l.call(c);(t==null?void 0:t.length)===1&&((p=(i=t==null?void 0:t[0])==null?void 0:i.type)==null?void 0:p.name)==="ASpace"?s.value=!!((y=(v=(n=Array.prototype.slice.call((m=(f=(h=d.value)==null?void 0:h.children)==null?void 0:f[0])==null?void 0:m.children))==null?void 0:n.filter)==null?void 0:v.call(n,u=>{var g;return(g=u==null?void 0:u.children)==null?void 0:g.length}))!=null&&y.length):s.value=!!((N=(S=d.value)==null?void 0:S.children)!=null&&N.length)})},{immediate:!0}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o)()])},[e.withDirectives(e.createElementVNode("div",{ref_key:"headerRef",ref:d,class:e.normalizeClass(e.unref(o)("header"))},[e.renderSlot(t.$slots,"header")],2),[[e.vShow,s.value]]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(o)("body"))},[e.renderSlot(t.$slots,"prefix"),a.showSelected?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",C,[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apBatchAction.selected"))+" ",1),e.createElementVNode("span",null,e.toDisplayString(A.value),1),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("ap.apBatchAction.piecesOfData")),1)]),e.createElementVNode("div",E,[e.createVNode(e.unref(B.Button),{type:"link",onClick:l[0]||(l[0]=i=>a.clearAll&&a.clearAll())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("ap.apBatchAction.empty")),1)]),_:1})])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"suffix")],2)],2))}});exports.default=D;
|
|
@@ -2,7 +2,9 @@ import { CreateComponentPublicInstanceWithMixins, ComponentOptionsMixin, PublicP
|
|
|
2
2
|
import { ApBatchActionProps } from './interface';
|
|
3
3
|
export * from './interface';
|
|
4
4
|
declare const ApBatchAction: {
|
|
5
|
-
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
5
|
+
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {
|
|
6
|
+
showSelected: boolean;
|
|
7
|
+
}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
|
|
6
8
|
headerRef: HTMLDivElement;
|
|
7
9
|
}, HTMLDivElement, ComponentProvideOptions, {
|
|
8
10
|
P: {};
|
|
@@ -11,11 +13,15 @@ declare const ApBatchAction: {
|
|
|
11
13
|
C: {};
|
|
12
14
|
M: {};
|
|
13
15
|
Defaults: {};
|
|
14
|
-
}, Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
16
|
+
}, Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
17
|
+
showSelected: boolean;
|
|
18
|
+
}>;
|
|
15
19
|
__isFragment?: never;
|
|
16
20
|
__isTeleport?: never;
|
|
17
21
|
__isSuspense?: never;
|
|
18
|
-
} & ComponentOptionsBase<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
22
|
+
} & ComponentOptionsBase<Readonly< ApBatchActionProps> & Readonly<{}>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
23
|
+
showSelected: boolean;
|
|
24
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
|
|
19
25
|
$slots: Readonly<{
|
|
20
26
|
header: () => any[];
|
|
21
27
|
prefix: () => void;
|
|
@@ -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?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=require("@ant-design/icons-vue"),f=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const n=require("./interface.js"),N=require("@aplus-frontend/hooks"),V=require("./handleExportDownload.js"),D=require("../../ap-table/context.js"),I=require("./convertExportField.js");require("../../ap-button/index.js");const K=require("../ap-batch-action-group/index.js"),j=require("../../config-provider/hooks/use-namespace.js"),R=require("../../config-provider/hooks/use-locale.js"),O=require("../../config-provider/hooks/use-global-config.js"),C=require("../../ap-button/ap-button.vue.js"),_=e.defineComponent({__name:"ApExportGroup",props:{type:{default:"button"},selectedRowKeys:{},groupList:{},buttonProps:{},disabled:{type:Boolean},auth:{},ifShow:{},text:{},idKey:{},request:{},getRequestParams:{},getInitialParams:{},beforeRequest:{},successMessage:{type:[Boolean,String],default:!1},exportField:{type:[Boolean,Object],default:void 0}},setup(B){const{hasPermission:L}=N.usePermission(),t=B,{columns:y,dataSource:x}=D.useInjectApTable(),{b:G}=j.useNamespace("ap-export-group"),{t:l}=R.useLocale(),E=O.useGlobalConfig("exportField"),s=e.ref(!1),b=e.ref(!1),i=e.computed(()=>{var a;return!!(t!=null&&t.disabled)||(x!==void 0?!((a=x==null?void 0:x.value)!=null&&a.length):!1)||s.value});e.watch(()=>i.value,()=>{i.value&&(b.value=!1)},{immediate:!0});const S=e.computed(()=>(t==null?void 0:t.successMessage)===!0?l("ap.apExportGroup.exportSuccess"):t!=null&&t.successMessage?t.successMessage:""),T=(a=t==null?void 0:t.exportField)=>{const r="exportFieldList",o=a??(E.value===""?!0:E.value)??!1;return o===!0?{key:r}:typeof o=="object"?{...o,key:o.key??r}:o},m={textAlign:"center"},v=e.computed(()=>(t==null?void 0:t.selectedRowKeys)||[]),k=e.computed(()=>{let a=t==null?void 0:t.ifShow;return!(t!=null&&t.ifShow)&&(t!=null&&t.auth)&&(a=()=>L(t.auth)),(a==null?void 0:a())??!0});async function q(){v.value.length>0?d({key:n.ApExportGroupActionType.SELECT}):d({key:n.ApExportGroupActionType.ALL})}async function d({key:a,option:r}){var w,A;const o=r||t,{getRequestParams:c,request:u}=o||{},p=T(o==null?void 0:o.exportField);let h={};a===n.ApExportGroupActionType.SELECT?h={[(o==null?void 0:o.idKey)||"ids"]:v.value}:a===n.ApExportGroupActionType.ALL&&(h=(c==null?void 0:c())||{});const F=((w=o==null?void 0:o.getInitialParams)==null?void 0:w.call(o))||{};try{s.value=!0;let g=Object.assign({...h,...F},p&&(y!=null&&y.value)?{[p.key]:I.convertExportField(y.value,p==null?void 0:p.convertField)}:{});g=((A=o==null?void 0:o.beforeRequest)==null?void 0:A.call(o,g))||g,await V.handleExportDownload(async()=>await(u==null?void 0:u(g))),o!=null&&o.successMessage&&f.message.success(S.value)}finally{s.value=!1}}const P=e.computed(()=>{var a;return((a=t==null?void 0:t.groupList)==null?void 0:a.map((r,o)=>({key:o,content:r==null?void 0:r.text,auth:r==null?void 0:r.auth,ifShow:r==null?void 0:r.ifShow,disabled:r==null?void 0:r.disabled,onClick:()=>{v.value.length>0?d({key:n.ApExportGroupActionType.SELECT,option:r}):d({key:n.ApExportGroupActionType.ALL,option:r})}})))||[]});return(a,r)=>{var o,c;return e.openBlock(),e.createElementBlock(e.Fragment,null,[k.value&&t.type==="button"?(e.openBlock(),e.createBlock(e.unref(C.default),e.mergeProps({key:0},{...a.$attrs},{disabled:i.value,loading:s.value,"min-width":"",onClick:q}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(l)("ap.apExportGroup.export")),1)]),_:1},16,["disabled","loading"])):e.createCommentVNode("",!0),k.value&&t.type==="dropdown"?(e.openBlock(),e.createBlock(e.unref(f.Dropdown),{key:1,open:b.value,"onUpdate:open":r[0]||(r[0]=u=>b.value=u),class:e.normalizeClass([e.unref(G)()]),"overlay-style":m,disabled:i.value},{overlay:e.withCtx(()=>[e.createVNode(e.unref(f.Menu),{onClick:d},{default:e.withCtx(()=>{var u;return[(e.openBlock(),e.createBlock(e.unref(f.MenuItem),{key:e.unref(n.ApExportGroupActionType).SELECT,disabled:((u=v.value)==null?void 0:u.length)===0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apExportGroup.exportSelected")),1)]),_:1},8,["disabled"])),(e.openBlock(),e.createBlock(e.unref(f.MenuItem),{key:e.unref(n.ApExportGroupActionType).ALL},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("ap.apExportGroup.exportAll")),1)]),_:1}))]}),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(C.default),e.mergeProps({...a.$attrs},{loading:s.value}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString((t==null?void 0:t.text)??e.unref(l)("ap.apExportGroup.export"))+" ",1),e.createVNode(e.unref(M.DownOutlined))]),_:1},16,["loading"])]),_:1},8,["open","class","disabled"])):e.createCommentVNode("",!0),k.value&&t.type==="group"?(e.openBlock(),e.createBlock(e.unref(K.ApBatchActionGroup),e.mergeProps({key:2},{...a.$attrs},{disabled:i.value,loading:s.value,"button-props":{...t.buttonProps,content:((o=t==null?void 0:t.buttonProps)==null?void 0:o.content)??e.unref(l)("ap.apExportGroup.export"),type:((c=t==null?void 0:t.buttonProps)==null?void 0:c.type)??"default"},"menu-list":P.value}),null,16,["disabled","loading","button-props","menu-list"])):e.createCommentVNode("",!0)],64)}}});exports.default=_;
|