@nocopypaste/vue-grid 0.3.2 → 0.4.1
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 +1 -1
- package/CHANGELOG.md +23 -0
- package/README.md +61 -51
- package/agent/api.json +13 -3
- package/agent/api.md +3 -2
- package/agent/grid-config.schema.json +11 -0
- package/dist/agent/api.js +11 -3
- package/dist/agent/requirements.js +3 -1
- package/dist/agent/requirements.js.map +1 -1
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +195 -182
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js +31 -14
- package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/usePinFit.js +41 -0
- package/dist/composables/usePinFit.js.map +1 -0
- package/dist/core.css +1 -1
- package/dist/features/columnPinning.js +8 -6
- package/dist/features/columnPinning.js.map +1 -1
- package/dist/renderers/ToggleTextCell.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/renderers/ToggleTextCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers.css +1 -1
- package/dist/theme.css +1 -1
- package/dist/types/components/VGrid.vue.d.ts +6 -0
- package/dist/types/composables/usePinFit.d.ts +17 -0
- package/dist/types/features/columnPinning.d.ts +3 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +65 -54
- package/package.json +1 -1
|
@@ -83,6 +83,10 @@ var Oe = ["data-density"], ke = {
|
|
|
83
83
|
default: !1
|
|
84
84
|
},
|
|
85
85
|
storage: {},
|
|
86
|
+
pinnedMaxShare: {
|
|
87
|
+
type: [Number, Boolean],
|
|
88
|
+
default: .5
|
|
89
|
+
},
|
|
86
90
|
renderers: {},
|
|
87
91
|
locale: {},
|
|
88
92
|
currency: {},
|
|
@@ -209,9 +213,9 @@ var Oe = ["data-density"], ke = {
|
|
|
209
213
|
fallback: !0
|
|
210
214
|
});
|
|
211
215
|
}
|
|
212
|
-
let Qe = l(() => O.virtualScrolling && y.virtual || !1), $e = l(() => !!Qe.value), M = l(() => O.selection ? y.selectable === "single" ? "single" : y.selectable ? "multi" : !1 : !1), N = l(() => {
|
|
213
|
-
let
|
|
214
|
-
if (M.value &&
|
|
216
|
+
let Qe = l(() => O.virtualScrolling && y.virtual || !1), $e = l(() => !!Qe.value), M = l(() => O.selection ? y.selectable === "single" ? "single" : y.selectable ? "multi" : !1 : !1), et = Se(!1), tt = (t, n) => et.value ? void 0 : e(t, n), N = l(() => {
|
|
217
|
+
let e = A.value, t = r(k.value, e), n = [];
|
|
218
|
+
if (M.value && n.push({
|
|
215
219
|
key: ne,
|
|
216
220
|
kind: "select",
|
|
217
221
|
def: {
|
|
@@ -222,38 +226,38 @@ var Oe = ["data-density"], ke = {
|
|
|
222
226
|
definition: void 0,
|
|
223
227
|
options: {},
|
|
224
228
|
align: "center",
|
|
225
|
-
pinned:
|
|
229
|
+
pinned: t.some((t) => tt(t, e) === "left") ? "left" : void 0,
|
|
226
230
|
pinEdge: !1,
|
|
227
231
|
isTree: !1
|
|
228
|
-
}),
|
|
229
|
-
let { component:
|
|
230
|
-
|
|
231
|
-
key:
|
|
232
|
+
}), t.forEach((t, r) => {
|
|
233
|
+
let { component: i, definition: a, fallback: o } = Ze(t);
|
|
234
|
+
n.push({
|
|
235
|
+
key: t.key,
|
|
232
236
|
kind: "data",
|
|
233
|
-
def:
|
|
234
|
-
component:
|
|
235
|
-
definition:
|
|
236
|
-
options:
|
|
237
|
-
...
|
|
238
|
-
...
|
|
237
|
+
def: t,
|
|
238
|
+
component: i,
|
|
239
|
+
definition: a,
|
|
240
|
+
options: o ? {} : {
|
|
241
|
+
...a?.defaults,
|
|
242
|
+
...t.rendererOptions
|
|
239
243
|
},
|
|
240
|
-
align:
|
|
241
|
-
pinned:
|
|
244
|
+
align: t.align ?? a?.align ?? "start",
|
|
245
|
+
pinned: tt(t, e),
|
|
242
246
|
pinEdge: !1,
|
|
243
247
|
isTree: r === 0
|
|
244
248
|
});
|
|
245
249
|
}), !ee()) {
|
|
246
|
-
let e =
|
|
247
|
-
e >= 0 && (
|
|
250
|
+
let e = n.findLastIndex((e) => e.pinned === "left"), t = n.findIndex((e) => e.pinned === "right");
|
|
251
|
+
e >= 0 && (n[e].pinEdge = !0), t >= 0 && (n[t].pinEdge = !0);
|
|
248
252
|
}
|
|
249
|
-
return
|
|
253
|
+
return n;
|
|
250
254
|
}), P = O.columnResizing?.useColumnResize({
|
|
251
255
|
root: E,
|
|
252
256
|
defOf: (e) => y.columns.find((t) => t.key === e),
|
|
253
257
|
state: () => A.value,
|
|
254
258
|
setState: j
|
|
255
|
-
}),
|
|
256
|
-
let t = e.kind === "data" ?
|
|
259
|
+
}), nt = (e) => P?.live.value?.key === e ? P.live.value.width : A.value.widths?.[e], rt = (e) => !!P && e.resizable !== !1, it = l(() => N.value.map((e) => {
|
|
260
|
+
let t = e.kind === "data" ? nt(e.key) : void 0;
|
|
257
261
|
return t ? {
|
|
258
262
|
...e,
|
|
259
263
|
def: {
|
|
@@ -262,22 +266,22 @@ var Oe = ["data-density"], ke = {
|
|
|
262
266
|
minWidth: void 0
|
|
263
267
|
}
|
|
264
268
|
} : e;
|
|
265
|
-
})),
|
|
266
|
-
function
|
|
269
|
+
})), at = l(() => t(it.value.map((e) => e.def))), ot = l(() => !!O.columnGroups && N.value.some((e) => e.kind === "data" && !!e.def.group)), st = l(() => ot.value ? 2 : 1), ct = (e) => !!O.sorting && !!e.sortable, lt = (e) => e;
|
|
270
|
+
function ut() {
|
|
267
271
|
let e = b.value, t = O.sorting;
|
|
268
|
-
if (!t || !
|
|
272
|
+
if (!t || !wt.value || !e) return lt;
|
|
269
273
|
let n = y.columns.find((t) => t.key === e.key);
|
|
270
|
-
if (!n) return
|
|
274
|
+
if (!n) return lt;
|
|
271
275
|
let { definition: r, fallback: i } = Ze(n), o = i ? {} : {
|
|
272
276
|
...r?.defaults,
|
|
273
277
|
...n.rendererOptions
|
|
274
278
|
}, s = n.sortValue ?? (r?.sortValue ? (e) => r.sortValue(a(e, n), o) : (e) => a(e, n));
|
|
275
279
|
return (r) => t.sortRows(r, e.dir, s, n.sortFn);
|
|
276
280
|
}
|
|
277
|
-
function
|
|
278
|
-
return
|
|
281
|
+
function dt(e) {
|
|
282
|
+
return ut()(e);
|
|
279
283
|
}
|
|
280
|
-
function
|
|
284
|
+
function ft(e) {
|
|
281
285
|
if (!O.sorting) return;
|
|
282
286
|
let t = b.value;
|
|
283
287
|
b.value = !t || t.key !== e ? {
|
|
@@ -298,7 +302,7 @@ var Oe = ["data-density"], ke = {
|
|
|
298
302
|
error: t
|
|
299
303
|
}),
|
|
300
304
|
onLoaded: (e, t) => {
|
|
301
|
-
if (!W || !
|
|
305
|
+
if (!W || !Mt.value || !x.value.includes(D(e))) return;
|
|
302
306
|
let n = new Set(x.value);
|
|
303
307
|
U(t, (e) => {
|
|
304
308
|
W.isRowSelectable(e) && n.add(D(e));
|
|
@@ -306,15 +310,15 @@ var Oe = ["data-density"], ke = {
|
|
|
306
310
|
}
|
|
307
311
|
});
|
|
308
312
|
v(() => y.loadSubRows, () => F?.clear());
|
|
309
|
-
let I = l(() => !!F && !!(y.subRows || y.loadSubRows)),
|
|
310
|
-
function
|
|
311
|
-
return I.value && F?.mayHaveChildren(e) ? !0 :
|
|
313
|
+
let I = l(() => !!F && !!(y.subRows || y.loadSubRows)), pt = l(() => !!Ge.detail), mt = l(() => new Set(Be.value)), L = (e) => I.value ? F?.children(e) : void 0;
|
|
314
|
+
function ht(e) {
|
|
315
|
+
return I.value && F?.mayHaveChildren(e) ? !0 : pt.value && (!y.rowExpandable || y.rowExpandable(e));
|
|
312
316
|
}
|
|
313
|
-
function
|
|
314
|
-
let t = D(e), n = new Set(
|
|
317
|
+
function gt(e) {
|
|
318
|
+
let t = D(e), n = new Set(mt.value);
|
|
315
319
|
n.has(t) ? n.delete(t) : n.add(t), Be.value = [...n];
|
|
316
320
|
}
|
|
317
|
-
let
|
|
321
|
+
let _t = Te(), vt = l((e) => {
|
|
318
322
|
let t = N.value.filter((e) => e.kind === "data").map((e) => e.def);
|
|
319
323
|
return e && e.length === t.length && t.every((t) => e.includes(t)) ? e : t;
|
|
320
324
|
}), R = O.filtering?.useFilters({
|
|
@@ -322,39 +326,39 @@ var Oe = ["data-density"], ke = {
|
|
|
322
326
|
storage: () => y.filterStorage,
|
|
323
327
|
mode: () => z.value ? "controlled" : y.filterMode,
|
|
324
328
|
columns: () => y.columns,
|
|
325
|
-
visibleColumns: () =>
|
|
329
|
+
visibleColumns: () => vt.value,
|
|
326
330
|
definitionOf: (e) => Ze(e).definition,
|
|
327
331
|
rows: () => H.value,
|
|
328
332
|
childrenOf: L,
|
|
329
333
|
getKey: D,
|
|
330
334
|
timeZone: () => y.timeZone ?? T?.timeZone
|
|
331
|
-
}),
|
|
332
|
-
function
|
|
333
|
-
let t = document.getElementById(
|
|
335
|
+
}), yt = (e) => `vg-filter-${_t}-${e.replace(/[^\w-]/g, "_")}`;
|
|
336
|
+
function bt(e) {
|
|
337
|
+
let t = document.getElementById(yt(e));
|
|
334
338
|
t && !t.matches(":popover-open") && t.showPopover?.();
|
|
335
339
|
}
|
|
336
|
-
let
|
|
340
|
+
let xt = l(() => R?.state.value ?? Re), St = l(() => R?.activeCount.value ?? 0), Ct = (e) => dt(R ? R.apply(e) : e), z = l(() => !!O.serverData && !!y.dataSource), wt = l(() => !z.value && y.sortMode === "client"), B = l(() => !!O.pagination && !!y.pagination && !$e.value), Tt = l(() => {
|
|
337
341
|
let e = Math.floor(He.value);
|
|
338
342
|
return Number.isFinite(e) && e >= 1 ? e : 25;
|
|
339
|
-
}),
|
|
343
|
+
}), Et = l(() => {
|
|
340
344
|
let e = Math.floor(S.value);
|
|
341
345
|
return Number.isFinite(e) && e >= 1 ? e : 1;
|
|
342
|
-
}),
|
|
346
|
+
}), Dt = l(() => ({
|
|
343
347
|
sort: b.value,
|
|
344
|
-
filters:
|
|
345
|
-
page: B.value ?
|
|
346
|
-
pageSize: B.value ?
|
|
348
|
+
filters: xt.value,
|
|
349
|
+
page: B.value ? Et.value : 1,
|
|
350
|
+
pageSize: B.value ? Tt.value : null
|
|
347
351
|
})), V = O.serverData?.useDataSource({
|
|
348
352
|
source: () => y.dataSource,
|
|
349
|
-
query: () =>
|
|
353
|
+
query: () => Dt.value,
|
|
350
354
|
getKey: D,
|
|
351
355
|
onError: (e) => w("load-error", e)
|
|
352
|
-
}), H = l(() => z.value && V ? V.rows.value : y.rows),
|
|
356
|
+
}), H = l(() => z.value && V ? V.rows.value : y.rows), Ot = l(() => y.loading || !!V?.loading.value), kt = l(() => z.value ? V?.error.value : void 0), At = async () => {
|
|
353
357
|
F?.clear(), await V?.reload();
|
|
354
|
-
},
|
|
355
|
-
v(() => JSON.stringify([b.value,
|
|
358
|
+
}, jt = (e) => F?.clear(e);
|
|
359
|
+
v(() => JSON.stringify([b.value, xt.value]), () => {
|
|
356
360
|
S.value !== 1 && (S.value = 1);
|
|
357
|
-
}), v(() => JSON.stringify(
|
|
361
|
+
}), v(() => JSON.stringify(Dt.value), () => w("query-change", Dt.value), {
|
|
358
362
|
immediate: !0,
|
|
359
363
|
flush: "post"
|
|
360
364
|
});
|
|
@@ -366,10 +370,10 @@ var Oe = ["data-density"], ke = {
|
|
|
366
370
|
e && U(e, t);
|
|
367
371
|
}
|
|
368
372
|
}
|
|
369
|
-
let
|
|
373
|
+
let Mt = l(() => M.value === "multi" && y.selectionMode === "cascade" && I.value), W = O.selection?.useSelection({
|
|
370
374
|
selected: x,
|
|
371
375
|
mode: () => M.value,
|
|
372
|
-
cascade: () =>
|
|
376
|
+
cascade: () => Mt.value,
|
|
373
377
|
isRowSelectable: () => y.isRowSelectable,
|
|
374
378
|
getKey: D,
|
|
375
379
|
rows: () => H.value,
|
|
@@ -377,27 +381,35 @@ var Oe = ["data-density"], ke = {
|
|
|
377
381
|
visibleChildren: (e) => (L(e) ?? []).filter((e) => !R || R.isVisible(e)),
|
|
378
382
|
walk: U,
|
|
379
383
|
view: () => ({
|
|
380
|
-
rows:
|
|
384
|
+
rows: on.value,
|
|
381
385
|
ctx: $
|
|
382
386
|
}),
|
|
383
387
|
prune: () => y.pruneSelection,
|
|
384
388
|
allMatching: We,
|
|
385
389
|
matchingTotal: () => z.value ? V?.total.value : void 0,
|
|
386
|
-
matchKey: () => JSON.stringify(
|
|
387
|
-
}),
|
|
390
|
+
matchKey: () => JSON.stringify(xt.value)
|
|
391
|
+
}), Nt = l(() => W?.allState.value ?? "none"), Pt = l(() => !!W?.selectableKeys.value.length), G = O.rowGrouping?.useRowGrouping({
|
|
388
392
|
groupBy: () => C.value,
|
|
389
393
|
setGroupBy: (e) => C.value = e,
|
|
390
394
|
columns: () => y.columns,
|
|
391
|
-
rows: () =>
|
|
395
|
+
rows: () => en.value,
|
|
392
396
|
sort: () => O.sorting ? b.value : null,
|
|
393
397
|
expandedByDefault: () => y.groupsExpanded,
|
|
394
398
|
selected: x,
|
|
395
|
-
cascade: () =>
|
|
399
|
+
cascade: () => Mt.value,
|
|
396
400
|
walk: U
|
|
397
|
-
}),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
+
}), Ft = O.columnPinning, It = Ft?.usePinFit(E, {
|
|
402
|
+
share: () => y.pinnedMaxShare,
|
|
403
|
+
pinnedKeys: () => {
|
|
404
|
+
let t = A.value, n = r(k.value, t).filter((n) => e(n, t)).map((e) => e.key);
|
|
405
|
+
return M.value && n.length ? [ne, ...n] : n;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
It && v(It.dropped, (e) => et.value = e, { immediate: !0 });
|
|
409
|
+
let Lt = Ft?.usePinnedOffsets(E, () => it.value);
|
|
410
|
+
Ft?.useScrollEdges(E, () => at.value);
|
|
411
|
+
let Rt = (e) => !!Ft && e.pinnable !== !1, K = O.columnReorder, zt = (e) => !!K && y.columns.find((t) => t.key === e)?.reorderable !== !1, q = K?.useColumnDrag({
|
|
412
|
+
canDrag: zt,
|
|
401
413
|
canDrop: (e, t) => K.moveColumn(k.value, A.value, e, t) !== A.value,
|
|
402
414
|
onDrop: (e, t) => {
|
|
403
415
|
let n = q?.target.value?.side ?? "before", r = K.moveColumnRelative(k.value, A.value, e, t, n);
|
|
@@ -408,45 +420,45 @@ var Oe = ["data-density"], ke = {
|
|
|
408
420
|
i && J?.openHeaderMenuAt(i, n, r, t);
|
|
409
421
|
}
|
|
410
422
|
});
|
|
411
|
-
function
|
|
423
|
+
function Bt(e, t) {
|
|
412
424
|
if (q) return q.onPointerDown(e, t);
|
|
413
425
|
let n = y.columns.find((e) => e.key === t);
|
|
414
426
|
n && J?.holdHeader(n, e, e.currentTarget);
|
|
415
427
|
}
|
|
416
|
-
function
|
|
428
|
+
function Vt(e, t) {
|
|
417
429
|
if (!K) return !1;
|
|
418
430
|
let n = N.value.filter((e) => e.kind === "data"), r = n[n.findIndex((t) => t.key === e) + t];
|
|
419
431
|
if (!r) return !1;
|
|
420
432
|
let i = K.moveColumn(k.value, A.value, e, r.key);
|
|
421
433
|
return i !== A.value && (j(i), !0);
|
|
422
434
|
}
|
|
423
|
-
let
|
|
435
|
+
let Ht = !!O.keyboardNavigation, Ut = O.keyboardNavigation?.useGridKeyboard(E, {
|
|
424
436
|
moveColumn(e, t) {
|
|
425
|
-
|
|
437
|
+
Vt(e, t) && _e(() => Ut?.focusCell(E.value?.querySelector(`.vg-header > [data-col-key="${CSS.escape(e)}"]`)));
|
|
426
438
|
},
|
|
427
439
|
resizeColumn: P ? (e, t) => {
|
|
428
440
|
let n = y.columns.find((t) => t.key === e);
|
|
429
|
-
n &&
|
|
441
|
+
n && rt(n) && P.step(e, t);
|
|
430
442
|
} : void 0
|
|
431
|
-
}),
|
|
432
|
-
|
|
433
|
-
},
|
|
434
|
-
menu:
|
|
443
|
+
}), Wt = (e) => {
|
|
444
|
+
Ut?.onKeyDown(e), sn?.onKeyDown(e);
|
|
445
|
+
}, Gt = (e) => Ut?.onFocusIn(e), Kt = l(() => Ht ? $.treeMode.value ? "treegrid" : "grid" : "table"), qt = Se(), J = O.menus?.useMenus({
|
|
446
|
+
menu: qt,
|
|
435
447
|
columns: () => k.value,
|
|
436
448
|
columnState: () => A.value,
|
|
437
449
|
setColumnState: j,
|
|
438
450
|
sort: b,
|
|
439
|
-
sortable:
|
|
440
|
-
pinnable:
|
|
441
|
-
reorderable: (e) =>
|
|
451
|
+
sortable: ct,
|
|
452
|
+
pinnable: Rt,
|
|
453
|
+
reorderable: (e) => zt(e.key),
|
|
442
454
|
hideColumn: O.columnVisibility && ((e) => j(O.columnVisibility.setColumnHidden(A.value, e, !0))),
|
|
443
455
|
resize: P && {
|
|
444
|
-
can:
|
|
456
|
+
can: rt,
|
|
445
457
|
isResized: (e) => !!A.value.widths?.[e],
|
|
446
458
|
fit: (e) => void P.autosize(e),
|
|
447
459
|
reset: (e) => P.reset(e)
|
|
448
460
|
},
|
|
449
|
-
moveColumnBy:
|
|
461
|
+
moveColumnBy: Vt,
|
|
450
462
|
contextMenu: () => y.contextMenu,
|
|
451
463
|
headerMenu: () => y.headerMenu,
|
|
452
464
|
grouping: G?.menu,
|
|
@@ -455,72 +467,72 @@ var Oe = ["data-density"], ke = {
|
|
|
455
467
|
filters: R && {
|
|
456
468
|
isActive: (e) => R.isActive(e),
|
|
457
469
|
anyActive: () => R.activeCount.value > 0,
|
|
458
|
-
open: (e) =>
|
|
470
|
+
open: (e) => bt(e),
|
|
459
471
|
clear: (e) => R.setColumnFilter(e, void 0),
|
|
460
472
|
clearAll: () => R.clearAll()
|
|
461
473
|
}
|
|
462
|
-
}),
|
|
474
|
+
}), Jt = () => {
|
|
463
475
|
let e = y.rowKey;
|
|
464
476
|
return (t) => o(t, e);
|
|
465
|
-
},
|
|
477
|
+
}, Yt = O.rowPinning?.PinnedRows ?? O.aggregation?.PinnedRows, Xt = l(() => R ? R.apply(H.value) : H.value), Y = O.rowPinning?.usePinnedRows({
|
|
466
478
|
model: Ue,
|
|
467
479
|
rows: () => H.value,
|
|
468
|
-
keyOf:
|
|
480
|
+
keyOf: Jt,
|
|
469
481
|
extraTop: () => y.pinnedTopRows,
|
|
470
482
|
extraBottom: () => y.pinnedBottomRows
|
|
471
483
|
}), X = O.aggregation?.useTotals({
|
|
472
484
|
totals: () => y.totals,
|
|
473
485
|
given: () => y.aggregates,
|
|
474
|
-
rows: () =>
|
|
486
|
+
rows: () => Xt.value,
|
|
475
487
|
columns: () => y.columns
|
|
476
|
-
}),
|
|
488
|
+
}), Zt = [], Z = l(() => {
|
|
477
489
|
if (!Y && !X) return {
|
|
478
|
-
top:
|
|
479
|
-
bottom:
|
|
490
|
+
top: Zt,
|
|
491
|
+
bottom: Zt
|
|
480
492
|
};
|
|
481
493
|
let e = X?.at.value, t = e ? [X.item.value] : [];
|
|
482
494
|
return {
|
|
483
495
|
top: [...e === "top" ? t : [], ...Y?.items.value.top ?? []],
|
|
484
496
|
bottom: [...Y?.items.value.bottom ?? [], ...e === "bottom" ? t : []]
|
|
485
497
|
};
|
|
486
|
-
}),
|
|
487
|
-
function
|
|
498
|
+
}), Qt = l(() => Z.value.top.length);
|
|
499
|
+
function $t(e, t) {
|
|
488
500
|
Y ? Y.pinRow(e, t) : process.env.NODE_ENV !== "production" && c("feature:rowPinning", "pinRow() needs the row pinning feature (rowPinningFeature).");
|
|
489
501
|
}
|
|
490
|
-
let
|
|
491
|
-
let e =
|
|
502
|
+
let en = l(() => {
|
|
503
|
+
let e = dt(Xt.value), t = Y?.keys.value;
|
|
492
504
|
if (!t?.size) return e;
|
|
493
|
-
let n =
|
|
505
|
+
let n = Jt();
|
|
494
506
|
return e.filter((e) => !t.has(n(e)));
|
|
495
|
-
}),
|
|
507
|
+
}), tn = l(() => G?.active.value ? G.groups.value : en.value), nn = O.virtualScrolling?.useVirtualRows({
|
|
496
508
|
root: E,
|
|
497
509
|
options: () => Qe.value,
|
|
498
|
-
rows: () =>
|
|
499
|
-
keyOf: G ? () => G.keyOf(
|
|
500
|
-
expanded: () => G?.expanded(
|
|
510
|
+
rows: () => tn.value,
|
|
511
|
+
keyOf: G ? () => G.keyOf(Jt()) : Jt,
|
|
512
|
+
expanded: () => G?.expanded(mt.value) ?? mt.value,
|
|
501
513
|
subRows: () => {
|
|
502
514
|
let e = I.value && F ? F.snapshot : null;
|
|
503
515
|
return G ? G.tree(e) : e;
|
|
504
516
|
},
|
|
505
|
-
hasDetail: () =>
|
|
517
|
+
hasDetail: () => pt.value,
|
|
506
518
|
isGroup: () => G?.active.value ? G.isGroup : void 0,
|
|
507
519
|
rowExpandable: () => y.rowExpandable,
|
|
508
520
|
preparer: () => {
|
|
509
|
-
let e = R?.visibleKeys.value ?? null, t =
|
|
521
|
+
let e = R?.visibleKeys.value ?? null, t = ut(), n = Jt(), r = (r) => t(e ? r.filter((t) => e.has(n(we(t)))) : r);
|
|
510
522
|
return G ? G.preparer(r) : r;
|
|
511
523
|
}
|
|
512
|
-
}),
|
|
524
|
+
}), rn = () => nn?.onScroll(), Q = l(() => nn?.layout.value ?? null), an = l(() => z.value ? V?.total.value ?? H.value.length : tn.value.length), on = l(() => {
|
|
513
525
|
if (B.value && !z.value) {
|
|
514
|
-
let e = (
|
|
515
|
-
return
|
|
526
|
+
let e = (Et.value - 1) * Tt.value;
|
|
527
|
+
return tn.value.slice(e, e + Tt.value);
|
|
516
528
|
}
|
|
517
|
-
return
|
|
529
|
+
return tn.value;
|
|
518
530
|
});
|
|
519
531
|
v([
|
|
520
532
|
B,
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
533
|
+
an,
|
|
534
|
+
Tt,
|
|
535
|
+
Et,
|
|
524
536
|
() => S.value,
|
|
525
537
|
() => !z.value || V?.total.value !== void 0
|
|
526
538
|
], ([e, t, n, r, i, a]) => {
|
|
@@ -528,16 +540,16 @@ var Oe = ["data-density"], ke = {
|
|
|
528
540
|
let o = a && Number.isFinite(t) ? Math.max(1, Math.ceil(t / n)) : Infinity, s = Math.min(r, o);
|
|
529
541
|
i !== s && (S.value = s);
|
|
530
542
|
}, { immediate: !0 });
|
|
531
|
-
let
|
|
543
|
+
let sn = O.export?.useExport({
|
|
532
544
|
columns: () => N.value,
|
|
533
545
|
allColumns: () => y.columns,
|
|
534
546
|
resolve: Ze,
|
|
535
547
|
format: () => Ke.value,
|
|
536
548
|
getKey: D,
|
|
537
549
|
isGroup: (e) => !!G?.isGroup(e),
|
|
538
|
-
rows: (e) => e === "page" ?
|
|
550
|
+
rows: (e) => e === "page" ? on.value : dt(e === "all" ? H.value : Xt.value),
|
|
539
551
|
children: L,
|
|
540
|
-
prepare: (e, t) => (t ?
|
|
552
|
+
prepare: (e, t) => (t ? Ct : dt)(e),
|
|
541
553
|
selected: x,
|
|
542
554
|
extraRows: () => [...y.pinnedTopRows ?? [], ...y.pinnedBottomRows ?? []],
|
|
543
555
|
totals: () => !!X?.at.value && {
|
|
@@ -576,35 +588,35 @@ var Oe = ["data-density"], ke = {
|
|
|
576
588
|
O.rowGrouping && s !== void 0 && c(`group-by:${s}`, `\`group-by\` names "${s}", which is not a column key; it is ignored.`);
|
|
577
589
|
}), v(() => y.features, () => c("features-changed", "`features` is read once, when the grid is created; changes are ignored."));
|
|
578
590
|
}
|
|
579
|
-
let
|
|
580
|
-
keyboardNav:
|
|
581
|
-
cellRole:
|
|
582
|
-
rovingTabindex:
|
|
591
|
+
let cn = l(() => new Set(y.highlightedRows ?? [])), $ = {
|
|
592
|
+
keyboardNav: Ht,
|
|
593
|
+
cellRole: Ht ? "gridcell" : "cell",
|
|
594
|
+
rovingTabindex: Ht ? -1 : void 0,
|
|
583
595
|
columns: N,
|
|
584
596
|
slots: Ge,
|
|
585
597
|
ui: l(() => y.ui ?? {}),
|
|
586
598
|
getKey: D,
|
|
587
|
-
sortRows:
|
|
588
|
-
sortable:
|
|
599
|
+
sortRows: Ct,
|
|
600
|
+
sortable: ct,
|
|
589
601
|
resize: P && {
|
|
590
602
|
Handle: O.columnResizing.Handle,
|
|
591
|
-
can:
|
|
603
|
+
can: rt,
|
|
592
604
|
start: (e, t) => P.onPointerDown(e, t),
|
|
593
605
|
autosize: (e) => void P.autosize(e),
|
|
594
606
|
step: (e, t) => P.step(e, t),
|
|
595
607
|
isSized: (e) => !!A.value.widths?.[e] || P.resizing.value === e
|
|
596
608
|
},
|
|
597
|
-
headerRows:
|
|
598
|
-
pinnedTopCount:
|
|
609
|
+
headerRows: st,
|
|
610
|
+
pinnedTopCount: Qt,
|
|
599
611
|
totals: X && {
|
|
600
612
|
values: X.values,
|
|
601
613
|
label: l(() => y.totalsLabel)
|
|
602
614
|
},
|
|
603
615
|
treeMode: I,
|
|
604
|
-
hasDetail:
|
|
605
|
-
canExpand:
|
|
606
|
-
isExpanded: (e) =>
|
|
607
|
-
toggleExpanded:
|
|
616
|
+
hasDetail: pt,
|
|
617
|
+
canExpand: ht,
|
|
618
|
+
isExpanded: (e) => mt.value.has(e),
|
|
619
|
+
toggleExpanded: gt,
|
|
608
620
|
children: (e) => L(e),
|
|
609
621
|
subRowState: (e) => F?.state(e),
|
|
610
622
|
ensureSubRows: (e) => F?.ensure(e),
|
|
@@ -614,7 +626,7 @@ var Oe = ["data-density"], ke = {
|
|
|
614
626
|
isRowSelectable: (e) => W?.isRowSelectable(e) ?? !1,
|
|
615
627
|
rowCheckState: (e) => W?.rowCheckState(e) ?? "none",
|
|
616
628
|
toggleRow: (e, t) => W?.toggleRow(e, t),
|
|
617
|
-
isHighlighted: (e) =>
|
|
629
|
+
isHighlighted: (e) => cn.value.has(e),
|
|
618
630
|
rowClass: (e, t) => y.rowClass?.(e, t),
|
|
619
631
|
rowClickable: l(() => y.rowClickable),
|
|
620
632
|
flash: l(() => y.flash ?? !1),
|
|
@@ -628,13 +640,13 @@ var Oe = ["data-density"], ke = {
|
|
|
628
640
|
typeOf: (e) => R.typeOf(e),
|
|
629
641
|
filterRow: l(() => y.filterRow),
|
|
630
642
|
distinct: R.distinct,
|
|
631
|
-
idFor:
|
|
632
|
-
open:
|
|
643
|
+
idFor: yt,
|
|
644
|
+
open: bt
|
|
633
645
|
},
|
|
634
646
|
virtual: $e,
|
|
635
|
-
virtualRows:
|
|
647
|
+
virtualRows: nn?.context,
|
|
636
648
|
pinStyle: (e) => {
|
|
637
|
-
let t =
|
|
649
|
+
let t = Lt?.value[e];
|
|
638
650
|
return t === void 0 ? void 0 : { "--vg-pin-offset": t };
|
|
639
651
|
},
|
|
640
652
|
onRowClick: (e, t, n) => w("row-click", e, n),
|
|
@@ -667,48 +679,48 @@ var Oe = ["data-density"], ke = {
|
|
|
667
679
|
}, r, i) : void 0
|
|
668
680
|
};
|
|
669
681
|
G?.extend($, O.rowGrouping.GroupCells), be(te, $);
|
|
670
|
-
function
|
|
682
|
+
function ln() {
|
|
671
683
|
E.value?.scrollTo({ top: 0 });
|
|
672
684
|
}
|
|
673
|
-
function
|
|
674
|
-
|
|
685
|
+
function un(e) {
|
|
686
|
+
nn?.scrollToKey(e) || (E.value?.querySelector(`[data-row-key="${CSS.escape(String(e))}"] > .vg-cell`))?.scrollIntoView({ block: "nearest" });
|
|
675
687
|
}
|
|
676
|
-
function
|
|
688
|
+
function dn() {
|
|
677
689
|
let e = [];
|
|
678
690
|
U(H.value, (t) => {
|
|
679
|
-
|
|
691
|
+
ht(t) && e.push(D(t));
|
|
680
692
|
}), Be.value = e, G?.setAll(!0);
|
|
681
693
|
}
|
|
682
|
-
function
|
|
694
|
+
function fn() {
|
|
683
695
|
Be.value = [], G?.setAll(!1);
|
|
684
696
|
}
|
|
685
|
-
function
|
|
697
|
+
function pn(e) {
|
|
686
698
|
return (F?.patchLoaded(e) ?? 0) + (z.value && V ? V.patch(e) : 0);
|
|
687
699
|
}
|
|
688
|
-
function
|
|
700
|
+
function mn(e) {
|
|
689
701
|
R ? R.setFilters(e) : process.env.NODE_ENV !== "production" && c("feature:filtering", "setFilters() needs the filtering feature (filteringFeature).");
|
|
690
702
|
}
|
|
691
|
-
let
|
|
692
|
-
function
|
|
693
|
-
return ((t) =>
|
|
703
|
+
let hn = () => R?.clearAll(), gn = () => W?.clear();
|
|
704
|
+
function _n(e) {
|
|
705
|
+
return ((t) => sn ? sn[e](t) : (process.env.NODE_ENV !== "production" && c("feature:export", `${e}() needs the export feature (exportFeature).`), e === "getCsv" ? "" : e === "copyRows" ? Promise.resolve(!1) : void 0));
|
|
694
706
|
}
|
|
695
707
|
return he({
|
|
696
|
-
scrollToTop:
|
|
697
|
-
scrollToRow:
|
|
698
|
-
expandAll:
|
|
699
|
-
collapseAll:
|
|
708
|
+
scrollToTop: ln,
|
|
709
|
+
scrollToRow: un,
|
|
710
|
+
expandAll: dn,
|
|
711
|
+
collapseAll: fn,
|
|
700
712
|
setColumnState: j,
|
|
701
|
-
patchLoadedRows:
|
|
702
|
-
setFilters:
|
|
703
|
-
clearFilters:
|
|
704
|
-
openFilter:
|
|
705
|
-
reload:
|
|
706
|
-
reloadSubRows:
|
|
707
|
-
pinRow:
|
|
708
|
-
getCsv:
|
|
709
|
-
exportCsv:
|
|
710
|
-
copyRows:
|
|
711
|
-
clearSelection:
|
|
713
|
+
patchLoadedRows: pn,
|
|
714
|
+
setFilters: mn,
|
|
715
|
+
clearFilters: hn,
|
|
716
|
+
openFilter: bt,
|
|
717
|
+
reload: At,
|
|
718
|
+
reloadSubRows: jt,
|
|
719
|
+
pinRow: $t,
|
|
720
|
+
getCsv: _n("getCsv"),
|
|
721
|
+
exportCsv: _n("exportCsv"),
|
|
722
|
+
copyRows: _n("copyRows"),
|
|
723
|
+
clearSelection: gn
|
|
712
724
|
}), (e, t) => (m(), f("div", {
|
|
713
725
|
class: ve(["vg-root", p.ui?.root]),
|
|
714
726
|
"data-density": p.density ?? g(T)?.density
|
|
@@ -717,57 +729,58 @@ var Oe = ["data-density"], ke = {
|
|
|
717
729
|
columns: p.columns,
|
|
718
730
|
columnState: A.value,
|
|
719
731
|
setColumnState: j,
|
|
720
|
-
filters:
|
|
721
|
-
setFilters:
|
|
722
|
-
clearFilters:
|
|
723
|
-
activeFilterCount:
|
|
732
|
+
filters: xt.value,
|
|
733
|
+
setFilters: mn,
|
|
734
|
+
clearFilters: hn,
|
|
735
|
+
activeFilterCount: St.value,
|
|
724
736
|
selected: x.value,
|
|
725
737
|
selectedCount: g(W)?.count.value ?? 0,
|
|
726
738
|
selectAllMatching: We.value,
|
|
727
|
-
clearSelection:
|
|
739
|
+
clearSelection: gn
|
|
728
740
|
})])) : d("", !0),
|
|
729
741
|
g(O).selection && g(W)?.banner.value ? (m(), u(h(g(O).selection.Banner), ge({ key: 1 }, g(W).banner.value, {
|
|
730
742
|
onSelectAll: t[0] ||= (e) => We.value = !0,
|
|
731
|
-
onClear:
|
|
743
|
+
onClear: gn
|
|
732
744
|
}), null, 16)) : d("", !0),
|
|
733
|
-
de("div", Ae, [
|
|
745
|
+
de("div", Ae, [Ot.value ? (m(), f("div", je)) : d("", !0), de("div", {
|
|
734
746
|
ref_key: "root",
|
|
735
747
|
ref: E,
|
|
736
748
|
class: ve(["vg", {
|
|
737
749
|
"vg-virtual": $e.value,
|
|
738
750
|
"vg-is-dragging": g(q)?.dragging.value,
|
|
739
751
|
"vg-is-resizing": g(P)?.resizing.value,
|
|
740
|
-
"vg-has-groups":
|
|
752
|
+
"vg-has-groups": ot.value,
|
|
753
|
+
"vg-pins-dropped": et.value,
|
|
741
754
|
"vg-grouped": g(G)?.active.value,
|
|
742
755
|
"vg-has-pinned-rows": Z.value.top.length || Z.value.bottom.length,
|
|
743
756
|
"vg-has-cell-menu": !!g(J) && !!p.contextMenu
|
|
744
757
|
}]),
|
|
745
|
-
role:
|
|
758
|
+
role: Kt.value,
|
|
746
759
|
tabindex: "0",
|
|
747
760
|
"aria-label": p.ariaLabel,
|
|
748
|
-
"aria-busy":
|
|
749
|
-
"aria-rowcount": Q.value ? Q.value.rowCount +
|
|
761
|
+
"aria-busy": Ot.value || void 0,
|
|
762
|
+
"aria-rowcount": Q.value ? Q.value.rowCount + st.value + Z.value.top.length + Z.value.bottom.length : void 0,
|
|
750
763
|
"aria-colcount": N.value.length,
|
|
751
|
-
"aria-multiselectable":
|
|
764
|
+
"aria-multiselectable": Ht && M.value === "multi" || void 0,
|
|
752
765
|
style: ye({
|
|
753
|
-
"--vg-columns":
|
|
766
|
+
"--vg-columns": at.value,
|
|
754
767
|
"--vg-row-height": Qe.value ? `${Qe.value.rowHeight}px` : void 0
|
|
755
768
|
}),
|
|
756
|
-
onScrollPassive:
|
|
757
|
-
onKeydown:
|
|
758
|
-
onFocusin:
|
|
769
|
+
onScrollPassive: rn,
|
|
770
|
+
onKeydown: Wt,
|
|
771
|
+
onFocusin: Gt
|
|
759
772
|
}, [
|
|
760
|
-
|
|
773
|
+
ot.value && g(O).columnGroups ? (m(), u(h(g(O).columnGroups.GroupRow), { key: 0 })) : d("", !0),
|
|
761
774
|
pe(le, {
|
|
762
775
|
sort: b.value,
|
|
763
|
-
"all-state":
|
|
764
|
-
"has-selectable-rows":
|
|
776
|
+
"all-state": Nt.value,
|
|
777
|
+
"has-selectable-rows": Pt.value,
|
|
765
778
|
dragging: g(q)?.dragging.value ?? null,
|
|
766
779
|
"drop-target": g(q)?.target.value ?? null,
|
|
767
|
-
"can-reorder":
|
|
768
|
-
onSort:
|
|
780
|
+
"can-reorder": zt,
|
|
781
|
+
onSort: ft,
|
|
769
782
|
onToggleAll: t[1] ||= (e) => g(W)?.toggleAll(),
|
|
770
|
-
onDragStart:
|
|
783
|
+
onDragStart: Bt,
|
|
771
784
|
onHeaderClick: t[2] ||= (e) => g(q)?.consumeClick(e)
|
|
772
785
|
}, null, 8, [
|
|
773
786
|
"sort",
|
|
@@ -776,35 +789,35 @@ var Oe = ["data-density"], ke = {
|
|
|
776
789
|
"dragging",
|
|
777
790
|
"drop-target"
|
|
778
791
|
]),
|
|
779
|
-
g(
|
|
792
|
+
g(Yt) && Z.value.top.length ? (m(), u(h(g(Yt)), {
|
|
780
793
|
key: 1,
|
|
781
794
|
position: "top",
|
|
782
795
|
items: Z.value.top,
|
|
783
|
-
"aria-start": Q.value ?
|
|
796
|
+
"aria-start": Q.value ? st.value + 1 : void 0
|
|
784
797
|
}, null, 8, ["items", "aria-start"])) : d("", !0),
|
|
785
|
-
|
|
798
|
+
on.value.length ? (m(), u(ue, {
|
|
786
799
|
key: 2,
|
|
787
|
-
rows:
|
|
800
|
+
rows: on.value,
|
|
788
801
|
presorted: "",
|
|
789
802
|
layout: Q.value ?? void 0
|
|
790
803
|
}, null, 8, ["rows", "layout"])) : (m(), f("div", Ne, [de("div", {
|
|
791
804
|
role: $.cellRole,
|
|
792
805
|
tabindex: $.rovingTabindex,
|
|
793
806
|
class: ve(["vg-empty", p.ui?.empty])
|
|
794
|
-
}, [
|
|
807
|
+
}, [Ot.value ? xe(e.$slots, "loading", {}, () => [t[7] ||= fe("Loading…", -1)], void 0, 0) : kt.value ? (m(), f("span", Fe, [t[8] ||= fe(" Couldn't load the rows. ", -1), de("button", {
|
|
795
808
|
type: "button",
|
|
796
809
|
class: "vg-link-button",
|
|
797
|
-
onClick: t[3] ||= (e) =>
|
|
798
|
-
}, "Retry")])) : (z.value || p.rows.length) &&
|
|
810
|
+
onClick: t[3] ||= (e) => At()
|
|
811
|
+
}, "Retry")])) : (z.value || p.rows.length) && St.value ? (m(), f("span", Ie, [fe(Ce(p.noMatchText) + " ", 1), de("button", {
|
|
799
812
|
type: "button",
|
|
800
813
|
class: "vg-link-button",
|
|
801
|
-
onClick: t[4] ||= (e) =>
|
|
814
|
+
onClick: t[4] ||= (e) => hn()
|
|
802
815
|
}, " Clear filters ")])) : xe(e.$slots, "empty", {}, () => [fe(Ce(p.emptyText), 1)], void 0, 3)], 10, Pe)])),
|
|
803
|
-
g(
|
|
816
|
+
g(Yt) && Z.value.bottom.length ? (m(), u(h(g(Yt)), {
|
|
804
817
|
key: 4,
|
|
805
818
|
position: "bottom",
|
|
806
819
|
items: Z.value.bottom,
|
|
807
|
-
"aria-start": Q.value ?
|
|
820
|
+
"aria-start": Q.value ? st.value + Z.value.top.length + Q.value.rowCount + 1 : void 0
|
|
808
821
|
}, null, 8, ["items", "aria-start"])) : d("", !0)
|
|
809
822
|
], 46, Me)]),
|
|
810
823
|
B.value && g(O).pagination ? (m(), u(h(g(O).pagination.Pagination), {
|
|
@@ -814,7 +827,7 @@ var Oe = ["data-density"], ke = {
|
|
|
814
827
|
"page-size": He.value,
|
|
815
828
|
"onUpdate:pageSize": t[6] ||= (e) => He.value = e,
|
|
816
829
|
class: "vg-grid-pagination",
|
|
817
|
-
total:
|
|
830
|
+
total: an.value,
|
|
818
831
|
"page-sizes": typeof p.pagination == "object" ? p.pagination.pageSizes : void 0
|
|
819
832
|
}, null, 40, [
|
|
820
833
|
"page",
|
|
@@ -825,7 +838,7 @@ var Oe = ["data-density"], ke = {
|
|
|
825
838
|
g(O).menus && g(J) ? (m(), u(h(g(O).menus.Menu), {
|
|
826
839
|
key: 3,
|
|
827
840
|
ref_key: "menuRef",
|
|
828
|
-
ref:
|
|
841
|
+
ref: qt,
|
|
829
842
|
items: g(J).items.value,
|
|
830
843
|
label: g(J).label.value,
|
|
831
844
|
placement: "point",
|