@aplus-frontend/ui 7.15.8 → 7.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/ag-grid/components/header-cell/index.vue2.mjs +56 -41
- package/es/src/ag-grid/context.d.ts +8 -0
- package/es/src/ag-grid/context.mjs +18 -7
- package/es/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/es/src/ag-grid/hooks/use-columns-def.mjs +64 -61
- package/es/src/ag-grid/hooks/use-columns.mjs +39 -30
- package/es/src/ag-grid/index.vue.mjs +270 -255
- package/es/src/ag-grid/interface.d.ts +20 -1
- package/es/src/ag-grid/style/custom-header.mjs +22 -13
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +86 -65
- package/es/src/ap-table/style/setting.mjs +30 -27
- package/es/src/locale/lang/en.mjs +1 -0
- package/es/src/locale/lang/zh-cn.mjs +1 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/context.d.ts +8 -0
- package/lib/src/ag-grid/context.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.d.ts +2 -2
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +20 -1
- package/lib/src/ag-grid/style/custom-header.js +1 -1
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
- package/lib/src/ap-table/style/setting.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/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TableProps } from '@aplus-frontend/antdv';
|
|
2
2
|
import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
3
|
-
import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection, ThemeDefaultParams } from 'ag-grid-community';
|
|
3
|
+
import { AgColumn, ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection, ThemeDefaultParams } from 'ag-grid-community';
|
|
4
4
|
import { ComputedRef, CSSProperties, VNode } from 'vue';
|
|
5
5
|
import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
|
|
6
6
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
@@ -89,6 +89,10 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
89
89
|
width?: number;
|
|
90
90
|
minWidth?: number;
|
|
91
91
|
maxWidth?: number;
|
|
92
|
+
/**
|
|
93
|
+
* @since 7.16.0
|
|
94
|
+
*/
|
|
95
|
+
flex?: number;
|
|
92
96
|
colSpan?: ColDef<RecordType>['colSpan'];
|
|
93
97
|
spanRows?: ColDef<RecordType>['spanRows'];
|
|
94
98
|
/**
|
|
@@ -122,6 +126,17 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
122
126
|
* @private 仅限内部使用,请勿传递
|
|
123
127
|
*/
|
|
124
128
|
_path?: (string | number)[];
|
|
129
|
+
/**
|
|
130
|
+
* 作为子列时的显示策略
|
|
131
|
+
* open: 仅展开时显示
|
|
132
|
+
* closed: 仅关闭时显示
|
|
133
|
+
* null,undefined: 总是显示
|
|
134
|
+
*/
|
|
135
|
+
columnGroupShow?: 'open' | 'closed';
|
|
136
|
+
/**
|
|
137
|
+
* 是否锁定固定(设置后不可以通过表格设置修改其固定属性)
|
|
138
|
+
*/
|
|
139
|
+
lockFixed?: boolean;
|
|
125
140
|
} : null;
|
|
126
141
|
export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
|
|
127
142
|
/**
|
|
@@ -500,4 +515,8 @@ export type AgGridSlots<RecordType> = {
|
|
|
500
515
|
shownColumns: AgGridColumnType<RecordType>[];
|
|
501
516
|
clearAll: () => void;
|
|
502
517
|
}) => any;
|
|
518
|
+
headerCell?: (props: {
|
|
519
|
+
title: any;
|
|
520
|
+
column: Omit<AgColumn, keyof AgGridColumnType> & AgGridColumnType;
|
|
521
|
+
}) => void;
|
|
503
522
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { genComponentStyleHook as o } from "../../utils/cssinjs/index.mjs";
|
|
2
|
-
const
|
|
3
|
-
const { componentCls:
|
|
2
|
+
const n = (r) => {
|
|
3
|
+
const { componentCls: e } = r;
|
|
4
4
|
return {
|
|
5
|
-
[
|
|
5
|
+
[e]: {
|
|
6
6
|
display: "flex",
|
|
7
7
|
flexDirection: "row",
|
|
8
8
|
flexWrap: "nowrap",
|
|
@@ -17,31 +17,40 @@ const t = (e) => {
|
|
|
17
17
|
"&.align-right": {
|
|
18
18
|
justifyContent: "end"
|
|
19
19
|
},
|
|
20
|
-
[`${
|
|
20
|
+
[`${e}__sort-wrapper`]: {
|
|
21
21
|
display: "inline-flex",
|
|
22
22
|
flexDirection: "column",
|
|
23
23
|
alignItems: "center",
|
|
24
24
|
color: "rgba(0, 0, 0, 0.3)",
|
|
25
|
-
marginInlineStart:
|
|
25
|
+
marginInlineStart: r.spaceXS,
|
|
26
26
|
"&:hover": {
|
|
27
27
|
color: "rgba(0, 0, 0, 0.6)"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
[`${
|
|
31
|
-
|
|
30
|
+
[`${e}__expand-wrapper`]: {
|
|
31
|
+
padding: r.spaceXS,
|
|
32
|
+
cursor: "pointer",
|
|
33
|
+
display: "flex",
|
|
34
|
+
borderRadius: r.borderRadiusXS,
|
|
35
|
+
"&:hover": {
|
|
36
|
+
background: r.colorBg1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
[`${e}__sorter-up.active`]: {
|
|
40
|
+
color: r.colorPrimary
|
|
32
41
|
},
|
|
33
|
-
[`${
|
|
42
|
+
[`${e}__sorter-down`]: {
|
|
34
43
|
marginTop: "-0.3em",
|
|
35
44
|
"&.active": {
|
|
36
|
-
color:
|
|
45
|
+
color: r.colorPrimary
|
|
37
46
|
}
|
|
38
47
|
}
|
|
39
48
|
}
|
|
40
49
|
};
|
|
41
|
-
},
|
|
42
|
-
|
|
50
|
+
}, a = o("AgGrid.CustomHeader", (r) => [
|
|
51
|
+
n(r)
|
|
43
52
|
]);
|
|
44
53
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
a as default,
|
|
55
|
+
n as genAgGridCustomHeaderCellStyle
|
|
47
56
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { HolderOutlined as
|
|
3
|
-
import { Space as
|
|
1
|
+
import { defineComponent as E, computed as O, createElementBlock as k, openBlock as s, normalizeClass as a, unref as e, createElementVNode as f, createVNode as r, createCommentVNode as u, createBlock as d, resolveDynamicComponent as A, withCtx as p } from "vue";
|
|
2
|
+
import { HolderOutlined as D, VerticalAlignTopOutlined as b, VerticalAlignMiddleOutlined as j, DeleteOutlined as z } from "@ant-design/icons-vue";
|
|
3
|
+
import { Space as M, Tooltip as m } from "@aplus-frontend/antdv";
|
|
4
|
+
import { useInjectApTable as S } from "../../../context.mjs";
|
|
4
5
|
import "../../../../config-provider/index.mjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useInjectSorterMethods as
|
|
8
|
-
import { getLabelRenderNode as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
const
|
|
6
|
+
import U from "../images/icon_carst_down.svg.mjs";
|
|
7
|
+
import H from "../images/icon_fill_right.svg.mjs";
|
|
8
|
+
import { useInjectSorterMethods as q } from "../sorter/context.mjs";
|
|
9
|
+
import { getLabelRenderNode as G } from "../utils.mjs";
|
|
10
|
+
import { useNamespace as J } from "../../../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useLocale as K } from "../../../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
const P = ["src"], ne = /* @__PURE__ */ E({
|
|
12
13
|
__name: "item",
|
|
13
14
|
props: {
|
|
14
15
|
value: {},
|
|
@@ -17,107 +18,127 @@ const q = ["src"], ee = /* @__PURE__ */ B({
|
|
|
17
18
|
open: { type: Boolean }
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:open", "update:value"],
|
|
20
|
-
setup(
|
|
21
|
-
const o =
|
|
21
|
+
setup(g, { emit: x }) {
|
|
22
|
+
const o = g, T = x, { b: t, be: v, is: y } = J("ap-column-setting-sortable-item-meta"), { fixedToLeft: C, fixedToRight: w, unFixed: F } = q(), { columnsBackup: V } = S(), { t: c } = K(), n = O(() => {
|
|
23
|
+
const l = V?.value.find(
|
|
24
|
+
(i) => o.value.key === i.key
|
|
25
|
+
);
|
|
26
|
+
return l ? l.lockFixed ?? !1 : !1;
|
|
27
|
+
});
|
|
22
28
|
function h(l) {
|
|
23
29
|
const i = o.value;
|
|
24
30
|
return i.fixed = l, i.children?.forEach((N) => N.fixed = l), i;
|
|
25
31
|
}
|
|
26
|
-
function
|
|
32
|
+
function _() {
|
|
33
|
+
if (n.value)
|
|
34
|
+
return;
|
|
27
35
|
const l = h("left");
|
|
28
|
-
|
|
36
|
+
C(l);
|
|
29
37
|
}
|
|
30
|
-
function
|
|
38
|
+
function L() {
|
|
39
|
+
if (n.value)
|
|
40
|
+
return;
|
|
31
41
|
const l = h("right");
|
|
32
42
|
w(l);
|
|
33
43
|
}
|
|
34
44
|
function R() {
|
|
45
|
+
if (n.value)
|
|
46
|
+
return;
|
|
35
47
|
const l = h(void 0);
|
|
36
|
-
|
|
48
|
+
F(l);
|
|
37
49
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
50
|
+
function B() {
|
|
51
|
+
T("update:open", !o.open);
|
|
40
52
|
}
|
|
41
|
-
function
|
|
53
|
+
function I() {
|
|
42
54
|
const l = o.value;
|
|
43
55
|
l.show = !1, l.children?.forEach((i) => i.show = !1);
|
|
44
56
|
}
|
|
45
|
-
return (l, i) => (
|
|
46
|
-
class:
|
|
57
|
+
return (l, i) => (s(), k("div", {
|
|
58
|
+
class: a(e(t)())
|
|
47
59
|
}, [
|
|
48
|
-
|
|
49
|
-
class:
|
|
60
|
+
f("span", {
|
|
61
|
+
class: a(e(t)("left"))
|
|
50
62
|
}, [
|
|
51
|
-
|
|
52
|
-
class:
|
|
63
|
+
r(e(D), {
|
|
64
|
+
class: a(e(v)("left", "holder")),
|
|
53
65
|
style: { "font-size": "16px", color: "#abb7cc" }
|
|
54
66
|
}, null, 8, ["class"]),
|
|
55
|
-
|
|
56
|
-
class:
|
|
57
|
-
onClick:
|
|
67
|
+
f("span", {
|
|
68
|
+
class: a(e(v)("left", "indicator")),
|
|
69
|
+
onClick: B
|
|
58
70
|
}, [
|
|
59
|
-
l.value.children?.length ? (
|
|
71
|
+
l.value.children?.length ? (s(), k("img", {
|
|
60
72
|
key: 0,
|
|
61
|
-
src: o.open ? e(
|
|
62
|
-
}, null, 8,
|
|
73
|
+
src: o.open ? e(H) : e(U)
|
|
74
|
+
}, null, 8, P)) : u("", !0)
|
|
63
75
|
], 2),
|
|
64
|
-
|
|
65
|
-
class:
|
|
76
|
+
f("span", {
|
|
77
|
+
class: a([e(v)("left", "label-wrapper"), e(y)("level2", o.level === 2)])
|
|
66
78
|
}, [
|
|
67
|
-
(
|
|
79
|
+
(s(), d(A(e(G)(l.value.label))))
|
|
68
80
|
], 2)
|
|
69
81
|
], 2),
|
|
70
|
-
|
|
71
|
-
class:
|
|
82
|
+
f("span", {
|
|
83
|
+
class: a(e(t)("right"))
|
|
72
84
|
}, [
|
|
73
|
-
|
|
74
|
-
default:
|
|
75
|
-
o.level !== 2 && l.value.fixed !== "left" ? (
|
|
85
|
+
r(e(M), null, {
|
|
86
|
+
default: p(() => [
|
|
87
|
+
o.level !== 2 && l.value.fixed !== "left" ? (s(), d(e(m), {
|
|
76
88
|
key: 0,
|
|
77
|
-
title: e(
|
|
89
|
+
title: n.value ? e(c)("ap.apTable.setting.lockFixed") : e(c)("ap.apTable.setting.fixToLeft")
|
|
78
90
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
|
|
91
|
+
default: p(() => [
|
|
92
|
+
r(e(b), {
|
|
81
93
|
rotate: 270,
|
|
82
|
-
class:
|
|
83
|
-
|
|
94
|
+
class: a([
|
|
95
|
+
e(t)("action-icon"),
|
|
96
|
+
{ [e(t)("action-icon-disabled")]: n.value }
|
|
97
|
+
]),
|
|
98
|
+
onClick: _
|
|
84
99
|
}, null, 8, ["class"])
|
|
85
100
|
]),
|
|
86
101
|
_: 1
|
|
87
|
-
}, 8, ["title"])) :
|
|
88
|
-
o.level !== 2 && l.value.fixed ? (
|
|
102
|
+
}, 8, ["title"])) : u("", !0),
|
|
103
|
+
o.level !== 2 && l.value.fixed ? (s(), d(e(m), {
|
|
89
104
|
key: 1,
|
|
90
|
-
title: e(
|
|
105
|
+
title: n.value ? e(c)("ap.apTable.setting.lockFixed") : e(c)("ap.apTable.setting.unFixed")
|
|
91
106
|
}, {
|
|
92
|
-
default:
|
|
93
|
-
|
|
94
|
-
class:
|
|
107
|
+
default: p(() => [
|
|
108
|
+
r(e(j), {
|
|
109
|
+
class: a([
|
|
110
|
+
e(t)("action-icon"),
|
|
111
|
+
{ [e(t)("action-icon-disabled")]: n.value }
|
|
112
|
+
]),
|
|
95
113
|
onClick: R
|
|
96
114
|
}, null, 8, ["class"])
|
|
97
115
|
]),
|
|
98
116
|
_: 1
|
|
99
|
-
}, 8, ["title"])) :
|
|
100
|
-
o.level !== 2 && l.value.fixed !== "right" ? (
|
|
117
|
+
}, 8, ["title"])) : u("", !0),
|
|
118
|
+
o.level !== 2 && l.value.fixed !== "right" ? (s(), d(e(m), {
|
|
101
119
|
key: 2,
|
|
102
|
-
title: e(
|
|
120
|
+
title: n.value ? e(c)("ap.apTable.setting.lockFixed") : e(c)("ap.apTable.setting.fixToRight")
|
|
103
121
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
|
|
122
|
+
default: p(() => [
|
|
123
|
+
r(e(b), {
|
|
106
124
|
rotate: 90,
|
|
107
|
-
class:
|
|
108
|
-
|
|
125
|
+
class: a([
|
|
126
|
+
e(t)("action-icon"),
|
|
127
|
+
{ [e(t)("action-icon-disabled")]: n.value }
|
|
128
|
+
]),
|
|
129
|
+
onClick: L
|
|
109
130
|
}, null, 8, ["class"])
|
|
110
131
|
]),
|
|
111
132
|
_: 1
|
|
112
|
-
}, 8, ["title"])) :
|
|
113
|
-
l.value.disabled ?
|
|
133
|
+
}, 8, ["title"])) : u("", !0),
|
|
134
|
+
l.value.disabled ? u("", !0) : (s(), d(e(m), {
|
|
114
135
|
key: 3,
|
|
115
|
-
title: e(
|
|
136
|
+
title: e(c)("ap.apTable.setting.delete")
|
|
116
137
|
}, {
|
|
117
|
-
default:
|
|
118
|
-
|
|
119
|
-
class:
|
|
120
|
-
onClick:
|
|
138
|
+
default: p(() => [
|
|
139
|
+
r(e(z), {
|
|
140
|
+
class: a(e(t)("action-icon")),
|
|
141
|
+
onClick: I
|
|
121
142
|
}, null, 8, ["class"])
|
|
122
143
|
]),
|
|
123
144
|
_: 1
|
|
@@ -130,5 +151,5 @@ const q = ["src"], ee = /* @__PURE__ */ B({
|
|
|
130
151
|
}
|
|
131
152
|
});
|
|
132
153
|
export {
|
|
133
|
-
|
|
154
|
+
ne as default
|
|
134
155
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { singleRow as a, resetComponent as
|
|
2
|
-
import { genComponentStyleHook as
|
|
3
|
-
import { defaultValue as
|
|
4
|
-
const
|
|
1
|
+
import { singleRow as a, resetComponent as t } from "../../style/index.mjs";
|
|
2
|
+
import { genComponentStyleHook as n } from "../../utils/cssinjs/index.mjs";
|
|
3
|
+
import { defaultValue as o } from "./index.mjs";
|
|
4
|
+
const p = (e) => {
|
|
5
5
|
const { componentCls: l, namespace: i } = e;
|
|
6
6
|
return {
|
|
7
7
|
[l]: {
|
|
@@ -90,7 +90,7 @@ const o = (e) => {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
|
-
},
|
|
93
|
+
}, c = (e) => {
|
|
94
94
|
const { componentCls: l } = e;
|
|
95
95
|
return {
|
|
96
96
|
[l]: {
|
|
@@ -107,8 +107,8 @@ const o = (e) => {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
},
|
|
111
|
-
const { componentCls: l } = e, i = `${l}-sortable-item-meta`;
|
|
110
|
+
}, d = (e) => {
|
|
111
|
+
const { componentCls: l } = e, i = `${l}-sortable-item-meta`, r = `${i}-action-icon`;
|
|
112
112
|
return {
|
|
113
113
|
[l]: {
|
|
114
114
|
[i]: {
|
|
@@ -158,15 +158,18 @@ const o = (e) => {
|
|
|
158
158
|
".is-level2": {
|
|
159
159
|
marginInlineStart: e.spaceXL
|
|
160
160
|
},
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
[r]: {
|
|
162
|
+
[`&:not(${r}-disabled):hover`]: {
|
|
163
163
|
color: e.colorPrimary
|
|
164
164
|
}
|
|
165
|
+
},
|
|
166
|
+
[`${r}-disabled`]: {
|
|
167
|
+
color: e.antdv.colorTextDisabled
|
|
165
168
|
}
|
|
166
169
|
}
|
|
167
170
|
}
|
|
168
171
|
};
|
|
169
|
-
},
|
|
172
|
+
}, s = (e) => {
|
|
170
173
|
const { componentCls: l } = e;
|
|
171
174
|
return {
|
|
172
175
|
[l]: {
|
|
@@ -177,7 +180,7 @@ const o = (e) => {
|
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
};
|
|
180
|
-
},
|
|
183
|
+
}, g = (e) => {
|
|
181
184
|
const { componentCls: l } = e;
|
|
182
185
|
return {
|
|
183
186
|
[l]: {
|
|
@@ -197,7 +200,7 @@ const o = (e) => {
|
|
|
197
200
|
paddingInline: "20px",
|
|
198
201
|
paddingBlock: e.spaceXL,
|
|
199
202
|
"&-title": {
|
|
200
|
-
...
|
|
203
|
+
...t(e),
|
|
201
204
|
fontWeight: "bold",
|
|
202
205
|
color: e.textColor1
|
|
203
206
|
}
|
|
@@ -213,7 +216,7 @@ const o = (e) => {
|
|
|
213
216
|
}
|
|
214
217
|
}
|
|
215
218
|
};
|
|
216
|
-
},
|
|
219
|
+
}, m = (e) => {
|
|
217
220
|
const { componentCls: l } = e;
|
|
218
221
|
return {
|
|
219
222
|
[l]: {
|
|
@@ -233,7 +236,7 @@ const o = (e) => {
|
|
|
233
236
|
}
|
|
234
237
|
}
|
|
235
238
|
};
|
|
236
|
-
},
|
|
239
|
+
}, f = (e) => {
|
|
237
240
|
const { componentCls: l } = e, i = `${e.componentCls}-template-item`;
|
|
238
241
|
return {
|
|
239
242
|
[l]: {
|
|
@@ -279,26 +282,26 @@ const o = (e) => {
|
|
|
279
282
|
}
|
|
280
283
|
}
|
|
281
284
|
};
|
|
282
|
-
}, S =
|
|
285
|
+
}, S = n(
|
|
283
286
|
"ApTable.Setting",
|
|
284
287
|
(e) => [
|
|
285
|
-
o(e),
|
|
286
288
|
p(e),
|
|
287
|
-
d(e),
|
|
288
289
|
c(e),
|
|
289
290
|
s(e),
|
|
290
|
-
|
|
291
|
-
g(e)
|
|
291
|
+
d(e),
|
|
292
|
+
g(e),
|
|
293
|
+
f(e),
|
|
294
|
+
m(e)
|
|
292
295
|
],
|
|
293
|
-
|
|
296
|
+
o
|
|
294
297
|
);
|
|
295
298
|
export {
|
|
296
299
|
S as default,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
c as genTableSettingSelectGroupStyle,
|
|
301
|
+
d as genTableSettingSortableItemMetaStyle,
|
|
302
|
+
s as genTableSettingSortableItemStyle,
|
|
303
|
+
g as genTableSettingSorterStyle,
|
|
304
|
+
p as genTableSettingStyle,
|
|
305
|
+
f as genTableSettingTemplateItemStyle,
|
|
306
|
+
m as genTableSettingTemplateListStyle
|
|
304
307
|
};
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.
|
|
1
|
+
declare const _default: "7.16.0";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -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"),o=require("@ant-design/icons-vue"),y=require("@aplus-frontend/antdv/es/theme/internal"),d=require("../../context.js"),w=require("../../../ap-table/utils.js");require("../../../config-provider/index.js");require("../../../render/index.js");const z=require("../../style/custom-header.js"),f=require("../../../config-provider/hooks/use-namespace.js"),O=require("../../../render/render.js"),V=e.defineComponent({__name:"index",props:{params:{}},setup(C){const t=C,{b:g,e:n}=f.useNamespace("ag-custom-header"),{be:k,bem:v}=f.useNamespace("ag-grid"),S=z.default("ag-custom-header"),[,b]=y.useToken(),{sorter:u,setSorter:h}=d.useInjectSorter(),{expandable:x}=d.useInjectExpandable(),a=e.computed(()=>t.params.column.sorter),I=e.computed(()=>t.params.columnGroup?.getLeafColumns?.()?.some(r=>r.getColDef().columnGroupShow)),s=e.computed(()=>{const r=t.params.columnGroup?.getGroupId?.();return r?x.value[r]??!1:!1});function q(r){return r?r==="asc"?"desc":null:"asc"}const c=e.computed(()=>t.params?.column?.getColId?.());function B(){if(!a.value)return;const l=t.params.column.getColId(),E=t.params.column.getSort(),m=q(E),p=t.params.api,T=p.getColumnState().map(i=>({...i,sort:i.colId===l?m:null}));p.applyColumnState({state:T}),h({[l]:m})}function N(){t.params.setExpanded(!s.value)}return(r,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(g)(),{sortable:a.value},`align-${r.params.column.align||"left"}`,e.unref(S)]),onClick:B},[e.createVNode(e.unref(O.default),{renderer:()=>e.unref(w.getTableTitle)(r.params.column,[e.unref(k)("table-header","title"),r.params.column.tooltip?"":e.unref(v)("table-header","title","single")],r.params.headerCell,e.unref(b).colorTextTertiary)},null,8,["renderer"]),a.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(n)("sort-wrapper"))},[e.createVNode(e.unref(o.CaretUpOutlined),{class:e.normalizeClass({[e.unref(n)("sorter-up")]:!0,active:e.unref(u)[c.value]==="asc"})},null,8,["class"]),e.createVNode(e.unref(o.CaretDownOutlined),{class:e.normalizeClass({[e.unref(n)("sorter-down")]:!0,active:e.unref(u)[c.value]==="desc"})},null,8,["class"])],2)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(n)("expand-wrapper")),onClick:e.withModifiers(N,["stop"])},[s.value?(e.openBlock(),e.createBlock(e.unref(o.CaretLeftOutlined),{key:0})):(e.openBlock(),e.createBlock(e.unref(o.CaretRightOutlined),{key:1}))],2)):e.createCommentVNode("",!0)],2))}});exports.default=V;
|
|
@@ -12,7 +12,15 @@ type AgGridSorterContextProps = {
|
|
|
12
12
|
*/
|
|
13
13
|
setSorter: (nextSorter: Recordable) => void;
|
|
14
14
|
};
|
|
15
|
+
type AgGirdColumnExpandedContextProps = {
|
|
16
|
+
expandable: Ref<Recordable<boolean>>;
|
|
17
|
+
};
|
|
18
|
+
export declare const AgGridExpandableContextKey: InjectionKey<AgGirdColumnExpandedContextProps>;
|
|
15
19
|
export declare const AgGridSorterContextKey: InjectionKey<AgGridSorterContextProps>;
|
|
20
|
+
export declare function useProvideExpandable(state: AgGirdColumnExpandedContextProps): void;
|
|
21
|
+
export declare function useInjectExpandable(): {
|
|
22
|
+
expandable: Ref<Recordable<boolean>, Recordable<boolean>>;
|
|
23
|
+
};
|
|
16
24
|
export declare function useProvideSorter(state: AgGridSorterContextProps): void;
|
|
17
25
|
export declare function useInjectSorter(): AgGridSorterContextProps;
|
|
18
26
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=Symbol("agGridExpandableKey"),n=Symbol("agGridSorterContextKey");function o(r){e.provide(t,r)}function d(){return e.inject(t,{expandable:e.ref({})})}function i(r){e.provide(n,r)}function a(){return e.inject(n,{sorter:e.ref({}),setSorter:()=>{}})}exports.AgGridExpandableContextKey=t;exports.AgGridSorterContextKey=n;exports.useInjectExpandable=d;exports.useInjectSorter=a;exports.useProvideExpandable=o;exports.useProvideSorter=i;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CellClassFunc, ColDef, ColGroupDef } from 'ag-grid-community';
|
|
2
2
|
import { Ref, ComputedRef } from 'vue';
|
|
3
|
-
import { AgGridColumnType, AgGridProps } from '../interface';
|
|
3
|
+
import { AgGridColumnType, AgGridProps, AgGridSlots } from '../interface';
|
|
4
4
|
/**
|
|
5
5
|
* 维护AgGrid列配置
|
|
6
6
|
* @param shownColumns
|
|
7
7
|
* @param props
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
export declare const useColumnsDef: <RecordType>(columns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>, customCellClass: (callback: CellClassFunc) => CellClassFunc) => {
|
|
10
|
+
export declare const useColumnsDef: <RecordType>(columns: Ref<AgGridColumnType<RecordType>[]>, props: AgGridProps<RecordType>, customCellClass: (callback: CellClassFunc) => CellClassFunc, headerCell?: AgGridSlots<RecordType>["headerCell"]) => {
|
|
11
11
|
columnDefs: ComputedRef<(ColDef<any, any> | ColGroupDef<any>)[]>;
|
|
12
12
|
defaultColDef: ComputedRef<ColDef<any, any>>;
|
|
13
13
|
gridWrapperRef: Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("lodash-unified"),p=require("vue"),q=require("../../ap-grid/utils/col.js"),y=require("../../ap-table/utils.js");require("../../config-provider/index.js");require("../../utils/index.js");require("../components/body-cell/index.vue.js");require("../components/header-cell/index.vue.js");require("../components/tooltip/index.vue.js");const x=require("../renderer/index.js"),S=require("../../config-provider/hooks/use-global-config.js"),R=require("../../config-provider/hooks/use-namespace.js"),P=require("../components/body-cell/index.vue2.js"),D=require("../components/tooltip/index.vue2.js"),G=require("../../utils/is.js"),b=require("../components/header-cell/index.vue2.js");function I(t){return d.isNumber(t)&&t>1}function M(t,i){if(i.bodyCellTooltip)return d.isFunction(i.bodyCellTooltip)?i.bodyCellTooltip(t.value,t.data):i.bodyCellTooltip;if(i.renderText)return i.renderText({value:t.value,record:t.data,column:i,text:t.value});const f=i.valueType||"text",u=x.rendererMap[f];if(u){const c=y.getTableRenderProps({...i,valueType:f},{value:t.value,text:t.value,record:t.data,column:t.column,rowIndex:t.node?.rowIndex,pinned:t.node?.rowPinned});return u(c)}return y.objectToString(t.value)}const N=(t,i,f,u)=>{const T=S.useGlobalConfig("valueTypeMap"),c=p.ref(),{em:C}=R.useNamespace("ag-grid"),h=r=>{const l={cellRenderer:P.default,cellRendererParams:{column:r,extraValueType:p.unref(T),rowKey:i.rowKey}};if(r.customRender)return l;if(r.renderText)return{valueFormatter:s=>r.renderText({value:s.value,record:s.data,column:r,text:s.value})};const a=r.valueType||"text",e=x.rendererMap[a];return e?{valueFormatter:s=>{const n=y.getTableRenderProps({...r,valueType:a},{value:s.value,text:s.value,record:s.data,column:s.column,rowIndex:s.node?.rowIndex,pinned:s.node?.rowPinned});return e(n)}}:l},_=r=>{const l=r.valueType||"text",a=x.rendererMap[l],e={},s=r.bodyCellTooltip||!r.customRender&&a&&(r.ellipsis===!0||r.ellipsis==="tooltip"||d.isNumber(r.ellipsis)),n=d.isNumber(r.ellipsis)&&r.ellipsis>1,o=d.isNumber(r.ellipsis)?r.ellipsis:1;return e.tooltipValueGetter=s?v=>M(v,r):void 0,e.wrapText=!r.ellipsis||n,e.cellStyle={"--ag-grid-line-clamp":o},e.tooltipComponent=D.default,e.tooltipComponentParams={lineClamp:o,gridWrapperRef:c},e},g=p.computed(()=>{const r=p.unref(t);function l(a){return a.map(e=>{const s={field:q.dataIndexToField(e.dataIndex),colId:G.isDef(e.key)?String(e.key):void 0,sortable:!!e.sorter,comparator:e.sorter===!0?()=>0:e.sorter,headerComponentParams:{column:e,headerCell:u},resizable:e.resizable,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,suppressKeyboardEvent:()=>!0,flex:e.width?void 0:e.flex??1,pinned:e.fixed||null,colSpan:e.colSpan,spanRows:e.spanRows,cellClass:f(n=>{const o=e.cellClass||"",v=d.isFunction(o)?o(n.data,n.node):o;return[`${C("cell",e.align||"left")}`,I(e.ellipsis)?C("cell","multiline"):null,v].flat().filter(Boolean)}),cellStyle:e.cellStyle,headerStyle:e.headerStyle,headerClass:e.headerClass,columnGroupShow:e.columnGroupShow,autoHeight:!0,..._(e),...h(e)};return e.children?.length?{...s,headerGroupComponent:b.default,headerGroupComponentParams:{column:e,headerCell:u},children:l(e.children)}:s})}return l(r)}),w=p.computed(()=>({headerComponent:b.default,resizable:i.columnResizable,suppressMovable:!0,cellDataType:!1}));return{columnDefs:g,defaultColDef:w,gridWrapperRef:c}};exports.useColumnsDef=N;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),c=require("../utils.js"),m=o=>{const r=u.ref([]),l=u.ref([]);function i(n=[]){return n.filter(e=>!e.hideInTable).map(e=>{if(e.children?.length){const t=i(e.children);return t?.length?{...e,children:t}:null}return e}).filter(Boolean)}function d(n){return r.value.find(e=>c.getStringKey(e.key)===n)}const f=u.computed(()=>r.value.map(n=>c.getStringKey(n.key)).filter(Boolean));u.watch(()=>o.columns,()=>{const n=i(o.columns);r.value=n,l.value=n,o.onShownColumnsChange?.(n)},{deep:!0,immediate:!0});function s(n){for(const e of n)if(e.children){const t=s(e.children);if(t)return t}else if(e.defaultSortOrder){const t=e.field??e.dataIndex??e.key;return{colKey:e.key,field:t,order:e.defaultSortOrder}}}const a=u.computed(()=>s(r.value));return{columns:r,shownColumns:l,columnKeys:f,getTargetColumnByKey:d,defaultSortOrder:a}};exports.useColumns=m;
|