@nocopypaste/vue-grid 0.4.3 → 0.6.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/AGENTS.md +5 -2
- package/CHANGELOG.md +27 -0
- package/README.md +83 -30
- package/agent/api.json +35 -2
- package/agent/api.md +7 -2
- package/agent/grid-config.schema.json +4 -0
- package/dist/agent/api.js +33 -2
- package/dist/agent/requirements.js +2 -1
- package/dist/agent/requirements.js.map +1 -1
- package/dist/base.css +1 -1
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +204 -180
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridStatusBar.js +6 -0
- package/dist/components/VGridStatusBar.js.map +1 -0
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useGridExport.js +83 -51
- package/dist/composables/useGridExport.js.map +1 -1
- package/dist/composables/useStatusBar.js +73 -0
- package/dist/composables/useStatusBar.js.map +1 -0
- package/dist/core/xlsx.js +172 -0
- package/dist/core/xlsx.js.map +1 -0
- package/dist/core.css +1 -1
- package/dist/features/export.js.map +1 -1
- package/dist/features/index.js +9 -7
- package/dist/features/index.js.map +1 -1
- package/dist/features/statusBar.js +11 -0
- package/dist/features/statusBar.js.map +1 -0
- package/dist/index.js +55 -53
- package/dist/internal/features.js.map +1 -1
- package/dist/theme.css +1 -1
- package/dist/types/agent/requirements.d.ts +1 -1
- package/dist/types/components/VGrid.vue.d.ts +9 -1
- package/dist/types/components/VGridStatusBar.vue.d.ts +14 -0
- package/dist/types/composables/useGridExport.d.ts +5 -1
- package/dist/types/composables/useStatusBar.d.ts +45 -0
- package/dist/types/core/xlsx.d.ts +34 -0
- package/dist/types/features/export.d.ts +5 -4
- package/dist/types/features/index.d.ts +2 -1
- package/dist/types/features/statusBar.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/internal/features.d.ts +2 -1
- package/dist/types/types.d.ts +61 -1
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +95 -34
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,7 @@ var De = ["data-density"], Oe = {
|
|
|
53
53
|
type: [Boolean, Object],
|
|
54
54
|
default: !1
|
|
55
55
|
},
|
|
56
|
+
statusBar: { type: [Boolean, Object] },
|
|
56
57
|
sortMode: { default: "controlled" },
|
|
57
58
|
filterMode: { default: "client" },
|
|
58
59
|
filterRow: {
|
|
@@ -273,7 +274,7 @@ var De = ["data-density"], Oe = {
|
|
|
273
274
|
})), at = l(() => t(it.value.map((e) => e.def))), ot = l(() => !!k.columnGroups && P.value.some((e) => e.kind === "data" && !!e.def.group)), st = l(() => ot.value ? 2 : 1), ct = (e) => !!k.sorting && !!e.sortable, lt = (e) => e;
|
|
274
275
|
function ut() {
|
|
275
276
|
let e = x.value, t = k.sorting;
|
|
276
|
-
if (!t || !
|
|
277
|
+
if (!t || !Tt.value || !e) return lt;
|
|
277
278
|
let n = b.columns.find((t) => t.key === e.key);
|
|
278
279
|
if (!n) return lt;
|
|
279
280
|
let { definition: r, fallback: i } = Ze(n), o = i ? {} : {
|
|
@@ -306,93 +307,93 @@ var De = ["data-density"], Oe = {
|
|
|
306
307
|
error: t
|
|
307
308
|
}),
|
|
308
309
|
onLoaded: (e, t) => {
|
|
309
|
-
if (!
|
|
310
|
+
if (!U || !Pt.value || !S.value.includes(O(e))) return;
|
|
310
311
|
let n = new Set(S.value);
|
|
311
|
-
|
|
312
|
-
|
|
312
|
+
Nt(t, (e) => {
|
|
313
|
+
U.isRowSelectable(e) && n.add(O(e));
|
|
313
314
|
}), n.size !== S.value.length && (S.value = [...n]);
|
|
314
315
|
}
|
|
315
316
|
});
|
|
316
317
|
y(() => b.loadSubRows, () => I?.clear());
|
|
317
|
-
let
|
|
318
|
-
function ht(e) {
|
|
319
|
-
return L.value && I?.mayHaveChildren(e) ? !0 : pt.value && (!b.rowExpandable || b.rowExpandable(e));
|
|
320
|
-
}
|
|
318
|
+
let pt = l(() => !!I && !!(b.subRows || b.loadSubRows)), mt = l(() => !!Ge.detail), ht = l(() => new Set(Be.value)), L = (e) => pt.value ? I?.children(e) : void 0;
|
|
321
319
|
function gt(e) {
|
|
322
|
-
|
|
320
|
+
return pt.value && I?.mayHaveChildren(e) ? !0 : mt.value && (!b.rowExpandable || b.rowExpandable(e));
|
|
321
|
+
}
|
|
322
|
+
function _t(e) {
|
|
323
|
+
let t = O(e), n = new Set(ht.value);
|
|
323
324
|
n.has(t) ? n.delete(t) : n.add(t), Be.value = [...n];
|
|
324
325
|
}
|
|
325
|
-
let
|
|
326
|
+
let vt = we(), yt = l((e) => {
|
|
326
327
|
let t = P.value.filter((e) => e.kind === "data").map((e) => e.def);
|
|
327
328
|
return e && e.length === t.length && t.every((t) => e.includes(t)) ? e : t;
|
|
328
|
-
}),
|
|
329
|
+
}), R = k.filtering?.useFilters({
|
|
329
330
|
model: Ve,
|
|
330
331
|
storage: () => b.filterStorage,
|
|
331
|
-
mode: () =>
|
|
332
|
+
mode: () => z.value ? "controlled" : b.filterMode,
|
|
332
333
|
columns: () => b.columns,
|
|
333
|
-
visibleColumns: () =>
|
|
334
|
+
visibleColumns: () => yt.value,
|
|
334
335
|
definitionOf: (e) => Ze(e).definition,
|
|
335
|
-
rows: () =>
|
|
336
|
-
childrenOf:
|
|
336
|
+
rows: () => H.value,
|
|
337
|
+
childrenOf: L,
|
|
337
338
|
getKey: O,
|
|
338
339
|
timeZone: () => b.timeZone ?? E?.timeZone
|
|
339
|
-
}),
|
|
340
|
-
function
|
|
341
|
-
let t = document.getElementById(
|
|
340
|
+
}), bt = (e) => `vg-filter-${vt}-${e.replace(/[^\w-]/g, "_")}`;
|
|
341
|
+
function xt(e) {
|
|
342
|
+
let t = document.getElementById(bt(e));
|
|
342
343
|
t && !t.matches(":popover-open") && t.showPopover?.();
|
|
343
344
|
}
|
|
344
|
-
let
|
|
345
|
+
let St = l(() => R?.state.value ?? Re), Ct = l(() => R?.activeCount.value ?? 0), wt = (e) => dt(R ? R.apply(e) : e), z = l(() => !!k.serverData && !!b.dataSource), Tt = l(() => !z.value && b.sortMode === "client"), B = l(() => !!k.pagination && !!b.pagination && !$e.value), Et = l(() => {
|
|
345
346
|
let e = Math.floor(He.value);
|
|
346
347
|
return Number.isFinite(e) && e >= 1 ? e : 25;
|
|
347
|
-
}),
|
|
348
|
+
}), Dt = l(() => {
|
|
348
349
|
let e = Math.floor(C.value);
|
|
349
350
|
return Number.isFinite(e) && e >= 1 ? e : 1;
|
|
350
|
-
}),
|
|
351
|
+
}), Ot = l(() => ({
|
|
351
352
|
sort: x.value,
|
|
352
|
-
filters:
|
|
353
|
-
page:
|
|
354
|
-
pageSize:
|
|
355
|
-
})),
|
|
353
|
+
filters: St.value,
|
|
354
|
+
page: B.value ? Dt.value : 1,
|
|
355
|
+
pageSize: B.value ? Et.value : null
|
|
356
|
+
})), V = k.serverData?.useDataSource({
|
|
356
357
|
source: () => b.dataSource,
|
|
357
|
-
query: () =>
|
|
358
|
+
query: () => Ot.value,
|
|
358
359
|
getKey: O,
|
|
359
360
|
onError: (e) => T("load-error", e)
|
|
360
|
-
}),
|
|
361
|
-
I?.clear(), await
|
|
362
|
-
},
|
|
363
|
-
y(() => JSON.stringify([x.value,
|
|
361
|
+
}), H = l(() => z.value && V ? V.rows.value : b.rows), kt = l(() => b.loading || !!V?.loading.value), At = l(() => z.value ? V?.error.value : void 0), jt = async () => {
|
|
362
|
+
I?.clear(), await V?.reload();
|
|
363
|
+
}, Mt = (e) => I?.clear(e);
|
|
364
|
+
y(() => JSON.stringify([x.value, St.value]), () => {
|
|
364
365
|
C.value !== 1 && (C.value = 1);
|
|
365
|
-
}), y(() => JSON.stringify(
|
|
366
|
+
}), y(() => JSON.stringify(Ot.value), () => T("query-change", Ot.value), {
|
|
366
367
|
immediate: !0,
|
|
367
368
|
flush: "post"
|
|
368
369
|
});
|
|
369
|
-
function
|
|
370
|
+
function Nt(e, t) {
|
|
370
371
|
for (let n of e) {
|
|
371
|
-
if (
|
|
372
|
+
if (R && !R.isVisible(n)) continue;
|
|
372
373
|
t(n);
|
|
373
|
-
let e =
|
|
374
|
-
e &&
|
|
374
|
+
let e = L(n);
|
|
375
|
+
e && Nt(e, t);
|
|
375
376
|
}
|
|
376
377
|
}
|
|
377
|
-
let
|
|
378
|
+
let Pt = l(() => N.value === "multi" && b.selectionMode === "cascade" && pt.value), U = k.selection?.useSelection({
|
|
378
379
|
selected: S,
|
|
379
380
|
mode: () => N.value,
|
|
380
|
-
cascade: () =>
|
|
381
|
+
cascade: () => Pt.value,
|
|
381
382
|
isRowSelectable: () => b.isRowSelectable,
|
|
382
383
|
getKey: O,
|
|
383
|
-
rows: () =>
|
|
384
|
-
children:
|
|
385
|
-
visibleChildren: (e) => (
|
|
386
|
-
walk:
|
|
384
|
+
rows: () => H.value,
|
|
385
|
+
children: L,
|
|
386
|
+
visibleChildren: (e) => (L(e) ?? []).filter((e) => !R || R.isVisible(e)),
|
|
387
|
+
walk: Nt,
|
|
387
388
|
view: () => ({
|
|
388
389
|
rows: sn.value,
|
|
389
390
|
ctx: $
|
|
390
391
|
}),
|
|
391
392
|
prune: () => b.pruneSelection,
|
|
392
393
|
allMatching: We,
|
|
393
|
-
matchingTotal: () =>
|
|
394
|
-
matchKey: () => JSON.stringify(
|
|
395
|
-
}),
|
|
394
|
+
matchingTotal: () => z.value ? V?.total.value : void 0,
|
|
395
|
+
matchKey: () => JSON.stringify(St.value)
|
|
396
|
+
}), Ft = l(() => U?.allState.value ?? "none"), It = l(() => !!U?.selectableKeys.value.length), W = k.rowGrouping?.useRowGrouping({
|
|
396
397
|
groupBy: () => w.value,
|
|
397
398
|
setGroupBy: (e) => w.value = e,
|
|
398
399
|
columns: () => b.columns,
|
|
@@ -400,23 +401,23 @@ var De = ["data-density"], Oe = {
|
|
|
400
401
|
sort: () => k.sorting ? x.value : null,
|
|
401
402
|
expandedByDefault: () => b.groupsExpanded,
|
|
402
403
|
selected: S,
|
|
403
|
-
cascade: () =>
|
|
404
|
-
walk:
|
|
405
|
-
}),
|
|
404
|
+
cascade: () => Pt.value,
|
|
405
|
+
walk: Nt
|
|
406
|
+
}), Lt = k.columnPinning, Rt = Lt?.usePinFit(D, {
|
|
406
407
|
share: () => b.pinnedMaxShare,
|
|
407
408
|
pinnedKeys: () => {
|
|
408
409
|
let t = j.value, n = r(A.value, t).filter((n) => e(n, t)).map((e) => e.key);
|
|
409
410
|
return N.value && n.length ? [ne, ...n] : n;
|
|
410
411
|
}
|
|
411
412
|
});
|
|
412
|
-
|
|
413
|
-
let
|
|
414
|
-
|
|
415
|
-
let
|
|
416
|
-
canDrag:
|
|
417
|
-
canDrop: (e, t) =>
|
|
413
|
+
Rt && y(Rt.dropped, (e) => et.value = e, { immediate: !0 });
|
|
414
|
+
let zt = Lt?.usePinnedOffsets(D, () => it.value);
|
|
415
|
+
Lt?.useScrollEdges(D, () => at.value);
|
|
416
|
+
let Bt = (e) => !!Lt && e.pinnable !== !1, G = k.columnReorder, Vt = (e) => !!G && b.columns.find((t) => t.key === e)?.reorderable !== !1, K = G?.useColumnDrag({
|
|
417
|
+
canDrag: Vt,
|
|
418
|
+
canDrop: (e, t) => G.moveColumn(A.value, j.value, e, t) !== j.value,
|
|
418
419
|
onDrop: (e, t) => {
|
|
419
|
-
let n =
|
|
420
|
+
let n = K?.target.value?.side ?? "before", r = G.moveColumnRelative(A.value, j.value, e, t, n);
|
|
420
421
|
r !== j.value && M(r);
|
|
421
422
|
},
|
|
422
423
|
onHold: (e, t, n, r) => {
|
|
@@ -424,21 +425,21 @@ var De = ["data-density"], Oe = {
|
|
|
424
425
|
i && J?.openHeaderMenuAt(i, n, r, t);
|
|
425
426
|
}
|
|
426
427
|
});
|
|
427
|
-
function
|
|
428
|
-
if (
|
|
428
|
+
function Ht(e, t) {
|
|
429
|
+
if (K) return K.onPointerDown(e, t);
|
|
429
430
|
let n = b.columns.find((e) => e.key === t);
|
|
430
431
|
n && J?.holdHeader(n, e, e.currentTarget);
|
|
431
432
|
}
|
|
432
|
-
function
|
|
433
|
-
if (!
|
|
433
|
+
function Ut(e, t) {
|
|
434
|
+
if (!G) return !1;
|
|
434
435
|
let n = P.value.filter((e) => e.kind === "data"), r = n[n.findIndex((t) => t.key === e) + t];
|
|
435
436
|
if (!r) return !1;
|
|
436
|
-
let i =
|
|
437
|
+
let i = G.moveColumn(A.value, j.value, e, r.key);
|
|
437
438
|
return i !== j.value && (M(i), !0);
|
|
438
439
|
}
|
|
439
|
-
let
|
|
440
|
+
let q = !!k.keyboardNavigation, Wt = k.keyboardNavigation?.useGridKeyboard(D, {
|
|
440
441
|
moveColumn(e, t) {
|
|
441
|
-
|
|
442
|
+
Ut(e, t) && ge(() => Wt?.focusCell(D.value?.querySelector(`.vg-header > [data-col-key="${CSS.escape(e)}"]`)));
|
|
442
443
|
},
|
|
443
444
|
resizeColumn: F ? (e, t) => {
|
|
444
445
|
let n = b.columns.find((t) => t.key === e);
|
|
@@ -446,15 +447,15 @@ var De = ["data-density"], Oe = {
|
|
|
446
447
|
} : void 0
|
|
447
448
|
}), Gt = (e) => {
|
|
448
449
|
Wt?.onKeyDown(e), cn?.onKeyDown(e);
|
|
449
|
-
}, Kt = (e) => Wt?.onFocusIn(e), qt = l(() =>
|
|
450
|
+
}, Kt = (e) => Wt?.onFocusIn(e), qt = l(() => q ? $.treeMode.value ? "treegrid" : "grid" : "table"), Jt = xe(), J = k.menus?.useMenus({
|
|
450
451
|
menu: Jt,
|
|
451
452
|
columns: () => A.value,
|
|
452
453
|
columnState: () => j.value,
|
|
453
454
|
setColumnState: M,
|
|
454
455
|
sort: x,
|
|
455
456
|
sortable: ct,
|
|
456
|
-
pinnable:
|
|
457
|
-
reorderable: (e) =>
|
|
457
|
+
pinnable: Bt,
|
|
458
|
+
reorderable: (e) => Vt(e.key),
|
|
458
459
|
hideColumn: k.columnVisibility && ((e) => M(k.columnVisibility.setColumnHidden(j.value, e, !0))),
|
|
459
460
|
resize: F && {
|
|
460
461
|
can: rt,
|
|
@@ -462,25 +463,25 @@ var De = ["data-density"], Oe = {
|
|
|
462
463
|
fit: (e) => void F.autosize(e),
|
|
463
464
|
reset: (e) => F.reset(e)
|
|
464
465
|
},
|
|
465
|
-
moveColumnBy:
|
|
466
|
+
moveColumnBy: Ut,
|
|
466
467
|
contextMenu: () => b.contextMenu,
|
|
467
468
|
headerMenu: () => b.headerMenu,
|
|
468
|
-
grouping:
|
|
469
|
+
grouping: W?.menu,
|
|
469
470
|
onContextAction: (e) => T("context-action", e),
|
|
470
471
|
onHeaderAction: (e) => T("header-action", e),
|
|
471
|
-
filters:
|
|
472
|
-
isActive: (e) =>
|
|
473
|
-
anyActive: () =>
|
|
474
|
-
open: (e) =>
|
|
475
|
-
clear: (e) =>
|
|
476
|
-
clearAll: () =>
|
|
472
|
+
filters: R && {
|
|
473
|
+
isActive: (e) => R.isActive(e),
|
|
474
|
+
anyActive: () => R.activeCount.value > 0,
|
|
475
|
+
open: (e) => xt(e),
|
|
476
|
+
clear: (e) => R.setColumnFilter(e, void 0),
|
|
477
|
+
clearAll: () => R.clearAll()
|
|
477
478
|
}
|
|
478
479
|
}), Yt = () => {
|
|
479
480
|
let e = b.rowKey;
|
|
480
481
|
return (t) => o(t, e);
|
|
481
|
-
}, Xt = k.rowPinning?.PinnedRows ?? k.aggregation?.PinnedRows, Zt = l(() =>
|
|
482
|
+
}, Xt = k.rowPinning?.PinnedRows ?? k.aggregation?.PinnedRows, Zt = l(() => R ? R.apply(H.value) : H.value), Y = k.rowPinning?.usePinnedRows({
|
|
482
483
|
model: Ue,
|
|
483
|
-
rows: () =>
|
|
484
|
+
rows: () => H.value,
|
|
484
485
|
keyOf: Yt,
|
|
485
486
|
extraTop: () => b.pinnedTopRows,
|
|
486
487
|
extraBottom: () => b.pinnedBottomRows
|
|
@@ -508,37 +509,37 @@ var De = ["data-density"], Oe = {
|
|
|
508
509
|
if (!t?.size) return e;
|
|
509
510
|
let n = Yt();
|
|
510
511
|
return e.filter((e) => !t.has(n(e)));
|
|
511
|
-
}), nn = l(() =>
|
|
512
|
+
}), nn = l(() => W?.active.value ? W.groups.value : tn.value), rn = k.virtualScrolling?.useVirtualRows({
|
|
512
513
|
root: D,
|
|
513
514
|
options: () => Qe.value,
|
|
514
515
|
rows: () => nn.value,
|
|
515
|
-
keyOf:
|
|
516
|
-
expanded: () =>
|
|
516
|
+
keyOf: W ? () => W.keyOf(Yt()) : Yt,
|
|
517
|
+
expanded: () => W?.expanded(ht.value) ?? ht.value,
|
|
517
518
|
subRows: () => {
|
|
518
|
-
let e =
|
|
519
|
-
return
|
|
519
|
+
let e = pt.value && I ? I.snapshot : null;
|
|
520
|
+
return W ? W.tree(e) : e;
|
|
520
521
|
},
|
|
521
|
-
hasDetail: () =>
|
|
522
|
-
isGroup: () =>
|
|
522
|
+
hasDetail: () => mt.value,
|
|
523
|
+
isGroup: () => W?.active.value ? W.isGroup : void 0,
|
|
523
524
|
rowExpandable: () => b.rowExpandable,
|
|
524
525
|
preparer: () => {
|
|
525
|
-
let e =
|
|
526
|
-
return
|
|
526
|
+
let e = R?.visibleKeys.value ?? null, t = ut(), n = Yt(), r = (r) => t(e ? r.filter((t) => e.has(n(Ce(t)))) : r);
|
|
527
|
+
return W ? W.preparer(r) : r;
|
|
527
528
|
}
|
|
528
|
-
}), an = () => rn?.onScroll(), Q = l(() => rn?.layout.value ?? null), on = l(() =>
|
|
529
|
-
if (
|
|
530
|
-
let e = (
|
|
531
|
-
return nn.value.slice(e, e +
|
|
529
|
+
}), an = () => rn?.onScroll(), Q = l(() => rn?.layout.value ?? null), on = l(() => z.value ? V?.total.value ?? H.value.length : nn.value.length), sn = l(() => {
|
|
530
|
+
if (B.value && !z.value) {
|
|
531
|
+
let e = (Dt.value - 1) * Et.value;
|
|
532
|
+
return nn.value.slice(e, e + Et.value);
|
|
532
533
|
}
|
|
533
534
|
return nn.value;
|
|
534
535
|
});
|
|
535
536
|
y([
|
|
536
|
-
|
|
537
|
+
B,
|
|
537
538
|
on,
|
|
538
|
-
Tt,
|
|
539
539
|
Et,
|
|
540
|
+
Dt,
|
|
540
541
|
() => C.value,
|
|
541
|
-
() => !
|
|
542
|
+
() => !z.value || V?.total.value !== void 0
|
|
542
543
|
], ([e, t, n, r, i, a]) => {
|
|
543
544
|
if (!e) return;
|
|
544
545
|
let o = a && Number.isFinite(t) ? Math.max(1, Math.ceil(t / n)) : Infinity, s = Math.min(r, o);
|
|
@@ -550,10 +551,10 @@ var De = ["data-density"], Oe = {
|
|
|
550
551
|
resolve: Ze,
|
|
551
552
|
format: () => Ke.value,
|
|
552
553
|
getKey: O,
|
|
553
|
-
isGroup: (e) => !!
|
|
554
|
-
rows: (e) => e === "page" ? sn.value : dt(e === "all" ?
|
|
555
|
-
children:
|
|
556
|
-
prepare: (e, t) => (t ?
|
|
554
|
+
isGroup: (e) => !!W?.isGroup(e),
|
|
555
|
+
rows: (e) => e === "page" ? sn.value : dt(e === "all" ? H.value : Zt.value),
|
|
556
|
+
children: L,
|
|
557
|
+
prepare: (e, t) => (t ? wt : dt)(e),
|
|
557
558
|
selected: S,
|
|
558
559
|
extraRows: () => [...b.pinnedTopRows ?? [], ...b.pinnedBottomRows ?? []],
|
|
559
560
|
totals: () => !!X?.at.value && {
|
|
@@ -561,11 +562,27 @@ var De = ["data-density"], Oe = {
|
|
|
561
562
|
label: b.totalsLabel
|
|
562
563
|
},
|
|
563
564
|
onCopy: (e) => T("copy", e)
|
|
565
|
+
}), ln = k.statusBar?.useStatusBar({
|
|
566
|
+
options: () => b.statusBar,
|
|
567
|
+
rowCount: () => z.value ? V?.total.value ?? H.value.length : Zt.value.length,
|
|
568
|
+
totalRowCount: () => z.value ? void 0 : H.value.length,
|
|
569
|
+
rows: () => H.value,
|
|
570
|
+
selection: U,
|
|
571
|
+
selected: S,
|
|
572
|
+
allMatching: We,
|
|
573
|
+
filterCount: Ct,
|
|
574
|
+
canClear: !!k.filtering,
|
|
575
|
+
clearFilters: () => _n(),
|
|
576
|
+
children: L,
|
|
577
|
+
getKey: O,
|
|
578
|
+
columns: () => b.columns,
|
|
579
|
+
resolve: Ze,
|
|
580
|
+
format: Ke
|
|
564
581
|
});
|
|
565
582
|
if (process.env.NODE_ENV !== "production") {
|
|
566
583
|
Ee(() => {
|
|
567
584
|
let e = /* @__PURE__ */ new Set();
|
|
568
|
-
for (let t of
|
|
585
|
+
for (let t of H.value) {
|
|
569
586
|
let n = O(t);
|
|
570
587
|
if (e.has(n)) {
|
|
571
588
|
c(`dup:${String(n)}`, `Duplicate row key "${String(n)}". Row keys must be unique.`);
|
|
@@ -583,7 +600,7 @@ var De = ["data-density"], Oe = {
|
|
|
583
600
|
let r = b.columns.find((e) => e.hidden)?.key ?? ze.value?.hidden?.[0];
|
|
584
601
|
!k.columnVisibility && r && e("columnVisibility", `Column "${r}" is hidden; that`);
|
|
585
602
|
let i = b.columns.find((e) => e.pinned)?.key;
|
|
586
|
-
!k.columnPinning && i && e("columnPinning", `Column "${i}" is pinned; that`), !k.menus && (b.contextMenu || typeof b.headerMenu == "function") && e("menus", "`context-menu` / a `header-menu` function"), !k.rowPinning && (Ue.value || b.pinnedTopRows || b.pinnedBottomRows) && e("rowPinning", "`pinned-rows` / `pinned-top-rows` / `pinned-bottom-rows`"), !k.aggregation && b.totals && e("aggregation", "`totals`");
|
|
603
|
+
!k.columnPinning && i && e("columnPinning", `Column "${i}" is pinned; that`), !k.menus && (b.contextMenu || typeof b.headerMenu == "function") && e("menus", "`context-menu` / a `header-menu` function"), !k.rowPinning && (Ue.value || b.pinnedTopRows || b.pinnedBottomRows) && e("rowPinning", "`pinned-rows` / `pinned-top-rows` / `pinned-bottom-rows`"), !k.aggregation && b.totals && e("aggregation", "`totals`"), !k.statusBar && b.statusBar && e("statusBar", "`status-bar`");
|
|
587
604
|
let a = b.columns.find((e) => e.exportValue)?.key;
|
|
588
605
|
!k.export && a && e("export", `Column "${a}" has an \`exportValue\`; that`);
|
|
589
606
|
let o = w.value == null ? [] : typeof w.value == "string" ? [w.value] : w.value;
|
|
@@ -592,15 +609,15 @@ var De = ["data-density"], Oe = {
|
|
|
592
609
|
k.rowGrouping && s !== void 0 && c(`group-by:${s}`, `\`group-by\` names "${s}", which is not a column key; it is ignored.`);
|
|
593
610
|
}), y(() => b.features, () => c("features-changed", "`features` is read once, when the grid is created; changes are ignored."));
|
|
594
611
|
}
|
|
595
|
-
let
|
|
596
|
-
keyboardNav:
|
|
597
|
-
cellRole:
|
|
598
|
-
rovingTabindex:
|
|
612
|
+
let un = l(() => new Set(b.highlightedRows ?? [])), $ = {
|
|
613
|
+
keyboardNav: q,
|
|
614
|
+
cellRole: q ? "gridcell" : "cell",
|
|
615
|
+
rovingTabindex: q ? -1 : void 0,
|
|
599
616
|
columns: P,
|
|
600
617
|
slots: Ge,
|
|
601
618
|
ui: l(() => b.ui ?? {}),
|
|
602
619
|
getKey: O,
|
|
603
|
-
sortRows:
|
|
620
|
+
sortRows: wt,
|
|
604
621
|
sortable: ct,
|
|
605
622
|
resize: F && {
|
|
606
623
|
Handle: k.columnResizing.Handle,
|
|
@@ -616,41 +633,41 @@ var De = ["data-density"], Oe = {
|
|
|
616
633
|
values: X.values,
|
|
617
634
|
label: l(() => b.totalsLabel)
|
|
618
635
|
},
|
|
619
|
-
treeMode:
|
|
620
|
-
hasDetail:
|
|
621
|
-
canExpand:
|
|
622
|
-
isExpanded: (e) =>
|
|
623
|
-
toggleExpanded:
|
|
624
|
-
children: (e) =>
|
|
636
|
+
treeMode: pt,
|
|
637
|
+
hasDetail: mt,
|
|
638
|
+
canExpand: gt,
|
|
639
|
+
isExpanded: (e) => ht.value.has(e),
|
|
640
|
+
toggleExpanded: _t,
|
|
641
|
+
children: (e) => L(e),
|
|
625
642
|
subRowState: (e) => I?.state(e),
|
|
626
643
|
ensureSubRows: (e) => I?.ensure(e),
|
|
627
644
|
retrySubRows: (e) => I?.retry(e),
|
|
628
645
|
selectMode: N,
|
|
629
646
|
Checkbox: k.selection?.Checkbox,
|
|
630
|
-
isRowSelectable: (e) =>
|
|
631
|
-
rowCheckState: (e) =>
|
|
632
|
-
toggleRow: (e, t) =>
|
|
633
|
-
isHighlighted: (e) =>
|
|
647
|
+
isRowSelectable: (e) => U?.isRowSelectable(e) ?? !1,
|
|
648
|
+
rowCheckState: (e) => U?.rowCheckState(e) ?? "none",
|
|
649
|
+
toggleRow: (e, t) => U?.toggleRow(e, t),
|
|
650
|
+
isHighlighted: (e) => un.value.has(e),
|
|
634
651
|
rowClass: (e, t) => b.rowClass?.(e, t),
|
|
635
652
|
rowClickable: l(() => b.rowClickable),
|
|
636
653
|
flash: l(() => b.flash ?? !1),
|
|
637
|
-
filters:
|
|
654
|
+
filters: R && {
|
|
638
655
|
FilterButton: k.filtering.FilterButton,
|
|
639
656
|
FilterInput: k.filtering.FilterInput,
|
|
640
|
-
state:
|
|
641
|
-
setSearch:
|
|
642
|
-
setColumnFilter:
|
|
643
|
-
isActive:
|
|
644
|
-
typeOf: (e) =>
|
|
657
|
+
state: R.state,
|
|
658
|
+
setSearch: R.setSearch,
|
|
659
|
+
setColumnFilter: R.setColumnFilter,
|
|
660
|
+
isActive: R.isActive,
|
|
661
|
+
typeOf: (e) => R.typeOf(e),
|
|
645
662
|
filterRow: l(() => b.filterRow),
|
|
646
|
-
distinct:
|
|
647
|
-
idFor:
|
|
648
|
-
open:
|
|
663
|
+
distinct: R.distinct,
|
|
664
|
+
idFor: bt,
|
|
665
|
+
open: xt
|
|
649
666
|
},
|
|
650
667
|
virtual: $e,
|
|
651
668
|
virtualRows: rn?.context,
|
|
652
669
|
pinStyle: (e) => {
|
|
653
|
-
let t =
|
|
670
|
+
let t = zt?.value[e];
|
|
654
671
|
return t === void 0 ? void 0 : { "--vg-pin-offset": t };
|
|
655
672
|
},
|
|
656
673
|
onRowClick: (e, t, n) => T("row-click", e, n),
|
|
@@ -682,49 +699,51 @@ var De = ["data-density"], Oe = {
|
|
|
682
699
|
value: a(e, n.def)
|
|
683
700
|
}, r, i) : void 0
|
|
684
701
|
};
|
|
685
|
-
|
|
686
|
-
function
|
|
702
|
+
W?.extend($, k.rowGrouping.GroupCells), ye(te, $);
|
|
703
|
+
function dn() {
|
|
687
704
|
D.value?.scrollTo({ top: 0 });
|
|
688
705
|
}
|
|
689
|
-
function
|
|
706
|
+
function fn(e) {
|
|
690
707
|
rn?.scrollToKey(e) || (D.value?.querySelector(`[data-row-key="${CSS.escape(String(e))}"] > .vg-cell`))?.scrollIntoView({ block: "nearest" });
|
|
691
708
|
}
|
|
692
|
-
function fn() {
|
|
693
|
-
let e = [];
|
|
694
|
-
Mt(U.value, (t) => {
|
|
695
|
-
ht(t) && e.push(O(t));
|
|
696
|
-
}), Be.value = e, G?.setAll(!0);
|
|
697
|
-
}
|
|
698
709
|
function pn() {
|
|
699
|
-
|
|
710
|
+
let e = [];
|
|
711
|
+
Nt(H.value, (t) => {
|
|
712
|
+
gt(t) && e.push(O(t));
|
|
713
|
+
}), Be.value = e, W?.setAll(!0);
|
|
700
714
|
}
|
|
701
|
-
function mn(
|
|
702
|
-
|
|
715
|
+
function mn() {
|
|
716
|
+
Be.value = [], W?.setAll(!1);
|
|
703
717
|
}
|
|
704
718
|
function hn(e) {
|
|
705
|
-
|
|
719
|
+
return (I?.patchLoaded(e) ?? 0) + (z.value && V ? V.patch(e) : 0);
|
|
706
720
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
721
|
+
function gn(e) {
|
|
722
|
+
R ? R.setFilters(e) : process.env.NODE_ENV !== "production" && c("feature:filtering", "setFilters() needs the filtering feature (filteringFeature).");
|
|
723
|
+
}
|
|
724
|
+
let _n = () => R?.clearAll(), vn = () => U?.clear();
|
|
725
|
+
function yn(e) {
|
|
726
|
+
return ((t) => cn ? cn[e](t) : (process.env.NODE_ENV !== "production" && c("feature:export", `${e}() needs the export feature (exportFeature).`), e === "getXlsx" ? Promise.reject(/* @__PURE__ */ Error("getXlsx() needs the export feature")) : e === "getCsv" ? "" : e === "copyRows" ? Promise.resolve(!1) : e === "exportXlsx" ? Promise.resolve() : void 0));
|
|
710
727
|
}
|
|
711
728
|
return me({
|
|
712
|
-
scrollToTop:
|
|
713
|
-
scrollToRow:
|
|
714
|
-
expandAll:
|
|
715
|
-
collapseAll:
|
|
729
|
+
scrollToTop: dn,
|
|
730
|
+
scrollToRow: fn,
|
|
731
|
+
expandAll: pn,
|
|
732
|
+
collapseAll: mn,
|
|
716
733
|
setColumnState: M,
|
|
717
|
-
patchLoadedRows:
|
|
718
|
-
setFilters:
|
|
719
|
-
clearFilters:
|
|
720
|
-
openFilter:
|
|
721
|
-
reload:
|
|
722
|
-
reloadSubRows:
|
|
734
|
+
patchLoadedRows: hn,
|
|
735
|
+
setFilters: gn,
|
|
736
|
+
clearFilters: _n,
|
|
737
|
+
openFilter: xt,
|
|
738
|
+
reload: jt,
|
|
739
|
+
reloadSubRows: Mt,
|
|
723
740
|
pinRow: en,
|
|
724
|
-
getCsv:
|
|
725
|
-
exportCsv:
|
|
726
|
-
|
|
727
|
-
|
|
741
|
+
getCsv: yn("getCsv"),
|
|
742
|
+
exportCsv: yn("exportCsv"),
|
|
743
|
+
getXlsx: yn("getXlsx"),
|
|
744
|
+
exportXlsx: yn("exportXlsx"),
|
|
745
|
+
copyRows: yn("copyRows"),
|
|
746
|
+
clearSelection: vn
|
|
728
747
|
}), (e, t) => (h(), f("div", {
|
|
729
748
|
class: _e(["vg-root", m.ui?.root]),
|
|
730
749
|
"data-density": m.density ?? _(E)?.density
|
|
@@ -733,44 +752,44 @@ var De = ["data-density"], Oe = {
|
|
|
733
752
|
columns: m.columns,
|
|
734
753
|
columnState: j.value,
|
|
735
754
|
setColumnState: M,
|
|
736
|
-
filters:
|
|
737
|
-
setFilters:
|
|
738
|
-
clearFilters:
|
|
739
|
-
activeFilterCount:
|
|
755
|
+
filters: St.value,
|
|
756
|
+
setFilters: gn,
|
|
757
|
+
clearFilters: _n,
|
|
758
|
+
activeFilterCount: Ct.value,
|
|
740
759
|
selected: S.value,
|
|
741
|
-
selectedCount: _(
|
|
760
|
+
selectedCount: _(U)?.count.value ?? 0,
|
|
742
761
|
selectAllMatching: We.value,
|
|
743
|
-
clearSelection:
|
|
762
|
+
clearSelection: vn
|
|
744
763
|
})])) : d("", !0),
|
|
745
|
-
_(k).selection && _(
|
|
764
|
+
_(k).selection && _(U)?.banner.value ? (h(), u(g(_(k).selection.Banner), he({ key: 1 }, _(U).banner.value, {
|
|
746
765
|
onSelectAll: t[0] ||= (e) => We.value = !0,
|
|
747
|
-
onClear:
|
|
766
|
+
onClear: vn
|
|
748
767
|
}), null, 16)) : d("", !0),
|
|
749
|
-
|
|
768
|
+
At.value && sn.value.length ? (h(), f("div", ke, [t[8] ||= p("span", null, "Couldn't load the rows. These are from before.", -1), p("button", {
|
|
750
769
|
type: "button",
|
|
751
770
|
class: "vg-link-button",
|
|
752
|
-
onClick: t[1] ||= (e) =>
|
|
771
|
+
onClick: t[1] ||= (e) => jt()
|
|
753
772
|
}, "Retry")])) : d("", !0),
|
|
754
|
-
p("div", Ae, [
|
|
773
|
+
p("div", Ae, [kt.value ? (h(), f("div", je)) : d("", !0), p("div", {
|
|
755
774
|
ref_key: "root",
|
|
756
775
|
ref: D,
|
|
757
776
|
class: _e(["vg", {
|
|
758
777
|
"vg-virtual": $e.value,
|
|
759
|
-
"vg-is-dragging": _(
|
|
778
|
+
"vg-is-dragging": _(K)?.dragging.value,
|
|
760
779
|
"vg-is-resizing": _(F)?.resizing.value,
|
|
761
780
|
"vg-has-groups": ot.value,
|
|
762
781
|
"vg-pins-dropped": et.value,
|
|
763
|
-
"vg-grouped": _(
|
|
782
|
+
"vg-grouped": _(W)?.active.value,
|
|
764
783
|
"vg-has-pinned-rows": Z.value.top.length || Z.value.bottom.length,
|
|
765
784
|
"vg-has-cell-menu": !!_(J) && !!m.contextMenu
|
|
766
785
|
}]),
|
|
767
786
|
role: qt.value,
|
|
768
787
|
tabindex: "0",
|
|
769
788
|
"aria-label": m.ariaLabel,
|
|
770
|
-
"aria-busy":
|
|
789
|
+
"aria-busy": kt.value || void 0,
|
|
771
790
|
"aria-rowcount": Q.value ? Q.value.rowCount + st.value + Z.value.top.length + Z.value.bottom.length : void 0,
|
|
772
791
|
"aria-colcount": P.value.length,
|
|
773
|
-
"aria-multiselectable":
|
|
792
|
+
"aria-multiselectable": q && N.value === "multi" || void 0,
|
|
774
793
|
style: ve({
|
|
775
794
|
"--vg-columns": at.value,
|
|
776
795
|
"--vg-row-height": Qe.value ? `${Qe.value.rowHeight}px` : void 0
|
|
@@ -782,15 +801,15 @@ var De = ["data-density"], Oe = {
|
|
|
782
801
|
ot.value && _(k).columnGroups ? (h(), u(g(_(k).columnGroups.GroupRow), { key: 0 })) : d("", !0),
|
|
783
802
|
fe(le, {
|
|
784
803
|
sort: x.value,
|
|
785
|
-
"all-state":
|
|
786
|
-
"has-selectable-rows":
|
|
787
|
-
dragging: _(
|
|
788
|
-
"drop-target": _(
|
|
789
|
-
"can-reorder":
|
|
804
|
+
"all-state": Ft.value,
|
|
805
|
+
"has-selectable-rows": It.value,
|
|
806
|
+
dragging: _(K)?.dragging.value ?? null,
|
|
807
|
+
"drop-target": _(K)?.target.value ?? null,
|
|
808
|
+
"can-reorder": Vt,
|
|
790
809
|
onSort: ft,
|
|
791
|
-
onToggleAll: t[2] ||= (e) => _(
|
|
792
|
-
onDragStart:
|
|
793
|
-
onHeaderClick: t[3] ||= (e) => _(
|
|
810
|
+
onToggleAll: t[2] ||= (e) => _(U)?.toggleAll(),
|
|
811
|
+
onDragStart: Ht,
|
|
812
|
+
onHeaderClick: t[3] ||= (e) => _(K)?.consumeClick(e)
|
|
794
813
|
}, null, 8, [
|
|
795
814
|
"sort",
|
|
796
815
|
"all-state",
|
|
@@ -813,14 +832,14 @@ var De = ["data-density"], Oe = {
|
|
|
813
832
|
role: $.cellRole,
|
|
814
833
|
tabindex: $.rovingTabindex,
|
|
815
834
|
class: _e(["vg-empty", m.ui?.empty])
|
|
816
|
-
}, [
|
|
835
|
+
}, [kt.value ? be(e.$slots, "loading", {}, () => [t[9] ||= de("Loading…", -1)], void 0, 0) : At.value ? (h(), f("span", Fe, [t[10] ||= de(" Couldn't load the rows. ", -1), p("button", {
|
|
817
836
|
type: "button",
|
|
818
837
|
class: "vg-link-button",
|
|
819
|
-
onClick: t[4] ||= (e) =>
|
|
820
|
-
}, "Retry")])) : (
|
|
838
|
+
onClick: t[4] ||= (e) => jt()
|
|
839
|
+
}, "Retry")])) : (z.value || m.rows.length) && Ct.value ? (h(), f("span", Ie, [de(Se(m.noMatchText) + " ", 1), p("button", {
|
|
821
840
|
type: "button",
|
|
822
841
|
class: "vg-link-button",
|
|
823
|
-
onClick: t[5] ||= (e) =>
|
|
842
|
+
onClick: t[5] ||= (e) => _n()
|
|
824
843
|
}, " Clear filters ")])) : be(e.$slots, "empty", {}, () => [de(Se(m.emptyText), 1)], void 0, 3)], 10, Pe)])),
|
|
825
844
|
_(Xt) && Z.value.bottom.length ? (h(), u(g(_(Xt)), {
|
|
826
845
|
key: 4,
|
|
@@ -829,8 +848,13 @@ var De = ["data-density"], Oe = {
|
|
|
829
848
|
"aria-start": Q.value ? st.value + Z.value.top.length + Q.value.rowCount + 1 : void 0
|
|
830
849
|
}, null, 8, ["items", "aria-start"])) : d("", !0)
|
|
831
850
|
], 46, Me)]),
|
|
832
|
-
|
|
851
|
+
_(ln)?.enabled.value && _(k).statusBar ? (h(), u(g(_(k).statusBar.StatusBar), {
|
|
833
852
|
key: 3,
|
|
853
|
+
bar: _(ln),
|
|
854
|
+
render: _(Ge)["status-bar"]
|
|
855
|
+
}, null, 8, ["bar", "render"])) : d("", !0),
|
|
856
|
+
B.value && _(k).pagination ? (h(), u(g(_(k).pagination.Pagination), {
|
|
857
|
+
key: 4,
|
|
834
858
|
page: C.value,
|
|
835
859
|
"onUpdate:page": t[6] ||= (e) => C.value = e,
|
|
836
860
|
"page-size": He.value,
|
|
@@ -845,7 +869,7 @@ var De = ["data-density"], Oe = {
|
|
|
845
869
|
"page-sizes"
|
|
846
870
|
])) : d("", !0),
|
|
847
871
|
_(k).menus && _(J) ? (h(), u(g(_(k).menus.Menu), {
|
|
848
|
-
key:
|
|
872
|
+
key: 5,
|
|
849
873
|
ref_key: "menuRef",
|
|
850
874
|
ref: Jt,
|
|
851
875
|
items: _(J).items.value,
|