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