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