@aplus-frontend/ui 6.39.2 → 6.41.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 +162 -153
- package/es/src/ag-grid/interface.d.ts +19 -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/interface.d.ts +5 -1
- package/es/src/ap-action/item/index.vue2.mjs +17 -16
- package/es/src/ap-action/item-dropdown/index.vue.mjs +2 -1
- package/es/src/ap-action/item-modal/index.vue.mjs +8 -7
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +1 -0
- package/es/src/ap-grid/utils/col.mjs +91 -82
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +28 -28
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +99 -95
- package/es/src/business/ag-grid-modal/interface.d.ts +6 -2
- 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 +19 -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/interface.d.ts +5 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-action/item-modal/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -1
- package/lib/src/ap-grid/utils/col.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.d.ts +2 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.js +1 -1
- package/lib/src/business/ag-grid-modal/interface.d.ts +6 -2
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AgGridVue as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { mergeProps as
|
|
5
|
-
import { Spin as
|
|
6
|
-
import { isUndefined 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
|
+
import { AgGridVue as So } from "ag-grid-vue3";
|
|
3
|
+
import { ModuleRegistry as yo, AllCommunityModule as ho } from "ag-grid-community";
|
|
4
|
+
import { mergeProps as Co } from "./utils.mjs";
|
|
5
|
+
import { Spin as vo, Pagination as Ro } from "@aplus-frontend/antdv";
|
|
6
|
+
import { isUndefined as k, isFunction as D } from "lodash-unified";
|
|
7
7
|
import "../config-provider/index.mjs";
|
|
8
|
-
import { ApForm as
|
|
9
|
-
import { recursionApColumns as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import
|
|
12
|
-
import { useProvideSorter as
|
|
13
|
-
import { useProvideApTable as
|
|
14
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as
|
|
15
|
-
import { useToken as
|
|
16
|
-
import { useTheme as
|
|
17
|
-
import { useColumns as
|
|
18
|
-
import { useColumnsDef as
|
|
19
|
-
import { isDef as
|
|
20
|
-
import { getValidVNodeList as
|
|
21
|
-
import { useSearchForm as
|
|
8
|
+
import { ApForm as bo } from "../ap-form/index.mjs";
|
|
9
|
+
import { recursionApColumns as Fo } from "../ap-table/utils.mjs";
|
|
10
|
+
import { useTablePaging as Bo } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import ko from "./hooks/use-row-selection.mjs";
|
|
12
|
+
import { useProvideSorter as xo } from "./context.mjs";
|
|
13
|
+
import { useProvideApTable as Io } from "../ap-table/context.mjs";
|
|
14
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as ue, sizeReverseMap as No, sizeMap as To } from "../ap-grid/constants.mjs";
|
|
15
|
+
import { useToken as Do } from "@aplus-frontend/antdv/es/theme/internal";
|
|
16
|
+
import { useTheme as Eo } from "./theme.mjs";
|
|
17
|
+
import { useColumns as Ko } from "./hooks/use-columns.mjs";
|
|
18
|
+
import { useColumnsDef as Po } from "./hooks/use-columns-def.mjs";
|
|
19
|
+
import { isDef as Ao } from "../utils/index.mjs";
|
|
20
|
+
import { getValidVNodeList as Vo } from "../utils/slot.mjs";
|
|
21
|
+
import { useSearchForm as zo } from "./hooks/use-search-form.mjs";
|
|
22
22
|
import "./components/empty/index.vue.mjs";
|
|
23
23
|
import Mo from "./hooks/use-virtual-config.mjs";
|
|
24
|
-
import { usePinnedRow as
|
|
25
|
-
import
|
|
24
|
+
import { usePinnedRow as Wo } from "./hooks/use-pinned-row.mjs";
|
|
25
|
+
import Oo from "./hooks/use-selection-col-def.mjs";
|
|
26
26
|
import "./components/row/index.vue.mjs";
|
|
27
|
-
import { useNamespace as
|
|
28
|
-
import { useGlobalConfig as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
const
|
|
27
|
+
import { useNamespace as Go } from "../config-provider/hooks/use-namespace.mjs";
|
|
28
|
+
import { useGlobalConfig as Ho } from "../config-provider/hooks/use-global-config.mjs";
|
|
29
|
+
import Lo from "./components/row/index.vue2.mjs";
|
|
30
|
+
import Uo from "./components/empty/index.vue2.mjs";
|
|
31
|
+
const vt = /* @__PURE__ */ io({
|
|
32
32
|
name: "AgGrid",
|
|
33
33
|
__name: "index",
|
|
34
34
|
props: {
|
|
@@ -100,19 +100,24 @@ const Ct = /* @__PURE__ */ so({
|
|
|
100
100
|
rowClassRules: {},
|
|
101
101
|
autoHeight: { type: Boolean },
|
|
102
102
|
onUpdate: {},
|
|
103
|
-
customRow: {}
|
|
103
|
+
customRow: {},
|
|
104
|
+
theme: {}
|
|
104
105
|
},
|
|
105
|
-
setup(
|
|
106
|
-
|
|
107
|
-
const o =
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
setup(de, { expose: ce }) {
|
|
107
|
+
yo.registerModules([ho]);
|
|
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 =
|
|
112
|
-
|
|
113
|
-
sorter:
|
|
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({});
|
|
117
|
+
xo({
|
|
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 Ct = /* @__PURE__ */ so({
|
|
|
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)) {
|
|
@@ -129,38 +134,38 @@ const Ct = /* @__PURE__ */ so({
|
|
|
129
134
|
}
|
|
130
135
|
if (!a)
|
|
131
136
|
return;
|
|
132
|
-
const
|
|
137
|
+
const u = a.getColDef(), m = a.getSort(), p = he(u.colId);
|
|
133
138
|
_(void 0, void 0, {
|
|
134
|
-
column:
|
|
135
|
-
field: p?.field ??
|
|
139
|
+
column: u,
|
|
140
|
+
field: p?.field ?? u.field ?? u.colId,
|
|
136
141
|
order: m ? be[m] : null
|
|
137
142
|
});
|
|
138
143
|
}
|
|
139
|
-
const Be = n(() =>
|
|
144
|
+
const Be = n(() => Fo(t(g), (e) => {
|
|
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;
|
|
147
152
|
const r = e.getColumnState()?.map((a) => ({ ...a, sort: null }));
|
|
148
153
|
e.applyColumnState({ state: r });
|
|
149
|
-
}, xe = n(() =>
|
|
154
|
+
}, xe = n(() => Ao(o.manual) ? o.manual : Vo(L.searchFormExtra?.() || []).some((r) => r.type?.name === "ApView")), {
|
|
150
155
|
formRef: w,
|
|
151
|
-
submit:
|
|
152
|
-
reset:
|
|
156
|
+
submit: E,
|
|
157
|
+
reset: K,
|
|
153
158
|
data: S,
|
|
154
159
|
tableProps: q,
|
|
155
160
|
handleTableChangeOptional: _,
|
|
156
161
|
submitWith: J,
|
|
157
162
|
refresh: Q,
|
|
158
163
|
getPaging: Ie,
|
|
159
|
-
setPaging:
|
|
160
|
-
setDataSource:
|
|
161
|
-
} =
|
|
164
|
+
setPaging: Ne,
|
|
165
|
+
setDataSource: Te
|
|
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 Ct = /* @__PURE__ */ so({
|
|
|
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,
|
|
@@ -185,22 +190,22 @@ const Ct = /* @__PURE__ */ so({
|
|
|
185
190
|
}), y = n(() => {
|
|
186
191
|
const e = o.rowSelection || we.value?.rowSelection;
|
|
187
192
|
if (e)
|
|
188
|
-
return e === !0 ?
|
|
189
|
-
...
|
|
193
|
+
return e === !0 ? ue : {
|
|
194
|
+
...ue,
|
|
190
195
|
...e
|
|
191
196
|
};
|
|
192
|
-
}),
|
|
193
|
-
() =>
|
|
197
|
+
}), De = Oo(o, g), Ee = n(
|
|
198
|
+
() => k(o.dataSource) ? S.records : o.dataSource
|
|
194
199
|
), {
|
|
195
200
|
select: Ke,
|
|
196
201
|
unSelect: Pe,
|
|
197
|
-
selectedRows:
|
|
198
|
-
selectedRowKeys:
|
|
199
|
-
clearAll:
|
|
200
|
-
selectMultiByKeys:
|
|
201
|
-
selectMulti:
|
|
202
|
+
selectedRows: P,
|
|
203
|
+
selectedRowKeys: Ae,
|
|
204
|
+
clearAll: Ve,
|
|
205
|
+
selectMultiByKeys: ze,
|
|
206
|
+
selectMulti: Me,
|
|
202
207
|
unSelectMulti: We
|
|
203
|
-
} =
|
|
208
|
+
} = ko({
|
|
204
209
|
...y.value,
|
|
205
210
|
dataSource: Ee,
|
|
206
211
|
rowKey: o.rowKey
|
|
@@ -218,25 +223,25 @@ const Ct = /* @__PURE__ */ so({
|
|
|
218
223
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
219
224
|
};
|
|
220
225
|
});
|
|
221
|
-
function
|
|
222
|
-
return
|
|
226
|
+
function A(e) {
|
|
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)
|
|
228
233
|
return;
|
|
229
|
-
const r =
|
|
234
|
+
const r = P.value || [];
|
|
230
235
|
C = !1;
|
|
231
236
|
const a = [];
|
|
232
237
|
e.forEachNode((i) => {
|
|
233
|
-
const
|
|
234
|
-
r.find((p) =>
|
|
238
|
+
const v = i.data, u = A(v), m = i.isSelected();
|
|
239
|
+
r.find((p) => A(p) === u) ? !m && a.push(i) : m && i.setSelected(!1);
|
|
235
240
|
}), e.setNodesSelected({ nodes: a, newValue: !0 }), setTimeout(() => {
|
|
236
241
|
C = !0;
|
|
237
242
|
}, 0);
|
|
238
243
|
}, He = (e) => {
|
|
239
|
-
C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data),
|
|
244
|
+
C && (e.node.isSelected() ? Ke(e.data) : Pe(e.data), D(y.value?.tooltip) && e.api.refreshCells({
|
|
240
245
|
rowNodes: [e.node],
|
|
241
246
|
// todo: 取消硬编码
|
|
242
247
|
columns: ["ag-Grid-SelectionColumn"],
|
|
@@ -244,32 +249,32 @@ const Ct = /* @__PURE__ */ so({
|
|
|
244
249
|
}));
|
|
245
250
|
}, Le = () => {
|
|
246
251
|
C = !0;
|
|
247
|
-
},
|
|
248
|
-
|
|
252
|
+
}, V = () => {
|
|
253
|
+
Ve(), s.value?.deselectAll();
|
|
249
254
|
};
|
|
250
255
|
function Ue(e) {
|
|
251
|
-
|
|
252
|
-
|
|
256
|
+
ze(e), z(() => {
|
|
257
|
+
N({});
|
|
253
258
|
});
|
|
254
259
|
}
|
|
255
260
|
const je = n(() => {
|
|
256
261
|
const e = o.customRow;
|
|
257
262
|
return e ? {
|
|
258
263
|
isFullWidthRow: e.isCustomRow,
|
|
259
|
-
fullWidthCellRenderer:
|
|
264
|
+
fullWidthCellRenderer: Lo,
|
|
260
265
|
fullWidthCellRendererParams: {
|
|
261
266
|
render: e.render
|
|
262
267
|
}
|
|
263
268
|
} : {};
|
|
264
269
|
});
|
|
265
270
|
function $e(e) {
|
|
266
|
-
|
|
267
|
-
|
|
271
|
+
Me(e), z(() => {
|
|
272
|
+
N({});
|
|
268
273
|
});
|
|
269
274
|
}
|
|
270
275
|
function qe(e) {
|
|
271
|
-
We(e),
|
|
272
|
-
|
|
276
|
+
We(e), z(() => {
|
|
277
|
+
N({});
|
|
273
278
|
});
|
|
274
279
|
}
|
|
275
280
|
function X(e = !1) {
|
|
@@ -295,38 +300,38 @@ const Ct = /* @__PURE__ */ so({
|
|
|
295
300
|
const r = s.value;
|
|
296
301
|
if (!r)
|
|
297
302
|
return;
|
|
298
|
-
const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean),
|
|
303
|
+
const a = r.getColumnState() || [], i = e.map((l) => l.key ? String(l.key) : l.key).filter(Boolean), v = a.map((l) => {
|
|
299
304
|
if (!ye.value.includes(l.colId))
|
|
300
305
|
return l;
|
|
301
|
-
const
|
|
306
|
+
const R = !i.includes(l.colId), re = {
|
|
302
307
|
...l,
|
|
303
|
-
hide:
|
|
308
|
+
hide: R
|
|
304
309
|
}, ae = e.find(
|
|
305
|
-
(
|
|
310
|
+
(so) => te(so.key) === l.colId
|
|
306
311
|
);
|
|
307
312
|
return ae && (re.pinned = ae.fixed || null), re;
|
|
308
|
-
}),
|
|
309
|
-
e.map((l,
|
|
310
|
-
), m =
|
|
311
|
-
(l,
|
|
313
|
+
}), u = new Map(
|
|
314
|
+
e.map((l, R) => [te(l.key), R])
|
|
315
|
+
), m = v.filter((l) => u.has(l.colId)).sort(
|
|
316
|
+
(l, R) => u.get(l.colId) - u.get(R.colId)
|
|
312
317
|
), p = [];
|
|
313
318
|
let c = 0;
|
|
314
|
-
for (const l of
|
|
315
|
-
|
|
319
|
+
for (const l of v)
|
|
320
|
+
u.has(l.colId) ? p.push(m[c++]) : p.push(l);
|
|
316
321
|
r.applyColumnState({
|
|
317
322
|
state: p,
|
|
318
323
|
applyOrder: !0
|
|
319
324
|
});
|
|
320
325
|
}
|
|
321
|
-
|
|
326
|
+
Io({
|
|
322
327
|
columns: n(() => g.value),
|
|
323
328
|
columnsBackup: n(() => $.value),
|
|
324
|
-
size: n(() =>
|
|
329
|
+
size: n(() => To[h.value]),
|
|
325
330
|
updateColumns(e) {
|
|
326
331
|
g.value = e, o.onShownColumnsChange?.(e), _e(e);
|
|
327
332
|
},
|
|
328
333
|
updateSize(e) {
|
|
329
|
-
h.value =
|
|
334
|
+
h.value = No[e];
|
|
330
335
|
},
|
|
331
336
|
renderConfig: n(() => ({
|
|
332
337
|
className: me("table-header", "title"),
|
|
@@ -335,21 +340,21 @@ const Ct = /* @__PURE__ */ so({
|
|
|
335
340
|
dataSource: n(() => t(S).records),
|
|
336
341
|
getSearchFormValues: X,
|
|
337
342
|
setSearchFormValues: Y,
|
|
338
|
-
submit:
|
|
343
|
+
submit: E,
|
|
339
344
|
submitWith: J,
|
|
340
|
-
reset:
|
|
345
|
+
reset: K,
|
|
341
346
|
refresh: Q,
|
|
342
347
|
getSearchFormSorterItems: Z,
|
|
343
348
|
setSearchFormSorterItems: ee,
|
|
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
|
-
|
|
350
|
-
o.card ? null :
|
|
351
|
-
|
|
352
|
-
|
|
354
|
+
d(),
|
|
355
|
+
o.card ? null : d("wrapper"),
|
|
356
|
+
d("adaptive"),
|
|
357
|
+
d(`size-${h.value}`)
|
|
353
358
|
].filter(Boolean)), Xe = n(() => ({
|
|
354
359
|
height: "100%",
|
|
355
360
|
...o.tableStyle || {}
|
|
@@ -358,29 +363,32 @@ const Ct = /* @__PURE__ */ so({
|
|
|
358
363
|
};
|
|
359
364
|
function Ze(e) {
|
|
360
365
|
const r = e.data;
|
|
361
|
-
return
|
|
366
|
+
return A(r);
|
|
362
367
|
}
|
|
363
368
|
function eo(e, r) {
|
|
364
|
-
s.value?.ensureIndexVisible(e, r);
|
|
369
|
+
(D(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, r);
|
|
365
370
|
}
|
|
366
|
-
function oo(e) {
|
|
367
|
-
|
|
371
|
+
function oo(e, r) {
|
|
372
|
+
s.value?.ensureColumnVisible(e, r);
|
|
368
373
|
}
|
|
369
374
|
function to(e) {
|
|
370
|
-
o.
|
|
375
|
+
o.onRowClicked?.(e.data, e.event);
|
|
371
376
|
}
|
|
372
377
|
function ro(e) {
|
|
373
|
-
|
|
378
|
+
o.onScrollEnd?.(e.direction);
|
|
374
379
|
}
|
|
375
380
|
function ao(e) {
|
|
381
|
+
return s.value?.refreshCells(e);
|
|
382
|
+
}
|
|
383
|
+
function lo(e) {
|
|
376
384
|
return s.value?.redrawRows(e);
|
|
377
385
|
}
|
|
378
|
-
const
|
|
386
|
+
const no = (e) => {
|
|
379
387
|
const r = [
|
|
380
388
|
U.value.getRowClass?.(e)
|
|
381
389
|
];
|
|
382
390
|
if (!e.node.rowPinned) {
|
|
383
|
-
const a =
|
|
391
|
+
const a = D(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
384
392
|
r.push(a);
|
|
385
393
|
}
|
|
386
394
|
return r.flat().filter(Boolean);
|
|
@@ -388,7 +396,7 @@ const Ct = /* @__PURE__ */ so({
|
|
|
388
396
|
return M(
|
|
389
397
|
() => o.dataSource,
|
|
390
398
|
(e) => {
|
|
391
|
-
|
|
399
|
+
Te(e);
|
|
392
400
|
},
|
|
393
401
|
{ immediate: !0, deep: !0 }
|
|
394
402
|
), M(
|
|
@@ -402,49 +410,50 @@ const Ct = /* @__PURE__ */ so({
|
|
|
402
410
|
o.onLoadingChange?.(e);
|
|
403
411
|
}
|
|
404
412
|
), ce({
|
|
405
|
-
submit:
|
|
406
|
-
reset:
|
|
413
|
+
submit: E,
|
|
414
|
+
reset: K,
|
|
407
415
|
refresh: Q,
|
|
408
416
|
submitWith: J,
|
|
409
417
|
setSearchFormValues: Y,
|
|
410
418
|
getSearchFormValues: X,
|
|
411
419
|
getShowColumns: () => t(g),
|
|
412
420
|
rowSelection: {
|
|
413
|
-
selectedRows: n(() =>
|
|
421
|
+
selectedRows: n(() => P.value),
|
|
414
422
|
setSelectedRowKeys: Ue,
|
|
415
423
|
setSelectedRows: $e,
|
|
416
|
-
clearAll:
|
|
424
|
+
clearAll: V,
|
|
417
425
|
unSelectRows: qe
|
|
418
426
|
},
|
|
419
427
|
scrollToRow: eo,
|
|
428
|
+
scrollToColumn: oo,
|
|
420
429
|
getDataSource: () => t(S.records),
|
|
421
430
|
getPaging: Ie,
|
|
422
|
-
setPaging:
|
|
431
|
+
setPaging: Ne,
|
|
423
432
|
getSearchFormSorterItems: Z,
|
|
424
433
|
setSearchFormSorterItems: ee,
|
|
425
434
|
resetSearchFormSorterItems: oe,
|
|
426
|
-
refreshCells:
|
|
427
|
-
redrawRows:
|
|
435
|
+
refreshCells: ao,
|
|
436
|
+
redrawRows: lo,
|
|
428
437
|
_internalGridApi: n(() => s.value)
|
|
429
|
-
}), (e, r) => (
|
|
438
|
+
}), (e, r) => (F(), W("div", {
|
|
430
439
|
class: f(Qe.value),
|
|
431
|
-
style:
|
|
440
|
+
style: O(e.wrapperStyle)
|
|
432
441
|
}, [
|
|
433
|
-
t(
|
|
442
|
+
t(k)(e.dataSource) && e.searchForm !== !1 && t(j).length > 0 ? (F(), W("div", {
|
|
434
443
|
key: 0,
|
|
435
|
-
class: f(e.card ? t(
|
|
436
|
-
style:
|
|
444
|
+
class: f(e.card ? t(x)("search-wrapper") : null),
|
|
445
|
+
style: O(e.searchFormWrapperStyle)
|
|
437
446
|
}, [
|
|
438
|
-
|
|
447
|
+
G(t(bo).SearchForm, H(e.searchForm || {}, {
|
|
439
448
|
ref_key: "formRef",
|
|
440
449
|
ref: w,
|
|
441
450
|
"custom-reset": "",
|
|
442
451
|
"submit-loading": t(q).loading,
|
|
443
|
-
onSubmit: t(
|
|
444
|
-
onReset: t(
|
|
445
|
-
}),
|
|
452
|
+
onSubmit: t(E),
|
|
453
|
+
onReset: t(K)
|
|
454
|
+
}), co({
|
|
446
455
|
default: ne(() => [
|
|
447
|
-
(
|
|
456
|
+
(F(!0), W(mo, null, po(t(j), (a) => (F(), se(fo(a.renderNode), {
|
|
448
457
|
key: a.dataIndex
|
|
449
458
|
}))), 128))
|
|
450
459
|
]),
|
|
@@ -459,36 +468,36 @@ const Ct = /* @__PURE__ */ so({
|
|
|
459
468
|
} : void 0
|
|
460
469
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
461
470
|
], 6)) : le("", !0),
|
|
462
|
-
|
|
463
|
-
class: f([t(
|
|
464
|
-
style:
|
|
471
|
+
B("div", {
|
|
472
|
+
class: f([t(x)("table-wrapper"), e.card ? t(x)("table-wrapper-card") : null]),
|
|
473
|
+
style: O(e.tableWrapperStyle)
|
|
465
474
|
}, [
|
|
466
|
-
|
|
467
|
-
class: f(t(
|
|
475
|
+
B("div", {
|
|
476
|
+
class: f(t(d)("header-wrapper"))
|
|
468
477
|
}, [
|
|
469
478
|
ie(e.$slots, "title", {
|
|
470
|
-
selectedRows: t(
|
|
471
|
-
selectedRowKeys: t(
|
|
479
|
+
selectedRows: t(P),
|
|
480
|
+
selectedRowKeys: t(Ae),
|
|
472
481
|
shownColumns: t(g),
|
|
473
|
-
clearAll:
|
|
482
|
+
clearAll: V
|
|
474
483
|
})
|
|
475
484
|
], 2),
|
|
476
|
-
|
|
485
|
+
B("div", {
|
|
477
486
|
ref_key: "gridWrapperRef",
|
|
478
|
-
ref:
|
|
479
|
-
class: f(t(
|
|
487
|
+
ref: Re,
|
|
488
|
+
class: f(t(d)("grid-wrapper"))
|
|
480
489
|
}, [
|
|
481
|
-
|
|
482
|
-
t(
|
|
490
|
+
G(t(So), H(
|
|
491
|
+
t(Co)(t(fe), t(U), je.value),
|
|
483
492
|
{
|
|
484
|
-
"get-row-class":
|
|
493
|
+
"get-row-class": no,
|
|
485
494
|
style: Xe.value,
|
|
486
495
|
"row-data": t(S).records,
|
|
487
|
-
"column-defs": t(
|
|
496
|
+
"column-defs": t(ve),
|
|
488
497
|
"default-col-def": t(Ce),
|
|
489
498
|
"suppress-loading-overlay": "",
|
|
490
499
|
"row-selection": Ge.value,
|
|
491
|
-
"selection-column-def": t(
|
|
500
|
+
"selection-column-def": t(De),
|
|
492
501
|
"get-row-id": Ze,
|
|
493
502
|
"get-row-height": o.getRowHeight,
|
|
494
503
|
theme: t(pe),
|
|
@@ -496,32 +505,32 @@ const Ct = /* @__PURE__ */ so({
|
|
|
496
505
|
"enable-browser-tooltips": e.browserTooltips,
|
|
497
506
|
"tooltip-interaction": "",
|
|
498
507
|
"row-class-rules": e.rowClassRules,
|
|
499
|
-
"no-rows-overlay-component":
|
|
508
|
+
"no-rows-overlay-component": Uo,
|
|
500
509
|
"suppress-cell-focus": "",
|
|
501
510
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
502
511
|
onSortChanged: Fe,
|
|
503
512
|
onGridReady: r[0] || (r[0] = (a) => s.value = a.api),
|
|
504
|
-
onRowDataUpdated:
|
|
513
|
+
onRowDataUpdated: N,
|
|
505
514
|
onRowSelected: He,
|
|
506
515
|
onFirstDataRendered: Le,
|
|
507
|
-
onRowClicked:
|
|
508
|
-
onBodyScrollEnd:
|
|
516
|
+
onRowClicked: to,
|
|
517
|
+
onBodyScrollEnd: ro
|
|
509
518
|
}
|
|
510
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"]),
|
|
511
|
-
|
|
512
|
-
class: f(t(
|
|
520
|
+
go(B("div", {
|
|
521
|
+
class: f(t(x)("table-loading-wrapper"))
|
|
513
522
|
}, [
|
|
514
|
-
|
|
523
|
+
G(t(vo), { delay: 300 })
|
|
515
524
|
], 2), [
|
|
516
|
-
[
|
|
525
|
+
[wo, Je.value]
|
|
517
526
|
])
|
|
518
527
|
], 2),
|
|
519
|
-
|
|
520
|
-
class: f(t(
|
|
528
|
+
B("div", {
|
|
529
|
+
class: f(t(d)("pagination-wrapper"))
|
|
521
530
|
}, [
|
|
522
|
-
e.pagination !== !1 ? (
|
|
531
|
+
e.pagination !== !1 ? (F(), se(t(Ro), H({
|
|
523
532
|
key: 0,
|
|
524
|
-
class: t(
|
|
533
|
+
class: t(d)("pagination")
|
|
525
534
|
}, t(q).pagination, { onChange: Ye }), null, 16, ["class"])) : le("", !0)
|
|
526
535
|
], 2)
|
|
527
536
|
], 6)
|
|
@@ -529,5 +538,5 @@ const Ct = /* @__PURE__ */ so({
|
|
|
529
538
|
}
|
|
530
539
|
});
|
|
531
540
|
export {
|
|
532
|
-
|
|
541
|
+
vt as default
|
|
533
542
|
};
|
|
@@ -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
|
/**
|
|
@@ -393,6 +404,13 @@ export type AgGridExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
|
393
404
|
* @returns
|
|
394
405
|
*/
|
|
395
406
|
scrollToRow: (index: number, position?: 'top' | 'bottom' | 'middle' | null) => void;
|
|
407
|
+
/**
|
|
408
|
+
* 滚动到某一列
|
|
409
|
+
* @param key 列的唯一标识
|
|
410
|
+
* @param position
|
|
411
|
+
* @returns
|
|
412
|
+
*/
|
|
413
|
+
scrollToColumn: (key: string, position?: 'auto' | 'start' | 'middle' | 'end') => void;
|
|
396
414
|
/**
|
|
397
415
|
* 获取当前表格数据
|
|
398
416
|
* @returns
|
|
@@ -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>>;
|