@aplus-frontend/ui 7.20.3 → 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/index.vue.mjs +106 -106
- 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/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/index.vue.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/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 n, nextTick as A, watch as W, createElementBlock as U, openBlock as y, normalizeStyle as _, normalizeClass 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
2
|
import { AG_GRID_LOCALE_EN as Eo, AG_GRID_LOCALE_CN as Do } from "@ag-grid-community/locale";
|
|
3
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
6
|
import { AgGridVue as nt } from "ag-grid-vue3";
|
|
7
7
|
import { isUndefined as x, isFunction as E, omit as rt } from "lodash-unified";
|
|
8
|
-
import { DEFAULT_ROW_SELECTION_CONFIG as
|
|
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";
|
|
@@ -117,8 +117,8 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
117
117
|
animateRows: { type: Boolean, default: !0 },
|
|
118
118
|
plugins: { default: () => [] }
|
|
119
119
|
},
|
|
120
|
-
setup(
|
|
121
|
-
const
|
|
120
|
+
setup(he, { expose: ye }) {
|
|
121
|
+
const ve = {
|
|
122
122
|
"zh-cn": Do,
|
|
123
123
|
en: Eo
|
|
124
124
|
};
|
|
@@ -144,13 +144,13 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
144
144
|
ot,
|
|
145
145
|
tt
|
|
146
146
|
]);
|
|
147
|
-
const t =
|
|
148
|
-
|
|
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
149
|
k(t, "rowHeight"),
|
|
150
150
|
k(t, "theme")
|
|
151
|
-
),
|
|
151
|
+
), ke = vt(k(t, "virtual")), { rowPinnedGridConfig: Q, getRowPinnedCellClass: xe } = St(
|
|
152
152
|
k(t, "summary")
|
|
153
|
-
),
|
|
153
|
+
), X = Bt("agGrid"), s = h(), [, Fe] = zo();
|
|
154
154
|
let b = !!t.dataSource;
|
|
155
155
|
async function z(e, o = {}) {
|
|
156
156
|
const r = await Mt(
|
|
@@ -160,32 +160,32 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
160
160
|
);
|
|
161
161
|
s.value.applyColumnState({ state: r, ...o });
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const Y = ht(t), {
|
|
164
164
|
shownColumns: p,
|
|
165
|
-
columns:
|
|
165
|
+
columns: Z,
|
|
166
166
|
columnKeys: Be,
|
|
167
167
|
getTargetColumnByKey: Ie,
|
|
168
168
|
defaultSortOrder: F
|
|
169
|
-
} = gt(t), { defaultColDef: Ae, columnDefs:
|
|
170
|
-
|
|
169
|
+
} = gt(t), { defaultColDef: Ae, columnDefs: ee, gridWrapperRef: Te } = wt(
|
|
170
|
+
Z,
|
|
171
171
|
t,
|
|
172
|
-
|
|
172
|
+
xe,
|
|
173
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
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
187
|
function Ne() {
|
|
188
|
-
const e =
|
|
188
|
+
const e = te.value, o = F.value;
|
|
189
189
|
if (o && e.includes(o.field))
|
|
190
190
|
return o;
|
|
191
191
|
}
|
|
@@ -206,16 +206,16 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
206
206
|
}
|
|
207
207
|
if (!r)
|
|
208
208
|
return;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
column:
|
|
212
|
-
field: w?.field ??
|
|
209
|
+
const d = r.getColDef(), g = r.getSort(), w = Ie(d.colId);
|
|
210
|
+
re(void 0, void 0, {
|
|
211
|
+
column: d,
|
|
212
|
+
field: w?.field ?? d.field ?? d.colId,
|
|
213
213
|
order: g ? Ee[g] : null
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const te = i(() => {
|
|
217
217
|
const e = n(p).length ? n(p) : t.columns;
|
|
218
|
-
return
|
|
218
|
+
return dt(e, (o) => {
|
|
219
219
|
if (o.sorter === !0)
|
|
220
220
|
return o.field ?? o.dataIndex ?? o.key;
|
|
221
221
|
}).filter(Boolean);
|
|
@@ -240,10 +240,10 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
240
240
|
submit: V,
|
|
241
241
|
reset: K,
|
|
242
242
|
data: f,
|
|
243
|
-
tableProps:
|
|
244
|
-
handleTableChangeOptional:
|
|
245
|
-
submitWith:
|
|
246
|
-
refresh:
|
|
243
|
+
tableProps: ne,
|
|
244
|
+
handleTableChangeOptional: re,
|
|
245
|
+
submitWith: le,
|
|
246
|
+
refresh: ae,
|
|
247
247
|
getPaging: Ke,
|
|
248
248
|
setPaging: Ge,
|
|
249
249
|
setDataSource: Le,
|
|
@@ -270,14 +270,14 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
270
270
|
manual: n(Ve),
|
|
271
271
|
formatParams: t.beforeSearchSubmit,
|
|
272
272
|
pagination: t.pagination,
|
|
273
|
-
sortFields:
|
|
273
|
+
sortFields: te,
|
|
274
274
|
onClickReset: Pe,
|
|
275
275
|
defaultSortOrder: Ne()
|
|
276
276
|
}), C = i(() => {
|
|
277
|
-
const e = t.rowSelection ||
|
|
277
|
+
const e = t.rowSelection || X.value?.rowSelection;
|
|
278
278
|
if (e)
|
|
279
|
-
return e === !0 ?
|
|
280
|
-
...
|
|
279
|
+
return e === !0 ? Ce : {
|
|
280
|
+
...Ce,
|
|
281
281
|
...e
|
|
282
282
|
};
|
|
283
283
|
}), We = yt(t, p), Ue = i(
|
|
@@ -321,8 +321,8 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
321
321
|
b = !1;
|
|
322
322
|
const r = [];
|
|
323
323
|
e.forEachNode((l) => {
|
|
324
|
-
const
|
|
325
|
-
o.find((w) => L(w) ===
|
|
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
326
|
}), e.setNodesSelected({ nodes: r, newValue: !0 }), setTimeout(() => {
|
|
327
327
|
b = !0;
|
|
328
328
|
}, 0);
|
|
@@ -338,11 +338,11 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
338
338
|
const e = s.value;
|
|
339
339
|
if (!e || !F.value)
|
|
340
340
|
return;
|
|
341
|
-
const o = e.getColumnState(), { colKey: r, order: l } = F.value,
|
|
342
|
-
...
|
|
343
|
-
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
|
|
344
344
|
}));
|
|
345
|
-
z(
|
|
345
|
+
z(u);
|
|
346
346
|
}, H = () => {
|
|
347
347
|
qe(), s.value?.deselectAll();
|
|
348
348
|
};
|
|
@@ -371,55 +371,55 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
371
371
|
I({});
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function se(e = !1) {
|
|
375
375
|
const o = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
376
376
|
return S.value?.apForm?.[o]?.(!0);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function ie(e) {
|
|
379
379
|
S.value?.apForm?.setFieldsValue?.(e);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function de() {
|
|
382
382
|
return S.value?.getSorterItems() || [];
|
|
383
383
|
}
|
|
384
384
|
function ue(e) {
|
|
385
385
|
S.value?.setSorterItems(e);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ce() {
|
|
388
388
|
S.value?.resetSorterItems();
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function me(e) {
|
|
391
391
|
return e && String(e);
|
|
392
392
|
}
|
|
393
393
|
function ao(e) {
|
|
394
394
|
const o = s.value;
|
|
395
395
|
if (!o)
|
|
396
396
|
return;
|
|
397
|
-
const r = o.getColumnState() || [], l = e.map((a) => a.key ? String(a.key) : a.key).filter(Boolean),
|
|
397
|
+
const r = o.getColumnState() || [], l = e.map((a) => a.key ? String(a.key) : a.key).filter(Boolean), u = r.map((a) => {
|
|
398
398
|
if (!Be.value.includes(a.colId))
|
|
399
399
|
return a;
|
|
400
|
-
const M = !l.includes(a.colId),
|
|
400
|
+
const M = !l.includes(a.colId), pe = {
|
|
401
401
|
...a,
|
|
402
402
|
hide: M
|
|
403
|
-
},
|
|
404
|
-
(Mo) =>
|
|
403
|
+
}, fe = e.find(
|
|
404
|
+
(Mo) => me(Mo.key) === a.colId
|
|
405
405
|
);
|
|
406
|
-
return
|
|
407
|
-
}),
|
|
408
|
-
e.map((a, M) => [
|
|
409
|
-
), g =
|
|
410
|
-
(a, M) =>
|
|
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
411
|
), w = [];
|
|
412
412
|
let m = 0;
|
|
413
|
-
for (const a of
|
|
414
|
-
|
|
413
|
+
for (const a of u)
|
|
414
|
+
d.has(a.colId) ? w.push(g[m++]) : w.push(a);
|
|
415
415
|
z(w, { applyOrder: !0 });
|
|
416
416
|
}
|
|
417
417
|
st({
|
|
418
418
|
columns: i(() => p.value),
|
|
419
|
-
columnsBackup: i(() =>
|
|
420
|
-
size: i(() => at[
|
|
419
|
+
columnsBackup: i(() => Z.value),
|
|
420
|
+
size: i(() => at[R.value]),
|
|
421
421
|
updateColumns(e) {
|
|
422
|
-
p.value = e, t.onShownColumnsChange?.(e),
|
|
422
|
+
p.value = e, t.onShownColumnsChange?.(e), ut(
|
|
423
423
|
() => s.value?.getAllDisplayedColumns(),
|
|
424
424
|
() => {
|
|
425
425
|
ao(e);
|
|
@@ -431,36 +431,36 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
431
431
|
);
|
|
432
432
|
},
|
|
433
433
|
updateSize(e) {
|
|
434
|
-
|
|
434
|
+
R.value = lt[e];
|
|
435
435
|
},
|
|
436
436
|
renderConfig: i(() => ({
|
|
437
437
|
className: Re("table-header", "title"),
|
|
438
438
|
color: Fe.value.colorTextTertiary
|
|
439
439
|
})),
|
|
440
440
|
dataSource: i(() => n(f).records),
|
|
441
|
-
getSearchFormValues:
|
|
442
|
-
setSearchFormValues:
|
|
441
|
+
getSearchFormValues: se,
|
|
442
|
+
setSearchFormValues: ie,
|
|
443
443
|
submit: V,
|
|
444
|
-
submitWith:
|
|
444
|
+
submitWith: le,
|
|
445
445
|
reset: K,
|
|
446
|
-
refresh:
|
|
447
|
-
getSearchFormSorterItems:
|
|
446
|
+
refresh: ae,
|
|
447
|
+
getSearchFormSorterItems: de,
|
|
448
448
|
setSearchFormSorterItems: ue,
|
|
449
|
-
resetSearchFormSorterItems:
|
|
449
|
+
resetSearchFormSorterItems: ce,
|
|
450
450
|
getLastParams: He
|
|
451
451
|
});
|
|
452
|
-
const so = i(() => (x(t.loading) ? f.loading : t.loading) ||
|
|
452
|
+
const so = i(() => (x(t.loading) ? f.loading : t.loading) || ee.value.length === 0), io = i(() => [
|
|
453
453
|
c(),
|
|
454
454
|
t.card ? null : c("wrapper"),
|
|
455
455
|
c("adaptive"),
|
|
456
|
-
c(`size-${
|
|
456
|
+
c(`size-${R.value}`),
|
|
457
457
|
t.autoHeight && f.records.length ? c("auto-height") : null,
|
|
458
|
-
|
|
458
|
+
be.value
|
|
459
459
|
].filter(Boolean)), uo = i(() => ({
|
|
460
460
|
height: "100%",
|
|
461
461
|
...t.tableStyle || {}
|
|
462
462
|
})), co = (e, o) => {
|
|
463
|
-
|
|
463
|
+
re({ current: e, pageSize: o });
|
|
464
464
|
};
|
|
465
465
|
function mo(e) {
|
|
466
466
|
const o = e.data;
|
|
@@ -491,11 +491,11 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
491
491
|
}) {
|
|
492
492
|
if (!e || r !== "uiColumnResized")
|
|
493
493
|
return;
|
|
494
|
-
const l = (o || []).map((
|
|
495
|
-
key:
|
|
496
|
-
width:
|
|
494
|
+
const l = (o || []).map((u) => ({
|
|
495
|
+
key: u.getColId(),
|
|
496
|
+
width: u.getActualWidth()
|
|
497
497
|
}));
|
|
498
|
-
q(t.plugins, (
|
|
498
|
+
q(t.plugins, (u) => u.onColumnResized?.bind(u), l), t.onColumnResized?.(l);
|
|
499
499
|
}
|
|
500
500
|
const yo = (e) => {
|
|
501
501
|
const o = [
|
|
@@ -506,10 +506,10 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
506
506
|
o.push(r);
|
|
507
507
|
}
|
|
508
508
|
return o.flat().filter(Boolean);
|
|
509
|
-
}, Ro = ({ api: e }) => {
|
|
510
|
-
s.value = e, q(t.plugins, (o) => o.init?.bind(o), e);
|
|
511
509
|
}, vo = ({ api: e }) => {
|
|
512
|
-
t.
|
|
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
513
|
}, bo = (e, o, r) => {
|
|
514
514
|
q(
|
|
515
515
|
t.plugins,
|
|
@@ -528,20 +528,20 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
528
528
|
), W(
|
|
529
529
|
() => t.size,
|
|
530
530
|
(e) => {
|
|
531
|
-
|
|
531
|
+
R.value = e;
|
|
532
532
|
}
|
|
533
533
|
), W(
|
|
534
534
|
() => n(f).loading,
|
|
535
535
|
(e) => {
|
|
536
536
|
t.onLoadingChange?.(e);
|
|
537
537
|
}
|
|
538
|
-
),
|
|
538
|
+
), ye({
|
|
539
539
|
submit: V,
|
|
540
540
|
reset: K,
|
|
541
|
-
refresh:
|
|
542
|
-
submitWith:
|
|
543
|
-
setSearchFormValues:
|
|
544
|
-
getSearchFormValues:
|
|
541
|
+
refresh: ae,
|
|
542
|
+
submitWith: le,
|
|
543
|
+
setSearchFormValues: ie,
|
|
544
|
+
getSearchFormValues: se,
|
|
545
545
|
getShowColumns: () => n(p),
|
|
546
546
|
rowSelection: {
|
|
547
547
|
selectedRows: i(() => G.value),
|
|
@@ -555,32 +555,32 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
555
555
|
getDataSource: () => n(f.records),
|
|
556
556
|
getPaging: Ke,
|
|
557
557
|
setPaging: Ge,
|
|
558
|
-
getSearchFormSorterItems:
|
|
558
|
+
getSearchFormSorterItems: de,
|
|
559
559
|
setSearchFormSorterItems: ue,
|
|
560
|
-
resetSearchFormSorterItems:
|
|
560
|
+
resetSearchFormSorterItems: ce,
|
|
561
561
|
refreshCells: So,
|
|
562
562
|
redrawRows: Co,
|
|
563
563
|
_internalGridApi: i(() => s.value)
|
|
564
564
|
}), (e, o) => (y(), U("div", {
|
|
565
|
-
class:
|
|
565
|
+
class: v(io.value),
|
|
566
566
|
style: _(e.wrapperStyle)
|
|
567
567
|
}, [
|
|
568
|
-
n(x)(e.dataSource) && e.searchForm !== !1 && n(
|
|
568
|
+
n(x)(e.dataSource) && e.searchForm !== !1 && n(Y).length > 0 ? (y(), U("div", {
|
|
569
569
|
key: 0,
|
|
570
|
-
class:
|
|
570
|
+
class: v(e.card ? n(N)("search-wrapper") : null),
|
|
571
571
|
style: _(e.searchFormWrapperStyle)
|
|
572
572
|
}, [
|
|
573
573
|
Fo(n(mt).SearchForm, j(n(rt)(e.searchForm || {}, ["onValuesChange"]), {
|
|
574
574
|
ref_key: "formRef",
|
|
575
575
|
ref: S,
|
|
576
576
|
"custom-reset": "",
|
|
577
|
-
"submit-loading": n(
|
|
577
|
+
"submit-loading": n(ne).loading,
|
|
578
578
|
onSubmit: n(V),
|
|
579
579
|
onReset: n(K),
|
|
580
580
|
onValuesChange: bo
|
|
581
581
|
}), Bo({
|
|
582
|
-
default:
|
|
583
|
-
(y(!0), U(Io, null, Ao(n(
|
|
582
|
+
default: we(() => [
|
|
583
|
+
(y(!0), U(Io, null, Ao(n(Y), (r) => (y(), $(To(r.renderNode), {
|
|
584
584
|
key: r.dataIndex
|
|
585
585
|
}))), 128))
|
|
586
586
|
]),
|
|
@@ -588,21 +588,21 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
588
588
|
}, [
|
|
589
589
|
D.searchFormExtra ? {
|
|
590
590
|
name: "extra",
|
|
591
|
-
fn:
|
|
592
|
-
|
|
591
|
+
fn: we(() => [
|
|
592
|
+
Se(e.$slots, "searchFormExtra")
|
|
593
593
|
]),
|
|
594
594
|
key: "0"
|
|
595
595
|
} : void 0
|
|
596
596
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
597
|
-
], 6)) :
|
|
597
|
+
], 6)) : ge("", !0),
|
|
598
598
|
T("div", {
|
|
599
|
-
class:
|
|
599
|
+
class: v([n(N)("table-wrapper"), e.card ? n(N)("table-wrapper-card") : null]),
|
|
600
600
|
style: _(e.tableWrapperStyle)
|
|
601
601
|
}, [
|
|
602
602
|
T("div", {
|
|
603
|
-
class:
|
|
603
|
+
class: v(n(c)("header-wrapper"))
|
|
604
604
|
}, [
|
|
605
|
-
|
|
605
|
+
Se(e.$slots, "title", {
|
|
606
606
|
selectedRows: n(G),
|
|
607
607
|
selectedRowKeys: n($e),
|
|
608
608
|
shownColumns: n(p),
|
|
@@ -612,24 +612,24 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
612
612
|
T("div", {
|
|
613
613
|
ref_key: "gridWrapperRef",
|
|
614
614
|
ref: Te,
|
|
615
|
-
class:
|
|
615
|
+
class: v(n(c)("grid-wrapper"))
|
|
616
616
|
}, [
|
|
617
617
|
(y(), $(n(nt), j(
|
|
618
|
-
n(kt)(n(
|
|
618
|
+
n(kt)(n(ke), n(Q), no.value),
|
|
619
619
|
{
|
|
620
620
|
key: n(J),
|
|
621
621
|
"animate-rows": e.animateRows,
|
|
622
622
|
"get-row-class": yo,
|
|
623
623
|
style: uo.value,
|
|
624
624
|
"row-data": n(f).records,
|
|
625
|
-
"column-defs": n(
|
|
625
|
+
"column-defs": n(ee),
|
|
626
626
|
"default-col-def": n(Ae),
|
|
627
627
|
"suppress-loading-overlay": "",
|
|
628
628
|
"row-selection": Ze.value,
|
|
629
629
|
"selection-column-def": n(We),
|
|
630
630
|
"get-row-id": mo,
|
|
631
631
|
"get-row-height": t.getRowHeight,
|
|
632
|
-
theme: n(
|
|
632
|
+
theme: n(Me),
|
|
633
633
|
"tooltip-show-delay": 500,
|
|
634
634
|
"enable-browser-tooltips": e.browserTooltips,
|
|
635
635
|
"tooltip-interaction": "",
|
|
@@ -642,9 +642,9 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
642
642
|
"tab-to-next-cell": () => !1,
|
|
643
643
|
"enable-cell-span": "",
|
|
644
644
|
"dom-layout": e.autoHeight ? "autoHeight" : "normal",
|
|
645
|
-
"locale-text":
|
|
645
|
+
"locale-text": ve[n(J)],
|
|
646
646
|
onSortChanged: ze,
|
|
647
|
-
onGridReady:
|
|
647
|
+
onGridReady: vo,
|
|
648
648
|
onRowDataUpdated: I,
|
|
649
649
|
onRowSelected: eo,
|
|
650
650
|
onFirstDataRendered: oo,
|
|
@@ -652,17 +652,17 @@ const Sn = /* @__PURE__ */ ko({
|
|
|
652
652
|
onBodyScrollEnd: wo,
|
|
653
653
|
onColumnResized: ho,
|
|
654
654
|
onColumnGroupOpened: Oe,
|
|
655
|
-
onModelUpdated:
|
|
655
|
+
onModelUpdated: Ro
|
|
656
656
|
}
|
|
657
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"]))
|
|
658
658
|
], 2),
|
|
659
659
|
T("div", {
|
|
660
|
-
class:
|
|
660
|
+
class: v(n(c)("pagination-wrapper"))
|
|
661
661
|
}, [
|
|
662
662
|
e.pagination !== !1 ? (y(), $(n(No), j({
|
|
663
663
|
key: 0,
|
|
664
664
|
class: n(c)("pagination")
|
|
665
|
-
}, n(
|
|
665
|
+
}, n(ne).pagination, { onChange: co }), null, 16, ["class"])) : ge("", !0)
|
|
666
666
|
], 2)
|
|
667
667
|
], 6)
|
|
668
668
|
], 6));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
minHeight?: number;
|
|
4
|
+
maxHeight?: number | string;
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {}): any;
|
|
10
|
+
};
|
|
11
|
+
refs: {
|
|
12
|
+
wrapperContainer: HTMLDivElement;
|
|
13
|
+
};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
18
|
+
heightChange: (height: number) => any;
|
|
19
|
+
}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
onHeightChange?: ((height: number) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
maxHeight: number | string;
|
|
23
|
+
minHeight: number;
|
|
24
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
25
|
+
wrapperContainer: HTMLDivElement;
|
|
26
|
+
}, any>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent as x, useTemplateRef as y, ref as v, shallowRef as G, onMounted as R, createBlock as _, openBlock as b, unref as P, normalizeProps as S, guardReactiveProps as k, withCtx as A, createElementVNode as M, normalizeStyle as T, renderSlot as $ } from "vue";
|
|
2
|
+
import { isNil as c } from "lodash-unified";
|
|
3
|
+
import { APConfigProvider as z } from "../../config-provider/index.mjs";
|
|
4
|
+
import { useGlobalConfig as B } from "../../config-provider/hooks/use-global-config.mjs";
|
|
5
|
+
import { globalConfigCached as f } from "../../config-provider/config-provider.mjs";
|
|
6
|
+
const U = /* @__PURE__ */ x({
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
minHeight: { default: 150 },
|
|
10
|
+
maxHeight: { default: "unset" }
|
|
11
|
+
},
|
|
12
|
+
emits: ["heightChange"],
|
|
13
|
+
setup(h, { emit: u }) {
|
|
14
|
+
const m = B(), d = f.value.agGrid, r = h, p = u, n = y("wrapperContainer"), a = v(g(r.minHeight)), l = (e) => {
|
|
15
|
+
const o = n.value?.clientHeight, t = n.value?.querySelector(
|
|
16
|
+
".ag-body.ag-layout-normal"
|
|
17
|
+
)?.clientHeight;
|
|
18
|
+
let i = 0;
|
|
19
|
+
!o || !t ? i = 0 : i = o - t;
|
|
20
|
+
const w = e + i, s = Math.max(w, r.minHeight);
|
|
21
|
+
a.value = `${s}px`, p("heightChange", s);
|
|
22
|
+
}, H = (e) => {
|
|
23
|
+
if (!e) return;
|
|
24
|
+
const o = e.getDisplayedRowCount();
|
|
25
|
+
if (o > 0) {
|
|
26
|
+
const t = e.getDisplayedRowAtIndex(o - 1);
|
|
27
|
+
if (t && !c(t.rowTop) && !c(t.rowHeight)) {
|
|
28
|
+
const i = t.rowTop + t.rowHeight;
|
|
29
|
+
l(i);
|
|
30
|
+
}
|
|
31
|
+
} else
|
|
32
|
+
l(150);
|
|
33
|
+
}, C = G({
|
|
34
|
+
agGrid: {
|
|
35
|
+
...m.value?.agGrid,
|
|
36
|
+
onModelUpdated: H
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
R(() => {
|
|
40
|
+
f.value.agGrid = d;
|
|
41
|
+
});
|
|
42
|
+
function g(e) {
|
|
43
|
+
return typeof e == "number" && e ? `${e}px` : e.toString();
|
|
44
|
+
}
|
|
45
|
+
return (e, o) => (b(), _(P(z), S(k(C.value)), {
|
|
46
|
+
default: A(() => [
|
|
47
|
+
M("div", {
|
|
48
|
+
ref_key: "wrapperContainer",
|
|
49
|
+
ref: n,
|
|
50
|
+
style: T({
|
|
51
|
+
height: a.value,
|
|
52
|
+
maxHeight: e.maxHeight && g(e.maxHeight)
|
|
53
|
+
})
|
|
54
|
+
}, [
|
|
55
|
+
$(e.$slots, "default")
|
|
56
|
+
], 4)
|
|
57
|
+
]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 16));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
U as default
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|