@aplus-frontend/ui 6.24.0 → 6.24.2
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/hooks/use-columns-def.mjs +18 -18
- package/es/src/ag-grid/hooks/use-search-form.d.ts +3 -0
- package/es/src/ag-grid/hooks/use-search-form.mjs +41 -0
- package/es/src/ag-grid/index.vue.mjs +224 -243
- package/es/src/ag-grid/interface.d.ts +1 -0
- package/es/src/ag-grid/renderer/date-range.mjs +7 -7
- package/es/src/ag-grid/renderer/date.mjs +11 -11
- package/es/src/ap-pro-card/utils/css-var.mjs +10 -10
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
- package/lib/src/ag-grid/hooks/use-search-form.d.ts +3 -0
- package/lib/src/ag-grid/hooks/use-search-form.js +1 -0
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +1 -0
- package/lib/src/ag-grid/renderer/date-range.js +1 -1
- package/lib/src/ag-grid/renderer/date.js +1 -1
- package/lib/src/ap-pro-card/utils/css-var.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
- package/theme/ag-grid/index.css +3 -0
- package/theme/ag-grid/index.less +3 -0
- package/theme/ap-grid/index.css +4 -0
- package/theme/ap-grid/index.less +4 -0
- package/theme/ap-pro-card/index.css +7 -4
- package/theme/ap-pro-card/index.less +7 -4
- package/theme/index.css +14 -4
|
@@ -12,7 +12,7 @@ import { useNamespace as P } from "../../config-provider/hooks/use-namespace.mjs
|
|
|
12
12
|
import S from "../components/body-cell/index.vue2.mjs";
|
|
13
13
|
import _ from "../components/header-cell/index.vue2.mjs";
|
|
14
14
|
function z(r, a) {
|
|
15
|
-
var
|
|
15
|
+
var p, f;
|
|
16
16
|
if (a.bodyCellTooltip)
|
|
17
17
|
return w(a.bodyCellTooltip) ? a.bodyCellTooltip(r.value, r.data) : a.bodyCellTooltip;
|
|
18
18
|
if (a.renderText)
|
|
@@ -22,31 +22,31 @@ function z(r, a) {
|
|
|
22
22
|
column: a,
|
|
23
23
|
text: r.value
|
|
24
24
|
});
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
25
|
+
const d = a.valueType || "text", n = g[d];
|
|
26
|
+
if (n) {
|
|
27
27
|
const v = h(
|
|
28
|
-
{ ...a, valueType:
|
|
28
|
+
{ ...a, valueType: d },
|
|
29
29
|
{
|
|
30
30
|
value: r.value,
|
|
31
31
|
text: r.value,
|
|
32
32
|
record: r.data,
|
|
33
33
|
column: r.column,
|
|
34
|
-
rowIndex: (
|
|
34
|
+
rowIndex: (p = r.node) == null ? void 0 : p.rowIndex,
|
|
35
35
|
pinned: (f = r.node) == null ? void 0 : f.rowPinned
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
|
-
return
|
|
38
|
+
return n(v);
|
|
39
39
|
}
|
|
40
40
|
return m(r.value);
|
|
41
41
|
}
|
|
42
42
|
const J = (r, a) => {
|
|
43
|
-
const
|
|
43
|
+
const d = I("valueTypeMap"), { em: n } = P("ag-grid"), C = b(() => {
|
|
44
44
|
const f = c(r), v = (i) => {
|
|
45
45
|
const e = {
|
|
46
46
|
cellRenderer: S,
|
|
47
47
|
cellRendererParams: {
|
|
48
48
|
column: i,
|
|
49
|
-
extraValueType: c(
|
|
49
|
+
extraValueType: c(d)
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
if (i.customRender)
|
|
@@ -60,8 +60,8 @@ const J = (r, a) => {
|
|
|
60
60
|
text: t.value
|
|
61
61
|
})
|
|
62
62
|
};
|
|
63
|
-
const u = i.valueType || "text",
|
|
64
|
-
return
|
|
63
|
+
const u = i.valueType || "text", s = g[u];
|
|
64
|
+
return s ? {
|
|
65
65
|
valueFormatter: (t) => {
|
|
66
66
|
var o, x;
|
|
67
67
|
const l = h(
|
|
@@ -75,14 +75,14 @@ const J = (r, a) => {
|
|
|
75
75
|
pinned: (x = t.node) == null ? void 0 : x.rowPinned
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
|
-
return
|
|
78
|
+
return s(l);
|
|
79
79
|
}
|
|
80
|
-
} :
|
|
80
|
+
} : e;
|
|
81
81
|
};
|
|
82
82
|
function y(i) {
|
|
83
83
|
return i.map((e) => {
|
|
84
84
|
var t;
|
|
85
|
-
const u = e.bodyCellTooltip || !e.customRender && (e.ellipsis === !0 || e.ellipsis === "tooltip" || T(e.ellipsis)),
|
|
85
|
+
const u = e.bodyCellTooltip || !e.customRender && (e.ellipsis === !0 || e.ellipsis === "tooltip" || T(e.ellipsis)), s = {
|
|
86
86
|
field: R(e.dataIndex),
|
|
87
87
|
colId: D(e.key) ? String(e.key) : void 0,
|
|
88
88
|
sortable: !!e.sorter,
|
|
@@ -102,7 +102,7 @@ const J = (r, a) => {
|
|
|
102
102
|
cellClass: (l) => {
|
|
103
103
|
const o = e.cellClass || "", x = w(o) ? o(l.data, l.node) : o;
|
|
104
104
|
return [
|
|
105
|
-
`${
|
|
105
|
+
`${n("cell", e.align || "left")}`,
|
|
106
106
|
x
|
|
107
107
|
].flat().filter(Boolean);
|
|
108
108
|
},
|
|
@@ -116,13 +116,13 @@ const J = (r, a) => {
|
|
|
116
116
|
...v(e)
|
|
117
117
|
};
|
|
118
118
|
return (t = e.children) != null && t.length ? {
|
|
119
|
-
...
|
|
119
|
+
...s,
|
|
120
120
|
children: y(e.children)
|
|
121
|
-
} :
|
|
121
|
+
} : s;
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
return y(f);
|
|
125
|
-
}),
|
|
125
|
+
}), p = b(
|
|
126
126
|
() => ({
|
|
127
127
|
headerComponent: _,
|
|
128
128
|
resizable: a.columnResizable,
|
|
@@ -132,7 +132,7 @@ const J = (r, a) => {
|
|
|
132
132
|
);
|
|
133
133
|
return {
|
|
134
134
|
columnDefs: C,
|
|
135
|
-
defaultColDef:
|
|
135
|
+
defaultColDef: p
|
|
136
136
|
};
|
|
137
137
|
};
|
|
138
138
|
export {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { noRenderAsFormItemValueList as m } from "../../ap-table/constants.mjs";
|
|
2
|
+
import { computed as u, unref as i } from "vue";
|
|
3
|
+
import { getColumnOrder as s, updateFormProps as c, getFieldProps as f, getSearchFormItemRenderNode as g } from "../../ap-table/utils.mjs";
|
|
4
|
+
import "../../config-provider/index.mjs";
|
|
5
|
+
import { useGlobalConfig as I } from "../../config-provider/hooks/use-global-config.mjs";
|
|
6
|
+
const O = (p) => {
|
|
7
|
+
let t = 0;
|
|
8
|
+
const l = I("valueTypeMap");
|
|
9
|
+
return u(() => {
|
|
10
|
+
var d, n, a;
|
|
11
|
+
return t++, ((a = (n = (d = p.columns) == null ? void 0 : d.filter(
|
|
12
|
+
(e) => !e.hideInSearch && e.dataIndex && (e.valueType || e.customRenderFormItem) && !m.includes(e.valueType)
|
|
13
|
+
)) == null ? void 0 : n.sort((e, o) => {
|
|
14
|
+
const r = s(e.order);
|
|
15
|
+
return s(o.order) - r;
|
|
16
|
+
})) == null ? void 0 : a.map((e) => {
|
|
17
|
+
const o = c(
|
|
18
|
+
e,
|
|
19
|
+
f(e.fieldProps, {})
|
|
20
|
+
), r = {
|
|
21
|
+
...e,
|
|
22
|
+
fieldProps: {
|
|
23
|
+
label: e.title,
|
|
24
|
+
name: e.dataIndex,
|
|
25
|
+
// tips: 在表格中的查询表单项默认是带边框的
|
|
26
|
+
bordered: !0,
|
|
27
|
+
...o || {},
|
|
28
|
+
_signal: t
|
|
29
|
+
},
|
|
30
|
+
renderNode: void 0
|
|
31
|
+
};
|
|
32
|
+
return r.renderNode = g(
|
|
33
|
+
r,
|
|
34
|
+
i(l)
|
|
35
|
+
), r;
|
|
36
|
+
})) || [];
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
O as useSearchForm
|
|
41
|
+
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { Spin as
|
|
5
|
-
import { isUndefined as
|
|
1
|
+
import { defineComponent as ze, useSlots as Ae, ref as v, toRef as j, computed as l, unref as a, nextTick as Ke, watch as k, createElementBlock as D, openBlock as g, normalizeStyle as b, normalizeClass as c, createCommentVNode as q, createElementVNode as S, createVNode as z, mergeProps as U, createSlots as Ne, withCtx as $, Fragment as Ve, renderList as Ie, createBlock as J, resolveDynamicComponent as Ee, renderSlot as Q, withDirectives as Pe, vShow as Me } from "vue";
|
|
2
|
+
import { AgGridVue as We } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as Le, AllCommunityModule as Oe } from "ag-grid-community";
|
|
4
|
+
import { Spin as Ge, Pagination as He } from "@aplus-frontend/antdv";
|
|
5
|
+
import { isUndefined as R, isFunction as je } from "lodash-unified";
|
|
6
6
|
import "../config-provider/index.mjs";
|
|
7
|
-
import { ApForm as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { useNamespace as
|
|
22
|
-
|
|
23
|
-
const Ko = /* @__PURE__ */ Ne({
|
|
7
|
+
import { ApForm as qe } from "../ap-form/index.mjs";
|
|
8
|
+
import { recursionApColumns as Ue } from "../ap-table/utils.mjs";
|
|
9
|
+
import { useTablePaging as $e } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
10
|
+
import Je from "./hooks/use-row-selection.mjs";
|
|
11
|
+
import { useProvideSorter as Qe } from "./context.mjs";
|
|
12
|
+
import { useProvideApTable as Xe } from "../ap-table/context.mjs";
|
|
13
|
+
import { sizeReverseMap as Ye, sizeMap as Ze } from "../ap-grid/constants.mjs";
|
|
14
|
+
import { useToken as _e } from "@aplus-frontend/antdv/es/theme/internal";
|
|
15
|
+
import { useTheme as eo } from "./theme.mjs";
|
|
16
|
+
import { useColumns as oo } from "./hooks/use-columns.mjs";
|
|
17
|
+
import { useColumnsDef as to } from "./hooks/use-columns-def.mjs";
|
|
18
|
+
import { isDef as ao } from "../utils/index.mjs";
|
|
19
|
+
import { getValidVNodeList as ro } from "../utils/slot.mjs";
|
|
20
|
+
import { useSearchForm as no } from "./hooks/use-search-form.mjs";
|
|
21
|
+
import { useNamespace as lo } from "../config-provider/hooks/use-namespace.mjs";
|
|
22
|
+
const Do = /* @__PURE__ */ ze({
|
|
24
23
|
name: "AgGrid",
|
|
25
24
|
__name: "index",
|
|
26
25
|
props: {
|
|
@@ -86,365 +85,347 @@ const Ko = /* @__PURE__ */ Ne({
|
|
|
86
85
|
advanceRenderer: { type: Boolean },
|
|
87
86
|
browserTooltips: { type: Boolean }
|
|
88
87
|
},
|
|
89
|
-
setup(
|
|
90
|
-
|
|
91
|
-
const o =
|
|
92
|
-
let w = !!o.dataSource
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
return z++, ((n = (t = (e = o.columns) == null ? void 0 : e.filter(
|
|
96
|
-
(r) => !r.hideInSearch && r.dataIndex && (r.valueType || r.customRenderFormItem) && !Je.includes(r.valueType)
|
|
97
|
-
)) == null ? void 0 : t.sort((r, l) => {
|
|
98
|
-
let i = Z(r.order);
|
|
99
|
-
return Z(l.order) - i;
|
|
100
|
-
})) == null ? void 0 : n.map((r) => {
|
|
101
|
-
const l = Qe(
|
|
102
|
-
r,
|
|
103
|
-
Xe(r.fieldProps, {})
|
|
104
|
-
), i = {
|
|
105
|
-
...r,
|
|
106
|
-
fieldProps: {
|
|
107
|
-
label: r.title,
|
|
108
|
-
name: r.dataIndex,
|
|
109
|
-
// tips: 在表格中的查询表单项默认是带边框的
|
|
110
|
-
bordered: !0,
|
|
111
|
-
...l || {},
|
|
112
|
-
_signal: z
|
|
113
|
-
},
|
|
114
|
-
renderNode: void 0
|
|
115
|
-
};
|
|
116
|
-
return i.renderNode = Ye(
|
|
117
|
-
i,
|
|
118
|
-
a(ae)
|
|
119
|
-
), i;
|
|
120
|
-
})) || [];
|
|
121
|
-
}), { shownColumns: u, shownColumnsBackup: ne } = so(o), { defaultColDef: le, columnDefs: se } = io(
|
|
122
|
-
u,
|
|
88
|
+
setup(X, { expose: Y }) {
|
|
89
|
+
Le.registerModules([Oe]);
|
|
90
|
+
const o = X, h = Ae(), { e: y, b: i, be: Z } = lo("ag-grid"), p = v(o.size), _ = eo(p, j(o, "rowHeight")), f = v(), [, ee] = _e();
|
|
91
|
+
let w = !!o.dataSource;
|
|
92
|
+
const A = no(o), { shownColumns: d, shownColumnsBackup: oe } = oo(o), { defaultColDef: te, columnDefs: ae } = to(
|
|
93
|
+
d,
|
|
123
94
|
o
|
|
124
|
-
),
|
|
125
|
-
|
|
126
|
-
sorter:
|
|
95
|
+
), K = v({});
|
|
96
|
+
Qe({
|
|
97
|
+
sorter: K,
|
|
127
98
|
setSorter(e) {
|
|
128
|
-
|
|
99
|
+
K.value = e;
|
|
129
100
|
}
|
|
130
101
|
});
|
|
131
|
-
const
|
|
102
|
+
const re = {
|
|
132
103
|
asc: "ascend",
|
|
133
104
|
desc: "descend"
|
|
134
105
|
};
|
|
135
|
-
function
|
|
136
|
-
var
|
|
137
|
-
const e = (
|
|
106
|
+
function ne() {
|
|
107
|
+
var s;
|
|
108
|
+
const e = (s = f.value.getColumns()) == null ? void 0 : s.filter((T) => T.getSort() !== void 0);
|
|
138
109
|
if (!(e != null && e.length))
|
|
139
110
|
return;
|
|
140
|
-
const t = e[0],
|
|
111
|
+
const t = e[0], r = t.getColDef(), n = t.getSort();
|
|
141
112
|
V(void 0, void 0, {
|
|
142
|
-
column:
|
|
143
|
-
field:
|
|
144
|
-
order:
|
|
113
|
+
column: r,
|
|
114
|
+
field: r.field,
|
|
115
|
+
order: n ? re[n] : null
|
|
145
116
|
});
|
|
146
117
|
}
|
|
147
|
-
const
|
|
118
|
+
const le = l(() => Ue(a(d), (e) => {
|
|
148
119
|
if (e.sorter === !0)
|
|
149
120
|
return e.key || e.dataIndex;
|
|
150
|
-
}).filter(Boolean)),
|
|
121
|
+
}).filter(Boolean)), se = l(() => {
|
|
151
122
|
var t;
|
|
152
|
-
return
|
|
153
|
-
var
|
|
154
|
-
return ((
|
|
123
|
+
return ao(o.manual) ? o.manual : ro(((t = h.searchFormExtra) == null ? void 0 : t.call(h)) || []).some((r) => {
|
|
124
|
+
var n;
|
|
125
|
+
return ((n = r.type) == null ? void 0 : n.name) === "ApView";
|
|
155
126
|
});
|
|
156
127
|
}), {
|
|
157
|
-
formRef:
|
|
158
|
-
submit:
|
|
159
|
-
reset:
|
|
160
|
-
data:
|
|
161
|
-
tableProps:
|
|
128
|
+
formRef: u,
|
|
129
|
+
submit: C,
|
|
130
|
+
reset: F,
|
|
131
|
+
data: m,
|
|
132
|
+
tableProps: N,
|
|
162
133
|
handleTableChangeOptional: V,
|
|
163
|
-
submitWith:
|
|
164
|
-
refresh:
|
|
165
|
-
getPaging:
|
|
166
|
-
setPaging:
|
|
167
|
-
|
|
134
|
+
submitWith: I,
|
|
135
|
+
refresh: E,
|
|
136
|
+
getPaging: ie,
|
|
137
|
+
setPaging: de,
|
|
138
|
+
setDataSource: ce
|
|
139
|
+
} = $e({
|
|
168
140
|
async request(e) {
|
|
169
|
-
var
|
|
170
|
-
if (w = !1, !
|
|
171
|
-
const
|
|
141
|
+
var r;
|
|
142
|
+
if (w = !1, !R(o.dataSource)) {
|
|
143
|
+
const n = e.pageSize * (e.current - 1);
|
|
172
144
|
return {
|
|
173
|
-
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(
|
|
145
|
+
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(n, n + e.pageSize)) || [],
|
|
174
146
|
total: o.dataSource.length || 0
|
|
175
147
|
};
|
|
176
148
|
}
|
|
177
|
-
const t = await ((
|
|
149
|
+
const t = await ((r = o.request) == null ? void 0 : r.call(o, e));
|
|
178
150
|
return {
|
|
179
151
|
data: (t == null ? void 0 : t.data) || [],
|
|
180
152
|
total: (t == null ? void 0 : t.total) || 0
|
|
181
153
|
};
|
|
182
154
|
},
|
|
183
155
|
namespace: "ap-grid",
|
|
184
|
-
filterFields:
|
|
185
|
-
params:
|
|
156
|
+
filterFields: v([]),
|
|
157
|
+
params: j(o, "params"),
|
|
186
158
|
defaultData: o.defaultData,
|
|
187
|
-
manual: a(
|
|
159
|
+
manual: a(se),
|
|
188
160
|
formatParams: o.beforeSearchSubmit,
|
|
189
161
|
pagination: o.pagination,
|
|
190
|
-
sortFields:
|
|
191
|
-
}),
|
|
192
|
-
() =>
|
|
162
|
+
sortFields: le
|
|
163
|
+
}), ue = l(
|
|
164
|
+
() => R(o.dataSource) ? m.records : o.dataSource
|
|
193
165
|
), {
|
|
194
|
-
select:
|
|
195
|
-
unSelect:
|
|
196
|
-
selectedRows:
|
|
197
|
-
selectedRowKeys:
|
|
198
|
-
clearAll:
|
|
199
|
-
selectMultiByKeys:
|
|
200
|
-
} =
|
|
166
|
+
select: me,
|
|
167
|
+
unSelect: pe,
|
|
168
|
+
selectedRows: B,
|
|
169
|
+
selectedRowKeys: fe,
|
|
170
|
+
clearAll: we,
|
|
171
|
+
selectMultiByKeys: ge
|
|
172
|
+
} = Je({
|
|
201
173
|
...o.rowSelection === !0 ? {} : o.rowSelection,
|
|
202
|
-
dataSource:
|
|
174
|
+
dataSource: ue,
|
|
203
175
|
rowKey: o.rowKey
|
|
204
|
-
}),
|
|
176
|
+
}), Se = {
|
|
205
177
|
checkbox: "multiRow",
|
|
206
178
|
radio: "singleRow"
|
|
207
|
-
},
|
|
179
|
+
}, he = l(() => {
|
|
208
180
|
if (!o.rowSelection)
|
|
209
181
|
return;
|
|
210
182
|
const { type: e = "checkbox", disabled: t } = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
211
183
|
return {
|
|
212
|
-
mode:
|
|
213
|
-
isRowSelectable: (
|
|
184
|
+
mode: Se[e],
|
|
185
|
+
isRowSelectable: (r) => t ? !t(r.data) : !0
|
|
214
186
|
};
|
|
215
|
-
}),
|
|
187
|
+
}), ye = l(() => {
|
|
216
188
|
if (!o.rowSelection)
|
|
217
189
|
return;
|
|
218
190
|
const e = o.rowSelection === !0 ? {} : o.rowSelection;
|
|
219
|
-
|
|
191
|
+
let t = e.fixed;
|
|
192
|
+
return t === void 0 && (t = d.value.some(
|
|
193
|
+
(r) => r.fixed === "left" || r.fixed === !0
|
|
194
|
+
) ? "left" : void 0), {
|
|
220
195
|
sortable: !1,
|
|
221
196
|
resizable: !1,
|
|
222
197
|
width: e.columnWidth || 60,
|
|
223
|
-
pinned:
|
|
198
|
+
pinned: t
|
|
224
199
|
};
|
|
225
200
|
});
|
|
226
|
-
function
|
|
227
|
-
return
|
|
201
|
+
function x(e) {
|
|
202
|
+
return je(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
228
203
|
}
|
|
229
|
-
const
|
|
230
|
-
api: e =
|
|
204
|
+
const P = ({
|
|
205
|
+
api: e = f.value
|
|
231
206
|
}) => {
|
|
232
207
|
if (!o.rowSelection)
|
|
233
208
|
return;
|
|
234
|
-
const t =
|
|
209
|
+
const t = B.value;
|
|
235
210
|
if (!t.length)
|
|
236
211
|
return;
|
|
237
212
|
w = !1;
|
|
238
|
-
const
|
|
239
|
-
e.forEachNode((
|
|
240
|
-
const
|
|
241
|
-
t.find((
|
|
242
|
-
}), e.setNodesSelected({ nodes:
|
|
213
|
+
const r = [];
|
|
214
|
+
e.forEachNode((n) => {
|
|
215
|
+
const s = n.data, T = x(s);
|
|
216
|
+
t.find((De) => x(De) === T) && r.push(n);
|
|
217
|
+
}), e.setNodesSelected({ nodes: r, newValue: !0 }), setTimeout(() => {
|
|
243
218
|
w = !0;
|
|
244
219
|
}, 0);
|
|
245
|
-
},
|
|
246
|
-
w && (e.node.isSelected() ?
|
|
247
|
-
},
|
|
220
|
+
}, ve = (e) => {
|
|
221
|
+
w && (e.node.isSelected() ? me(e.data) : pe(e.data));
|
|
222
|
+
}, be = () => {
|
|
248
223
|
w = !0;
|
|
249
224
|
}, M = () => {
|
|
250
225
|
var e;
|
|
251
|
-
|
|
226
|
+
we(), (e = f.value) == null || e.deselectAll();
|
|
252
227
|
};
|
|
253
|
-
function
|
|
254
|
-
|
|
255
|
-
|
|
228
|
+
function Re(e) {
|
|
229
|
+
ge(e), Ke(() => {
|
|
230
|
+
P({});
|
|
256
231
|
});
|
|
257
232
|
}
|
|
258
|
-
function
|
|
259
|
-
var
|
|
233
|
+
function W(e = !1) {
|
|
234
|
+
var r, n, s;
|
|
260
235
|
const t = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
261
|
-
return (
|
|
236
|
+
return (s = (n = (r = u.value) == null ? void 0 : r.apForm) == null ? void 0 : n[t]) == null ? void 0 : s.call(n, !0);
|
|
262
237
|
}
|
|
263
|
-
function
|
|
264
|
-
var t,
|
|
265
|
-
(
|
|
238
|
+
function L(e) {
|
|
239
|
+
var t, r, n;
|
|
240
|
+
(n = (r = (t = u.value) == null ? void 0 : t.apForm) == null ? void 0 : r.setFieldsValue) == null || n.call(r, e);
|
|
266
241
|
}
|
|
267
|
-
function
|
|
242
|
+
function O() {
|
|
268
243
|
var e;
|
|
269
|
-
return ((e =
|
|
244
|
+
return ((e = u.value) == null ? void 0 : e.getSorterItems()) || [];
|
|
270
245
|
}
|
|
271
246
|
function G(e) {
|
|
272
247
|
var t;
|
|
273
|
-
(t =
|
|
248
|
+
(t = u.value) == null || t.setSorterItems(e);
|
|
274
249
|
}
|
|
275
250
|
function H() {
|
|
276
251
|
var e;
|
|
277
|
-
(e =
|
|
252
|
+
(e = u.value) == null || e.resetSorterItems();
|
|
278
253
|
}
|
|
279
|
-
|
|
280
|
-
columns:
|
|
281
|
-
columnsBackup:
|
|
282
|
-
size:
|
|
254
|
+
Xe({
|
|
255
|
+
columns: l(() => d.value),
|
|
256
|
+
columnsBackup: l(() => oe.value),
|
|
257
|
+
size: l(() => Ze[p.value]),
|
|
283
258
|
updateColumns(e) {
|
|
284
259
|
var t;
|
|
285
|
-
console.log(e),
|
|
260
|
+
console.log(e), d.value = e, (t = o.onShownColumnsChange) == null || t.call(o, e);
|
|
286
261
|
},
|
|
287
262
|
updateSize(e) {
|
|
288
|
-
|
|
263
|
+
p.value = Ye[e];
|
|
289
264
|
},
|
|
290
|
-
renderConfig:
|
|
291
|
-
className:
|
|
292
|
-
color:
|
|
265
|
+
renderConfig: l(() => ({
|
|
266
|
+
className: Z("table-header", "title"),
|
|
267
|
+
color: ee.value.colorTextTertiary
|
|
293
268
|
})),
|
|
294
|
-
dataSource:
|
|
295
|
-
getSearchFormValues:
|
|
296
|
-
setSearchFormValues:
|
|
297
|
-
submit:
|
|
298
|
-
submitWith:
|
|
299
|
-
reset:
|
|
300
|
-
refresh:
|
|
301
|
-
getSearchFormSorterItems:
|
|
269
|
+
dataSource: l(() => a(m).records),
|
|
270
|
+
getSearchFormValues: W,
|
|
271
|
+
setSearchFormValues: L,
|
|
272
|
+
submit: C,
|
|
273
|
+
submitWith: I,
|
|
274
|
+
reset: F,
|
|
275
|
+
refresh: E,
|
|
276
|
+
getSearchFormSorterItems: O,
|
|
302
277
|
setSearchFormSorterItems: G,
|
|
303
278
|
resetSearchFormSorterItems: H
|
|
304
279
|
});
|
|
305
|
-
const
|
|
306
|
-
() =>
|
|
307
|
-
),
|
|
308
|
-
|
|
309
|
-
o.card ? null :
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
].filter(Boolean)),
|
|
280
|
+
const Ce = l(
|
|
281
|
+
() => R(o.loading) ? m.loading : o.loading
|
|
282
|
+
), Fe = l(() => [
|
|
283
|
+
i(),
|
|
284
|
+
o.card ? null : i("wrapper"),
|
|
285
|
+
i("adaptive"),
|
|
286
|
+
i(`size-${p.value}`)
|
|
287
|
+
].filter(Boolean)), Be = l(() => ({
|
|
313
288
|
height: "100%",
|
|
314
289
|
...o.tableStyle || {}
|
|
315
|
-
})),
|
|
290
|
+
})), xe = (e, t) => {
|
|
316
291
|
V({ current: e, pageSize: t });
|
|
317
292
|
};
|
|
318
|
-
function
|
|
293
|
+
function Te(e) {
|
|
319
294
|
const t = e.data;
|
|
320
|
-
return
|
|
295
|
+
return x(t);
|
|
321
296
|
}
|
|
322
|
-
function
|
|
323
|
-
var
|
|
324
|
-
(
|
|
297
|
+
function ke(e, t) {
|
|
298
|
+
var r;
|
|
299
|
+
(r = f.value) == null || r.ensureIndexVisible(e, t);
|
|
325
300
|
}
|
|
326
|
-
return
|
|
301
|
+
return k(
|
|
302
|
+
() => o.dataSource,
|
|
303
|
+
(e) => {
|
|
304
|
+
ce(e);
|
|
305
|
+
},
|
|
306
|
+
{ immediate: !0, deep: !0 }
|
|
307
|
+
), k(
|
|
327
308
|
() => o.size,
|
|
328
309
|
(e) => {
|
|
329
|
-
|
|
310
|
+
p.value = e;
|
|
330
311
|
}
|
|
331
|
-
),
|
|
332
|
-
() => a(
|
|
312
|
+
), k(
|
|
313
|
+
() => a(m).loading,
|
|
333
314
|
(e) => {
|
|
334
315
|
var t;
|
|
335
316
|
(t = o.onLoadingChange) == null || t.call(o, e);
|
|
336
317
|
}
|
|
337
|
-
),
|
|
338
|
-
submit:
|
|
339
|
-
reset:
|
|
340
|
-
refresh:
|
|
341
|
-
submitWith:
|
|
342
|
-
setSearchFormValues:
|
|
343
|
-
getSearchFormValues:
|
|
344
|
-
getShowColumns: () => a(
|
|
318
|
+
), Y({
|
|
319
|
+
submit: C,
|
|
320
|
+
reset: F,
|
|
321
|
+
refresh: E,
|
|
322
|
+
submitWith: I,
|
|
323
|
+
setSearchFormValues: L,
|
|
324
|
+
getSearchFormValues: W,
|
|
325
|
+
getShowColumns: () => a(d),
|
|
345
326
|
rowSelection: {
|
|
346
|
-
selectedRows:
|
|
347
|
-
setSelectedRowKeys:
|
|
327
|
+
selectedRows: l(() => B.value),
|
|
328
|
+
setSelectedRowKeys: Re,
|
|
348
329
|
clearAll: M
|
|
349
330
|
},
|
|
350
|
-
scrollToRow:
|
|
351
|
-
getDataSource: () => a(
|
|
352
|
-
getPaging:
|
|
353
|
-
setPaging:
|
|
354
|
-
getSearchFormSorterItems:
|
|
331
|
+
scrollToRow: ke,
|
|
332
|
+
getDataSource: () => a(m.records),
|
|
333
|
+
getPaging: ie,
|
|
334
|
+
setPaging: de,
|
|
335
|
+
getSearchFormSorterItems: O,
|
|
355
336
|
setSearchFormSorterItems: G,
|
|
356
337
|
resetSearchFormSorterItems: H
|
|
357
338
|
}), (e, t) => {
|
|
358
|
-
var
|
|
359
|
-
return
|
|
360
|
-
class: c(
|
|
361
|
-
style:
|
|
339
|
+
var r, n;
|
|
340
|
+
return g(), D("div", {
|
|
341
|
+
class: c(Fe.value),
|
|
342
|
+
style: b(e.wrapperStyle)
|
|
362
343
|
}, [
|
|
363
|
-
a(
|
|
344
|
+
a(R)(e.dataSource) && e.searchForm !== !1 && a(A).length > 0 ? (g(), D("div", {
|
|
364
345
|
key: 0,
|
|
365
|
-
class: c(e.card ? a(
|
|
366
|
-
style:
|
|
346
|
+
class: c(e.card ? a(y)("search-wrapper") : null),
|
|
347
|
+
style: b(e.searchFormWrapperStyle)
|
|
367
348
|
}, [
|
|
368
|
-
|
|
349
|
+
z(a(qe).SearchForm, U(e.searchForm || {}, {
|
|
369
350
|
ref_key: "formRef",
|
|
370
|
-
ref:
|
|
351
|
+
ref: u,
|
|
371
352
|
"custom-reset": "",
|
|
372
|
-
"submit-loading": a(
|
|
373
|
-
onSubmit: a(
|
|
374
|
-
onReset: a(
|
|
375
|
-
}),
|
|
376
|
-
default:
|
|
377
|
-
(
|
|
378
|
-
key:
|
|
353
|
+
"submit-loading": a(N).loading,
|
|
354
|
+
onSubmit: a(C),
|
|
355
|
+
onReset: a(F)
|
|
356
|
+
}), Ne({
|
|
357
|
+
default: $(() => [
|
|
358
|
+
(g(!0), D(Ve, null, Ie(a(A), (s) => (g(), J(Ee(s.renderNode), {
|
|
359
|
+
key: s.dataIndex
|
|
379
360
|
}))), 128))
|
|
380
361
|
]),
|
|
381
362
|
_: 2
|
|
382
363
|
}, [
|
|
383
|
-
|
|
364
|
+
h.searchFormExtra ? {
|
|
384
365
|
name: "extra",
|
|
385
|
-
fn:
|
|
386
|
-
|
|
366
|
+
fn: $(() => [
|
|
367
|
+
Q(e.$slots, "searchFormExtra")
|
|
387
368
|
]),
|
|
388
369
|
key: "0"
|
|
389
370
|
} : void 0
|
|
390
371
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
391
|
-
], 6)) :
|
|
392
|
-
|
|
393
|
-
class: c([a(
|
|
394
|
-
style:
|
|
372
|
+
], 6)) : q("", !0),
|
|
373
|
+
S("div", {
|
|
374
|
+
class: c([a(y)("table-wrapper"), e.card ? a(y)("table-wrapper-card") : null]),
|
|
375
|
+
style: b(e.tableWrapperStyle)
|
|
395
376
|
}, [
|
|
396
|
-
|
|
397
|
-
class: c(a(
|
|
377
|
+
S("div", {
|
|
378
|
+
class: c(a(i)("header-wrapper"))
|
|
398
379
|
}, [
|
|
399
|
-
|
|
400
|
-
selectedRows: a(
|
|
401
|
-
selectedRowKeys: a(
|
|
402
|
-
shownColumns: a(
|
|
380
|
+
Q(e.$slots, "title", {
|
|
381
|
+
selectedRows: a(B),
|
|
382
|
+
selectedRowKeys: a(fe),
|
|
383
|
+
shownColumns: a(d),
|
|
403
384
|
clearAll: M
|
|
404
385
|
})
|
|
405
386
|
], 2),
|
|
406
|
-
|
|
407
|
-
class: c(a(
|
|
387
|
+
S("div", {
|
|
388
|
+
class: c(a(i)("grid-wrapper"))
|
|
408
389
|
}, [
|
|
409
|
-
|
|
410
|
-
style:
|
|
411
|
-
"row-data": a(
|
|
412
|
-
"column-defs": a(
|
|
413
|
-
"default-col-def": a(
|
|
390
|
+
z(a(We), {
|
|
391
|
+
style: b(Be.value),
|
|
392
|
+
"row-data": a(m).records,
|
|
393
|
+
"column-defs": a(ae),
|
|
394
|
+
"default-col-def": a(te),
|
|
414
395
|
"locale-text": {
|
|
415
396
|
noRowsToShow: ""
|
|
416
397
|
// 为了隐藏默认的无数据提示,因为外部已经自行实现了loading
|
|
417
398
|
},
|
|
418
|
-
"row-selection":
|
|
419
|
-
"selection-column-def":
|
|
420
|
-
"get-row-id":
|
|
421
|
-
"pinned-top-row-data": (
|
|
422
|
-
"pinned-bottom-row-data": (
|
|
423
|
-
theme: a(
|
|
399
|
+
"row-selection": he.value,
|
|
400
|
+
"selection-column-def": ye.value,
|
|
401
|
+
"get-row-id": Te,
|
|
402
|
+
"pinned-top-row-data": (r = e.summary) == null ? void 0 : r.top,
|
|
403
|
+
"pinned-bottom-row-data": (n = e.summary) == null ? void 0 : n.bottom,
|
|
404
|
+
theme: a(_),
|
|
424
405
|
"tooltip-show-delay": 500,
|
|
425
406
|
"enable-browser-tooltips": e.browserTooltips,
|
|
426
407
|
"tooltip-interaction": "",
|
|
427
|
-
onSortChanged:
|
|
428
|
-
onGridReady: t[0] || (t[0] = (
|
|
429
|
-
onRowDataUpdated:
|
|
430
|
-
onRowSelected:
|
|
431
|
-
onFirstDataRendered:
|
|
408
|
+
onSortChanged: ne,
|
|
409
|
+
onGridReady: t[0] || (t[0] = (s) => f.value = s.api),
|
|
410
|
+
onRowDataUpdated: P,
|
|
411
|
+
onRowSelected: ve,
|
|
412
|
+
onFirstDataRendered: be
|
|
432
413
|
}, null, 8, ["style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "pinned-top-row-data", "pinned-bottom-row-data", "theme", "enable-browser-tooltips"]),
|
|
433
|
-
|
|
434
|
-
class: c(a(
|
|
414
|
+
Pe(S("div", {
|
|
415
|
+
class: c(a(y)("table-loading-wrapper"))
|
|
435
416
|
}, [
|
|
436
|
-
|
|
417
|
+
z(a(Ge), { delay: 300 })
|
|
437
418
|
], 2), [
|
|
438
|
-
[
|
|
419
|
+
[Me, Ce.value]
|
|
439
420
|
])
|
|
440
421
|
], 2),
|
|
441
|
-
|
|
442
|
-
class: c(a(
|
|
422
|
+
S("div", {
|
|
423
|
+
class: c(a(i)("pagination-wrapper"))
|
|
443
424
|
}, [
|
|
444
|
-
e.pagination !== !1 ? (
|
|
425
|
+
e.pagination !== !1 ? (g(), J(a(He), U({
|
|
445
426
|
key: 0,
|
|
446
|
-
class: a(
|
|
447
|
-
}, a(
|
|
427
|
+
class: a(i)("pagination")
|
|
428
|
+
}, a(N).pagination, { onChange: xe }), null, 16, ["class"])) : q("", !0)
|
|
448
429
|
], 2)
|
|
449
430
|
], 6)
|
|
450
431
|
], 6);
|
|
@@ -452,5 +433,5 @@ const Ko = /* @__PURE__ */ Ne({
|
|
|
452
433
|
}
|
|
453
434
|
});
|
|
454
435
|
export {
|
|
455
|
-
|
|
436
|
+
Do as default
|
|
456
437
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { getTimeFormatToZone as m } from "@aplus-frontend/utils";
|
|
2
|
-
import
|
|
3
|
-
import { isArray as
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
5
|
-
function
|
|
2
|
+
import i from "dayjs";
|
|
3
|
+
import { isArray as d, isString as F } from "lodash-unified";
|
|
4
|
+
import { ApFieldDatePresetFormats as T, PRESET_FORMAT_MAP as u } from "../../ap-field/date/constant.mjs";
|
|
5
|
+
function D(t) {
|
|
6
6
|
var a;
|
|
7
7
|
const e = t.value;
|
|
8
8
|
if (!(e != null && e.length))
|
|
9
9
|
return t.emptyText || "--";
|
|
10
|
-
const r =
|
|
11
|
-
return `${
|
|
10
|
+
const r = d(t.timezone) ? (a = t.timezone[0]) == null ? void 0 : a.value : t.timezone, s = r ? m(e[0], r) : e[0], f = r ? m(e[1], r) : e[1], o = t.format || "Y-D", n = T.indexOf(o) > -1 ? u[o] : o, c = F(t.readModeSeparator) ? t.readModeSeparator : "~";
|
|
11
|
+
return `${i(s).format(n)}${c}${i(f).format(n)}`;
|
|
12
12
|
}
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
D as dateRangeRenderer
|
|
15
15
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { getTimeFormatToZone as
|
|
2
|
-
import
|
|
3
|
-
import { isNil as
|
|
4
|
-
import { ApFieldDatePresetFormats as
|
|
1
|
+
import { getTimeFormatToZone as n } from "@aplus-frontend/utils";
|
|
2
|
+
import i from "dayjs";
|
|
3
|
+
import { isNil as f, isArray as l } from "lodash-unified";
|
|
4
|
+
import { ApFieldDatePresetFormats as u, PRESET_FORMAT_MAP as c } from "../../ap-field/date/constant.mjs";
|
|
5
5
|
function P(e) {
|
|
6
|
-
var
|
|
7
|
-
if (
|
|
6
|
+
var r;
|
|
7
|
+
if (f(e.value))
|
|
8
8
|
return e.emptyText || "--";
|
|
9
|
-
let
|
|
9
|
+
let m = i(e.value);
|
|
10
10
|
if (e.timezone) {
|
|
11
|
-
const a =
|
|
12
|
-
|
|
11
|
+
const a = l(e.timezone) ? (r = e.timezone[0]) == null ? void 0 : r.value : e.timezone;
|
|
12
|
+
m = i(n(e.value, a));
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
return
|
|
14
|
+
const t = e.format || "Y-D", o = u.indexOf(t) > -1 ? c[t] : t;
|
|
15
|
+
return m.format(o);
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
18
|
P as dateRenderer
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p = {
|
|
2
2
|
"--ap-pro-card-colo-bg-container": "transparent",
|
|
3
3
|
"--ap-pro-card-border-radius": "4px",
|
|
4
|
-
"--ap-pro-card-header-padding": "
|
|
5
|
-
"--ap-pro-card-header-padding-bottom": "
|
|
6
|
-
"--ap-pro-card-body-padding": "
|
|
4
|
+
"--ap-pro-card-header-padding": "8px 16px 0",
|
|
5
|
+
"--ap-pro-card-header-padding-bottom": "8px",
|
|
6
|
+
"--ap-pro-card-body-padding": "8px 16px 12px",
|
|
7
7
|
"--ap-pro-card-actions-padding": "12px 16px",
|
|
8
8
|
"--ap-pro-card-border-line-width": "1px",
|
|
9
9
|
"--ap-pro-card-border-line-type": "solid",
|
|
10
10
|
"--ap-pro-card-border-color-split": "#e9edf3",
|
|
11
|
-
"--ap-pro-card-box-shadow": "
|
|
11
|
+
"--ap-pro-card-box-shadow": "3px 10px 30px -2px rgba(123, 121, 140, 0.15)",
|
|
12
12
|
"--ap-pro-card-tooltip-color": "#8896b0",
|
|
13
|
-
"--ap-pro-card-header-title-font-size": "
|
|
13
|
+
"--ap-pro-card-header-title-font-size": "12px",
|
|
14
14
|
"--ap-pro-card-header-title-font-color": "#182948",
|
|
15
15
|
"--ap-pro-card-area-color": "#f1f7ff",
|
|
16
16
|
"--ap-pro-card-split-line-height": "100%"
|
|
17
17
|
}, a = {
|
|
18
18
|
"--ap-pro-card-border-color-split": "#e9e9e9",
|
|
19
|
-
"--ap-pro-card-box-shadow": "
|
|
19
|
+
"--ap-pro-card-box-shadow": "3px 10px 30px -2px rgba(123, 121, 140, 0.15)",
|
|
20
20
|
"--ap-pro-card-tooltip-color": "#999",
|
|
21
21
|
"--ap-pro-card-header-title-font-color": "#333",
|
|
22
22
|
"--ap-pro-card-area-color": "#eff9f5"
|
|
23
|
-
}, o = (
|
|
24
|
-
...
|
|
25
|
-
...
|
|
23
|
+
}, o = (r) => ({
|
|
24
|
+
...p,
|
|
25
|
+
...r === "admin" ? a : {}
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
28
|
o as getProCardCssVar
|
package/es/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.24.
|
|
1
|
+
declare const _default: "6.24.2";
|
|
2
2
|
export default _default;
|
package/es/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../../ap-table/utils.js"),g=require("../renderer/index.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../../ap-table/utils.js"),g=require("../renderer/index.js"),d=require("lodash-unified"),x=require("vue");require("../components/body-cell/index.vue.js");require("../components/header-cell/index.vue.js");require("../../config-provider/index.js");const h=require("../../ap-grid/utils/col.js"),_=require("../../utils/index.js"),q=require("../../config-provider/hooks/use-global-config.js"),w=require("../../config-provider/hooks/use-namespace.js"),P=require("../components/body-cell/index.vue2.js"),R=require("../components/header-cell/index.vue2.js");function S(r,s){var p,f;if(s.bodyCellTooltip)return d.isFunction(s.bodyCellTooltip)?s.bodyCellTooltip(r.value,r.data):s.bodyCellTooltip;if(s.renderText)return s.renderText({value:r.value,record:r.data,column:s,text:r.value});const o=s.valueType||"text",u=g.rendererMap[o];if(u){const T=C.getTableRenderProps({...s,valueType:o},{value:r.value,text:r.value,record:r.data,column:r.column,rowIndex:(p=r.node)==null?void 0:p.rowIndex,pinned:(f=r.node)==null?void 0:f.rowPinned});return u(T)}return C.objectToString(r.value)}const D=(r,s)=>{const o=q.useGlobalConfig("valueTypeMap"),{em:u}=w.useNamespace("ag-grid"),b=x.computed(()=>{const f=x.unref(r),T=i=>{const e={cellRenderer:P.default,cellRendererParams:{column:i,extraValueType:x.unref(o)}};if(i.customRender)return e;if(i.renderText)return{valueFormatter:t=>i.renderText({value:t.value,record:t.data,column:i,text:t.value})};const c=i.valueType||"text",n=g.rendererMap[c];return n?{valueFormatter:t=>{var l,v;const a=C.getTableRenderProps({...i,valueType:c},{value:t.value,text:t.value,record:t.data,column:t.column,rowIndex:(l=t.node)==null?void 0:l.rowIndex,pinned:(v=t.node)==null?void 0:v.rowPinned});return n(a)}}:e};function y(i){return i.map(e=>{var t;const c=e.bodyCellTooltip||!e.customRender&&(e.ellipsis===!0||e.ellipsis==="tooltip"||d.isNumber(e.ellipsis)),n={field:h.dataIndexToField(e.dataIndex),colId:_.isDef(e.key)?String(e.key):void 0,sortable:!!e.sorter,comparator:e.sorter===!0?()=>0:e.sorter,headerComponentParams:{column:e},resizable:e.resizable,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,flex:e.width?void 0:1,pinned:e.fixed||null,colSpan:e.colSpan,cellClass:a=>{const l=e.cellClass||"",v=d.isFunction(l)?l(a.data,a.node):l;return[`${u("cell",e.align||"left")}`,v].flat().filter(Boolean)},cellStyle:{"--ag-grid-line-clamp":d.isNumber(e.ellipsis)?e.ellipsis:1},wrapText:!e.ellipsis||d.isNumber(e.ellipsis)&&e.ellipsis>=2,autoHeight:!0,tooltipValueGetter:c?a=>S(a,e):void 0,...T(e)};return(t=e.children)!=null&&t.length?{...n,children:y(e.children)}:n})}return y(f)}),p=x.computed(()=>({headerComponent:R.default,resizable:s.columnResizable,suppressMovable:!0,cellDataType:!1}));return{columnDefs:b,defaultColDef:p}};exports.useColumnsDef=D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../ap-table/constants.js"),a=require("vue"),o=require("../../ap-table/utils.js");require("../../config-provider/index.js");const p=require("../../config-provider/hooks/use-global-config.js"),g=l=>{let d=0;const c=p.useGlobalConfig("valueTypeMap");return a.computed(()=>{var n,s,u;return d++,((u=(s=(n=l.columns)==null?void 0:n.filter(e=>!e.hideInSearch&&e.dataIndex&&(e.valueType||e.customRenderFormItem)&&!i.noRenderAsFormItemValueList.includes(e.valueType)))==null?void 0:s.sort((e,t)=>{const r=o.getColumnOrder(e.order);return o.getColumnOrder(t.order)-r}))==null?void 0:u.map(e=>{const t=o.updateFormProps(e,o.getFieldProps(e.fieldProps,{})),r={...e,fieldProps:{label:e.title,name:e.dataIndex,bordered:!0,...t||{},_signal:d},renderNode:void 0};return r.renderNode=o.getSearchFormItemRenderNode(r,a.unref(c)),r}))||[]})};exports.useSearchForm=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),ve=require("ag-grid-vue3"),K=require("ag-grid-community"),M=require("@aplus-frontend/antdv"),S=require("lodash-unified");require("../config-provider/index.js");const be=require("../ap-form/index.js"),Ce=require("../ap-table/constants.js"),m=require("../ap-table/utils.js"),Re=require("../ap-table/hooks/use-table-paging-ng.js"),Be=require("./hooks/use-row-selection.js"),Fe=require("./context.js"),xe=require("../ap-table/context.js"),O=require("../ap-grid/constants.js"),Te=require("@aplus-frontend/antdv/es/theme/internal"),ke=require("./theme.js"),ze=require("./hooks/use-columns.js"),Ne=require("./hooks/use-columns-def.js"),qe=require("../utils/index.js"),Ve=require("../utils/slot.js"),Ie=require("../config-provider/hooks/use-namespace.js"),Pe=require("../config-provider/hooks/use-global-config.js"),De=e.defineComponent({name:"AgGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean}},setup(W,{expose:G}){K.ModuleRegistry.registerModules([K.AllCommunityModule]);const t=W,w=e.useSlots(),{e:y,b:u,be:L}=Ie.useNamespace("ag-grid"),p=e.ref(t.size),U=ke.useTheme(p,e.toRef(t,"rowHeight")),f=e.ref(),[,$]=Te.useToken();let g=!!t.dataSource,R=0;const j=Pe.useGlobalConfig("valueTypeMap"),B=e.computed(()=>{var o,r,a;return R++,((a=(r=(o=t.columns)==null?void 0:o.filter(n=>!n.hideInSearch&&n.dataIndex&&(n.valueType||n.customRenderFormItem)&&!Ce.noRenderAsFormItemValueList.includes(n.valueType)))==null?void 0:r.sort((n,l)=>{let s=m.getColumnOrder(n.order);return m.getColumnOrder(l.order)-s}))==null?void 0:a.map(n=>{const l=m.updateFormProps(n,m.getFieldProps(n.fieldProps,{})),s={...n,fieldProps:{label:n.title,name:n.dataIndex,bordered:!0,...l||{},_signal:R},renderNode:void 0};return s.renderNode=m.getSearchFormItemRenderNode(s,e.unref(j)),s}))||[]}),{shownColumns:d,shownColumnsBackup:H}=ze.useColumns(t),{defaultColDef:J,columnDefs:Q}=Ne.useColumnsDef(d,t),F=e.ref({});Fe.useProvideSorter({sorter:F,setSorter(o){F.value=o}});const X={asc:"ascend",desc:"descend"};function Y(){var l;const o=(l=f.value.getColumns())==null?void 0:l.filter(s=>s.getSort()!==void 0);if(!(o!=null&&o.length))return;const r=o[0],a=r.getColDef(),n=r.getSort();T(void 0,void 0,{column:a,field:a.field,order:n?X[n]:null})}const Z=e.computed(()=>m.recursionApColumns(e.unref(d),o=>{if(o.sorter===!0)return o.key||o.dataIndex}).filter(Boolean)),_=e.computed(()=>{var r;return qe.isDef(t.manual)?t.manual:Ve.getValidVNodeList(((r=w.searchFormExtra)==null?void 0:r.call(w))||[]).some(a=>{var n;return((n=a.type)==null?void 0:n.name)==="ApView"})}),{formRef:i,submit:h,reset:v,data:c,tableProps:x,handleTableChangeOptional:T,submitWith:k,refresh:z,getPaging:ee,setPaging:oe}=Re.useTablePaging({async request(o){var a;if(g=!1,!S.isUndefined(t.dataSource)){const n=o.pageSize*(o.current-1);return{data:(t.pagination===!1?t.dataSource:t.dataSource.slice(n,n+o.pageSize))||[],total:t.dataSource.length||0}}const r=await((a=t.request)==null?void 0:a.call(t,o));return{data:(r==null?void 0:r.data)||[],total:(r==null?void 0:r.total)||0}},namespace:"ap-grid",filterFields:e.ref([]),params:e.toRef(t,"params"),defaultData:t.defaultData,manual:e.unref(_),formatParams:t.beforeSearchSubmit,pagination:t.pagination,sortFields:Z}),te=e.computed(()=>S.isUndefined(t.dataSource)?c.records:t.dataSource),{select:re,unSelect:ne,selectedRows:b,selectedRowKeys:ae,clearAll:le,selectMultiByKeys:se}=Be.default({...t.rowSelection===!0?{}:t.rowSelection,dataSource:te,rowKey:t.rowKey}),ue={checkbox:"multiRow",radio:"singleRow"},de=e.computed(()=>{if(!t.rowSelection)return;const{type:o="checkbox",disabled:r}=t.rowSelection===!0?{}:t.rowSelection;return{mode:ue[o],isRowSelectable:a=>r?!r(a.data):!0}}),ie=e.computed(()=>{if(!t.rowSelection)return;const o=t.rowSelection===!0?{}:t.rowSelection;return{sortable:!1,resizable:!1,width:o.columnWidth||60,pinned:o.fixed}});function C(o){return S.isFunction(t.rowKey)?t.rowKey(o):o[t.rowKey]}const N=({api:o=f.value})=>{if(!t.rowSelection)return;const r=b.value;if(!r.length)return;g=!1;const a=[];o.forEachNode(n=>{const l=n.data,s=C(l);r.find(A=>C(A)===s)&&a.push(n)}),o.setNodesSelected({nodes:a,newValue:!0}),setTimeout(()=>{g=!0},0)},ce=o=>{g&&(o.node.isSelected()?re(o.data):ne(o.data))},me=()=>{g=!0},q=()=>{var o;le(),(o=f.value)==null||o.deselectAll()};function pe(o){se(o),e.nextTick(()=>{N({})})}function V(o=!1){var a,n,l;const r=o?"getFieldsValueTransformed":"getFieldsValue";return(l=(n=(a=i.value)==null?void 0:a.apForm)==null?void 0:n[r])==null?void 0:l.call(n,!0)}function I(o){var r,a,n;(n=(a=(r=i.value)==null?void 0:r.apForm)==null?void 0:a.setFieldsValue)==null||n.call(a,o)}function P(){var o;return((o=i.value)==null?void 0:o.getSorterItems())||[]}function D(o){var r;(r=i.value)==null||r.setSorterItems(o)}function E(){var o;(o=i.value)==null||o.resetSorterItems()}xe.useProvideApTable({columns:e.computed(()=>d.value),columnsBackup:e.computed(()=>H.value),size:e.computed(()=>O.sizeMap[p.value]),updateColumns(o){var r;console.log(o),d.value=o,(r=t.onShownColumnsChange)==null||r.call(t,o)},updateSize(o){p.value=O.sizeReverseMap[o]},renderConfig:e.computed(()=>({className:L("table-header","title"),color:$.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(c).records),getSearchFormValues:V,setSearchFormValues:I,submit:h,submitWith:k,reset:v,refresh:z,getSearchFormSorterItems:P,setSearchFormSorterItems:D,resetSearchFormSorterItems:E});const fe=e.computed(()=>S.isUndefined(t.loading)?c.loading:t.loading),ge=e.computed(()=>[u(),t.card?null:u("wrapper"),u("adaptive"),u(`size-${p.value}`)].filter(Boolean)),Se=e.computed(()=>({height:"100%",...t.tableStyle||{}})),we=(o,r)=>{T({current:o,pageSize:r})};function ye(o){const r=o.data;return C(r)}function he(o,r){var a;(a=f.value)==null||a.ensureIndexVisible(o,r)}return e.watch(()=>t.size,o=>{p.value=o}),e.watch(()=>e.unref(c).loading,o=>{var r;(r=t.onLoadingChange)==null||r.call(t,o)}),G({submit:h,reset:v,refresh:z,submitWith:k,setSearchFormValues:I,getSearchFormValues:V,getShowColumns:()=>e.unref(d),rowSelection:{selectedRows:e.computed(()=>b.value),setSelectedRowKeys:pe,clearAll:q},scrollToRow:he,getDataSource:()=>e.unref(c.records),getPaging:ee,setPaging:oe,getSearchFormSorterItems:P,setSearchFormSorterItems:D,resetSearchFormSorterItems:E}),(o,r)=>{var a,n;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(ge.value),style:e.normalizeStyle(o.wrapperStyle)},[e.unref(S.isUndefined)(o.dataSource)&&o.searchForm!==!1&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.card?e.unref(y)("search-wrapper"):null),style:e.normalizeStyle(o.searchFormWrapperStyle)},[e.createVNode(e.unref(be.ApForm).SearchForm,e.mergeProps(o.searchForm||{},{ref_key:"formRef",ref:i,"custom-reset":"","submit-loading":e.unref(x).loading,onSubmit:e.unref(h),onReset:e.unref(v)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,l=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.renderNode),{key:l.dataIndex}))),128))]),_:2},[w.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(y)("table-wrapper"),o.card?e.unref(y)("table-wrapper-card"):null]),style:e.normalizeStyle(o.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("header-wrapper"))},[e.renderSlot(o.$slots,"title",{selectedRows:e.unref(b),selectedRowKeys:e.unref(ae),shownColumns:e.unref(d),clearAll:q})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("grid-wrapper"))},[e.createVNode(e.unref(ve.AgGridVue),{style:e.normalizeStyle(Se.value),"row-data":e.unref(c).records,"column-defs":e.unref(Q),"default-col-def":e.unref(J),"locale-text":{noRowsToShow:""},"row-selection":de.value,"selection-column-def":ie.value,"get-row-id":ye,"pinned-top-row-data":(a=o.summary)==null?void 0:a.top,"pinned-bottom-row-data":(n=o.summary)==null?void 0:n.bottom,theme:e.unref(U),"tooltip-show-delay":500,"enable-browser-tooltips":o.browserTooltips,"tooltip-interaction":"",onSortChanged:Y,onGridReady:r[0]||(r[0]=l=>f.value=l.api),onRowDataUpdated:N,onRowSelected:ce,onFirstDataRendered:me},null,8,["style","row-data","column-defs","default-col-def","row-selection","selection-column-def","pinned-top-row-data","pinned-bottom-row-data","theme","enable-browser-tooltips"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(y)("table-loading-wrapper"))},[e.createVNode(e.unref(M.Spin),{delay:300})],2),[[e.vShow,fe.value]])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(u)("pagination-wrapper"))},[o.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(M.Pagination),e.mergeProps({key:0,class:e.unref(u)("pagination")},e.unref(x).pagination,{onChange:we}),null,16,["class"])):e.createCommentVNode("",!0)],2)],6)],6)}}});exports.default=De;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),he=require("ag-grid-vue3"),P=require("ag-grid-community"),A=require("@aplus-frontend/antdv"),p=require("lodash-unified");require("../config-provider/index.js");const ye=require("../ap-form/index.js"),ve=require("../ap-table/utils.js"),Ce=require("../ap-table/hooks/use-table-paging-ng.js"),be=require("./hooks/use-row-selection.js"),Re=require("./context.js"),Be=require("../ap-table/context.js"),K=require("../ap-grid/constants.js"),xe=require("@aplus-frontend/antdv/es/theme/internal"),Fe=require("./theme.js"),ke=require("./hooks/use-columns.js"),ze=require("./hooks/use-columns-def.js"),qe=require("../utils/index.js"),Ne=require("../utils/slot.js"),Te=require("./hooks/use-search-form.js"),Ve=require("../config-provider/hooks/use-namespace.js"),De=e.defineComponent({name:"AgGrid",__name:"index",props:{dropdownPrefixCls:{},bordered:{type:Boolean},locale:{},onChange:{},onResizeColumn:{},getPopupContainer:{},scroll:{},sortDirections:{},showSorterTooltip:{type:[Boolean,Object]},prefixCls:{},rowKey:{default:"key"},tableLayout:{},title:{},id:{},showHeader:{type:Boolean},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean]},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean},indentSize:{},expandIconColumnIndex:{},showExpandColumn:{type:Boolean},expandedRowClassName:{},childrenColumnName:{},rowExpandable:{},transformCellText:{},columns:{},rowSelection:{type:Boolean},card:{type:Boolean},params:{},request:{},defaultData:{},dataSource:{},onLoadingChange:{},onShownColumnsChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},wrapperStyle:{},tableStyle:{},manual:{type:Boolean,default:void 0},size:{default:"mini"},adaptive:{type:Boolean},columnResizable:{type:Boolean,default:!1},loading:{type:Boolean,default:void 0},summary:{},rowHeight:{},advanceRenderer:{type:Boolean},browserTooltips:{type:Boolean}},setup(I,{expose:M}){P.ModuleRegistry.registerModules([P.AllCommunityModule]);const t=I,g=e.useSlots(),{e:S,b:s,be:W}=Ve.useNamespace("ag-grid"),d=e.ref(t.size),U=Fe.useTheme(d,e.toRef(t,"rowHeight")),m=e.ref(),[,L]=xe.useToken();let f=!!t.dataSource;const b=Te.useSearchForm(t),{shownColumns:i,shownColumnsBackup:O}=ke.useColumns(t),{defaultColDef:$,columnDefs:G}=ze.useColumnsDef(i,t),R=e.ref({});Re.useProvideSorter({sorter:R,setSorter(o){R.value=o}});const j={asc:"ascend",desc:"descend"};function H(){var l;const o=(l=m.value.getColumns())==null?void 0:l.filter(C=>C.getSort()!==void 0);if(!(o!=null&&o.length))return;const r=o[0],n=r.getColDef(),a=r.getSort();x(void 0,void 0,{column:n,field:n.field,order:a?j[a]:null})}const J=e.computed(()=>ve.recursionApColumns(e.unref(i),o=>{if(o.sorter===!0)return o.key||o.dataIndex}).filter(Boolean)),Q=e.computed(()=>{var r;return qe.isDef(t.manual)?t.manual:Ne.getValidVNodeList(((r=g.searchFormExtra)==null?void 0:r.call(g))||[]).some(n=>{var a;return((a=n.type)==null?void 0:a.name)==="ApView"})}),{formRef:u,submit:w,reset:h,data:c,tableProps:B,handleTableChangeOptional:x,submitWith:F,refresh:k,getPaging:X,setPaging:Y,setDataSource:Z}=Ce.useTablePaging({async request(o){var n;if(f=!1,!p.isUndefined(t.dataSource)){const a=o.pageSize*(o.current-1);return{data:(t.pagination===!1?t.dataSource:t.dataSource.slice(a,a+o.pageSize))||[],total:t.dataSource.length||0}}const r=await((n=t.request)==null?void 0:n.call(t,o));return{data:(r==null?void 0:r.data)||[],total:(r==null?void 0:r.total)||0}},namespace:"ap-grid",filterFields:e.ref([]),params:e.toRef(t,"params"),defaultData:t.defaultData,manual:e.unref(Q),formatParams:t.beforeSearchSubmit,pagination:t.pagination,sortFields:J}),_=e.computed(()=>p.isUndefined(t.dataSource)?c.records:t.dataSource),{select:ee,unSelect:oe,selectedRows:y,selectedRowKeys:te,clearAll:re,selectMultiByKeys:ne}=be.default({...t.rowSelection===!0?{}:t.rowSelection,dataSource:_,rowKey:t.rowKey}),ae={checkbox:"multiRow",radio:"singleRow"},le=e.computed(()=>{if(!t.rowSelection)return;const{type:o="checkbox",disabled:r}=t.rowSelection===!0?{}:t.rowSelection;return{mode:ae[o],isRowSelectable:n=>r?!r(n.data):!0}}),se=e.computed(()=>{if(!t.rowSelection)return;const o=t.rowSelection===!0?{}:t.rowSelection;let r=o.fixed;return r===void 0&&(r=i.value.some(n=>n.fixed==="left"||n.fixed===!0)?"left":void 0),{sortable:!1,resizable:!1,width:o.columnWidth||60,pinned:r}});function v(o){return p.isFunction(t.rowKey)?t.rowKey(o):o[t.rowKey]}const z=({api:o=m.value})=>{if(!t.rowSelection)return;const r=y.value;if(!r.length)return;f=!1;const n=[];o.forEachNode(a=>{const l=a.data,C=v(l);r.find(we=>v(we)===C)&&n.push(a)}),o.setNodesSelected({nodes:n,newValue:!0}),setTimeout(()=>{f=!0},0)},ie=o=>{f&&(o.node.isSelected()?ee(o.data):oe(o.data))},ue=()=>{f=!0},q=()=>{var o;re(),(o=m.value)==null||o.deselectAll()};function ce(o){ne(o),e.nextTick(()=>{z({})})}function N(o=!1){var n,a,l;const r=o?"getFieldsValueTransformed":"getFieldsValue";return(l=(a=(n=u.value)==null?void 0:n.apForm)==null?void 0:a[r])==null?void 0:l.call(a,!0)}function T(o){var r,n,a;(a=(n=(r=u.value)==null?void 0:r.apForm)==null?void 0:n.setFieldsValue)==null||a.call(n,o)}function V(){var o;return((o=u.value)==null?void 0:o.getSorterItems())||[]}function D(o){var r;(r=u.value)==null||r.setSorterItems(o)}function E(){var o;(o=u.value)==null||o.resetSorterItems()}Be.useProvideApTable({columns:e.computed(()=>i.value),columnsBackup:e.computed(()=>O.value),size:e.computed(()=>K.sizeMap[d.value]),updateColumns(o){var r;console.log(o),i.value=o,(r=t.onShownColumnsChange)==null||r.call(t,o)},updateSize(o){d.value=K.sizeReverseMap[o]},renderConfig:e.computed(()=>({className:W("table-header","title"),color:L.value.colorTextTertiary})),dataSource:e.computed(()=>e.unref(c).records),getSearchFormValues:N,setSearchFormValues:T,submit:w,submitWith:F,reset:h,refresh:k,getSearchFormSorterItems:V,setSearchFormSorterItems:D,resetSearchFormSorterItems:E});const de=e.computed(()=>p.isUndefined(t.loading)?c.loading:t.loading),me=e.computed(()=>[s(),t.card?null:s("wrapper"),s("adaptive"),s(`size-${d.value}`)].filter(Boolean)),fe=e.computed(()=>({height:"100%",...t.tableStyle||{}})),pe=(o,r)=>{x({current:o,pageSize:r})};function ge(o){const r=o.data;return v(r)}function Se(o,r){var n;(n=m.value)==null||n.ensureIndexVisible(o,r)}return e.watch(()=>t.dataSource,o=>{Z(o)},{immediate:!0,deep:!0}),e.watch(()=>t.size,o=>{d.value=o}),e.watch(()=>e.unref(c).loading,o=>{var r;(r=t.onLoadingChange)==null||r.call(t,o)}),M({submit:w,reset:h,refresh:k,submitWith:F,setSearchFormValues:T,getSearchFormValues:N,getShowColumns:()=>e.unref(i),rowSelection:{selectedRows:e.computed(()=>y.value),setSelectedRowKeys:ce,clearAll:q},scrollToRow:Se,getDataSource:()=>e.unref(c.records),getPaging:X,setPaging:Y,getSearchFormSorterItems:V,setSearchFormSorterItems:D,resetSearchFormSorterItems:E}),(o,r)=>{var n,a;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(me.value),style:e.normalizeStyle(o.wrapperStyle)},[e.unref(p.isUndefined)(o.dataSource)&&o.searchForm!==!1&&e.unref(b).length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.card?e.unref(S)("search-wrapper"):null),style:e.normalizeStyle(o.searchFormWrapperStyle)},[e.createVNode(e.unref(ye.ApForm).SearchForm,e.mergeProps(o.searchForm||{},{ref_key:"formRef",ref:u,"custom-reset":"","submit-loading":e.unref(B).loading,onSubmit:e.unref(w),onReset:e.unref(h)}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),l=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.renderNode),{key:l.dataIndex}))),128))]),_:2},[g.searchFormExtra?{name:"extra",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"searchFormExtra")]),key:"0"}:void 0]),1040,["submit-loading","onSubmit","onReset"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(S)("table-wrapper"),o.card?e.unref(S)("table-wrapper-card"):null]),style:e.normalizeStyle(o.tableWrapperStyle)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("header-wrapper"))},[e.renderSlot(o.$slots,"title",{selectedRows:e.unref(y),selectedRowKeys:e.unref(te),shownColumns:e.unref(i),clearAll:q})],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("grid-wrapper"))},[e.createVNode(e.unref(he.AgGridVue),{style:e.normalizeStyle(fe.value),"row-data":e.unref(c).records,"column-defs":e.unref(G),"default-col-def":e.unref($),"locale-text":{noRowsToShow:""},"row-selection":le.value,"selection-column-def":se.value,"get-row-id":ge,"pinned-top-row-data":(n=o.summary)==null?void 0:n.top,"pinned-bottom-row-data":(a=o.summary)==null?void 0:a.bottom,theme:e.unref(U),"tooltip-show-delay":500,"enable-browser-tooltips":o.browserTooltips,"tooltip-interaction":"",onSortChanged:H,onGridReady:r[0]||(r[0]=l=>m.value=l.api),onRowDataUpdated:z,onRowSelected:ie,onFirstDataRendered:ue},null,8,["style","row-data","column-defs","default-col-def","row-selection","selection-column-def","pinned-top-row-data","pinned-bottom-row-data","theme","enable-browser-tooltips"]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(S)("table-loading-wrapper"))},[e.createVNode(e.unref(A.Spin),{delay:300})],2),[[e.vShow,de.value]])],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s)("pagination-wrapper"))},[o.pagination!==!1?(e.openBlock(),e.createBlock(e.unref(A.Pagination),e.mergeProps({key:0,class:e.unref(s)("pagination")},e.unref(B).pagination,{onChange:pe}),null,16,["class"])):e.createCommentVNode("",!0)],2)],6)],6)}}});exports.default=De;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@aplus-frontend/utils"),s=require("dayjs"),m=require("lodash-unified"),c=require("../../ap-field/date/constant.js");function l(e){var a;const t=e.value;if(!(t!=null&&t.length))return e.emptyText||"--";const n=m.isArray(e.timezone)?(a=e.timezone[0])==null?void 0:a.value:e.timezone,d=n?i.getTimeFormatToZone(t[0],n):t[0],u=n?i.getTimeFormatToZone(t[1],n):t[1],r=e.format||"Y-D",o=c.ApFieldDatePresetFormats.indexOf(r)>-1?c.PRESET_FORMAT_MAP[r]:r,f=m.isString(e.readModeSeparator)?e.readModeSeparator:"~";return`${s(d).format(o)}${f}${s(u).format(o)}`}exports.dateRangeRenderer=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@aplus-frontend/utils"),i=require("dayjs"),a=require("lodash-unified"),o=require("../../ap-field/date/constant.js");function c(e){var r;if(a.isNil(e.value))return e.emptyText||"--";let n=i(e.value);if(e.timezone){const u=a.isArray(e.timezone)?(r=e.timezone[0])==null?void 0:r.value:e.timezone;n=i(s.getTimeFormatToZone(e.value,u))}const t=e.format||"Y-D",m=o.ApFieldDatePresetFormats.indexOf(t)>-1?o.PRESET_FORMAT_MAP[t]:t;return n.format(m)}exports.dateRenderer=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p={"--ap-pro-card-colo-bg-container":"transparent","--ap-pro-card-border-radius":"4px","--ap-pro-card-header-padding":"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p={"--ap-pro-card-colo-bg-container":"transparent","--ap-pro-card-border-radius":"4px","--ap-pro-card-header-padding":"8px 16px 0","--ap-pro-card-header-padding-bottom":"8px","--ap-pro-card-body-padding":"8px 16px 12px","--ap-pro-card-actions-padding":"12px 16px","--ap-pro-card-border-line-width":"1px","--ap-pro-card-border-line-type":"solid","--ap-pro-card-border-color-split":"#e9edf3","--ap-pro-card-box-shadow":"3px 10px 30px -2px rgba(123, 121, 140, 0.15)","--ap-pro-card-tooltip-color":"#8896b0","--ap-pro-card-header-title-font-size":"12px","--ap-pro-card-header-title-font-color":"#182948","--ap-pro-card-area-color":"#f1f7ff","--ap-pro-card-split-line-height":"100%"},a={"--ap-pro-card-border-color-split":"#e9e9e9","--ap-pro-card-box-shadow":"3px 10px 30px -2px rgba(123, 121, 140, 0.15)","--ap-pro-card-tooltip-color":"#999","--ap-pro-card-header-title-font-color":"#333","--ap-pro-card-area-color":"#eff9f5"},o=r=>({...p,...r==="admin"?a:{}});exports.getProCardCssVar=o;
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "6.24.
|
|
1
|
+
declare const _default: "6.24.2";
|
|
2
2
|
export default _default;
|
package/lib/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.24.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.24.2";exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "6.24.
|
|
3
|
+
"version": "6.24.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
38
38
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
39
39
|
"vuedraggable": "^4.1.0",
|
|
40
|
-
"@aplus-frontend/
|
|
41
|
-
"@aplus-frontend/
|
|
40
|
+
"@aplus-frontend/hooks": "1.0.7",
|
|
41
|
+
"@aplus-frontend/utils": "1.0.61"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@aplus-frontend/antdv": "^1.2.
|
|
44
|
+
"@aplus-frontend/antdv": "^1.2.2",
|
|
45
45
|
"@aplus-frontend/icon": "^1.2.6",
|
|
46
46
|
"@aplus-frontend/oss": "^1.1.2",
|
|
47
47
|
"vue": "^3.5.14",
|
|
48
48
|
"vxe-table": "^4.13.37"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@aplus-frontend/antdv": "^1.2.
|
|
51
|
+
"@aplus-frontend/antdv": "^1.2.2",
|
|
52
52
|
"@aplus-frontend/icon": "^1.2.6",
|
|
53
53
|
"@aplus-frontend/oss": "^1.1.2",
|
|
54
54
|
"@types/sortablejs": "^1.15.8",
|
package/theme/ag-grid/index.css
CHANGED
package/theme/ag-grid/index.less
CHANGED
package/theme/ap-grid/index.css
CHANGED
package/theme/ap-grid/index.less
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
transition: all 0.3s;
|
|
55
55
|
background: var(--ap-pro-card-colo-bg-container);
|
|
56
56
|
border-radius: var(--ap-pro-card-border-radius);
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
line-height: 18px;
|
|
57
59
|
}
|
|
58
60
|
.aplus-pro-card-border {
|
|
59
61
|
border: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
}
|
|
84
86
|
.aplus-pro-card-header-title-tooltip {
|
|
85
87
|
margin-left: 5px;
|
|
86
|
-
font-size:
|
|
88
|
+
font-size: 12px;
|
|
87
89
|
color: var(--ap-pro-card-tooltip-color);
|
|
88
90
|
}
|
|
89
91
|
.aplus-pro-card-header-extra {
|
|
@@ -398,7 +400,8 @@
|
|
|
398
400
|
width: 100%;
|
|
399
401
|
}
|
|
400
402
|
.aplus-pro-card-statistic .ant-statistic-title {
|
|
401
|
-
color: var(--ap-text-color-
|
|
403
|
+
color: var(--ap-text-color-1);
|
|
404
|
+
font-size: 12px;
|
|
402
405
|
line-height: 18px;
|
|
403
406
|
}
|
|
404
407
|
.aplus-pro-card-statistic-trend-up .ant-statistic-content {
|
|
@@ -434,14 +437,14 @@
|
|
|
434
437
|
}
|
|
435
438
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline {
|
|
436
439
|
display: inline-flex;
|
|
437
|
-
color: var(--ap-text-color-1);
|
|
438
440
|
}
|
|
439
441
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-title {
|
|
440
442
|
margin-inline-end: 6px;
|
|
441
443
|
margin-block-end: 0;
|
|
444
|
+
color: var(--ap-text-color-3);
|
|
442
445
|
}
|
|
443
446
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-content {
|
|
444
|
-
color: var(--ap-text-color-
|
|
447
|
+
color: var(--ap-text-color-2);
|
|
445
448
|
}
|
|
446
449
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-title,
|
|
447
450
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-content-value,
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
transition: all 0.3s;
|
|
11
11
|
background: var(--ap-pro-card-colo-bg-container);
|
|
12
12
|
border-radius: var(--ap-pro-card-border-radius);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
line-height: 18px;
|
|
13
15
|
&-border {
|
|
14
16
|
border: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
|
|
15
17
|
}
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
font-weight: 500;
|
|
37
39
|
&-tooltip {
|
|
38
40
|
margin-left: 5px;
|
|
39
|
-
font-size:
|
|
41
|
+
font-size: 12px;
|
|
40
42
|
color: var(--ap-pro-card-tooltip-color);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -275,7 +277,8 @@
|
|
|
275
277
|
width: 100%;
|
|
276
278
|
}
|
|
277
279
|
.ant-statistic-title {
|
|
278
|
-
color: var(--ap-text-color-
|
|
280
|
+
color: var(--ap-text-color-1);
|
|
281
|
+
font-size: 12px;
|
|
279
282
|
line-height: 18px;
|
|
280
283
|
}
|
|
281
284
|
&-trend-up {
|
|
@@ -310,13 +313,13 @@
|
|
|
310
313
|
}
|
|
311
314
|
& &-layout-inline {
|
|
312
315
|
display: inline-flex;
|
|
313
|
-
color: var(--ap-text-color-1);
|
|
314
316
|
.ant-statistic-title {
|
|
315
317
|
margin-inline-end: 6px;
|
|
316
318
|
margin-block-end: 0;
|
|
319
|
+
color: var(--ap-text-color-3);
|
|
317
320
|
}
|
|
318
321
|
.ant-statistic-content {
|
|
319
|
-
color: var(--ap-text-color-
|
|
322
|
+
color: var(--ap-text-color-2);
|
|
320
323
|
}
|
|
321
324
|
.ant-statistic-title,.ant-statistic-content-value,.ant-statistic-content-value-int,.ant-statistic-content,.ant-statistic-content-suffix,.ant-statistic-content-prefix,.ant-statistic-content-value-decimal {
|
|
322
325
|
font-size: 12px;
|
package/theme/index.css
CHANGED
|
@@ -3573,6 +3573,10 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
3573
3573
|
.aplus-ap-grid .vxe-cell--checkbox span.vxe-checkbox--icon {
|
|
3574
3574
|
vertical-align: text-top;
|
|
3575
3575
|
}
|
|
3576
|
+
.aplus-ap-grid div.vxe-cell--tree-btn > i {
|
|
3577
|
+
font-size: 10px;
|
|
3578
|
+
color: var(--ap-text-color-2);
|
|
3579
|
+
}
|
|
3576
3580
|
.aplus-editable-grid__header-cell--required {
|
|
3577
3581
|
color: #FF4D4F;
|
|
3578
3582
|
padding-right: 2px;
|
|
@@ -4334,6 +4338,9 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4334
4338
|
-webkit-line-clamp: var(--ag-grid-line-clamp);
|
|
4335
4339
|
word-break: break-all;
|
|
4336
4340
|
}
|
|
4341
|
+
.aplus-ag-grid .ag-tooltip {
|
|
4342
|
+
max-width: 300px;
|
|
4343
|
+
}
|
|
4337
4344
|
.aplus-ap-value-select-card {
|
|
4338
4345
|
position: relative;
|
|
4339
4346
|
margin-top: 8px;
|
|
@@ -4461,6 +4468,8 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4461
4468
|
transition: all 0.3s;
|
|
4462
4469
|
background: var(--ap-pro-card-colo-bg-container);
|
|
4463
4470
|
border-radius: var(--ap-pro-card-border-radius);
|
|
4471
|
+
font-size: 12px;
|
|
4472
|
+
line-height: 18px;
|
|
4464
4473
|
}
|
|
4465
4474
|
.aplus-pro-card-border {
|
|
4466
4475
|
border: var(--ap-pro-card-border-line-width) var(--ap-pro-card-border-line-type) var(--ap-pro-card-border-color-split);
|
|
@@ -4490,7 +4499,7 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4490
4499
|
}
|
|
4491
4500
|
.aplus-pro-card-header-title-tooltip {
|
|
4492
4501
|
margin-left: 5px;
|
|
4493
|
-
font-size:
|
|
4502
|
+
font-size: 12px;
|
|
4494
4503
|
color: var(--ap-pro-card-tooltip-color);
|
|
4495
4504
|
}
|
|
4496
4505
|
.aplus-pro-card-header-extra {
|
|
@@ -4805,7 +4814,8 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4805
4814
|
width: 100%;
|
|
4806
4815
|
}
|
|
4807
4816
|
.aplus-pro-card-statistic .ant-statistic-title {
|
|
4808
|
-
color: var(--ap-text-color-
|
|
4817
|
+
color: var(--ap-text-color-1);
|
|
4818
|
+
font-size: 12px;
|
|
4809
4819
|
line-height: 18px;
|
|
4810
4820
|
}
|
|
4811
4821
|
.aplus-pro-card-statistic-trend-up .ant-statistic-content {
|
|
@@ -4841,14 +4851,14 @@ div.aplus-ap-info-layout-admin__header-shadow.aplus-ap-info-layout-admin__sticky
|
|
|
4841
4851
|
}
|
|
4842
4852
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline {
|
|
4843
4853
|
display: inline-flex;
|
|
4844
|
-
color: var(--ap-text-color-1);
|
|
4845
4854
|
}
|
|
4846
4855
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-title {
|
|
4847
4856
|
margin-inline-end: 6px;
|
|
4848
4857
|
margin-block-end: 0;
|
|
4858
|
+
color: var(--ap-text-color-3);
|
|
4849
4859
|
}
|
|
4850
4860
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-content {
|
|
4851
|
-
color: var(--ap-text-color-
|
|
4861
|
+
color: var(--ap-text-color-2);
|
|
4852
4862
|
}
|
|
4853
4863
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-title,
|
|
4854
4864
|
.aplus-pro-card-statistic .aplus-pro-card-statistic-layout-inline .ant-statistic-content-value,
|