@aplus-frontend/ui 7.20.2 → 7.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/src/ag-grid/editable/form-item.vue.mjs +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 +169 -166
- 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/check-card/index.vue.d.ts +0 -1
- package/es/src/check-card/index.vue2.mjs +3 -5
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/editable/interface.d.ts +7 -0
- package/lib/src/ag-grid/hooks/use-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/check-card/index.vue.d.ts +0 -1
- package/lib/src/check-card/index.vue2.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
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 R, createCommentVNode as fe, createElementVNode as T, createVNode as Fo, mergeProps as j, createSlots as Bo, withCtx as ge, Fragment as Io, renderList as Ao, createBlock as $, resolveDynamicComponent as To, renderSlot as we } from "vue";
|
|
2
|
+
import { AG_GRID_LOCALE_EN as Eo, AG_GRID_LOCALE_CN as 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
|
|
6
|
+
import { AgGridVue as nt } from "ag-grid-vue3";
|
|
7
|
+
import { isUndefined as x, isFunction as E, omit as rt } from "lodash-unified";
|
|
8
8
|
import { DEFAULT_ROW_SELECTION_CONFIG as Se, 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";
|
|
@@ -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: {
|
|
@@ -119,7 +119,7 @@ const wr = /* @__PURE__ */ ko({
|
|
|
119
119
|
},
|
|
120
120
|
setup(Ce, { expose: he }) {
|
|
121
121
|
const ye = {
|
|
122
|
-
"zh-cn":
|
|
122
|
+
"zh-cn": Do,
|
|
123
123
|
en: Eo
|
|
124
124
|
};
|
|
125
125
|
Po.registerModules([
|
|
@@ -144,33 +144,33 @@ const wr = /* @__PURE__ */ ko({
|
|
|
144
144
|
ot,
|
|
145
145
|
tt
|
|
146
146
|
]);
|
|
147
|
-
const
|
|
147
|
+
const t = Ce, D = xo(), { e: N, b: c, be: Re } = xt("ag-grid"), { lang: J } = Ft(), ve = vt("ag-grid"), v = h(t.size), be = bt(
|
|
148
148
|
v,
|
|
149
|
-
k(
|
|
150
|
-
k(
|
|
151
|
-
), Me = Rt(k(
|
|
152
|
-
k(
|
|
149
|
+
k(t, "rowHeight"),
|
|
150
|
+
k(t, "theme")
|
|
151
|
+
), Me = Rt(k(t, "virtual")), { rowPinnedGridConfig: Q, getRowPinnedCellClass: ke } = St(
|
|
152
|
+
k(t, "summary")
|
|
153
153
|
), xe = Bt("apGrid"), s = h(), [, Fe] = zo();
|
|
154
|
-
let b = !!
|
|
155
|
-
async function z(e,
|
|
156
|
-
const
|
|
157
|
-
|
|
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 X = ht(
|
|
164
|
-
shownColumns:
|
|
163
|
+
const X = ht(t), {
|
|
164
|
+
shownColumns: p,
|
|
165
165
|
columns: Y,
|
|
166
166
|
columnKeys: Be,
|
|
167
167
|
getTargetColumnByKey: Ie,
|
|
168
168
|
defaultSortOrder: F
|
|
169
|
-
} = gt(
|
|
169
|
+
} = gt(t), { defaultColDef: Ae, columnDefs: Z, gridWrapperRef: Te } = wt(
|
|
170
170
|
Y,
|
|
171
|
-
|
|
171
|
+
t,
|
|
172
172
|
ke,
|
|
173
|
-
|
|
173
|
+
D.headerCell
|
|
174
174
|
), Ee = {
|
|
175
175
|
asc: "ascend",
|
|
176
176
|
desc: "descend"
|
|
@@ -178,18 +178,18 @@ const wr = /* @__PURE__ */ ko({
|
|
|
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
184
|
[e.colKey]: ee[e.order]
|
|
185
185
|
} : {};
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
const e = oe.value,
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
187
|
+
function Ne() {
|
|
188
|
+
const e = oe.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,49 +197,52 @@ 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 u =
|
|
210
|
-
|
|
209
|
+
const u = r.getColDef(), g = r.getSort(), w = Ie(u.colId);
|
|
210
|
+
ne(void 0, void 0, {
|
|
211
211
|
column: u,
|
|
212
|
-
field:
|
|
213
|
-
order:
|
|
212
|
+
field: w?.field ?? u.field ?? u.colId,
|
|
213
|
+
order: g ? Ee[g] : null
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
-
const oe = i(() =>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
const oe = i(() => {
|
|
217
|
+
const e = n(p).length ? n(p) : t.columns;
|
|
218
|
+
return ut(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:
|
|
242
|
+
data: f,
|
|
240
243
|
tableProps: te,
|
|
241
|
-
handleTableChangeOptional:
|
|
242
|
-
submitWith:
|
|
244
|
+
handleTableChangeOptional: ne,
|
|
245
|
+
submitWith: re,
|
|
243
246
|
refresh: le,
|
|
244
247
|
getPaging: Ke,
|
|
245
248
|
setPaging: Ge,
|
|
@@ -247,38 +250,38 @@ const wr = /* @__PURE__ */ ko({
|
|
|
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:
|
|
268
|
+
params: k(t, "params"),
|
|
269
|
+
defaultData: t.defaultData,
|
|
270
|
+
manual: n(Ve),
|
|
271
|
+
formatParams: t.beforeSearchSubmit,
|
|
272
|
+
pagination: t.pagination,
|
|
270
273
|
sortFields: oe,
|
|
271
274
|
onClickReset: Pe,
|
|
272
|
-
defaultSortOrder:
|
|
275
|
+
defaultSortOrder: Ne()
|
|
273
276
|
}), C = i(() => {
|
|
274
|
-
const e =
|
|
277
|
+
const e = t.rowSelection || xe.value?.rowSelection;
|
|
275
278
|
if (e)
|
|
276
279
|
return e === !0 ? Se : {
|
|
277
280
|
...Se,
|
|
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 d = l.data, u = L(d),
|
|
322
|
-
|
|
323
|
-
}), e.setNodesSelected({ nodes:
|
|
324
|
+
const d = l.data, u = L(d), g = l.isSelected();
|
|
325
|
+
o.find((w) => L(w) === u) ? !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,9 +338,9 @@ const wr = /* @__PURE__ */ ko({
|
|
|
335
338
|
const e = s.value;
|
|
336
339
|
if (!e || !F.value)
|
|
337
340
|
return;
|
|
338
|
-
const
|
|
341
|
+
const o = e.getColumnState(), { colKey: r, order: l } = F.value, d = o.map((u) => ({
|
|
339
342
|
...u,
|
|
340
|
-
sort: u.colId ===
|
|
343
|
+
sort: u.colId === r ? ee[l] : null
|
|
341
344
|
}));
|
|
342
345
|
z(d);
|
|
343
346
|
}, H = () => {
|
|
@@ -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
|
});
|
|
@@ -369,8 +372,8 @@ const wr = /* @__PURE__ */ ko({
|
|
|
369
372
|
});
|
|
370
373
|
}
|
|
371
374
|
function ae(e = !1) {
|
|
372
|
-
const
|
|
373
|
-
return S.value?.apForm?.[
|
|
375
|
+
const o = e ? "getFieldsValueTransformed" : "getFieldsValue";
|
|
376
|
+
return S.value?.apForm?.[o]?.(!0);
|
|
374
377
|
}
|
|
375
378
|
function se(e) {
|
|
376
379
|
S.value?.apForm?.setFieldsValue?.(e);
|
|
@@ -388,10 +391,10 @@ const wr = /* @__PURE__ */ ko({
|
|
|
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), d = r.map((a) => {
|
|
395
398
|
if (!Be.value.includes(a.colId))
|
|
396
399
|
return a;
|
|
397
400
|
const M = !l.includes(a.colId), me = {
|
|
@@ -403,27 +406,27 @@ const wr = /* @__PURE__ */ ko({
|
|
|
403
406
|
return pe && (me.pinned = pe.fixed || null), me;
|
|
404
407
|
}), u = new Map(
|
|
405
408
|
e.map((a, M) => [ce(a.key), M])
|
|
406
|
-
),
|
|
409
|
+
), g = d.filter((a) => u.has(a.colId)).sort(
|
|
407
410
|
(a, M) => u.get(a.colId) - u.get(M.colId)
|
|
408
|
-
),
|
|
411
|
+
), w = [];
|
|
409
412
|
let m = 0;
|
|
410
413
|
for (const a of d)
|
|
411
|
-
u.has(a.colId) ?
|
|
412
|
-
z(
|
|
414
|
+
u.has(a.colId) ? w.push(g[m++]) : w.push(a);
|
|
415
|
+
z(w, { applyOrder: !0 });
|
|
413
416
|
}
|
|
414
417
|
st({
|
|
415
|
-
columns: i(() =>
|
|
418
|
+
columns: i(() => p.value),
|
|
416
419
|
columnsBackup: i(() => Y.value),
|
|
417
420
|
size: i(() => at[v.value]),
|
|
418
421
|
updateColumns(e) {
|
|
419
|
-
|
|
422
|
+
p.value = e, t.onShownColumnsChange?.(e), dt(
|
|
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
|
},
|
|
@@ -434,11 +437,11 @@ const wr = /* @__PURE__ */ ko({
|
|
|
434
437
|
className: Re("table-header", "title"),
|
|
435
438
|
color: Fe.value.colorTextTertiary
|
|
436
439
|
})),
|
|
437
|
-
dataSource: i(() =>
|
|
440
|
+
dataSource: i(() => n(f).records),
|
|
438
441
|
getSearchFormValues: ae,
|
|
439
442
|
setSearchFormValues: se,
|
|
440
443
|
submit: V,
|
|
441
|
-
submitWith:
|
|
444
|
+
submitWith: re,
|
|
442
445
|
reset: K,
|
|
443
446
|
refresh: le,
|
|
444
447
|
getSearchFormSorterItems: ie,
|
|
@@ -446,34 +449,34 @@ const wr = /* @__PURE__ */ ko({
|
|
|
446
449
|
resetSearchFormSorterItems: de,
|
|
447
450
|
getLastParams: He
|
|
448
451
|
});
|
|
449
|
-
const so = i(() => (x(
|
|
452
|
+
const so = i(() => (x(t.loading) ? f.loading : t.loading) || Z.value.length === 0), io = i(() => [
|
|
450
453
|
c(),
|
|
451
|
-
|
|
454
|
+
t.card ? null : c("wrapper"),
|
|
452
455
|
c("adaptive"),
|
|
453
456
|
c(`size-${v.value}`),
|
|
454
|
-
|
|
457
|
+
t.autoHeight && f.records.length ? c("auto-height") : null,
|
|
455
458
|
ve.value
|
|
456
459
|
].filter(Boolean)), uo = i(() => ({
|
|
457
460
|
height: "100%",
|
|
458
|
-
...
|
|
459
|
-
})), co = (e,
|
|
460
|
-
|
|
461
|
+
...t.tableStyle || {}
|
|
462
|
+
})), co = (e, o) => {
|
|
463
|
+
ne({ 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 = (
|
|
494
|
+
const l = (o || []).map((d) => ({
|
|
492
495
|
key: d.getColId(),
|
|
493
496
|
width: d.getActualWidth()
|
|
494
497
|
}));
|
|
495
|
-
q(
|
|
498
|
+
q(t.plugins, (d) => d.onColumnResized?.bind(d), 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
|
|
508
|
+
return o.flat().filter(Boolean);
|
|
506
509
|
}, Ro = ({ api: e }) => {
|
|
507
|
-
s.value = e, q(
|
|
510
|
+
s.value = e, q(t.plugins, (o) => o.init?.bind(o), e);
|
|
508
511
|
}, vo = ({ api: e }) => {
|
|
509
|
-
|
|
510
|
-
}, bo = (e,
|
|
512
|
+
t.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,33 +526,33 @@ const wr = /* @__PURE__ */ ko({
|
|
|
523
526
|
},
|
|
524
527
|
{ immediate: !0, deep: !0 }
|
|
525
528
|
), W(
|
|
526
|
-
() =>
|
|
529
|
+
() => t.size,
|
|
527
530
|
(e) => {
|
|
528
531
|
v.value = e;
|
|
529
532
|
}
|
|
530
533
|
), W(
|
|
531
|
-
() =>
|
|
534
|
+
() => n(f).loading,
|
|
532
535
|
(e) => {
|
|
533
|
-
|
|
536
|
+
t.onLoadingChange?.(e);
|
|
534
537
|
}
|
|
535
538
|
), he({
|
|
536
539
|
submit: V,
|
|
537
540
|
reset: K,
|
|
538
541
|
refresh: le,
|
|
539
|
-
submitWith:
|
|
542
|
+
submitWith: re,
|
|
540
543
|
setSearchFormValues: se,
|
|
541
544
|
getSearchFormValues: ae,
|
|
542
|
-
getShowColumns: () =>
|
|
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
558
|
getSearchFormSorterItems: ie,
|
|
@@ -558,32 +561,32 @@ const wr = /* @__PURE__ */ ko({
|
|
|
558
561
|
refreshCells: So,
|
|
559
562
|
redrawRows: Co,
|
|
560
563
|
_internalGridApi: i(() => s.value)
|
|
561
|
-
}), (e,
|
|
564
|
+
}), (e, o) => (y(), U("div", {
|
|
562
565
|
class: R(io.value),
|
|
563
566
|
style: _(e.wrapperStyle)
|
|
564
567
|
}, [
|
|
565
|
-
|
|
568
|
+
n(x)(e.dataSource) && e.searchForm !== !1 && n(X).length > 0 ? (y(), U("div", {
|
|
566
569
|
key: 0,
|
|
567
|
-
class: R(e.card ?
|
|
570
|
+
class: R(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(te).loading,
|
|
578
|
+
onSubmit: n(V),
|
|
579
|
+
onReset: n(K),
|
|
577
580
|
onValuesChange: bo
|
|
578
581
|
}), Bo({
|
|
579
582
|
default: ge(() => [
|
|
580
|
-
(y(!0), U(Io, null, Ao(
|
|
581
|
-
key:
|
|
583
|
+
(y(!0), U(Io, null, Ao(n(X), (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
591
|
fn: ge(() => [
|
|
589
592
|
we(e.$slots, "searchFormExtra")
|
|
@@ -593,40 +596,40 @@ const wr = /* @__PURE__ */ ko({
|
|
|
593
596
|
]), 1040, ["submit-loading", "onSubmit", "onReset"])
|
|
594
597
|
], 6)) : fe("", !0),
|
|
595
598
|
T("div", {
|
|
596
|
-
class: R([
|
|
599
|
+
class: R([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: R(
|
|
603
|
+
class: R(n(c)("header-wrapper"))
|
|
601
604
|
}, [
|
|
602
605
|
we(e.$slots, "title", {
|
|
603
|
-
selectedRows:
|
|
604
|
-
selectedRowKeys:
|
|
605
|
-
shownColumns:
|
|
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: R(
|
|
615
|
+
class: R(n(c)("grid-wrapper"))
|
|
613
616
|
}, [
|
|
614
|
-
(y(), $(
|
|
615
|
-
|
|
617
|
+
(y(), $(n(nt), j(
|
|
618
|
+
n(kt)(n(Me), 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(Z),
|
|
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(be),
|
|
630
633
|
"tooltip-show-delay": 500,
|
|
631
634
|
"enable-browser-tooltips": e.browserTooltips,
|
|
632
635
|
"tooltip-interaction": "",
|
|
@@ -639,7 +642,7 @@ 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": ye[
|
|
645
|
+
"locale-text": ye[n(J)],
|
|
643
646
|
onSortChanged: ze,
|
|
644
647
|
onGridReady: Ro,
|
|
645
648
|
onRowDataUpdated: I,
|
|
@@ -654,17 +657,17 @@ const wr = /* @__PURE__ */ ko({
|
|
|
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: R(
|
|
660
|
+
class: R(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(te).pagination, { onChange: co }), null, 16, ["class"])) : fe("", !0)
|
|
663
666
|
], 2)
|
|
664
667
|
], 6)
|
|
665
668
|
], 6));
|
|
666
669
|
}
|
|
667
670
|
});
|
|
668
671
|
export {
|
|
669
|
-
|
|
672
|
+
Sn as default
|
|
670
673
|
};
|