@aplus-frontend/ui 7.13.9 → 7.13.10
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.d.ts +2 -0
- package/es/src/ag-grid/hooks/use-columns.mjs +35 -17
- package/es/src/ag-grid/index.vue.mjs +323 -292
- package/es/src/ap-field/date-range/index.vue.mjs +18 -18
- package/es/src/ap-field/date-range/read.vue2.mjs +3 -3
- package/es/src/ap-field/hooks/use-default-presets.mjs +59 -16
- package/es/src/ap-field/interface.d.ts +46 -1
- package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
- package/es/src/ap-table/hooks/use-sorted-filtered.mjs +13 -11
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +148 -142
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +119 -112
- package/es/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
- package/es/src/business/ap-export-group/handleExportDownload.mjs +2 -2
- package/es/src/business/ap-export-group/interface.d.ts +9 -0
- package/es/src/config-provider/config-provider-props.d.ts +1 -1
- package/es/src/config-provider/config-provider.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +1 -0
- package/es/src/config-provider/index.d.ts +6 -0
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/hooks/use-columns.d.ts +2 -0
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
- package/lib/src/ap-field/interface.d.ts +46 -1
- package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
- package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.js +1 -1
- package/lib/src/business/ap-export-group/interface.d.ts +9 -0
- package/lib/src/config-provider/config-provider-props.d.ts +1 -1
- package/lib/src/config-provider/config-provider.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +1 -0
- package/lib/src/config-provider/index.d.ts +6 -0
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AG_GRID_LOCALE_EN as
|
|
3
|
-
import { Pagination as
|
|
4
|
-
import { useToken as
|
|
5
|
-
import { ModuleRegistry as
|
|
6
|
-
import { AgGridVue as
|
|
7
|
-
import { isUndefined as
|
|
8
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as
|
|
9
|
-
import { useProvideApTable as
|
|
10
|
-
import { useTablePaging as
|
|
11
|
-
import { recursionApColumns as
|
|
1
|
+
import { defineComponent as wo, useSlots as yo, ref as M, toRef as B, computed as n, unref as r, nextTick as A, watch as G, createElementBlock as L, openBlock as C, normalizeStyle as W, normalizeClass as h, createCommentVNode as de, createElementVNode as T, createVNode as Co, mergeProps as H, createSlots as ho, withCtx as ce, Fragment as vo, renderList as Ro, createBlock as U, resolveDynamicComponent as bo, renderSlot as me } from "vue";
|
|
2
|
+
import { AG_GRID_LOCALE_EN as Mo, AG_GRID_LOCALE_CN as Bo } from "@ag-grid-community/locale";
|
|
3
|
+
import { Pagination as Fo } from "@aplus-frontend/antdv";
|
|
4
|
+
import { useToken as ko } from "@aplus-frontend/antdv/es/theme/internal";
|
|
5
|
+
import { ModuleRegistry as xo, ValidationModule as Io, ColumnAutoSizeModule as Ao, PinnedRowModule as To, RowAutoHeightModule as No, RowStyleModule as Do, CellSpanModule as Eo, CellStyleModule as Ko, TooltipModule as Oo, RowSelectionModule as Po, LocaleModule as Vo, ValueCacheModule as zo, GridStateModule as Go, ColumnApiModule as Lo, RowApiModule as Wo, CellApiModule as Ho, RenderApiModule as Uo, EventApiModule as _o, ScrollApiModule as jo, ClientSideRowModelApiModule as $o, ClientSideRowModelModule as qo } from "ag-grid-community";
|
|
6
|
+
import { AgGridVue as Jo } from "ag-grid-vue3";
|
|
7
|
+
import { isUndefined as F, isFunction as N } from "lodash-unified";
|
|
8
|
+
import { DEFAULT_ROW_SELECTION_CONFIG as pe, sizeReverseMap as Qo, sizeMap as Xo } from "../ap-grid/constants.mjs";
|
|
9
|
+
import { useProvideApTable as Yo } from "../ap-table/context.mjs";
|
|
10
|
+
import { useTablePaging as Zo } from "../ap-table/hooks/use-table-paging-ng.mjs";
|
|
11
|
+
import { recursionApColumns as et } 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 ot } from "../utils/retry.mjs";
|
|
15
|
+
import { getValidVNodeList as tt } from "../utils/slot.mjs";
|
|
16
|
+
import { ApForm as rt } 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 { mergeProps as
|
|
31
|
-
import { useNamespace as
|
|
32
|
-
import { useLocale as
|
|
33
|
-
import { useGlobalConfig as
|
|
34
|
-
import { isDef as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
const
|
|
20
|
+
import { useProvideSorter as lt } from "./context.mjs";
|
|
21
|
+
import { useColumns as at } from "./hooks/use-columns.mjs";
|
|
22
|
+
import { useColumnsDef as nt } from "./hooks/use-columns-def.mjs";
|
|
23
|
+
import { usePinnedRow as st } from "./hooks/use-pinned-row.mjs";
|
|
24
|
+
import it from "./hooks/use-row-selection.mjs";
|
|
25
|
+
import { useSearchForm as ut } from "./hooks/use-search-form.mjs";
|
|
26
|
+
import dt from "./hooks/use-selection-col-def.mjs";
|
|
27
|
+
import ct from "./hooks/use-virtual-config.mjs";
|
|
28
|
+
import mt from "./style/index.mjs";
|
|
29
|
+
import { useTheme as pt } from "./theme.mjs";
|
|
30
|
+
import { mergeProps as ft } from "./utils.mjs";
|
|
31
|
+
import { useNamespace as gt } from "../config-provider/hooks/use-namespace.mjs";
|
|
32
|
+
import { useLocale as St } from "../config-provider/hooks/use-locale.mjs";
|
|
33
|
+
import { useGlobalConfig as wt } from "../config-provider/hooks/use-global-config.mjs";
|
|
34
|
+
import { isDef as yt } from "../utils/is.mjs";
|
|
35
|
+
import Ct from "./components/row/index.vue2.mjs";
|
|
36
|
+
import ht from "./components/loading/index.vue2.mjs";
|
|
37
|
+
import vt from "./components/empty/index.vue2.mjs";
|
|
38
|
+
const ar = /* @__PURE__ */ wo({
|
|
39
39
|
name: "AgGrid",
|
|
40
40
|
__name: "index",
|
|
41
41
|
props: {
|
|
@@ -113,261 +113,292 @@ const or = /* @__PURE__ */ po({
|
|
|
113
113
|
emptyComponent: {},
|
|
114
114
|
emptyText: {}
|
|
115
115
|
},
|
|
116
|
-
setup(
|
|
117
|
-
const
|
|
118
|
-
"zh-cn":
|
|
119
|
-
en:
|
|
116
|
+
setup(fe, { expose: ge }) {
|
|
117
|
+
const Se = {
|
|
118
|
+
"zh-cn": Bo,
|
|
119
|
+
en: Mo
|
|
120
120
|
};
|
|
121
|
-
|
|
122
|
-
Fo,
|
|
123
|
-
Bo,
|
|
124
|
-
xo,
|
|
125
|
-
ko,
|
|
121
|
+
xo.registerModules([
|
|
126
122
|
Io,
|
|
127
123
|
Ao,
|
|
128
124
|
To,
|
|
129
125
|
No,
|
|
130
126
|
Do,
|
|
131
127
|
Eo,
|
|
132
|
-
Po,
|
|
133
128
|
Ko,
|
|
129
|
+
Oo,
|
|
130
|
+
Po,
|
|
134
131
|
Vo,
|
|
135
132
|
zo,
|
|
136
133
|
Go,
|
|
137
134
|
Lo,
|
|
138
|
-
Oo,
|
|
139
135
|
Wo,
|
|
140
136
|
Ho,
|
|
141
|
-
Uo
|
|
137
|
+
Uo,
|
|
138
|
+
_o,
|
|
139
|
+
jo,
|
|
140
|
+
$o,
|
|
141
|
+
qo
|
|
142
142
|
]);
|
|
143
|
-
const o =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
),
|
|
148
|
-
|
|
149
|
-
),
|
|
143
|
+
const o = fe, _ = yo(), { e: D, b: d, be: we } = gt("ag-grid"), { lang: j } = St(), ye = mt("ag-grid"), v = M(o.size), Ce = pt(
|
|
144
|
+
v,
|
|
145
|
+
B(o, "rowHeight"),
|
|
146
|
+
B(o, "theme")
|
|
147
|
+
), he = ct(B(o, "virtual")), { rowPinnedGridConfig: $, getRowPinnedCellClass: ve } = st(
|
|
148
|
+
B(o, "summary")
|
|
149
|
+
), Re = wt("apGrid"), s = M(), [, be] = ko();
|
|
150
150
|
let R = !!o.dataSource;
|
|
151
|
-
const
|
|
152
|
-
|
|
151
|
+
const q = ut(o), {
|
|
152
|
+
shownColumns: S,
|
|
153
|
+
columns: J,
|
|
154
|
+
columnKeys: Me,
|
|
155
|
+
getTargetColumnByKey: Be,
|
|
156
|
+
defaultSortOrder: k
|
|
157
|
+
} = at(o), { defaultColDef: Fe, columnDefs: ke, gridWrapperRef: xe } = nt(J, o, ve), Ie = {
|
|
158
|
+
asc: "ascend",
|
|
159
|
+
desc: "descend"
|
|
160
|
+
}, Q = {
|
|
161
|
+
ascend: "asc",
|
|
162
|
+
descend: "desc"
|
|
163
|
+
};
|
|
164
|
+
function Ae() {
|
|
165
|
+
const e = k.value;
|
|
166
|
+
return e ? {
|
|
167
|
+
[e.colKey]: Q[e.order]
|
|
168
|
+
} : {};
|
|
169
|
+
}
|
|
170
|
+
function Te() {
|
|
171
|
+
const e = X.value, t = k.value;
|
|
172
|
+
if (t && e.includes(t.field))
|
|
173
|
+
return t;
|
|
174
|
+
}
|
|
175
|
+
const x = M(Ae());
|
|
176
|
+
lt({
|
|
153
177
|
sorter: x,
|
|
154
178
|
setSorter(e) {
|
|
155
179
|
x.value = e;
|
|
156
180
|
}
|
|
157
181
|
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
desc: "descend"
|
|
161
|
-
};
|
|
162
|
-
function xe() {
|
|
163
|
-
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), r = t(x) || {};
|
|
182
|
+
function Ne() {
|
|
183
|
+
const e = s.value.getColumns()?.filter((c) => c.getSort() !== void 0), t = r(x) || {};
|
|
164
184
|
let l = e?.[0];
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
const c = Object.keys(
|
|
185
|
+
const u = Object.keys(t);
|
|
186
|
+
if (u.length && u.every((c) => t[c] === null)) {
|
|
187
|
+
const c = Object.keys(t)[0];
|
|
168
188
|
c && (l = s.value?.getColumn(c));
|
|
169
189
|
}
|
|
170
190
|
if (!l)
|
|
171
191
|
return;
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
column:
|
|
175
|
-
field:
|
|
176
|
-
order:
|
|
192
|
+
const i = l.getColDef(), f = l.getSort(), g = Be(i.colId);
|
|
193
|
+
Z(void 0, void 0, {
|
|
194
|
+
column: i,
|
|
195
|
+
field: g?.field ?? i.field ?? i.colId,
|
|
196
|
+
order: f ? Ie[f] : null
|
|
177
197
|
});
|
|
178
198
|
}
|
|
179
|
-
const
|
|
199
|
+
const X = n(() => et(r(S), (e) => {
|
|
180
200
|
if (e.sorter === !0)
|
|
181
201
|
return e.field ?? e.dataIndex ?? e.key;
|
|
182
|
-
}).filter(Boolean)),
|
|
202
|
+
}).filter(Boolean)), De = () => {
|
|
183
203
|
x.value = {};
|
|
184
204
|
const e = s.value;
|
|
185
205
|
if (!e)
|
|
186
206
|
return;
|
|
187
|
-
const
|
|
188
|
-
e.applyColumnState({ state:
|
|
189
|
-
},
|
|
207
|
+
const t = e.getColumnState()?.map((l) => ({ ...l, sort: null }));
|
|
208
|
+
e.applyColumnState({ state: t });
|
|
209
|
+
}, E = M(!0), Ee = n(() => yt(o.manual) ? o.manual : tt(_.searchFormExtra?.() || []).some((t) => t.type?.name === "ApView")), {
|
|
190
210
|
formRef: w,
|
|
191
|
-
submit:
|
|
192
|
-
reset:
|
|
211
|
+
submit: K,
|
|
212
|
+
reset: O,
|
|
193
213
|
data: m,
|
|
194
|
-
tableProps:
|
|
195
|
-
handleTableChangeOptional:
|
|
196
|
-
submitWith:
|
|
197
|
-
refresh:
|
|
198
|
-
getPaging:
|
|
199
|
-
setPaging:
|
|
200
|
-
setDataSource:
|
|
201
|
-
getLastParams:
|
|
202
|
-
} =
|
|
214
|
+
tableProps: Y,
|
|
215
|
+
handleTableChangeOptional: Z,
|
|
216
|
+
submitWith: ee,
|
|
217
|
+
refresh: oe,
|
|
218
|
+
getPaging: Ke,
|
|
219
|
+
setPaging: Oe,
|
|
220
|
+
setDataSource: Pe,
|
|
221
|
+
getLastParams: Ve
|
|
222
|
+
} = Zo({
|
|
203
223
|
async request(e) {
|
|
204
|
-
if (R = !1,
|
|
224
|
+
if (R = !1, y.value && !y.value.preserveSelectedRowKeys && F(o.dataSource) && !E.value && z(), E.value && (E.value = !1), !F(o.dataSource)) {
|
|
205
225
|
const l = e.pageSize * (e.current - 1);
|
|
206
226
|
return {
|
|
207
227
|
data: (o.pagination === !1 ? o.dataSource : o.dataSource.slice(l, l + e.pageSize)) || [],
|
|
208
228
|
total: o.dataSource.length || 0
|
|
209
229
|
};
|
|
210
230
|
}
|
|
211
|
-
const
|
|
231
|
+
const t = await o.request?.(e);
|
|
212
232
|
return {
|
|
213
|
-
data:
|
|
214
|
-
total:
|
|
233
|
+
data: t?.data || [],
|
|
234
|
+
total: t?.total || 0
|
|
215
235
|
};
|
|
216
236
|
},
|
|
217
237
|
namespace: "ap-grid",
|
|
218
238
|
filterFields: M([]),
|
|
219
|
-
params:
|
|
239
|
+
params: B(o, "params"),
|
|
220
240
|
defaultData: o.defaultData,
|
|
221
|
-
manual:
|
|
241
|
+
manual: r(Ee),
|
|
222
242
|
formatParams: o.beforeSearchSubmit,
|
|
223
243
|
pagination: o.pagination,
|
|
224
|
-
sortFields:
|
|
225
|
-
onClickReset:
|
|
226
|
-
|
|
227
|
-
|
|
244
|
+
sortFields: X,
|
|
245
|
+
onClickReset: De,
|
|
246
|
+
defaultSortOrder: Te()
|
|
247
|
+
}), y = n(() => {
|
|
248
|
+
const e = o.rowSelection || Re.value?.rowSelection;
|
|
228
249
|
if (e)
|
|
229
|
-
return e === !0 ?
|
|
230
|
-
...
|
|
250
|
+
return e === !0 ? pe : {
|
|
251
|
+
...pe,
|
|
231
252
|
...e
|
|
232
253
|
};
|
|
233
|
-
}),
|
|
234
|
-
() =>
|
|
254
|
+
}), ze = dt(o, S), Ge = n(
|
|
255
|
+
() => F(o.dataSource) ? m.records : o.dataSource
|
|
235
256
|
), {
|
|
236
|
-
select:
|
|
237
|
-
unSelect:
|
|
238
|
-
selectedRows:
|
|
239
|
-
selectedRowKeys:
|
|
240
|
-
clearAll:
|
|
241
|
-
selectMultiByKeys:
|
|
242
|
-
selectMulti:
|
|
243
|
-
unSelectMulti:
|
|
244
|
-
} =
|
|
245
|
-
...
|
|
246
|
-
dataSource:
|
|
257
|
+
select: Le,
|
|
258
|
+
unSelect: We,
|
|
259
|
+
selectedRows: P,
|
|
260
|
+
selectedRowKeys: He,
|
|
261
|
+
clearAll: Ue,
|
|
262
|
+
selectMultiByKeys: _e,
|
|
263
|
+
selectMulti: je,
|
|
264
|
+
unSelectMulti: $e
|
|
265
|
+
} = it({
|
|
266
|
+
...y.value,
|
|
267
|
+
dataSource: Ge,
|
|
247
268
|
rowKey: o.rowKey
|
|
248
|
-
}),
|
|
269
|
+
}), qe = {
|
|
249
270
|
checkbox: "multiRow",
|
|
250
271
|
radio: "singleRow"
|
|
251
|
-
},
|
|
252
|
-
const e =
|
|
272
|
+
}, Je = n(() => {
|
|
273
|
+
const e = y.value;
|
|
253
274
|
if (!e)
|
|
254
275
|
return;
|
|
255
|
-
const { type:
|
|
276
|
+
const { type: t = "checkbox", disabled: l } = e;
|
|
256
277
|
return {
|
|
257
|
-
mode:
|
|
258
|
-
isRowSelectable: (
|
|
278
|
+
mode: qe[t],
|
|
279
|
+
isRowSelectable: (u) => l ? !l(u.data) : !0,
|
|
259
280
|
hideDisabledCheckboxes: e.hideDisabled ?? !1
|
|
260
281
|
};
|
|
261
282
|
});
|
|
262
283
|
function V(e) {
|
|
263
|
-
return
|
|
284
|
+
return N(o.rowKey) ? o.rowKey(e) : e[o.rowKey];
|
|
264
285
|
}
|
|
265
|
-
const
|
|
286
|
+
const I = ({
|
|
266
287
|
api: e = s.value
|
|
267
288
|
}) => {
|
|
268
|
-
if (o.onUpdate?.(), !
|
|
289
|
+
if (o.onUpdate?.(), !y.value)
|
|
269
290
|
return;
|
|
270
|
-
const
|
|
291
|
+
const t = P.value || [];
|
|
271
292
|
R = !1;
|
|
272
293
|
const l = [];
|
|
273
|
-
e.forEachNode((
|
|
274
|
-
const
|
|
275
|
-
|
|
294
|
+
e.forEachNode((u) => {
|
|
295
|
+
const p = u.data, i = V(p), f = u.isSelected();
|
|
296
|
+
t.find((g) => V(g) === i) ? !f && l.push(u) : f && u.setSelected(!1);
|
|
276
297
|
}), e.setNodesSelected({ nodes: l, newValue: !0 }), setTimeout(() => {
|
|
277
298
|
R = !0;
|
|
278
299
|
}, 0);
|
|
279
|
-
},
|
|
280
|
-
R && (e.node.isSelected() ?
|
|
300
|
+
}, Qe = (e) => {
|
|
301
|
+
R && (e.node.isSelected() ? Le(e.data) : We(e.data), N(y.value?.tooltip) && e.api.refreshCells({
|
|
281
302
|
rowNodes: [e.node],
|
|
282
303
|
// todo: 取消硬编码
|
|
283
304
|
columns: ["ag-Grid-SelectionColumn"],
|
|
284
305
|
force: !0
|
|
285
306
|
}));
|
|
286
|
-
},
|
|
307
|
+
}, Xe = () => {
|
|
287
308
|
R = !0;
|
|
309
|
+
const e = s.value;
|
|
310
|
+
if (!e || !k.value)
|
|
311
|
+
return;
|
|
312
|
+
const t = e.getColumnState(), { colKey: l, order: u } = k.value, p = t.map((i) => ({
|
|
313
|
+
...i,
|
|
314
|
+
sort: i.colId === l ? Q[u] : null
|
|
315
|
+
}));
|
|
316
|
+
e.applyColumnState({
|
|
317
|
+
state: p
|
|
318
|
+
});
|
|
288
319
|
}, z = () => {
|
|
289
|
-
|
|
320
|
+
Ue(), s.value?.deselectAll();
|
|
290
321
|
};
|
|
291
|
-
function
|
|
292
|
-
|
|
293
|
-
|
|
322
|
+
function Ye(e) {
|
|
323
|
+
_e(e), A(() => {
|
|
324
|
+
I({});
|
|
294
325
|
});
|
|
295
326
|
}
|
|
296
|
-
const
|
|
327
|
+
const Ze = n(() => {
|
|
297
328
|
const e = o.customRow;
|
|
298
329
|
return e ? {
|
|
299
330
|
isFullWidthRow: e.isCustomRow,
|
|
300
|
-
fullWidthCellRenderer:
|
|
331
|
+
fullWidthCellRenderer: Ct,
|
|
301
332
|
fullWidthCellRendererParams: {
|
|
302
333
|
render: e.render
|
|
303
334
|
}
|
|
304
335
|
} : {};
|
|
305
336
|
});
|
|
306
|
-
function
|
|
307
|
-
|
|
308
|
-
|
|
337
|
+
function eo(e) {
|
|
338
|
+
je(e), A(() => {
|
|
339
|
+
I({});
|
|
309
340
|
});
|
|
310
341
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
342
|
+
function oo(e) {
|
|
343
|
+
$e(e), A(() => {
|
|
344
|
+
I({});
|
|
314
345
|
});
|
|
315
346
|
}
|
|
316
|
-
function
|
|
317
|
-
const
|
|
318
|
-
return w.value?.apForm?.[
|
|
347
|
+
function te(e = !1) {
|
|
348
|
+
const t = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
349
|
+
return w.value?.apForm?.[t]?.(!0);
|
|
319
350
|
}
|
|
320
|
-
function
|
|
351
|
+
function re(e) {
|
|
321
352
|
w.value?.apForm?.setFieldsValue?.(e);
|
|
322
353
|
}
|
|
323
|
-
function
|
|
354
|
+
function le() {
|
|
324
355
|
return w.value?.getSorterItems() || [];
|
|
325
356
|
}
|
|
326
|
-
function
|
|
357
|
+
function ae(e) {
|
|
327
358
|
w.value?.setSorterItems(e);
|
|
328
359
|
}
|
|
329
|
-
function
|
|
360
|
+
function ne() {
|
|
330
361
|
w.value?.resetSorterItems();
|
|
331
362
|
}
|
|
332
|
-
function
|
|
363
|
+
function se(e) {
|
|
333
364
|
return e && String(e);
|
|
334
365
|
}
|
|
335
|
-
function
|
|
336
|
-
const
|
|
337
|
-
if (!
|
|
366
|
+
function to(e) {
|
|
367
|
+
const t = s.value;
|
|
368
|
+
if (!t)
|
|
338
369
|
return;
|
|
339
|
-
const l =
|
|
340
|
-
if (!
|
|
370
|
+
const l = t.getColumnState() || [], u = e.map((a) => a.key ? String(a.key) : a.key).filter(Boolean), p = l.map((a) => {
|
|
371
|
+
if (!Me.value.includes(a.colId))
|
|
341
372
|
return a;
|
|
342
|
-
const b = !
|
|
373
|
+
const b = !u.includes(a.colId), ie = {
|
|
343
374
|
...a,
|
|
344
375
|
hide: b
|
|
345
|
-
},
|
|
346
|
-
(
|
|
376
|
+
}, ue = e.find(
|
|
377
|
+
(So) => se(So.key) === a.colId
|
|
347
378
|
);
|
|
348
|
-
return
|
|
349
|
-
}),
|
|
350
|
-
e.map((a, b) => [
|
|
351
|
-
),
|
|
352
|
-
(a, b) =>
|
|
353
|
-
),
|
|
379
|
+
return ue && (ie.pinned = ue.fixed || null), ie;
|
|
380
|
+
}), i = new Map(
|
|
381
|
+
e.map((a, b) => [se(a.key), b])
|
|
382
|
+
), f = p.filter((a) => i.has(a.colId)).sort(
|
|
383
|
+
(a, b) => i.get(a.colId) - i.get(b.colId)
|
|
384
|
+
), g = [];
|
|
354
385
|
let c = 0;
|
|
355
|
-
for (const a of
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
state:
|
|
386
|
+
for (const a of p)
|
|
387
|
+
i.has(a.colId) ? g.push(f[c++]) : g.push(a);
|
|
388
|
+
t.applyColumnState({
|
|
389
|
+
state: g,
|
|
359
390
|
applyOrder: !0
|
|
360
391
|
});
|
|
361
392
|
}
|
|
362
|
-
|
|
363
|
-
columns: n(() =>
|
|
364
|
-
columnsBackup: n(() =>
|
|
365
|
-
size: n(() =>
|
|
393
|
+
Yo({
|
|
394
|
+
columns: n(() => S.value),
|
|
395
|
+
columnsBackup: n(() => J.value),
|
|
396
|
+
size: n(() => Xo[v.value]),
|
|
366
397
|
updateColumns(e) {
|
|
367
|
-
|
|
398
|
+
S.value = e, o.onShownColumnsChange?.(e), ot(
|
|
368
399
|
() => s.value,
|
|
369
400
|
() => {
|
|
370
|
-
|
|
401
|
+
to(e);
|
|
371
402
|
},
|
|
372
403
|
{
|
|
373
404
|
interval: 17
|
|
@@ -375,217 +406,217 @@ const or = /* @__PURE__ */ po({
|
|
|
375
406
|
);
|
|
376
407
|
},
|
|
377
408
|
updateSize(e) {
|
|
378
|
-
|
|
409
|
+
v.value = Qo[e];
|
|
379
410
|
},
|
|
380
411
|
renderConfig: n(() => ({
|
|
381
|
-
className:
|
|
382
|
-
color:
|
|
412
|
+
className: we("table-header", "title"),
|
|
413
|
+
color: be.value.colorTextTertiary
|
|
383
414
|
})),
|
|
384
|
-
dataSource: n(() =>
|
|
385
|
-
getSearchFormValues:
|
|
386
|
-
setSearchFormValues:
|
|
387
|
-
submit:
|
|
388
|
-
submitWith:
|
|
389
|
-
reset:
|
|
390
|
-
refresh:
|
|
391
|
-
getSearchFormSorterItems:
|
|
392
|
-
setSearchFormSorterItems:
|
|
393
|
-
resetSearchFormSorterItems:
|
|
394
|
-
getLastParams:
|
|
415
|
+
dataSource: n(() => r(m).records),
|
|
416
|
+
getSearchFormValues: te,
|
|
417
|
+
setSearchFormValues: re,
|
|
418
|
+
submit: K,
|
|
419
|
+
submitWith: ee,
|
|
420
|
+
reset: O,
|
|
421
|
+
refresh: oe,
|
|
422
|
+
getSearchFormSorterItems: le,
|
|
423
|
+
setSearchFormSorterItems: ae,
|
|
424
|
+
resetSearchFormSorterItems: ne,
|
|
425
|
+
getLastParams: Ve
|
|
395
426
|
});
|
|
396
|
-
const
|
|
397
|
-
() =>
|
|
398
|
-
),
|
|
427
|
+
const ro = n(
|
|
428
|
+
() => F(o.loading) ? m.loading : o.loading
|
|
429
|
+
), lo = n(() => [
|
|
399
430
|
d(),
|
|
400
431
|
o.card ? null : d("wrapper"),
|
|
401
432
|
d("adaptive"),
|
|
402
|
-
d(`size-${
|
|
433
|
+
d(`size-${v.value}`),
|
|
403
434
|
o.autoHeight && m.records.length ? d("auto-height") : null,
|
|
404
|
-
|
|
405
|
-
].filter(Boolean)),
|
|
435
|
+
ye.value
|
|
436
|
+
].filter(Boolean)), ao = n(() => ({
|
|
406
437
|
height: "100%",
|
|
407
438
|
...o.tableStyle || {}
|
|
408
|
-
})),
|
|
409
|
-
|
|
439
|
+
})), no = (e, t) => {
|
|
440
|
+
Z({ current: e, pageSize: t });
|
|
410
441
|
};
|
|
411
|
-
function
|
|
412
|
-
const
|
|
413
|
-
return V(
|
|
442
|
+
function so(e) {
|
|
443
|
+
const t = e.data;
|
|
444
|
+
return V(t);
|
|
414
445
|
}
|
|
415
|
-
function
|
|
416
|
-
(
|
|
446
|
+
function io(e, t) {
|
|
447
|
+
(N(e) ? s.value?.ensureNodeVisible : s.value?.ensureIndexVisible)?.(e, t);
|
|
417
448
|
}
|
|
418
|
-
function
|
|
419
|
-
s.value?.ensureColumnVisible(e,
|
|
449
|
+
function uo(e, t) {
|
|
450
|
+
s.value?.ensureColumnVisible(e, t);
|
|
420
451
|
}
|
|
421
|
-
function
|
|
452
|
+
function co(e) {
|
|
422
453
|
o.onRowClicked?.(e.data, e.event);
|
|
423
454
|
}
|
|
424
|
-
function
|
|
455
|
+
function mo(e) {
|
|
425
456
|
o.onScrollEnd?.(e.direction);
|
|
426
457
|
}
|
|
427
|
-
function
|
|
458
|
+
function po(e) {
|
|
428
459
|
return s.value?.refreshCells(e);
|
|
429
460
|
}
|
|
430
|
-
function
|
|
461
|
+
function fo(e) {
|
|
431
462
|
return s.value?.redrawRows(e);
|
|
432
463
|
}
|
|
433
|
-
const
|
|
434
|
-
const
|
|
435
|
-
|
|
464
|
+
const go = (e) => {
|
|
465
|
+
const t = [
|
|
466
|
+
$.value.getRowClass?.(e)
|
|
436
467
|
];
|
|
437
468
|
if (!e.node.rowPinned) {
|
|
438
|
-
const l =
|
|
439
|
-
|
|
469
|
+
const l = N(o.rowClassName) ? o.rowClassName(e.data, e.rowIndex) : o.rowClassName;
|
|
470
|
+
t.push(l);
|
|
440
471
|
}
|
|
441
|
-
return
|
|
472
|
+
return t.flat().filter(Boolean);
|
|
442
473
|
};
|
|
443
474
|
return G(
|
|
444
475
|
() => o.dataSource,
|
|
445
476
|
(e) => {
|
|
446
|
-
|
|
447
|
-
|
|
477
|
+
A(() => {
|
|
478
|
+
Pe(e);
|
|
448
479
|
});
|
|
449
480
|
},
|
|
450
481
|
{ immediate: !0, deep: !0 }
|
|
451
482
|
), G(
|
|
452
483
|
() => o.size,
|
|
453
484
|
(e) => {
|
|
454
|
-
|
|
485
|
+
v.value = e;
|
|
455
486
|
}
|
|
456
487
|
), G(
|
|
457
|
-
() =>
|
|
488
|
+
() => r(m).loading,
|
|
458
489
|
(e) => {
|
|
459
490
|
o.onLoadingChange?.(e);
|
|
460
491
|
}
|
|
461
|
-
),
|
|
462
|
-
submit:
|
|
463
|
-
reset:
|
|
464
|
-
refresh:
|
|
465
|
-
submitWith:
|
|
466
|
-
setSearchFormValues:
|
|
467
|
-
getSearchFormValues:
|
|
468
|
-
getShowColumns: () =>
|
|
492
|
+
), ge({
|
|
493
|
+
submit: K,
|
|
494
|
+
reset: O,
|
|
495
|
+
refresh: oe,
|
|
496
|
+
submitWith: ee,
|
|
497
|
+
setSearchFormValues: re,
|
|
498
|
+
getSearchFormValues: te,
|
|
499
|
+
getShowColumns: () => r(S),
|
|
469
500
|
rowSelection: {
|
|
470
|
-
selectedRows: n(() =>
|
|
471
|
-
setSelectedRowKeys:
|
|
472
|
-
setSelectedRows:
|
|
501
|
+
selectedRows: n(() => P.value),
|
|
502
|
+
setSelectedRowKeys: Ye,
|
|
503
|
+
setSelectedRows: eo,
|
|
473
504
|
clearAll: z,
|
|
474
|
-
unSelectRows:
|
|
505
|
+
unSelectRows: oo
|
|
475
506
|
},
|
|
476
|
-
scrollToRow:
|
|
477
|
-
scrollToColumn:
|
|
478
|
-
getDataSource: () =>
|
|
479
|
-
getPaging:
|
|
480
|
-
setPaging:
|
|
481
|
-
getSearchFormSorterItems:
|
|
482
|
-
setSearchFormSorterItems:
|
|
483
|
-
resetSearchFormSorterItems:
|
|
484
|
-
refreshCells:
|
|
485
|
-
redrawRows:
|
|
507
|
+
scrollToRow: io,
|
|
508
|
+
scrollToColumn: uo,
|
|
509
|
+
getDataSource: () => r(m.records),
|
|
510
|
+
getPaging: Ke,
|
|
511
|
+
setPaging: Oe,
|
|
512
|
+
getSearchFormSorterItems: le,
|
|
513
|
+
setSearchFormSorterItems: ae,
|
|
514
|
+
resetSearchFormSorterItems: ne,
|
|
515
|
+
refreshCells: po,
|
|
516
|
+
redrawRows: fo,
|
|
486
517
|
_internalGridApi: n(() => s.value)
|
|
487
|
-
}), (e,
|
|
488
|
-
class:
|
|
489
|
-
style:
|
|
518
|
+
}), (e, t) => (C(), L("div", {
|
|
519
|
+
class: h(lo.value),
|
|
520
|
+
style: W(e.wrapperStyle)
|
|
490
521
|
}, [
|
|
491
|
-
|
|
522
|
+
r(F)(e.dataSource) && e.searchForm !== !1 && r(q).length > 0 ? (C(), L("div", {
|
|
492
523
|
key: 0,
|
|
493
|
-
class:
|
|
494
|
-
style:
|
|
524
|
+
class: h(e.card ? r(D)("search-wrapper") : null),
|
|
525
|
+
style: W(e.searchFormWrapperStyle)
|
|
495
526
|
}, [
|
|
496
|
-
|
|
527
|
+
Co(r(rt).SearchForm, H(e.searchForm || {}, {
|
|
497
528
|
ref_key: "formRef",
|
|
498
529
|
ref: w,
|
|
499
530
|
"custom-reset": "",
|
|
500
|
-
"submit-loading":
|
|
501
|
-
onSubmit:
|
|
502
|
-
onReset:
|
|
503
|
-
}),
|
|
504
|
-
default:
|
|
505
|
-
(
|
|
531
|
+
"submit-loading": r(Y).loading,
|
|
532
|
+
onSubmit: r(K),
|
|
533
|
+
onReset: r(O)
|
|
534
|
+
}), ho({
|
|
535
|
+
default: ce(() => [
|
|
536
|
+
(C(!0), L(vo, null, Ro(r(q), (l) => (C(), U(bo(l.renderNode), {
|
|
506
537
|
key: l.dataIndex
|
|
507
538
|
}))), 128))
|
|
508
539
|
]),
|
|
509
540
|
_: 2
|
|
510
541
|
}, [
|
|
511
|
-
|
|
542
|
+
_.searchFormExtra ? {
|
|
512
543
|
name: "extra",
|
|
513
|
-
fn:
|
|
514
|
-
|
|
544
|
+
fn: ce(() => [
|
|
545
|
+
me(e.$slots, "searchFormExtra")
|
|
515
546
|
]),
|
|
516
547
|
key: "0"
|
|
517
548
|
} : void 0
|
|
518
549
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
519
|
-
], 6)) :
|
|
520
|
-
|
|
521
|
-
class:
|
|
522
|
-
style:
|
|
550
|
+
], 6)) : de("", !0),
|
|
551
|
+
T("div", {
|
|
552
|
+
class: h([r(D)("table-wrapper"), e.card ? r(D)("table-wrapper-card") : null]),
|
|
553
|
+
style: W(e.tableWrapperStyle)
|
|
523
554
|
}, [
|
|
524
|
-
|
|
525
|
-
class:
|
|
555
|
+
T("div", {
|
|
556
|
+
class: h(r(d)("header-wrapper"))
|
|
526
557
|
}, [
|
|
527
|
-
|
|
528
|
-
selectedRows:
|
|
529
|
-
selectedRowKeys:
|
|
530
|
-
shownColumns:
|
|
558
|
+
me(e.$slots, "title", {
|
|
559
|
+
selectedRows: r(P),
|
|
560
|
+
selectedRowKeys: r(He),
|
|
561
|
+
shownColumns: r(S),
|
|
531
562
|
clearAll: z
|
|
532
563
|
})
|
|
533
564
|
], 2),
|
|
534
|
-
|
|
565
|
+
T("div", {
|
|
535
566
|
ref_key: "gridWrapperRef",
|
|
536
|
-
ref:
|
|
537
|
-
class:
|
|
567
|
+
ref: xe,
|
|
568
|
+
class: h(r(d)("grid-wrapper"))
|
|
538
569
|
}, [
|
|
539
|
-
(
|
|
540
|
-
|
|
570
|
+
(C(), U(r(Jo), H(
|
|
571
|
+
r(ft)(r(he), r($), Ze.value),
|
|
541
572
|
{
|
|
542
|
-
key:
|
|
543
|
-
"get-row-class":
|
|
544
|
-
style:
|
|
545
|
-
"row-data":
|
|
546
|
-
"column-defs":
|
|
547
|
-
"default-col-def":
|
|
573
|
+
key: r(j),
|
|
574
|
+
"get-row-class": go,
|
|
575
|
+
style: ao.value,
|
|
576
|
+
"row-data": r(m).records,
|
|
577
|
+
"column-defs": r(ke),
|
|
578
|
+
"default-col-def": r(Fe),
|
|
548
579
|
"suppress-loading-overlay": "",
|
|
549
|
-
"row-selection":
|
|
550
|
-
"selection-column-def":
|
|
551
|
-
"get-row-id":
|
|
580
|
+
"row-selection": Je.value,
|
|
581
|
+
"selection-column-def": r(ze),
|
|
582
|
+
"get-row-id": so,
|
|
552
583
|
"get-row-height": o.getRowHeight,
|
|
553
|
-
theme:
|
|
584
|
+
theme: r(Ce),
|
|
554
585
|
"tooltip-show-delay": 500,
|
|
555
586
|
"enable-browser-tooltips": e.browserTooltips,
|
|
556
587
|
"tooltip-interaction": "",
|
|
557
588
|
"row-class-rules": e.rowClassRules,
|
|
558
|
-
"no-rows-overlay-component":
|
|
589
|
+
"no-rows-overlay-component": vt,
|
|
559
590
|
"no-rows-overlay-component-params": { emptyComponent: e.emptyComponent, emptyText: e.emptyText },
|
|
560
|
-
"loading-overlay-component":
|
|
561
|
-
loading:
|
|
591
|
+
"loading-overlay-component": ht,
|
|
592
|
+
loading: ro.value,
|
|
562
593
|
"suppress-cell-focus": "",
|
|
563
594
|
"tab-to-next-cell": () => !1,
|
|
564
595
|
"enable-cell-span": "",
|
|
565
596
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
566
|
-
"locale-text":
|
|
567
|
-
onSortChanged:
|
|
568
|
-
onGridReady:
|
|
569
|
-
onRowDataUpdated:
|
|
570
|
-
onRowSelected:
|
|
571
|
-
onFirstDataRendered:
|
|
572
|
-
onRowClicked:
|
|
573
|
-
onBodyScrollEnd:
|
|
597
|
+
"locale-text": Se[r(j)],
|
|
598
|
+
onSortChanged: Ne,
|
|
599
|
+
onGridReady: t[0] || (t[0] = (l) => s.value = l.api),
|
|
600
|
+
onRowDataUpdated: I,
|
|
601
|
+
onRowSelected: Qe,
|
|
602
|
+
onFirstDataRendered: Xe,
|
|
603
|
+
onRowClicked: co,
|
|
604
|
+
onBodyScrollEnd: mo
|
|
574
605
|
}
|
|
575
606
|
), 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", "no-rows-overlay-component-params", "loading", "dom-layout", "locale-text"]))
|
|
576
607
|
], 2),
|
|
577
|
-
|
|
578
|
-
class:
|
|
608
|
+
T("div", {
|
|
609
|
+
class: h(r(d)("pagination-wrapper"))
|
|
579
610
|
}, [
|
|
580
|
-
e.pagination !== !1 ? (
|
|
611
|
+
e.pagination !== !1 ? (C(), U(r(Fo), H({
|
|
581
612
|
key: 0,
|
|
582
|
-
class:
|
|
583
|
-
},
|
|
613
|
+
class: r(d)("pagination")
|
|
614
|
+
}, r(Y).pagination, { onChange: no }), null, 16, ["class"])) : de("", !0)
|
|
584
615
|
], 2)
|
|
585
616
|
], 6)
|
|
586
617
|
], 6));
|
|
587
618
|
}
|
|
588
619
|
});
|
|
589
620
|
export {
|
|
590
|
-
|
|
621
|
+
ar as default
|
|
591
622
|
};
|