@aplus-frontend/ui 7.19.7 → 7.20.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 +113 -93
- package/es/src/ag-grid/editable/index.vue.mjs +91 -79
- package/es/src/ag-grid/editable/interface.d.ts +7 -0
- package/es/src/ag-grid/hooks/use-editable-api.mjs +106 -132
- package/es/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/es/src/ag-grid/hooks/use-editable-form-item-api.mjs +100 -165
- package/es/src/ag-grid/index.vue.mjs +124 -120
- package/es/src/ag-grid/interface.d.ts +6 -0
- package/es/src/ap-button/ap-button.vue.mjs +23 -23
- package/es/src/ap-button/interface.d.ts +1 -1
- package/es/src/ap-button/utils/index.d.ts +1 -1
- package/es/src/ap-button/utils/index.mjs +7 -7
- package/es/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/es/src/business/ag-grid-modal/constants.mjs +1 -1
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-instance.mjs +51 -41
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-modal.mjs +33 -30
- package/es/src/business/ag-grid-modal/hooks/use-ag-grid-select-modal.mjs +71 -68
- package/es/src/business/ag-grid-modal/interface.d.ts +4 -2
- package/es/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/es/src/business/ag-grid-modal/utils.mjs +34 -30
- package/es/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -3
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +25 -23
- package/es/src/business/ap-batch-action-group/index.d.ts +3 -3
- 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 +7 -0
- package/lib/src/ag-grid/hooks/use-editable-api.js +1 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.d.ts +0 -1
- package/lib/src/ag-grid/hooks/use-editable-form-item-api.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ag-grid/interface.d.ts +6 -0
- package/lib/src/ap-button/ap-button.vue.js +1 -1
- package/lib/src/ap-button/interface.d.ts +1 -1
- package/lib/src/ap-button/utils/index.d.ts +1 -1
- package/lib/src/ap-button/utils/index.js +1 -1
- package/lib/src/business/ag-grid-modal/constants.d.ts +1 -1
- package/lib/src/business/ag-grid-modal/constants.js +1 -1
- package/lib/src/business/ag-grid-modal/hooks/use-ag-grid-instance.d.ts +6 -2
- 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.js +1 -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 +4 -2
- package/lib/src/business/ag-grid-modal/utils.d.ts +2 -0
- package/lib/src/business/ag-grid-modal/utils.js +1 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue.d.ts +7 -3
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-batch-action-group/index.d.ts +3 -3
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as ko, useSlots as xo, ref as h, toRef as
|
|
2
|
-
import { AG_GRID_LOCALE_EN as
|
|
3
|
-
import { Pagination as
|
|
1
|
+
import { defineComponent as ko, useSlots as xo, ref as h, toRef as k, computed as i, unref as r, nextTick as A, watch as W, createElementBlock as U, openBlock as y, normalizeStyle as _, normalizeClass as R, createCommentVNode as fe, createElementVNode as T, createVNode as Fo, mergeProps as j, createSlots as Bo, withCtx as ge, Fragment as Io, renderList as Ao, createBlock as $, resolveDynamicComponent as To, renderSlot as we } from "vue";
|
|
2
|
+
import { AG_GRID_LOCALE_EN as Eo, AG_GRID_LOCALE_CN as No } from "@ag-grid-community/locale";
|
|
3
|
+
import { Pagination as Do } from "@aplus-frontend/antdv";
|
|
4
4
|
import { useToken as zo } from "@aplus-frontend/antdv/es/theme/internal";
|
|
5
|
-
import { ModuleRegistry as
|
|
6
|
-
import { AgGridVue as
|
|
7
|
-
import { isUndefined as
|
|
8
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as Se, sizeReverseMap as
|
|
9
|
-
import { useProvideApTable as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import { recursionApColumns as
|
|
5
|
+
import { ModuleRegistry as Po, ValidationModule as Oo, ColumnAutoSizeModule as Vo, PinnedRowModule as Ko, RowAutoHeightModule as Go, RowStyleModule as Lo, CellSpanModule as Ho, CellStyleModule as Wo, TooltipModule as Uo, RowSelectionModule as _o, LocaleModule as jo, ValueCacheModule as $o, GridStateModule as qo, ColumnApiModule as Jo, RowApiModule as Qo, CellApiModule as Xo, RenderApiModule as Yo, EventApiModule as Zo, ScrollApiModule as et, ClientSideRowModelApiModule as ot, ClientSideRowModelModule as tt } from "ag-grid-community";
|
|
6
|
+
import { AgGridVue as rt } from "ag-grid-vue3";
|
|
7
|
+
import { isUndefined as x, isFunction as E, omit as nt } from "lodash-unified";
|
|
8
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as Se, sizeReverseMap as lt, sizeMap as at } from "../ap-grid/constants.mjs";
|
|
9
|
+
import { useProvideApTable as st } from "../ap-table/context.mjs";
|
|
10
|
+
import { useTablePaging as it } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import { recursionApColumns as ut } from "../ap-table/utils.mjs";
|
|
12
12
|
import "../config-provider/index.mjs";
|
|
13
13
|
import "../utils/index.mjs";
|
|
14
|
-
import { retryUntil as
|
|
15
|
-
import { getValidVNodeList as
|
|
16
|
-
import { ApForm as
|
|
14
|
+
import { retryUntil as dt } from "../utils/retry.mjs";
|
|
15
|
+
import { getValidVNodeList as ct } from "../utils/slot.mjs";
|
|
16
|
+
import { ApForm as mt } from "../ap-form/index.mjs";
|
|
17
17
|
import "./components/empty/index.vue.mjs";
|
|
18
18
|
import "./components/loading/index.vue.mjs";
|
|
19
19
|
import "./components/row/index.vue.mjs";
|
|
20
|
-
import { useProvideSorter as
|
|
21
|
-
import { useColumns as
|
|
22
|
-
import { useColumnsDef as
|
|
23
|
-
import { usePinnedRow as
|
|
24
|
-
import
|
|
25
|
-
import { useSearchForm as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { useTheme as
|
|
30
|
-
import { runPipelineHooks as
|
|
20
|
+
import { useProvideSorter as pt, useProvideExpandable as ft } from "./context.mjs";
|
|
21
|
+
import { useColumns as gt } from "./hooks/use-columns.mjs";
|
|
22
|
+
import { useColumnsDef as wt } from "./hooks/use-columns-def.mjs";
|
|
23
|
+
import { usePinnedRow as St } from "./hooks/use-pinned-row.mjs";
|
|
24
|
+
import Ct from "./hooks/use-row-selection.mjs";
|
|
25
|
+
import { useSearchForm as ht } from "./hooks/use-search-form.mjs";
|
|
26
|
+
import yt from "./hooks/use-selection-col-def.mjs";
|
|
27
|
+
import Rt from "./hooks/use-virtual-config.mjs";
|
|
28
|
+
import vt from "./style/index.mjs";
|
|
29
|
+
import { useTheme as bt } from "./theme.mjs";
|
|
30
|
+
import { runPipelineHooks as Mt, runEffectHooks as q, mergeProps as kt } from "./utils.mjs";
|
|
31
31
|
import { useNamespace as xt } from "../config-provider/hooks/use-namespace.mjs";
|
|
32
|
-
import { useLocale as
|
|
33
|
-
import { useGlobalConfig as
|
|
34
|
-
import { isDef as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
const
|
|
32
|
+
import { useLocale as Ft } from "../config-provider/hooks/use-locale.mjs";
|
|
33
|
+
import { useGlobalConfig as Bt } from "../config-provider/hooks/use-global-config.mjs";
|
|
34
|
+
import { isDef as It } from "../utils/is.mjs";
|
|
35
|
+
import At from "./components/row/index.vue2.mjs";
|
|
36
|
+
import Tt from "./components/loading/index.vue2.mjs";
|
|
37
|
+
import Et from "./components/empty/index.vue2.mjs";
|
|
38
|
+
const wr = /* @__PURE__ */ ko({
|
|
39
39
|
name: "AgGrid",
|
|
40
40
|
__name: "index",
|
|
41
41
|
props: {
|
|
@@ -108,6 +108,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
108
108
|
rowClassRules: {},
|
|
109
109
|
autoHeight: { type: Boolean },
|
|
110
110
|
onUpdate: {},
|
|
111
|
+
onModelUpdated: {},
|
|
111
112
|
customRow: {},
|
|
112
113
|
theme: {},
|
|
113
114
|
emptyComponent: {},
|
|
@@ -118,11 +119,10 @@ const gr = /* @__PURE__ */ ko({
|
|
|
118
119
|
},
|
|
119
120
|
setup(Ce, { expose: he }) {
|
|
120
121
|
const ye = {
|
|
121
|
-
"zh-cn":
|
|
122
|
-
en:
|
|
122
|
+
"zh-cn": No,
|
|
123
|
+
en: Eo
|
|
123
124
|
};
|
|
124
|
-
|
|
125
|
-
Po,
|
|
125
|
+
Po.registerModules([
|
|
126
126
|
Oo,
|
|
127
127
|
Vo,
|
|
128
128
|
Ko,
|
|
@@ -141,34 +141,35 @@ const gr = /* @__PURE__ */ ko({
|
|
|
141
141
|
Yo,
|
|
142
142
|
Zo,
|
|
143
143
|
et,
|
|
144
|
-
ot
|
|
144
|
+
ot,
|
|
145
|
+
tt
|
|
145
146
|
]);
|
|
146
|
-
const o = Ce, N = xo(), { e:
|
|
147
|
+
const o = Ce, N = xo(), { e: D, b: c, be: Re } = xt("ag-grid"), { lang: J } = Ft(), ve = vt("ag-grid"), v = h(o.size), be = bt(
|
|
147
148
|
v,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
),
|
|
151
|
-
|
|
152
|
-
),
|
|
149
|
+
k(o, "rowHeight"),
|
|
150
|
+
k(o, "theme")
|
|
151
|
+
), Me = Rt(k(o, "virtual")), { rowPinnedGridConfig: Q, getRowPinnedCellClass: ke } = St(
|
|
152
|
+
k(o, "summary")
|
|
153
|
+
), xe = Bt("apGrid"), s = h(), [, Fe] = zo();
|
|
153
154
|
let b = !!o.dataSource;
|
|
154
|
-
async function
|
|
155
|
-
const n = await
|
|
155
|
+
async function z(e, t = {}) {
|
|
156
|
+
const n = await Mt(
|
|
156
157
|
o.plugins,
|
|
157
158
|
e,
|
|
158
|
-
(
|
|
159
|
+
(l) => l.beforeApplyColumnState?.bind(l)
|
|
159
160
|
);
|
|
160
161
|
s.value.applyColumnState({ state: n, ...t });
|
|
161
162
|
}
|
|
162
|
-
const X =
|
|
163
|
+
const X = ht(o), {
|
|
163
164
|
shownColumns: w,
|
|
164
165
|
columns: Y,
|
|
165
166
|
columnKeys: Be,
|
|
166
167
|
getTargetColumnByKey: Ie,
|
|
167
168
|
defaultSortOrder: F
|
|
168
|
-
} =
|
|
169
|
+
} = gt(o), { defaultColDef: Ae, columnDefs: Z, gridWrapperRef: Te } = wt(
|
|
169
170
|
Y,
|
|
170
171
|
o,
|
|
171
|
-
|
|
172
|
+
ke,
|
|
172
173
|
N.headerCell
|
|
173
174
|
), Ee = {
|
|
174
175
|
asc: "ascend",
|
|
@@ -183,23 +184,23 @@ const gr = /* @__PURE__ */ ko({
|
|
|
183
184
|
[e.colKey]: ee[e.order]
|
|
184
185
|
} : {};
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function De() {
|
|
187
188
|
const e = oe.value, t = F.value;
|
|
188
189
|
if (t && e.includes(t.field))
|
|
189
190
|
return t;
|
|
190
191
|
}
|
|
191
192
|
const B = h(Ne());
|
|
192
|
-
|
|
193
|
+
pt({
|
|
193
194
|
sorter: B,
|
|
194
195
|
setSorter(e) {
|
|
195
196
|
B.value = e;
|
|
196
197
|
}
|
|
197
198
|
});
|
|
198
|
-
function
|
|
199
|
+
function ze() {
|
|
199
200
|
const e = s.value.getColumns()?.filter((m) => m.getSort() != null), t = r(B) || {};
|
|
200
201
|
let n = e?.[0];
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
202
|
+
const l = Object.keys(t);
|
|
203
|
+
if (l.length && l.every((m) => t[m] === null)) {
|
|
203
204
|
const m = Object.keys(t)[0];
|
|
204
205
|
m && (n = s.value?.getColumn(m));
|
|
205
206
|
}
|
|
@@ -212,7 +213,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
212
213
|
order: f ? Ee[f] : null
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
|
-
const oe = i(() =>
|
|
216
|
+
const oe = i(() => ut(r(w), (e) => {
|
|
216
217
|
if (e.sorter === !0)
|
|
217
218
|
return e.field ?? e.dataIndex ?? e.key;
|
|
218
219
|
}).filter(Boolean)), Pe = () => {
|
|
@@ -221,9 +222,9 @@ const gr = /* @__PURE__ */ ko({
|
|
|
221
222
|
if (!e)
|
|
222
223
|
return;
|
|
223
224
|
const t = e.getColumnState()?.map((n) => ({ ...n, sort: null }));
|
|
224
|
-
|
|
225
|
+
z(t);
|
|
225
226
|
}, P = h({});
|
|
226
|
-
|
|
227
|
+
ft({ expandable: P });
|
|
227
228
|
function Oe(e) {
|
|
228
229
|
const t = e.columnGroup;
|
|
229
230
|
t && (P.value = {
|
|
@@ -231,7 +232,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
231
232
|
[t.getGroupId()]: t.isExpanded()
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
|
-
const O = h(!0), Ve = i(() =>
|
|
235
|
+
const O = h(!0), Ve = i(() => It(o.manual) ? o.manual : ct(N.searchFormExtra?.() || []).some((t) => t.type?.name === "ApView")), {
|
|
235
236
|
formRef: S,
|
|
236
237
|
submit: V,
|
|
237
238
|
reset: K,
|
|
@@ -239,14 +240,14 @@ const gr = /* @__PURE__ */ ko({
|
|
|
239
240
|
tableProps: te,
|
|
240
241
|
handleTableChangeOptional: re,
|
|
241
242
|
submitWith: ne,
|
|
242
|
-
refresh:
|
|
243
|
+
refresh: le,
|
|
243
244
|
getPaging: Ke,
|
|
244
245
|
setPaging: Ge,
|
|
245
246
|
setDataSource: Le,
|
|
246
247
|
getLastParams: He
|
|
247
|
-
} =
|
|
248
|
+
} = it({
|
|
248
249
|
async request(e) {
|
|
249
|
-
if (b = !1, C.value && !C.value.preserveSelectedRowKeys &&
|
|
250
|
+
if (b = !1, C.value && !C.value.preserveSelectedRowKeys && x(o.dataSource) && !O.value && H(), O.value && (O.value = !1), !x(o.dataSource)) {
|
|
250
251
|
const n = e.pageSize * (e.current - 1);
|
|
251
252
|
return {
|
|
252
253
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(n, n + e.pageSize)) || [],
|
|
@@ -261,23 +262,23 @@ const gr = /* @__PURE__ */ ko({
|
|
|
261
262
|
},
|
|
262
263
|
namespace: "ap-grid",
|
|
263
264
|
filterFields: h([]),
|
|
264
|
-
params:
|
|
265
|
+
params: k(o, "params"),
|
|
265
266
|
defaultData: o.defaultData,
|
|
266
267
|
manual: r(Ve),
|
|
267
268
|
formatParams: o.beforeSearchSubmit,
|
|
268
269
|
pagination: o.pagination,
|
|
269
270
|
sortFields: oe,
|
|
270
271
|
onClickReset: Pe,
|
|
271
|
-
defaultSortOrder:
|
|
272
|
+
defaultSortOrder: De()
|
|
272
273
|
}), C = i(() => {
|
|
273
|
-
const e = o.rowSelection ||
|
|
274
|
+
const e = o.rowSelection || xe.value?.rowSelection;
|
|
274
275
|
if (e)
|
|
275
276
|
return e === !0 ? Se : {
|
|
276
277
|
...Se,
|
|
277
278
|
...e
|
|
278
279
|
};
|
|
279
|
-
}), We =
|
|
280
|
-
() =>
|
|
280
|
+
}), We = yt(o, w), Ue = i(
|
|
281
|
+
() => x(o.dataSource) ? p.records : o.dataSource
|
|
281
282
|
), {
|
|
282
283
|
select: _e,
|
|
283
284
|
unSelect: je,
|
|
@@ -287,7 +288,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
287
288
|
selectMultiByKeys: Je,
|
|
288
289
|
selectMulti: Qe,
|
|
289
290
|
unSelectMulti: Xe
|
|
290
|
-
} =
|
|
291
|
+
} = Ct({
|
|
291
292
|
...C.value,
|
|
292
293
|
dataSource: Ue,
|
|
293
294
|
rowKey: o.rowKey
|
|
@@ -301,7 +302,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
301
302
|
const { type: t = "checkbox", disabled: n } = e;
|
|
302
303
|
return {
|
|
303
304
|
mode: Ye[t],
|
|
304
|
-
isRowSelectable: (
|
|
305
|
+
isRowSelectable: (l) => n ? !n(l.data) : !0,
|
|
305
306
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
306
307
|
};
|
|
307
308
|
});
|
|
@@ -316,9 +317,9 @@ const gr = /* @__PURE__ */ ko({
|
|
|
316
317
|
const t = G.value || [];
|
|
317
318
|
b = !1;
|
|
318
319
|
const n = [];
|
|
319
|
-
e.forEachNode((
|
|
320
|
-
const d =
|
|
321
|
-
t.find((g) => L(g) === u) ? !f && n.push(
|
|
320
|
+
e.forEachNode((l) => {
|
|
321
|
+
const d = l.data, u = L(d), f = l.isSelected();
|
|
322
|
+
t.find((g) => L(g) === u) ? !f && n.push(l) : f && l.setSelected(!1);
|
|
322
323
|
}), e.setNodesSelected({ nodes: n, newValue: !0 }), setTimeout(() => {
|
|
323
324
|
b = !0;
|
|
324
325
|
}, 0);
|
|
@@ -334,11 +335,11 @@ const gr = /* @__PURE__ */ ko({
|
|
|
334
335
|
const e = s.value;
|
|
335
336
|
if (!e || !F.value)
|
|
336
337
|
return;
|
|
337
|
-
const t = e.getColumnState(), { colKey: n, order:
|
|
338
|
+
const t = e.getColumnState(), { colKey: n, order: l } = F.value, d = t.map((u) => ({
|
|
338
339
|
...u,
|
|
339
|
-
sort: u.colId === n ? ee[
|
|
340
|
+
sort: u.colId === n ? ee[l] : null
|
|
340
341
|
}));
|
|
341
|
-
|
|
342
|
+
z(d);
|
|
342
343
|
}, H = () => {
|
|
343
344
|
qe(), s.value?.deselectAll();
|
|
344
345
|
};
|
|
@@ -351,7 +352,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
351
352
|
const e = o.customRow;
|
|
352
353
|
return e ? {
|
|
353
354
|
isFullWidthRow: e.isCustomRow,
|
|
354
|
-
fullWidthCellRenderer:
|
|
355
|
+
fullWidthCellRenderer: At,
|
|
355
356
|
fullWidthCellRendererParams: {
|
|
356
357
|
render: e.render
|
|
357
358
|
}
|
|
@@ -362,12 +363,12 @@ const gr = /* @__PURE__ */ ko({
|
|
|
362
363
|
I({});
|
|
363
364
|
});
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
+
function lo(e) {
|
|
366
367
|
Xe(e), A(() => {
|
|
367
368
|
I({});
|
|
368
369
|
});
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
+
function ae(e = !1) {
|
|
371
372
|
const t = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
372
373
|
return S.value?.apForm?.[t]?.(!0);
|
|
373
374
|
}
|
|
@@ -386,39 +387,39 @@ const gr = /* @__PURE__ */ ko({
|
|
|
386
387
|
function ce(e) {
|
|
387
388
|
return e && String(e);
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
+
function ao(e) {
|
|
390
391
|
const t = s.value;
|
|
391
392
|
if (!t)
|
|
392
393
|
return;
|
|
393
|
-
const n = t.getColumnState() || [],
|
|
394
|
-
if (!Be.value.includes(
|
|
395
|
-
return
|
|
396
|
-
const
|
|
397
|
-
...
|
|
398
|
-
hide:
|
|
394
|
+
const n = t.getColumnState() || [], l = e.map((a) => a.key ? String(a.key) : a.key).filter(Boolean), d = n.map((a) => {
|
|
395
|
+
if (!Be.value.includes(a.colId))
|
|
396
|
+
return a;
|
|
397
|
+
const M = !l.includes(a.colId), me = {
|
|
398
|
+
...a,
|
|
399
|
+
hide: M
|
|
399
400
|
}, pe = e.find(
|
|
400
|
-
(
|
|
401
|
+
(Mo) => ce(Mo.key) === a.colId
|
|
401
402
|
);
|
|
402
403
|
return pe && (me.pinned = pe.fixed || null), me;
|
|
403
404
|
}), u = new Map(
|
|
404
|
-
e.map((
|
|
405
|
-
), f = d.filter((
|
|
406
|
-
(
|
|
405
|
+
e.map((a, M) => [ce(a.key), M])
|
|
406
|
+
), f = d.filter((a) => u.has(a.colId)).sort(
|
|
407
|
+
(a, M) => u.get(a.colId) - u.get(M.colId)
|
|
407
408
|
), g = [];
|
|
408
409
|
let m = 0;
|
|
409
|
-
for (const
|
|
410
|
-
u.has(
|
|
411
|
-
|
|
410
|
+
for (const a of d)
|
|
411
|
+
u.has(a.colId) ? g.push(f[m++]) : g.push(a);
|
|
412
|
+
z(g, { applyOrder: !0 });
|
|
412
413
|
}
|
|
413
|
-
|
|
414
|
+
st({
|
|
414
415
|
columns: i(() => w.value),
|
|
415
416
|
columnsBackup: i(() => Y.value),
|
|
416
417
|
size: i(() => at[v.value]),
|
|
417
418
|
updateColumns(e) {
|
|
418
|
-
w.value = e, o.onShownColumnsChange?.(e),
|
|
419
|
-
() => s.value?.
|
|
419
|
+
w.value = e, o.onShownColumnsChange?.(e), dt(
|
|
420
|
+
() => s.value?.getAllDisplayedColumns(),
|
|
420
421
|
() => {
|
|
421
|
-
|
|
422
|
+
ao(e);
|
|
422
423
|
},
|
|
423
424
|
{
|
|
424
425
|
interval: 17,
|
|
@@ -427,25 +428,25 @@ const gr = /* @__PURE__ */ ko({
|
|
|
427
428
|
);
|
|
428
429
|
},
|
|
429
430
|
updateSize(e) {
|
|
430
|
-
v.value =
|
|
431
|
+
v.value = lt[e];
|
|
431
432
|
},
|
|
432
433
|
renderConfig: i(() => ({
|
|
433
434
|
className: Re("table-header", "title"),
|
|
434
435
|
color: Fe.value.colorTextTertiary
|
|
435
436
|
})),
|
|
436
437
|
dataSource: i(() => r(p).records),
|
|
437
|
-
getSearchFormValues:
|
|
438
|
+
getSearchFormValues: ae,
|
|
438
439
|
setSearchFormValues: se,
|
|
439
440
|
submit: V,
|
|
440
441
|
submitWith: ne,
|
|
441
442
|
reset: K,
|
|
442
|
-
refresh:
|
|
443
|
+
refresh: le,
|
|
443
444
|
getSearchFormSorterItems: ie,
|
|
444
445
|
setSearchFormSorterItems: ue,
|
|
445
446
|
resetSearchFormSorterItems: de,
|
|
446
447
|
getLastParams: He
|
|
447
448
|
});
|
|
448
|
-
const so = i(() => (
|
|
449
|
+
const so = i(() => (x(o.loading) ? p.loading : o.loading) || Z.value.length === 0), io = i(() => [
|
|
449
450
|
c(),
|
|
450
451
|
o.card ? null : c("wrapper"),
|
|
451
452
|
c("adaptive"),
|
|
@@ -487,11 +488,11 @@ const gr = /* @__PURE__ */ ko({
|
|
|
487
488
|
}) {
|
|
488
489
|
if (!e || n !== "uiColumnResized")
|
|
489
490
|
return;
|
|
490
|
-
const
|
|
491
|
+
const l = (t || []).map((d) => ({
|
|
491
492
|
key: d.getColId(),
|
|
492
493
|
width: d.getActualWidth()
|
|
493
494
|
}));
|
|
494
|
-
q(o.plugins, (d) => d.onColumnResized?.bind(d),
|
|
495
|
+
q(o.plugins, (d) => d.onColumnResized?.bind(d), l), o.onColumnResized?.(l);
|
|
495
496
|
}
|
|
496
497
|
const yo = (e) => {
|
|
497
498
|
const t = [
|
|
@@ -504,10 +505,12 @@ const gr = /* @__PURE__ */ ko({
|
|
|
504
505
|
return t.flat().filter(Boolean);
|
|
505
506
|
}, Ro = ({ api: e }) => {
|
|
506
507
|
s.value = e, q(o.plugins, (t) => t.init?.bind(t), e);
|
|
507
|
-
}, vo = (e
|
|
508
|
+
}, vo = ({ api: e }) => {
|
|
509
|
+
o.onModelUpdated?.(e);
|
|
510
|
+
}, bo = (e, t, n) => {
|
|
508
511
|
q(
|
|
509
512
|
o.plugins,
|
|
510
|
-
(
|
|
513
|
+
(l) => l.searchParamsChange?.bind(this),
|
|
511
514
|
t
|
|
512
515
|
), o.searchForm && o.searchForm.onValuesChange?.(e, t, n);
|
|
513
516
|
};
|
|
@@ -532,17 +535,17 @@ const gr = /* @__PURE__ */ ko({
|
|
|
532
535
|
), he({
|
|
533
536
|
submit: V,
|
|
534
537
|
reset: K,
|
|
535
|
-
refresh:
|
|
538
|
+
refresh: le,
|
|
536
539
|
submitWith: ne,
|
|
537
540
|
setSearchFormValues: se,
|
|
538
|
-
getSearchFormValues:
|
|
541
|
+
getSearchFormValues: ae,
|
|
539
542
|
getShowColumns: () => r(w),
|
|
540
543
|
rowSelection: {
|
|
541
544
|
selectedRows: i(() => G.value),
|
|
542
545
|
setSelectedRowKeys: to,
|
|
543
546
|
setSelectedRows: no,
|
|
544
547
|
clearAll: H,
|
|
545
|
-
unSelectRows:
|
|
548
|
+
unSelectRows: lo
|
|
546
549
|
},
|
|
547
550
|
scrollToRow: po,
|
|
548
551
|
scrollToColumn: fo,
|
|
@@ -559,22 +562,22 @@ const gr = /* @__PURE__ */ ko({
|
|
|
559
562
|
class: R(io.value),
|
|
560
563
|
style: _(e.wrapperStyle)
|
|
561
564
|
}, [
|
|
562
|
-
r(
|
|
565
|
+
r(x)(e.dataSource) && e.searchForm !== !1 && r(X).length > 0 ? (y(), U("div", {
|
|
563
566
|
key: 0,
|
|
564
|
-
class: R(e.card ? r(
|
|
567
|
+
class: R(e.card ? r(D)("search-wrapper") : null),
|
|
565
568
|
style: _(e.searchFormWrapperStyle)
|
|
566
569
|
}, [
|
|
567
|
-
|
|
570
|
+
Fo(r(mt).SearchForm, j(r(nt)(e.searchForm || {}, ["onValuesChange"]), {
|
|
568
571
|
ref_key: "formRef",
|
|
569
572
|
ref: S,
|
|
570
573
|
"custom-reset": "",
|
|
571
574
|
"submit-loading": r(te).loading,
|
|
572
575
|
onSubmit: r(V),
|
|
573
576
|
onReset: r(K),
|
|
574
|
-
onValuesChange:
|
|
575
|
-
}),
|
|
577
|
+
onValuesChange: bo
|
|
578
|
+
}), Bo({
|
|
576
579
|
default: ge(() => [
|
|
577
|
-
(y(!0), U(
|
|
580
|
+
(y(!0), U(Io, null, Ao(r(X), (n) => (y(), $(To(n.renderNode), {
|
|
578
581
|
key: n.dataIndex
|
|
579
582
|
}))), 128))
|
|
580
583
|
]),
|
|
@@ -590,7 +593,7 @@ const gr = /* @__PURE__ */ ko({
|
|
|
590
593
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
591
594
|
], 6)) : fe("", !0),
|
|
592
595
|
T("div", {
|
|
593
|
-
class: R([r(
|
|
596
|
+
class: R([r(D)("table-wrapper"), e.card ? r(D)("table-wrapper-card") : null]),
|
|
594
597
|
style: _(e.tableWrapperStyle)
|
|
595
598
|
}, [
|
|
596
599
|
T("div", {
|
|
@@ -608,8 +611,8 @@ const gr = /* @__PURE__ */ ko({
|
|
|
608
611
|
ref: Te,
|
|
609
612
|
class: R(r(c)("grid-wrapper"))
|
|
610
613
|
}, [
|
|
611
|
-
(y(), $(r(
|
|
612
|
-
r(kt)(r(
|
|
614
|
+
(y(), $(r(rt), j(
|
|
615
|
+
r(kt)(r(Me), r(Q), ro.value),
|
|
613
616
|
{
|
|
614
617
|
key: r(J),
|
|
615
618
|
"animate-rows": e.animateRows,
|
|
@@ -628,16 +631,16 @@ const gr = /* @__PURE__ */ ko({
|
|
|
628
631
|
"enable-browser-tooltips": e.browserTooltips,
|
|
629
632
|
"tooltip-interaction": "",
|
|
630
633
|
"row-class-rules": e.rowClassRules,
|
|
631
|
-
"no-rows-overlay-component":
|
|
634
|
+
"no-rows-overlay-component": Et,
|
|
632
635
|
"no-rows-overlay-component-params": { emptyComponent: e.emptyComponent, emptyText: e.emptyText },
|
|
633
|
-
"loading-overlay-component":
|
|
636
|
+
"loading-overlay-component": Tt,
|
|
634
637
|
loading: so.value,
|
|
635
638
|
"suppress-cell-focus": "",
|
|
636
639
|
"tab-to-next-cell": () => !1,
|
|
637
640
|
"enable-cell-span": "",
|
|
638
641
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
639
642
|
"locale-text": ye[r(J)],
|
|
640
|
-
onSortChanged:
|
|
643
|
+
onSortChanged: ze,
|
|
641
644
|
onGridReady: Ro,
|
|
642
645
|
onRowDataUpdated: I,
|
|
643
646
|
onRowSelected: eo,
|
|
@@ -645,14 +648,15 @@ const gr = /* @__PURE__ */ ko({
|
|
|
645
648
|
onRowClicked: go,
|
|
646
649
|
onBodyScrollEnd: wo,
|
|
647
650
|
onColumnResized: ho,
|
|
648
|
-
onColumnGroupOpened: Oe
|
|
651
|
+
onColumnGroupOpened: Oe,
|
|
652
|
+
onModelUpdated: vo
|
|
649
653
|
}
|
|
650
654
|
), null, 16, ["animate-rows", "style", "row-data", "column-defs", "default-col-def", "row-selection", "selection-column-def", "get-row-height", "theme", "enable-browser-tooltips", "row-class-rules", "no-rows-overlay-component-params", "loading", "dom-layout", "locale-text"]))
|
|
651
655
|
], 2),
|
|
652
656
|
T("div", {
|
|
653
657
|
class: R(r(c)("pagination-wrapper"))
|
|
654
658
|
}, [
|
|
655
|
-
e.pagination !== !1 ? (y(), $(r(
|
|
659
|
+
e.pagination !== !1 ? (y(), $(r(Do), j({
|
|
656
660
|
key: 0,
|
|
657
661
|
class: r(c)("pagination")
|
|
658
662
|
}, r(te).pagination, { onChange: co }), null, 16, ["class"])) : fe("", !0)
|
|
@@ -662,5 +666,5 @@ const gr = /* @__PURE__ */ ko({
|
|
|
662
666
|
}
|
|
663
667
|
});
|
|
664
668
|
export {
|
|
665
|
-
|
|
669
|
+
wr as default
|
|
666
670
|
};
|
|
@@ -340,6 +340,12 @@ export type AgGridProps<RecordType = any, ParamsType = any> = Omit<TableProps<Re
|
|
|
340
340
|
* @returns
|
|
341
341
|
*/
|
|
342
342
|
onUpdate?: () => void;
|
|
343
|
+
/**
|
|
344
|
+
* Displayed rows have changed. Triggered after sort, filter or tree expand / collapse events.
|
|
345
|
+
* @param api
|
|
346
|
+
* @returns
|
|
347
|
+
*/
|
|
348
|
+
onModelUpdated?: (api: GridApi) => void;
|
|
343
349
|
/**
|
|
344
350
|
* 自定义行渲染配置
|
|
345
351
|
* @since 6.37.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as W, ref as z, computed as o, createBlock as L, openBlock as w, unref as
|
|
1
|
+
import { defineComponent as B, useSlots as W, ref as z, computed as o, createBlock as L, openBlock as w, unref as a, mergeProps as P, createSlots as S, renderList as T, withCtx as _, renderSlot as $, normalizeProps as x, guardReactiveProps as M } from "vue";
|
|
2
2
|
import { Button as N } from "@aplus-frontend/antdv";
|
|
3
3
|
import { wait as A } from "@aplus-frontend/utils";
|
|
4
4
|
import { omit as D } from "lodash-unified";
|
|
@@ -34,15 +34,15 @@ const q = 72, E = 300, X = /* @__PURE__ */ B({
|
|
|
34
34
|
onClick: {}
|
|
35
35
|
},
|
|
36
36
|
setup(f) {
|
|
37
|
-
const m = W(), e = f, { b:
|
|
37
|
+
const m = W(), e = f, { b: i } = R("ap-action-button"), y = I("ap-action-button"), l = z(!1), b = o(
|
|
38
38
|
() => e.borderLinkColor || "var(--ap-button-border-link-color)"
|
|
39
|
-
), i = o(
|
|
40
|
-
() => e.type === "borderLink" && !e.disabled ? b.value : void 0
|
|
41
39
|
), s = o(
|
|
42
|
-
() =>
|
|
40
|
+
() => e.type === "borderLink" && !e.disabled ? b.value : void 0
|
|
41
|
+
), u = o(
|
|
42
|
+
() => O(s.value)
|
|
43
43
|
), h = o(() => e.minWidth === !0 ? `${q}px` : typeof e.minWidth == "number" ? `${e.minWidth}px` : typeof e.minWidth == "string" ? e.minWidth : void 0), v = o(
|
|
44
44
|
() => (e.type === "borderLink" ? "default" : e.type) || "default"
|
|
45
|
-
),
|
|
45
|
+
), c = o(() => e.loading ?? l.value ?? !1), d = o(() => e.lazy === !0 ? E : typeof e.lazy == "number" && e.lazy >= 0 ? e.lazy : 0);
|
|
46
46
|
function k() {
|
|
47
47
|
const t = D(e, [
|
|
48
48
|
"type",
|
|
@@ -57,39 +57,39 @@ const q = 72, E = 300, X = /* @__PURE__ */ B({
|
|
|
57
57
|
onclick: g
|
|
58
58
|
} : {};
|
|
59
59
|
}
|
|
60
|
-
async function g() {
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
60
|
+
async function g(t) {
|
|
61
|
+
if (c.value) return;
|
|
62
|
+
const r = j(e.onClick, t), p = Date.now();
|
|
63
63
|
try {
|
|
64
|
-
|
|
64
|
+
r && (l.value = !0, await r);
|
|
65
65
|
} finally {
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
|
|
66
|
+
if (r) {
|
|
67
|
+
const n = Date.now() - p;
|
|
68
|
+
n < d.value && await A(d.value - n), l.value = !1;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
return (t,
|
|
72
|
+
return (t, r) => (w(), L(a(N), P({
|
|
73
73
|
class: {
|
|
74
|
-
[
|
|
75
|
-
[`${
|
|
76
|
-
[`${
|
|
74
|
+
[a(i)()]: !0,
|
|
75
|
+
[`${a(i)()}-border-link`]: u.value,
|
|
76
|
+
[`${a(y)}`]: !0
|
|
77
77
|
}
|
|
78
78
|
}, {
|
|
79
79
|
...t.$attrs,
|
|
80
80
|
...k()
|
|
81
81
|
}, {
|
|
82
82
|
style: {
|
|
83
|
-
color:
|
|
83
|
+
color: s.value,
|
|
84
84
|
minWidth: h.value,
|
|
85
|
-
"--button-border-color":
|
|
85
|
+
"--button-border-color": u.value
|
|
86
86
|
},
|
|
87
|
-
loading:
|
|
87
|
+
loading: c.value
|
|
88
88
|
}), S({ _: 2 }, [
|
|
89
|
-
T(m, (
|
|
90
|
-
name:
|
|
89
|
+
T(m, (p, n) => ({
|
|
90
|
+
name: n,
|
|
91
91
|
fn: _((C) => [
|
|
92
|
-
$(t.$slots,
|
|
92
|
+
$(t.$slots, n, x(M(C || {})))
|
|
93
93
|
])
|
|
94
94
|
}))
|
|
95
95
|
]), 1040, ["class", "style", "loading"]));
|
|
@@ -4,7 +4,7 @@ export type ApButtonProps = Omit<ButtonProps, 'type' | 'onClick'> & {
|
|
|
4
4
|
borderLinkColor?: string;
|
|
5
5
|
minWidth?: boolean | number | string;
|
|
6
6
|
lazy?: boolean | number;
|
|
7
|
-
onClick?: () => any | Promise<any>;
|
|
7
|
+
onClick?: (e: MouseEvent) => any | Promise<any>;
|
|
8
8
|
};
|
|
9
9
|
export type ApActionButtonProps = ApButtonProps;
|
|
10
10
|
export type ApButtonSlots = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModalFuncProps } from '@aplus-frontend/antdv';
|
|
2
2
|
export declare function isPromise(fn: any): any;
|
|
3
|
-
export declare const isAsynchronous: (fn: any) => any;
|
|
3
|
+
export declare const isAsynchronous: (fn: any, e: MouseEvent) => any;
|
|
4
4
|
export declare const transferOpacityColor: (thisColor?: string, thisOpacity?: string) => string | undefined;
|
|
5
5
|
export declare const confirmHandle: (ModalFuncProps: ModalFuncProps) => Promise<unknown>;
|