@aplus-frontend/ui 6.40.0 → 7.0.0-beta.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/editable/form-item.vue.mjs +1 -0
- package/es/src/ag-grid/editable/index.vue.mjs +1 -0
- package/es/src/ag-grid/editable/interface.d.ts +1 -0
- package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
- package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
- package/es/src/ag-grid/index.vue.mjs +38 -33
- package/es/src/ag-grid/interface.d.ts +12 -1
- package/es/src/ag-grid/theme.d.ts +2 -1
- package/es/src/ag-grid/theme.mjs +12 -11
- package/es/src/ap-action/item/index.vue2.mjs +14 -12
- package/es/src/ap-action/style/index.d.ts +8 -0
- package/es/src/ap-action/style/index.js +61 -0
- package/es/src/ap-action/style/index.mjs +74 -0
- package/es/src/ap-grid/utils/col.mjs +91 -82
- package/es/src/config-provider/config-provider-props.d.ts +7 -0
- package/es/src/config-provider/config-provider-props.mjs +6 -0
- package/es/src/config-provider/config-provider.d.ts +7 -0
- package/es/src/config-provider/config-provider.mjs +11 -10
- package/es/src/config-provider/hooks/use-global-config.d.ts +4 -0
- package/es/src/config-provider/hooks/use-global-config.mjs +27 -22
- package/es/src/config-provider/hooks/use-token.d.ts +4 -0
- package/es/src/config-provider/hooks/use-token.mjs +6 -0
- package/es/src/config-provider/index.d.ts +10 -0
- package/es/src/design-token/constants.d.ts +2 -0
- package/es/src/design-token/constants.mjs +44 -0
- package/es/src/design-token/interface.d.ts +123 -0
- package/es/src/style/index.d.ts +3 -0
- package/es/src/style/index.js +12 -0
- package/es/src/style/index.mjs +13 -0
- package/es/src/utils/cssinjs/index.d.ts +8 -0
- package/es/src/utils/cssinjs/index.mjs +56 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +1 -0
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +12 -1
- package/lib/src/ag-grid/theme.d.ts +2 -1
- package/lib/src/ag-grid/theme.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/style/index.cjs +61 -0
- package/lib/src/ap-action/style/index.d.ts +8 -0
- package/lib/src/ap-action/style/index.js +1 -0
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/config-provider/config-provider-props.d.ts +7 -0
- package/lib/src/config-provider/config-provider-props.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +7 -0
- package/lib/src/config-provider/config-provider.js +1 -1
- package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -0
- package/lib/src/config-provider/hooks/use-global-config.js +1 -1
- package/lib/src/config-provider/hooks/use-token.d.ts +4 -0
- package/lib/src/config-provider/hooks/use-token.js +1 -0
- package/lib/src/config-provider/index.d.ts +10 -0
- package/lib/src/design-token/constants.d.ts +2 -0
- package/lib/src/design-token/constants.js +1 -0
- package/lib/src/design-token/interface.d.ts +123 -0
- package/lib/src/style/index.cjs +12 -0
- package/lib/src/style/index.d.ts +3 -0
- package/lib/src/style/index.js +1 -0
- package/lib/src/utils/cssinjs/index.d.ts +8 -0
- package/lib/src/utils/cssinjs/index.js +1 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -1
- package/theme/ag-grid/index.css +0 -56
- package/theme/ag-grid-modal/index.css +0 -56
- package/theme/ap-action/item.css +0 -56
- package/theme/ap-action/item.less +1 -58
- package/theme/ap-grid/index.css +0 -56
- package/theme/ap-table/ap-table.css +0 -56
- package/theme/ap-table-modal/index.css +0 -56
- package/theme/editable-table/index.css +0 -56
- package/theme/index.css +0 -56
- package/theme/index.less +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getTableRenderProps as
|
|
2
|
-
import { rendererMap as
|
|
1
|
+
import { getTableRenderProps as y, objectToString as P } from "../../ap-table/utils.mjs";
|
|
2
|
+
import { rendererMap as h } from "../renderer/index.mjs";
|
|
3
3
|
import { isNumber as f, isFunction as m } from "lodash-unified";
|
|
4
4
|
import { ref as R, unref as x, computed as T } from "vue";
|
|
5
5
|
import "../components/body-cell/index.vue.mjs";
|
|
@@ -16,20 +16,20 @@ import v from "../components/header-cell/index.vue2.mjs";
|
|
|
16
16
|
function F(t) {
|
|
17
17
|
return f(t) && t > 1;
|
|
18
18
|
}
|
|
19
|
-
function M(t,
|
|
20
|
-
if (
|
|
21
|
-
return m(
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
19
|
+
function M(t, o) {
|
|
20
|
+
if (o.bodyCellTooltip)
|
|
21
|
+
return m(o.bodyCellTooltip) ? o.bodyCellTooltip(t.value, t.data) : o.bodyCellTooltip;
|
|
22
|
+
if (o.renderText)
|
|
23
|
+
return o.renderText({
|
|
24
24
|
value: t.value,
|
|
25
25
|
record: t.data,
|
|
26
|
-
column:
|
|
26
|
+
column: o,
|
|
27
27
|
text: t.value
|
|
28
28
|
});
|
|
29
|
-
const n =
|
|
29
|
+
const n = o.valueType || "text", d = h[n];
|
|
30
30
|
if (d) {
|
|
31
|
-
const p =
|
|
32
|
-
{ ...
|
|
31
|
+
const p = y(
|
|
32
|
+
{ ...o, valueType: n },
|
|
33
33
|
{
|
|
34
34
|
value: t.value,
|
|
35
35
|
text: t.value,
|
|
@@ -43,17 +43,18 @@ function M(t, a) {
|
|
|
43
43
|
}
|
|
44
44
|
return P(t.value);
|
|
45
45
|
}
|
|
46
|
-
const X = (t,
|
|
46
|
+
const X = (t, o, n) => {
|
|
47
47
|
const d = _("valueTypeMap"), u = R(), { em: p } = G("ag-grid"), c = (r) => {
|
|
48
|
-
const
|
|
48
|
+
const a = {
|
|
49
49
|
cellRenderer: W,
|
|
50
50
|
cellRendererParams: {
|
|
51
51
|
column: r,
|
|
52
|
-
extraValueType: x(d)
|
|
52
|
+
extraValueType: x(d),
|
|
53
|
+
rowKey: o.rowKey
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
if (r.customRender)
|
|
56
|
-
return
|
|
57
|
+
return a;
|
|
57
58
|
if (r.renderText)
|
|
58
59
|
return {
|
|
59
60
|
valueFormatter: (i) => r.renderText({
|
|
@@ -63,10 +64,10 @@ const X = (t, a, n) => {
|
|
|
63
64
|
text: i.value
|
|
64
65
|
})
|
|
65
66
|
};
|
|
66
|
-
const l = r.valueType || "text", e =
|
|
67
|
+
const l = r.valueType || "text", e = h[l];
|
|
67
68
|
return e ? {
|
|
68
69
|
valueFormatter: (i) => {
|
|
69
|
-
const s =
|
|
70
|
+
const s = y(
|
|
70
71
|
{ ...r, valueType: l },
|
|
71
72
|
{
|
|
72
73
|
value: i.value,
|
|
@@ -79,18 +80,18 @@ const X = (t, a, n) => {
|
|
|
79
80
|
);
|
|
80
81
|
return e(s);
|
|
81
82
|
}
|
|
82
|
-
} :
|
|
83
|
+
} : a;
|
|
83
84
|
}, b = (r) => {
|
|
84
|
-
const
|
|
85
|
-
return
|
|
85
|
+
const a = {}, l = r.bodyCellTooltip || !r.customRender && (r.ellipsis === !0 || r.ellipsis === "tooltip" || f(r.ellipsis)), e = f(r.ellipsis) && r.ellipsis > 1, i = f(r.ellipsis) ? r.ellipsis : 1;
|
|
86
|
+
return a.tooltipValueGetter = l ? (s) => M(s, r) : void 0, a.wrapText = !r.ellipsis || e, a.cellStyle = {
|
|
86
87
|
"--ag-grid-line-clamp": i
|
|
87
|
-
},
|
|
88
|
+
}, a.tooltipComponent = z, a.tooltipComponentParams = {
|
|
88
89
|
lineClamp: i,
|
|
89
90
|
gridWrapperRef: u
|
|
90
|
-
},
|
|
91
|
+
}, a;
|
|
91
92
|
}, g = T(() => {
|
|
92
93
|
const r = x(t);
|
|
93
|
-
function
|
|
94
|
+
function a(l) {
|
|
94
95
|
return l.map((e) => {
|
|
95
96
|
const i = {
|
|
96
97
|
field: S(e.dataIndex),
|
|
@@ -130,15 +131,15 @@ const X = (t, a, n) => {
|
|
|
130
131
|
headerGroupComponentParams: {
|
|
131
132
|
column: e
|
|
132
133
|
},
|
|
133
|
-
children:
|
|
134
|
+
children: a(e.children)
|
|
134
135
|
} : i;
|
|
135
136
|
});
|
|
136
137
|
}
|
|
137
|
-
return
|
|
138
|
+
return a(r);
|
|
138
139
|
}), w = T(
|
|
139
140
|
() => ({
|
|
140
141
|
headerComponent: v,
|
|
141
|
-
resizable:
|
|
142
|
+
resizable: o.columnResizable,
|
|
142
143
|
suppressMovable: !0,
|
|
143
144
|
cellDataType: !1
|
|
144
145
|
})
|
|
@@ -1,93 +1,99 @@
|
|
|
1
|
-
import { unref as
|
|
2
|
-
import {
|
|
3
|
-
import { mergeClass as
|
|
1
|
+
import { unref as k, computed as w } from "vue";
|
|
2
|
+
import { isArray as m, isFunction as E } from "lodash-unified";
|
|
3
|
+
import { mergeClass as F, getColumnIsRequired as v } from "../../editable-table/utils.mjs";
|
|
4
4
|
import { updateFormProps as y, getFieldProps as q } from "../../ap-table/utils.mjs";
|
|
5
5
|
import { getFinalEditableNode as A } from "../../ap-grid/utils/editable.mjs";
|
|
6
6
|
import { isDef as K } from "../../utils/index.mjs";
|
|
7
7
|
import { getRowKey as M } from "../editable/utils.mjs";
|
|
8
|
-
function
|
|
9
|
-
t.__skipNextRefresh ? t.__skipNextRefresh[
|
|
8
|
+
function b(t, i, r) {
|
|
9
|
+
t.__skipNextRefresh ? t.__skipNextRefresh[i] = r : t.__skipNextRefresh = { [i]: r };
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
t.__prevEditable ? t.__prevEditable[
|
|
11
|
+
function S(t, i, r) {
|
|
12
|
+
t.__prevEditable ? t.__prevEditable[i] = r : t.__prevEditable = { [i]: r };
|
|
13
13
|
}
|
|
14
|
-
const J = (t,
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const J = (t, i, r) => {
|
|
15
|
+
function I(e) {
|
|
16
|
+
const s = e.editable, o = r ? [r] : m(t.name) ? t.name : [t.name];
|
|
17
|
+
return !s || e.children?.length ? {
|
|
18
|
+
_path: [...o]
|
|
19
|
+
} : {
|
|
20
|
+
customRender({ value: d, originalNode: C, params: a, ...n }) {
|
|
21
|
+
const c = E(e.editable) ? e.editable(
|
|
22
|
+
n.text,
|
|
23
|
+
n.record,
|
|
24
|
+
n.rowIndex
|
|
22
25
|
) : !!e.editable;
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
let u = C;
|
|
27
|
+
const R = m(e.dataIndex) ? e.dataIndex : [e.dataIndex], x = M(
|
|
28
|
+
n.record,
|
|
29
|
+
n.rowIndex,
|
|
30
|
+
t.rowKey
|
|
31
|
+
);
|
|
32
|
+
if (c) {
|
|
33
|
+
const _ = y(
|
|
26
34
|
e,
|
|
27
35
|
q(e.fieldProps, {
|
|
28
|
-
value:
|
|
29
|
-
...
|
|
36
|
+
value: d,
|
|
37
|
+
...n
|
|
30
38
|
})
|
|
31
|
-
),
|
|
32
|
-
t.onFieldChange && (
|
|
33
|
-
|
|
39
|
+
), h = {};
|
|
40
|
+
t.onFieldChange && (h[`onUpdate:${_.valuePropName || "value"}`] = (N) => t.onFieldChange?.(
|
|
41
|
+
n.rowIndex,
|
|
34
42
|
e.dataIndex,
|
|
35
|
-
|
|
43
|
+
N
|
|
36
44
|
));
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
t.rowKey
|
|
41
|
-
), N = {
|
|
42
|
-
name: [...C, String(R), ...I],
|
|
43
|
-
...u || {},
|
|
45
|
+
const p = {
|
|
46
|
+
name: [...o, String(x), ...R],
|
|
47
|
+
..._ || {},
|
|
44
48
|
field: {
|
|
45
49
|
style: "width: 100%",
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
class:
|
|
50
|
+
..._?.field || {},
|
|
51
|
+
...h,
|
|
52
|
+
class: F("is-editable", _.class)
|
|
49
53
|
}
|
|
50
54
|
};
|
|
51
|
-
|
|
55
|
+
u = A(
|
|
52
56
|
e,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
p,
|
|
58
|
+
n.record,
|
|
59
|
+
k(i)
|
|
56
60
|
);
|
|
57
61
|
}
|
|
58
|
-
e.customRender && (
|
|
59
|
-
value:
|
|
60
|
-
...
|
|
61
|
-
editable:
|
|
62
|
-
originalNode:
|
|
63
|
-
index:
|
|
64
|
-
renderIndex:
|
|
62
|
+
e.customRender && (u = e.customRender({
|
|
63
|
+
value: d,
|
|
64
|
+
...n,
|
|
65
|
+
editable: c,
|
|
66
|
+
originalNode: u,
|
|
67
|
+
index: n.rowIndex,
|
|
68
|
+
renderIndex: n.rowIndex,
|
|
69
|
+
path: [...o, String(x)]
|
|
65
70
|
}));
|
|
66
|
-
const
|
|
67
|
-
return !
|
|
68
|
-
|
|
69
|
-
rowNodes: [
|
|
70
|
-
columns: [
|
|
71
|
+
const l = a.node, f = a.column.getColId(), g = l.__prevEditable?.[f];
|
|
72
|
+
return !l.__skipNextRefresh?.[f] && K(g) && g !== c && (b(l, f, !0), setTimeout(() => {
|
|
73
|
+
a?.api.refreshCells({
|
|
74
|
+
rowNodes: [a.node],
|
|
75
|
+
columns: [a.column.getColId()],
|
|
71
76
|
force: !0
|
|
72
|
-
}),
|
|
73
|
-
}, 0)),
|
|
74
|
-
}
|
|
77
|
+
}), b(l, f, !1);
|
|
78
|
+
}, 0)), S(l, f, c), u;
|
|
79
|
+
},
|
|
80
|
+
_path: [...o]
|
|
75
81
|
};
|
|
76
82
|
}
|
|
77
|
-
return
|
|
83
|
+
return w(() => {
|
|
78
84
|
const e = t.columns;
|
|
79
85
|
if (!e)
|
|
80
86
|
return [];
|
|
81
|
-
function
|
|
82
|
-
return
|
|
87
|
+
function s(o) {
|
|
88
|
+
return o.map((d) => ({
|
|
83
89
|
...d,
|
|
84
90
|
_requireMark: v(d),
|
|
85
|
-
children:
|
|
91
|
+
children: s(d.children || []),
|
|
86
92
|
// 处理可编辑/不可编辑下的单元格渲染
|
|
87
|
-
...
|
|
93
|
+
...I(d)
|
|
88
94
|
}));
|
|
89
95
|
}
|
|
90
|
-
return
|
|
96
|
+
return s(e);
|
|
91
97
|
});
|
|
92
98
|
};
|
|
93
99
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as io, useSlots as uo, ref as
|
|
1
|
+
import { defineComponent as io, useSlots as uo, ref as T, toRef as b, unref as t, computed as n, nextTick as z, watch as M, createElementBlock as W, openBlock as F, normalizeStyle as O, normalizeClass as f, createCommentVNode as le, createElementVNode as B, createVNode as G, mergeProps as H, createSlots as co, withCtx as ne, Fragment as mo, renderList as po, createBlock as se, resolveDynamicComponent as fo, renderSlot as ie, withDirectives as go, vShow as wo } from "vue";
|
|
2
2
|
import { AgGridVue as So } from "ag-grid-vue3";
|
|
3
3
|
import { ModuleRegistry as yo, AllCommunityModule as ho } from "ag-grid-community";
|
|
4
4
|
import { mergeProps as Co } from "./utils.mjs";
|
|
5
5
|
import { Spin as vo, Pagination as Ro } from "@aplus-frontend/antdv";
|
|
6
|
-
import { isUndefined as
|
|
6
|
+
import { isUndefined as k, isFunction as D } from "lodash-unified";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
8
|
import { ApForm as bo } from "../ap-form/index.mjs";
|
|
9
9
|
import { recursionApColumns as Fo } from "../ap-table/utils.mjs";
|
|
@@ -100,19 +100,24 @@ const vt = /* @__PURE__ */ io({
|
|
|
100
100
|
rowClassRules: {},
|
|
101
101
|
autoHeight: { type: Boolean },
|
|
102
102
|
onUpdate: {},
|
|
103
|
-
customRow: {}
|
|
103
|
+
customRow: {},
|
|
104
|
+
theme: {}
|
|
104
105
|
},
|
|
105
106
|
setup(de, { expose: ce }) {
|
|
106
107
|
yo.registerModules([ho]);
|
|
107
|
-
const o = de, L = uo(), { e:
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const o = de, L = uo(), { e: x, b: d, be: me } = Go("ag-grid"), h = T(o.size), pe = Eo(
|
|
109
|
+
h,
|
|
110
|
+
b(o, "rowHeight"),
|
|
111
|
+
b(o, "theme")
|
|
112
|
+
), fe = Mo(b(o, "virtual")), { rowPinnedGridConfig: U, getRowPinnedCellClass: ge } = Wo(
|
|
113
|
+
b(o, "summary")
|
|
114
|
+
), we = Ho("apGrid"), s = T(), [, Se] = Do();
|
|
110
115
|
let C = !!o.dataSource;
|
|
111
|
-
const j = zo(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Ko(o), { defaultColDef: Ce, columnDefs: ve, gridWrapperRef: Re } = Po($, o, ge),
|
|
116
|
+
const j = zo(o), { shownColumns: g, columns: $, columnKeys: ye, getTargetColumnByKey: he } = Ko(o), { defaultColDef: Ce, columnDefs: ve, gridWrapperRef: Re } = Po($, o, ge), I = T({});
|
|
112
117
|
xo({
|
|
113
|
-
sorter:
|
|
118
|
+
sorter: I,
|
|
114
119
|
setSorter(e) {
|
|
115
|
-
|
|
120
|
+
I.value = e;
|
|
116
121
|
}
|
|
117
122
|
});
|
|
118
123
|
const be = {
|
|
@@ -120,7 +125,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
120
125
|
desc: "descend"
|
|
121
126
|
};
|
|
122
127
|
function Fe() {
|
|
123
|
-
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(
|
|
128
|
+
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(I) || {};
|
|
124
129
|
let a = e?.[0];
|
|
125
130
|
const i = Object.keys(r);
|
|
126
131
|
if (i.length && i.every((c) => r[c] === null)) {
|
|
@@ -140,7 +145,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
140
145
|
if (e.sorter === !0)
|
|
141
146
|
return e.field ?? e.dataIndex ?? e.key;
|
|
142
147
|
}).filter(Boolean)), ke = () => {
|
|
143
|
-
|
|
148
|
+
I.value = {};
|
|
144
149
|
const e = s.value;
|
|
145
150
|
if (!e)
|
|
146
151
|
return;
|
|
@@ -160,7 +165,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
160
165
|
setDataSource: Te
|
|
161
166
|
} = Bo({
|
|
162
167
|
async request(e) {
|
|
163
|
-
if (C = !1, y.value && !y.value.preserveSelectedRowKeys &&
|
|
168
|
+
if (C = !1, y.value && !y.value.preserveSelectedRowKeys && k(o.dataSource) && V(), !k(o.dataSource)) {
|
|
164
169
|
const a = e.pageSize * (e.current - 1);
|
|
165
170
|
return {
|
|
166
171
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(a, a + e.pageSize)) || [],
|
|
@@ -174,8 +179,8 @@ const vt = /* @__PURE__ */ io({
|
|
|
174
179
|
};
|
|
175
180
|
},
|
|
176
181
|
namespace: "ap-grid",
|
|
177
|
-
filterFields:
|
|
178
|
-
params:
|
|
182
|
+
filterFields: T([]),
|
|
183
|
+
params: b(o, "params"),
|
|
179
184
|
defaultData: o.defaultData,
|
|
180
185
|
manual: t(xe),
|
|
181
186
|
formatParams: o.beforeSearchSubmit,
|
|
@@ -190,7 +195,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
190
195
|
...e
|
|
191
196
|
};
|
|
192
197
|
}), De = Oo(o, g), Ee = n(
|
|
193
|
-
() =>
|
|
198
|
+
() => k(o.dataSource) ? S.records : o.dataSource
|
|
194
199
|
), {
|
|
195
200
|
select: Ke,
|
|
196
201
|
unSelect: Pe,
|
|
@@ -221,7 +226,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
221
226
|
function A(e) {
|
|
222
227
|
return D(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
223
228
|
}
|
|
224
|
-
const
|
|
229
|
+
const N = ({
|
|
225
230
|
api: e = s.value
|
|
226
231
|
}) => {
|
|
227
232
|
if (o.onUpdate?.(), !y.value)
|
|
@@ -249,7 +254,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
249
254
|
};
|
|
250
255
|
function Ue(e) {
|
|
251
256
|
ze(e), z(() => {
|
|
252
|
-
|
|
257
|
+
N({});
|
|
253
258
|
});
|
|
254
259
|
}
|
|
255
260
|
const je = n(() => {
|
|
@@ -264,12 +269,12 @@ const vt = /* @__PURE__ */ io({
|
|
|
264
269
|
});
|
|
265
270
|
function $e(e) {
|
|
266
271
|
Me(e), z(() => {
|
|
267
|
-
|
|
272
|
+
N({});
|
|
268
273
|
});
|
|
269
274
|
}
|
|
270
275
|
function qe(e) {
|
|
271
276
|
We(e), z(() => {
|
|
272
|
-
|
|
277
|
+
N({});
|
|
273
278
|
});
|
|
274
279
|
}
|
|
275
280
|
function X(e = !1) {
|
|
@@ -344,7 +349,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
344
349
|
resetSearchFormSorterItems: oe
|
|
345
350
|
});
|
|
346
351
|
const Je = n(
|
|
347
|
-
() =>
|
|
352
|
+
() => k(o.loading) ? S.loading : o.loading
|
|
348
353
|
), Qe = n(() => [
|
|
349
354
|
d(),
|
|
350
355
|
o.card ? null : d("wrapper"),
|
|
@@ -430,13 +435,13 @@ const vt = /* @__PURE__ */ io({
|
|
|
430
435
|
refreshCells: ao,
|
|
431
436
|
redrawRows: lo,
|
|
432
437
|
_internalGridApi: n(() => s.value)
|
|
433
|
-
}), (e, r) => (
|
|
438
|
+
}), (e, r) => (F(), W("div", {
|
|
434
439
|
class: f(Qe.value),
|
|
435
440
|
style: O(e.wrapperStyle)
|
|
436
441
|
}, [
|
|
437
|
-
t(
|
|
442
|
+
t(k)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (F(), W("div", {
|
|
438
443
|
key: 0,
|
|
439
|
-
class: f(e.card ? t(
|
|
444
|
+
class: f(e.card ? t(x)("search-wrapper") : null),
|
|
440
445
|
style: O(e.searchFormWrapperStyle)
|
|
441
446
|
}, [
|
|
442
447
|
G(t(bo).SearchForm, H(e.searchForm || {}, {
|
|
@@ -448,7 +453,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
448
453
|
onReset: t(K)
|
|
449
454
|
}), co({
|
|
450
455
|
default: ne(() => [
|
|
451
|
-
(
|
|
456
|
+
(F(!0), W(mo, null, po(t(j), (a) => (F(), se(fo(a.renderNode), {
|
|
452
457
|
key: a.dataIndex
|
|
453
458
|
}))), 128))
|
|
454
459
|
]),
|
|
@@ -463,11 +468,11 @@ const vt = /* @__PURE__ */ io({
|
|
|
463
468
|
} : void 0
|
|
464
469
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
465
470
|
], 6)) : le("", !0),
|
|
466
|
-
|
|
467
|
-
class: f([t(
|
|
471
|
+
B("div", {
|
|
472
|
+
class: f([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
|
|
468
473
|
style: O(e.tableWrapperStyle)
|
|
469
474
|
}, [
|
|
470
|
-
|
|
475
|
+
B("div", {
|
|
471
476
|
class: f(t(d)("header-wrapper"))
|
|
472
477
|
}, [
|
|
473
478
|
ie(e.$slots, "title", {
|
|
@@ -477,7 +482,7 @@ const vt = /* @__PURE__ */ io({
|
|
|
477
482
|
clearAll: V
|
|
478
483
|
})
|
|
479
484
|
], 2),
|
|
480
|
-
|
|
485
|
+
B("div", {
|
|
481
486
|
ref_key: "gridWrapperRef",
|
|
482
487
|
ref: Re,
|
|
483
488
|
class: f(t(d)("grid-wrapper"))
|
|
@@ -505,25 +510,25 @@ const vt = /* @__PURE__ */ io({
|
|
|
505
510
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
506
511
|
onSortChanged: Fe,
|
|
507
512
|
onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
|
|
508
|
-
onRowDataUpdated:
|
|
513
|
+
onRowDataUpdated: N,
|
|
509
514
|
onRowSelected: He,
|
|
510
515
|
onFirstDataRendered: Le,
|
|
511
516
|
onRowClicked: to,
|
|
512
517
|
onBodyScrollEnd: ro
|
|
513
518
|
}
|
|
514
519
|
), null, 16, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "dom-layout"]),
|
|
515
|
-
go(
|
|
516
|
-
class: f(t(
|
|
520
|
+
go(B("div", {
|
|
521
|
+
class: f(t(x)("table-loading-wrapper"))
|
|
517
522
|
}, [
|
|
518
523
|
G(t(vo), { delay: 300 })
|
|
519
524
|
], 2), [
|
|
520
525
|
[wo, Je.value]
|
|
521
526
|
])
|
|
522
527
|
], 2),
|
|
523
|
-
|
|
528
|
+
B("div", {
|
|
524
529
|
class: f(t(d)("pagination-wrapper"))
|
|
525
530
|
}, [
|
|
526
|
-
e.pagination !== !1 ? (
|
|
531
|
+
e.pagination !== !1 ? (F(), se(t(Ro), H({
|
|
527
532
|
key: 0,
|
|
528
533
|
class: t(d)("pagination")
|
|
529
534
|
}, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
|
|
@@ -4,7 +4,7 @@ import { TableProps } from '@aplus-frontend/antdv';
|
|
|
4
4
|
import { ApFormSearchFormPopoverSorterItem, ApFormSearchFormProps } from '../ap-form/interface';
|
|
5
5
|
import { Recordable } from '../type';
|
|
6
6
|
import { SortOrder, TableRowSelection } from '@aplus-frontend/antdv/es/table/interface';
|
|
7
|
-
import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection } from 'ag-grid-community';
|
|
7
|
+
import { ColDef, GridApi, ICellRendererParams, IRowNode, IsFullWidthRowParams, RedrawRowsParams, RefreshCellsParams, RowClassRules, RowHeightParams, RowPinnedType, ScrollDirection, ThemeDefaultParams } from 'ag-grid-community';
|
|
8
8
|
import { InternalPagingType } from '../ap-table/hooks/use-table-paging-ng';
|
|
9
9
|
export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? Omit<ExtraProColumnType<RecordType>, 'sorter' | 'rowSpan' | 'customCell' | 'customHeaderCell' | 'minWidth' | 'width' | 'maxWidth' | 'className' | 'class' | 'colSpan'> & {
|
|
10
10
|
children?: AgGridColumnType<RecordType, ExtraValueType, ValueType>[];
|
|
@@ -84,6 +84,7 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
84
84
|
pinned?: boolean;
|
|
85
85
|
rowIndex?: number;
|
|
86
86
|
params?: ICellRendererParams;
|
|
87
|
+
path?: (string | number)[];
|
|
87
88
|
}) => any;
|
|
88
89
|
width?: number;
|
|
89
90
|
minWidth?: number;
|
|
@@ -111,6 +112,11 @@ export type AgGridColumnType<RecordType = any, ExtraValueType = 'text', ValueTyp
|
|
|
111
112
|
* 自定表头列类名
|
|
112
113
|
*/
|
|
113
114
|
headerClass?: ColDef<RecordType>['headerClass'];
|
|
115
|
+
/**
|
|
116
|
+
* 当单元格可编辑时,记录表单项的namePath
|
|
117
|
+
* @private 仅限内部使用,请勿传递
|
|
118
|
+
*/
|
|
119
|
+
_path?: (string | number)[];
|
|
114
120
|
} : null;
|
|
115
121
|
export type AgGridRowSelection<RecordType> = Pick<TableRowSelection<RecordType>, 'type' | 'fixed' | 'columnWidth' | 'defaultSelectedRowKeys'> & {
|
|
116
122
|
/**
|
|
@@ -319,6 +325,11 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
319
325
|
* @since 6.37.0
|
|
320
326
|
*/
|
|
321
327
|
customRow?: AgGridCustomRowConfig;
|
|
328
|
+
/**
|
|
329
|
+
* 自定义主题
|
|
330
|
+
* @since 6.41.0
|
|
331
|
+
*/
|
|
332
|
+
theme?: Partial<ThemeDefaultParams>;
|
|
322
333
|
};
|
|
323
334
|
export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
324
335
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { AgGridProps } from './interface';
|
|
2
3
|
import { Theme, ThemeDefaultParams } from 'ag-grid-community';
|
|
3
|
-
export declare const useTheme: (size: Ref<"medium" | "mini" | undefined>, rowHeight: Ref<undefined | number>) => ComputedRef<Theme<ThemeDefaultParams>>;
|
|
4
|
+
export declare const useTheme: (size: Ref<"medium" | "mini" | undefined>, rowHeight: Ref<undefined | number>, customTheme: Ref<AgGridProps["theme"]>) => ComputedRef<Theme<ThemeDefaultParams>>;
|
package/es/src/ag-grid/theme.mjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { useToken as
|
|
2
|
-
import { themeQuartz as
|
|
3
|
-
import { computed as
|
|
4
|
-
const h = (o, r) => {
|
|
5
|
-
const [,
|
|
6
|
-
return
|
|
7
|
-
const
|
|
8
|
-
return
|
|
1
|
+
import { useToken as n } from "@aplus-frontend/antdv/es/theme/internal";
|
|
2
|
+
import { themeQuartz as c } from "ag-grid-community";
|
|
3
|
+
import { computed as l } from "vue";
|
|
4
|
+
const h = (o, r, a) => {
|
|
5
|
+
const [, t] = n();
|
|
6
|
+
return l(() => {
|
|
7
|
+
const d = o.value === "mini", e = t.value;
|
|
8
|
+
return c.withParams({
|
|
9
9
|
headerHeight: "36px",
|
|
10
10
|
headerFontSize: "12px",
|
|
11
11
|
dataFontSize: "12px",
|
|
12
|
-
rowHeight: r.value,
|
|
13
|
-
spacing: t ? "5px" : "6.5px",
|
|
14
12
|
foregroundColor: e.colorTextBase,
|
|
15
13
|
wrapperBorder: !1,
|
|
16
14
|
rowBorder: { color: e.colorBorderSecondary },
|
|
@@ -21,7 +19,10 @@ const h = (o, r) => {
|
|
|
21
19
|
headerBackgroundColor: "var(--ap-table-header-bg)",
|
|
22
20
|
headerColumnResizeHandleHeight: "50%",
|
|
23
21
|
headerColumnResizeHandleWidth: "1px",
|
|
24
|
-
wrapperBorderRadius: "4px"
|
|
22
|
+
wrapperBorderRadius: "4px",
|
|
23
|
+
...a.value || {},
|
|
24
|
+
rowHeight: r.value,
|
|
25
|
+
spacing: d ? "5px" : "6.5px"
|
|
25
26
|
});
|
|
26
27
|
});
|
|
27
28
|
};
|