@nocopypaste/vue-grid 0.4.2 → 0.5.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 +2 -1
- package/CHANGELOG.md +24 -0
- package/README.md +63 -30
- package/agent/api.json +23 -2
- package/agent/api.md +5 -2
- package/agent/grid-config.schema.json +4 -0
- package/dist/agent/api.js +21 -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 +392 -361
- 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/useStatusBar.js +73 -0
- package/dist/composables/useStatusBar.js.map +1 -0
- package/dist/core.css +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 +5 -4
- 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/useStatusBar.d.ts +45 -0
- package/dist/types/features/index.d.ts +2 -1
- package/dist/types/features/statusBar.d.ts +8 -0
- package/dist/types/internal/features.d.ts +2 -1
- package/dist/types/types.d.ts +47 -1
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +70 -33
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -10,11 +10,15 @@ import { createRendererRegistry as oe, isRendererDefinition as se } from "../reg
|
|
|
10
10
|
import { textRenderer as ce } from "../renderers/text.js";
|
|
11
11
|
import le from "./VGridHeader.js";
|
|
12
12
|
import ue from "./VGridRows.js";
|
|
13
|
-
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as
|
|
13
|
+
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as de, createVNode as fe, defineComponent as m, inject as pe, mergeModels as me, mergeProps as he, nextTick as ge, normalizeClass as _e, normalizeStyle as ve, openBlock as h, provide as ye, renderSlot as be, resolveDynamicComponent as g, shallowRef as xe, toDisplayString as Se, toRaw as Ce, unref as _, useId as we, useModel as v, useSlots as Te, watch as y, watchEffect as Ee } from "vue";
|
|
14
14
|
// src/components/VGrid.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
-
var
|
|
15
|
+
var De = ["data-density"], Oe = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "vg-toolbar"
|
|
18
|
+
}, ke = {
|
|
19
|
+
key: 2,
|
|
20
|
+
class: "vg-load-error-banner",
|
|
21
|
+
role: "alert"
|
|
18
22
|
}, Ae = { class: "vg-viewport" }, je = {
|
|
19
23
|
key: 0,
|
|
20
24
|
class: "vg-progress",
|
|
@@ -37,9 +41,9 @@ var Oe = ["data-density"], ke = {
|
|
|
37
41
|
}, Ie = {
|
|
38
42
|
key: 2,
|
|
39
43
|
class: "vg-no-match"
|
|
40
|
-
}, Le = /*@__PURE__*/
|
|
44
|
+
}, Le = /*@__PURE__*/ m({
|
|
41
45
|
__name: "VGrid",
|
|
42
|
-
props: /*@__PURE__*/
|
|
46
|
+
props: /*@__PURE__*/ me({
|
|
43
47
|
rows: { default: () => [] },
|
|
44
48
|
columns: {},
|
|
45
49
|
rowKey: {},
|
|
@@ -49,6 +53,7 @@ var Oe = ["data-density"], ke = {
|
|
|
49
53
|
type: [Boolean, Object],
|
|
50
54
|
default: !1
|
|
51
55
|
},
|
|
56
|
+
statusBar: { type: [Boolean, Object] },
|
|
52
57
|
sortMode: { default: "controlled" },
|
|
53
58
|
filterMode: { default: "client" },
|
|
54
59
|
filterRow: {
|
|
@@ -141,7 +146,7 @@ var Oe = ["data-density"], ke = {
|
|
|
141
146
|
},
|
|
142
147
|
selectAllMatchingModifiers: {}
|
|
143
148
|
}),
|
|
144
|
-
emits: /*@__PURE__*/
|
|
149
|
+
emits: /*@__PURE__*/ me([
|
|
145
150
|
"query-change",
|
|
146
151
|
"load-error",
|
|
147
152
|
"row-click",
|
|
@@ -163,49 +168,49 @@ var Oe = ["data-density"], ke = {
|
|
|
163
168
|
"update:groupBy",
|
|
164
169
|
"update:selectAllMatching"
|
|
165
170
|
]),
|
|
166
|
-
setup(
|
|
171
|
+
setup(m, { expose: me, emit: Le }) {
|
|
167
172
|
let Re = Object.freeze({
|
|
168
173
|
columns: Object.freeze({}),
|
|
169
174
|
search: ""
|
|
170
|
-
}),
|
|
171
|
-
locale:
|
|
172
|
-
currency:
|
|
173
|
-
timeZone:
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
let
|
|
177
|
-
|
|
178
|
-
let
|
|
179
|
-
let e = !!
|
|
180
|
-
return e && t ?
|
|
175
|
+
}), b = m, x = v(m, "sort"), ze = v(m, "columnState"), Be = v(m, "expanded"), S = v(m, "selected"), Ve = v(m, "filters"), C = v(m, "page"), He = v(m, "pageSize"), Ue = v(m, "pinnedRows"), w = v(m, "groupBy"), We = v(m, "selectAllMatching"), T = Le, Ge = Te(), E = pe(ie, void 0), D = xe(), Ke = l(() => ae({
|
|
176
|
+
locale: b.locale,
|
|
177
|
+
currency: b.currency,
|
|
178
|
+
timeZone: b.timeZone
|
|
179
|
+
}, E));
|
|
180
|
+
ye(re, Ke);
|
|
181
|
+
let O = (e) => o(e, b.rowKey), k = s(E?.features, b.features), qe = l(() => typeof b.storage == "string" ? i(b.storage) : b.storage), Je = xe(qe.value?.load() ?? null);
|
|
182
|
+
y(qe, (e) => Je.value = e?.load() ?? null);
|
|
183
|
+
let A = l(() => {
|
|
184
|
+
let e = !!k.columnPinning, t = !!k.columnVisibility;
|
|
185
|
+
return e && t ? b.columns : b.columns.map((n) => !e && n.pinned || !t && n.hidden ? {
|
|
181
186
|
...n,
|
|
182
187
|
pinned: e ? n.pinned : void 0,
|
|
183
188
|
hidden: t ? n.hidden : void 0
|
|
184
189
|
} : n);
|
|
185
|
-
}),
|
|
186
|
-
let e = n(
|
|
190
|
+
}), j = l(() => {
|
|
191
|
+
let e = n(A.value, ze.value ?? Je.value);
|
|
187
192
|
return {
|
|
188
193
|
...e,
|
|
189
|
-
hidden:
|
|
190
|
-
pinned:
|
|
191
|
-
widths:
|
|
194
|
+
hidden: k.columnVisibility ? e.hidden : [],
|
|
195
|
+
pinned: k.columnPinning ? e.pinned : void 0,
|
|
196
|
+
widths: k.columnResizing ? e.widths : void 0
|
|
192
197
|
};
|
|
193
198
|
});
|
|
194
|
-
function
|
|
195
|
-
let t = n(
|
|
199
|
+
function M(e) {
|
|
200
|
+
let t = n(A.value, e);
|
|
196
201
|
ze.value = t, qe.value?.save(t);
|
|
197
202
|
}
|
|
198
|
-
let Ye = l(() => oe([ce],
|
|
203
|
+
let Ye = l(() => oe([ce], E?.renderers, b.renderers)), Xe = (e) => e.replace(/-(\w)/g, (e, t) => t.toUpperCase());
|
|
199
204
|
function Ze(e) {
|
|
200
205
|
let t = e.renderer ?? "text";
|
|
201
206
|
if (se(t)) return {
|
|
202
|
-
component:
|
|
207
|
+
component: Ce(t.component),
|
|
203
208
|
definition: t
|
|
204
209
|
};
|
|
205
|
-
if (typeof t != "string") return { component:
|
|
210
|
+
if (typeof t != "string") return { component: Ce(t) };
|
|
206
211
|
let n = Ye.value.get(t);
|
|
207
212
|
return n ? {
|
|
208
|
-
component:
|
|
213
|
+
component: Ce(n.component),
|
|
209
214
|
definition: n
|
|
210
215
|
} : (process.env.NODE_ENV !== "production" && c(`renderer:${t}`, `Unknown renderer "${t}" (column "${e.key}"); falling back to "text". Pass the definition (renderer: ${Xe(t)}Renderer) or register it by name: createVueGrid({ renderers: [${Xe(t)}Renderer] }) / <VGrid :renderers="[…]">.`), {
|
|
211
216
|
component: ce.component,
|
|
@@ -213,9 +218,9 @@ var Oe = ["data-density"], ke = {
|
|
|
213
218
|
fallback: !0
|
|
214
219
|
});
|
|
215
220
|
}
|
|
216
|
-
let Qe = l(() =>
|
|
217
|
-
let e =
|
|
218
|
-
if (
|
|
221
|
+
let Qe = l(() => k.virtualScrolling && b.virtual || !1), $e = l(() => !!Qe.value), N = l(() => k.selection ? b.selectable === "single" ? "single" : b.selectable ? "multi" : !1 : !1), et = xe(!1), tt = (t, n) => et.value ? void 0 : e(t, n), P = l(() => {
|
|
222
|
+
let e = j.value, t = r(A.value, e), n = [];
|
|
223
|
+
if (N.value && n.push({
|
|
219
224
|
key: ne,
|
|
220
225
|
kind: "select",
|
|
221
226
|
def: {
|
|
@@ -251,12 +256,12 @@ var Oe = ["data-density"], ke = {
|
|
|
251
256
|
e >= 0 && (n[e].pinEdge = !0), t >= 0 && (n[t].pinEdge = !0);
|
|
252
257
|
}
|
|
253
258
|
return n;
|
|
254
|
-
}),
|
|
255
|
-
root:
|
|
256
|
-
defOf: (e) =>
|
|
257
|
-
state: () =>
|
|
258
|
-
setState:
|
|
259
|
-
}), nt = (e) =>
|
|
259
|
+
}), F = k.columnResizing?.useColumnResize({
|
|
260
|
+
root: D,
|
|
261
|
+
defOf: (e) => b.columns.find((t) => t.key === e),
|
|
262
|
+
state: () => j.value,
|
|
263
|
+
setState: M
|
|
264
|
+
}), nt = (e) => F?.live.value?.key === e ? F.live.value.width : j.value.widths?.[e], rt = (e) => !!F && e.resizable !== !1, it = l(() => P.value.map((e) => {
|
|
260
265
|
let t = e.kind === "data" ? nt(e.key) : void 0;
|
|
261
266
|
return t ? {
|
|
262
267
|
...e,
|
|
@@ -266,11 +271,11 @@ var Oe = ["data-density"], ke = {
|
|
|
266
271
|
minWidth: void 0
|
|
267
272
|
}
|
|
268
273
|
} : e;
|
|
269
|
-
})), at = l(() => t(it.value.map((e) => e.def))), ot = l(() => !!
|
|
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;
|
|
270
275
|
function ut() {
|
|
271
|
-
let e =
|
|
276
|
+
let e = x.value, t = k.sorting;
|
|
272
277
|
if (!t || !wt.value || !e) return lt;
|
|
273
|
-
let n =
|
|
278
|
+
let n = b.columns.find((t) => t.key === e.key);
|
|
274
279
|
if (!n) return lt;
|
|
275
280
|
let { definition: r, fallback: i } = Ze(n), o = i ? {} : {
|
|
276
281
|
...r?.defaults,
|
|
@@ -282,9 +287,9 @@ var Oe = ["data-density"], ke = {
|
|
|
282
287
|
return ut()(e);
|
|
283
288
|
}
|
|
284
289
|
function ft(e) {
|
|
285
|
-
if (!
|
|
286
|
-
let t =
|
|
287
|
-
|
|
290
|
+
if (!k.sorting) return;
|
|
291
|
+
let t = x.value;
|
|
292
|
+
x.value = !t || t.key !== e ? {
|
|
288
293
|
key: e,
|
|
289
294
|
dir: "asc"
|
|
290
295
|
} : t.dir === "asc" ? {
|
|
@@ -292,277 +297,293 @@ var Oe = ["data-density"], ke = {
|
|
|
292
297
|
dir: "desc"
|
|
293
298
|
} : null;
|
|
294
299
|
}
|
|
295
|
-
let
|
|
296
|
-
getKey:
|
|
297
|
-
subRows: () =>
|
|
298
|
-
loadSubRows: () =>
|
|
299
|
-
hasSubRows: () =>
|
|
300
|
-
onError: (e, t) =>
|
|
300
|
+
let I = k.subGrids?.useSubRows({
|
|
301
|
+
getKey: O,
|
|
302
|
+
subRows: () => b.subRows,
|
|
303
|
+
loadSubRows: () => b.loadSubRows,
|
|
304
|
+
hasSubRows: () => b.hasSubRows,
|
|
305
|
+
onError: (e, t) => T("sub-rows-error", {
|
|
301
306
|
row: e,
|
|
302
307
|
error: t
|
|
303
308
|
}),
|
|
304
309
|
onLoaded: (e, t) => {
|
|
305
|
-
if (!W || !
|
|
306
|
-
let n = new Set(
|
|
307
|
-
|
|
308
|
-
W.isRowSelectable(e) && n.add(
|
|
309
|
-
}), n.size !==
|
|
310
|
+
if (!W || !Nt.value || !S.value.includes(O(e))) return;
|
|
311
|
+
let n = new Set(S.value);
|
|
312
|
+
Mt(t, (e) => {
|
|
313
|
+
W.isRowSelectable(e) && n.add(O(e));
|
|
314
|
+
}), n.size !== S.value.length && (S.value = [...n]);
|
|
310
315
|
}
|
|
311
316
|
});
|
|
312
|
-
|
|
313
|
-
let
|
|
317
|
+
y(() => b.loadSubRows, () => I?.clear());
|
|
318
|
+
let L = l(() => !!I && !!(b.subRows || b.loadSubRows)), pt = l(() => !!Ge.detail), mt = l(() => new Set(Be.value)), R = (e) => L.value ? I?.children(e) : void 0;
|
|
314
319
|
function ht(e) {
|
|
315
|
-
return
|
|
320
|
+
return L.value && I?.mayHaveChildren(e) ? !0 : pt.value && (!b.rowExpandable || b.rowExpandable(e));
|
|
316
321
|
}
|
|
317
322
|
function gt(e) {
|
|
318
|
-
let t =
|
|
323
|
+
let t = O(e), n = new Set(mt.value);
|
|
319
324
|
n.has(t) ? n.delete(t) : n.add(t), Be.value = [...n];
|
|
320
325
|
}
|
|
321
|
-
let _t =
|
|
322
|
-
let t =
|
|
326
|
+
let _t = we(), vt = l((e) => {
|
|
327
|
+
let t = P.value.filter((e) => e.kind === "data").map((e) => e.def);
|
|
323
328
|
return e && e.length === t.length && t.every((t) => e.includes(t)) ? e : t;
|
|
324
|
-
}),
|
|
329
|
+
}), z = k.filtering?.useFilters({
|
|
325
330
|
model: Ve,
|
|
326
|
-
storage: () =>
|
|
327
|
-
mode: () =>
|
|
328
|
-
columns: () =>
|
|
331
|
+
storage: () => b.filterStorage,
|
|
332
|
+
mode: () => B.value ? "controlled" : b.filterMode,
|
|
333
|
+
columns: () => b.columns,
|
|
329
334
|
visibleColumns: () => vt.value,
|
|
330
335
|
definitionOf: (e) => Ze(e).definition,
|
|
331
|
-
rows: () =>
|
|
332
|
-
childrenOf:
|
|
333
|
-
getKey:
|
|
334
|
-
timeZone: () =>
|
|
336
|
+
rows: () => U.value,
|
|
337
|
+
childrenOf: R,
|
|
338
|
+
getKey: O,
|
|
339
|
+
timeZone: () => b.timeZone ?? E?.timeZone
|
|
335
340
|
}), yt = (e) => `vg-filter-${_t}-${e.replace(/[^\w-]/g, "_")}`;
|
|
336
341
|
function bt(e) {
|
|
337
342
|
let t = document.getElementById(yt(e));
|
|
338
343
|
t && !t.matches(":popover-open") && t.showPopover?.();
|
|
339
344
|
}
|
|
340
|
-
let xt = l(() =>
|
|
345
|
+
let xt = l(() => z?.state.value ?? Re), St = l(() => z?.activeCount.value ?? 0), Ct = (e) => dt(z ? z.apply(e) : e), B = l(() => !!k.serverData && !!b.dataSource), wt = l(() => !B.value && b.sortMode === "client"), V = l(() => !!k.pagination && !!b.pagination && !$e.value), Tt = l(() => {
|
|
341
346
|
let e = Math.floor(He.value);
|
|
342
347
|
return Number.isFinite(e) && e >= 1 ? e : 25;
|
|
343
348
|
}), Et = l(() => {
|
|
344
|
-
let e = Math.floor(
|
|
349
|
+
let e = Math.floor(C.value);
|
|
345
350
|
return Number.isFinite(e) && e >= 1 ? e : 1;
|
|
346
351
|
}), Dt = l(() => ({
|
|
347
|
-
sort:
|
|
352
|
+
sort: x.value,
|
|
348
353
|
filters: xt.value,
|
|
349
|
-
page:
|
|
350
|
-
pageSize:
|
|
351
|
-
})),
|
|
352
|
-
source: () =>
|
|
354
|
+
page: V.value ? Et.value : 1,
|
|
355
|
+
pageSize: V.value ? Tt.value : null
|
|
356
|
+
})), H = k.serverData?.useDataSource({
|
|
357
|
+
source: () => b.dataSource,
|
|
353
358
|
query: () => Dt.value,
|
|
354
|
-
getKey:
|
|
355
|
-
onError: (e) =>
|
|
356
|
-
}),
|
|
357
|
-
|
|
358
|
-
}, jt = (e) =>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}),
|
|
359
|
+
getKey: O,
|
|
360
|
+
onError: (e) => T("load-error", e)
|
|
361
|
+
}), U = l(() => B.value && H ? H.rows.value : b.rows), Ot = l(() => b.loading || !!H?.loading.value), kt = l(() => B.value ? H?.error.value : void 0), At = async () => {
|
|
362
|
+
I?.clear(), await H?.reload();
|
|
363
|
+
}, jt = (e) => I?.clear(e);
|
|
364
|
+
y(() => JSON.stringify([x.value, xt.value]), () => {
|
|
365
|
+
C.value !== 1 && (C.value = 1);
|
|
366
|
+
}), y(() => JSON.stringify(Dt.value), () => T("query-change", Dt.value), {
|
|
362
367
|
immediate: !0,
|
|
363
368
|
flush: "post"
|
|
364
369
|
});
|
|
365
|
-
function
|
|
370
|
+
function Mt(e, t) {
|
|
366
371
|
for (let n of e) {
|
|
367
|
-
if (
|
|
372
|
+
if (z && !z.isVisible(n)) continue;
|
|
368
373
|
t(n);
|
|
369
|
-
let e =
|
|
370
|
-
e &&
|
|
374
|
+
let e = R(n);
|
|
375
|
+
e && Mt(e, t);
|
|
371
376
|
}
|
|
372
377
|
}
|
|
373
|
-
let
|
|
374
|
-
selected:
|
|
375
|
-
mode: () =>
|
|
376
|
-
cascade: () =>
|
|
377
|
-
isRowSelectable: () =>
|
|
378
|
-
getKey:
|
|
379
|
-
rows: () =>
|
|
380
|
-
children:
|
|
381
|
-
visibleChildren: (e) => (
|
|
382
|
-
walk:
|
|
378
|
+
let Nt = l(() => N.value === "multi" && b.selectionMode === "cascade" && L.value), W = k.selection?.useSelection({
|
|
379
|
+
selected: S,
|
|
380
|
+
mode: () => N.value,
|
|
381
|
+
cascade: () => Nt.value,
|
|
382
|
+
isRowSelectable: () => b.isRowSelectable,
|
|
383
|
+
getKey: O,
|
|
384
|
+
rows: () => U.value,
|
|
385
|
+
children: R,
|
|
386
|
+
visibleChildren: (e) => (R(e) ?? []).filter((e) => !z || z.isVisible(e)),
|
|
387
|
+
walk: Mt,
|
|
383
388
|
view: () => ({
|
|
384
|
-
rows:
|
|
389
|
+
rows: sn.value,
|
|
385
390
|
ctx: $
|
|
386
391
|
}),
|
|
387
|
-
prune: () =>
|
|
392
|
+
prune: () => b.pruneSelection,
|
|
388
393
|
allMatching: We,
|
|
389
|
-
matchingTotal: () =>
|
|
394
|
+
matchingTotal: () => B.value ? H?.total.value : void 0,
|
|
390
395
|
matchKey: () => JSON.stringify(xt.value)
|
|
391
|
-
}),
|
|
392
|
-
groupBy: () =>
|
|
393
|
-
setGroupBy: (e) =>
|
|
394
|
-
columns: () =>
|
|
395
|
-
rows: () =>
|
|
396
|
-
sort: () =>
|
|
397
|
-
expandedByDefault: () =>
|
|
398
|
-
selected:
|
|
399
|
-
cascade: () =>
|
|
400
|
-
walk:
|
|
401
|
-
}),
|
|
402
|
-
share: () =>
|
|
396
|
+
}), Pt = l(() => W?.allState.value ?? "none"), Ft = l(() => !!W?.selectableKeys.value.length), G = k.rowGrouping?.useRowGrouping({
|
|
397
|
+
groupBy: () => w.value,
|
|
398
|
+
setGroupBy: (e) => w.value = e,
|
|
399
|
+
columns: () => b.columns,
|
|
400
|
+
rows: () => tn.value,
|
|
401
|
+
sort: () => k.sorting ? x.value : null,
|
|
402
|
+
expandedByDefault: () => b.groupsExpanded,
|
|
403
|
+
selected: S,
|
|
404
|
+
cascade: () => Nt.value,
|
|
405
|
+
walk: Mt
|
|
406
|
+
}), It = k.columnPinning, Lt = It?.usePinFit(D, {
|
|
407
|
+
share: () => b.pinnedMaxShare,
|
|
403
408
|
pinnedKeys: () => {
|
|
404
|
-
let t =
|
|
405
|
-
return
|
|
409
|
+
let t = j.value, n = r(A.value, t).filter((n) => e(n, t)).map((e) => e.key);
|
|
410
|
+
return N.value && n.length ? [ne, ...n] : n;
|
|
406
411
|
}
|
|
407
412
|
});
|
|
408
|
-
|
|
409
|
-
let
|
|
410
|
-
|
|
411
|
-
let
|
|
412
|
-
canDrag:
|
|
413
|
-
canDrop: (e, t) => K.moveColumn(
|
|
413
|
+
Lt && y(Lt.dropped, (e) => et.value = e, { immediate: !0 });
|
|
414
|
+
let Rt = It?.usePinnedOffsets(D, () => it.value);
|
|
415
|
+
It?.useScrollEdges(D, () => at.value);
|
|
416
|
+
let zt = (e) => !!It && e.pinnable !== !1, K = k.columnReorder, Bt = (e) => !!K && b.columns.find((t) => t.key === e)?.reorderable !== !1, q = K?.useColumnDrag({
|
|
417
|
+
canDrag: Bt,
|
|
418
|
+
canDrop: (e, t) => K.moveColumn(A.value, j.value, e, t) !== j.value,
|
|
414
419
|
onDrop: (e, t) => {
|
|
415
|
-
let n = q?.target.value?.side ?? "before", r = K.moveColumnRelative(
|
|
416
|
-
r !==
|
|
420
|
+
let n = q?.target.value?.side ?? "before", r = K.moveColumnRelative(A.value, j.value, e, t, n);
|
|
421
|
+
r !== j.value && M(r);
|
|
417
422
|
},
|
|
418
423
|
onHold: (e, t, n, r) => {
|
|
419
|
-
let i =
|
|
424
|
+
let i = b.columns.find((t) => t.key === e);
|
|
420
425
|
i && J?.openHeaderMenuAt(i, n, r, t);
|
|
421
426
|
}
|
|
422
427
|
});
|
|
423
|
-
function
|
|
428
|
+
function Vt(e, t) {
|
|
424
429
|
if (q) return q.onPointerDown(e, t);
|
|
425
|
-
let n =
|
|
430
|
+
let n = b.columns.find((e) => e.key === t);
|
|
426
431
|
n && J?.holdHeader(n, e, e.currentTarget);
|
|
427
432
|
}
|
|
428
|
-
function
|
|
433
|
+
function Ht(e, t) {
|
|
429
434
|
if (!K) return !1;
|
|
430
|
-
let n =
|
|
435
|
+
let n = P.value.filter((e) => e.kind === "data"), r = n[n.findIndex((t) => t.key === e) + t];
|
|
431
436
|
if (!r) return !1;
|
|
432
|
-
let i = K.moveColumn(
|
|
433
|
-
return i !==
|
|
437
|
+
let i = K.moveColumn(A.value, j.value, e, r.key);
|
|
438
|
+
return i !== j.value && (M(i), !0);
|
|
434
439
|
}
|
|
435
|
-
let
|
|
440
|
+
let Ut = !!k.keyboardNavigation, Wt = k.keyboardNavigation?.useGridKeyboard(D, {
|
|
436
441
|
moveColumn(e, t) {
|
|
437
|
-
|
|
442
|
+
Ht(e, t) && ge(() => Wt?.focusCell(D.value?.querySelector(`.vg-header > [data-col-key="${CSS.escape(e)}"]`)));
|
|
438
443
|
},
|
|
439
|
-
resizeColumn:
|
|
440
|
-
let n =
|
|
441
|
-
n && rt(n) &&
|
|
444
|
+
resizeColumn: F ? (e, t) => {
|
|
445
|
+
let n = b.columns.find((t) => t.key === e);
|
|
446
|
+
n && rt(n) && F.step(e, t);
|
|
442
447
|
} : void 0
|
|
443
|
-
}),
|
|
444
|
-
|
|
445
|
-
},
|
|
446
|
-
menu:
|
|
447
|
-
columns: () =>
|
|
448
|
-
columnState: () =>
|
|
449
|
-
setColumnState:
|
|
450
|
-
sort:
|
|
448
|
+
}), Gt = (e) => {
|
|
449
|
+
Wt?.onKeyDown(e), cn?.onKeyDown(e);
|
|
450
|
+
}, Kt = (e) => Wt?.onFocusIn(e), qt = l(() => Ut ? $.treeMode.value ? "treegrid" : "grid" : "table"), Jt = xe(), J = k.menus?.useMenus({
|
|
451
|
+
menu: Jt,
|
|
452
|
+
columns: () => A.value,
|
|
453
|
+
columnState: () => j.value,
|
|
454
|
+
setColumnState: M,
|
|
455
|
+
sort: x,
|
|
451
456
|
sortable: ct,
|
|
452
|
-
pinnable:
|
|
453
|
-
reorderable: (e) =>
|
|
454
|
-
hideColumn:
|
|
455
|
-
resize:
|
|
457
|
+
pinnable: zt,
|
|
458
|
+
reorderable: (e) => Bt(e.key),
|
|
459
|
+
hideColumn: k.columnVisibility && ((e) => M(k.columnVisibility.setColumnHidden(j.value, e, !0))),
|
|
460
|
+
resize: F && {
|
|
456
461
|
can: rt,
|
|
457
|
-
isResized: (e) => !!
|
|
458
|
-
fit: (e) => void
|
|
459
|
-
reset: (e) =>
|
|
462
|
+
isResized: (e) => !!j.value.widths?.[e],
|
|
463
|
+
fit: (e) => void F.autosize(e),
|
|
464
|
+
reset: (e) => F.reset(e)
|
|
460
465
|
},
|
|
461
|
-
moveColumnBy:
|
|
462
|
-
contextMenu: () =>
|
|
463
|
-
headerMenu: () =>
|
|
466
|
+
moveColumnBy: Ht,
|
|
467
|
+
contextMenu: () => b.contextMenu,
|
|
468
|
+
headerMenu: () => b.headerMenu,
|
|
464
469
|
grouping: G?.menu,
|
|
465
|
-
onContextAction: (e) =>
|
|
466
|
-
onHeaderAction: (e) =>
|
|
467
|
-
filters:
|
|
468
|
-
isActive: (e) =>
|
|
469
|
-
anyActive: () =>
|
|
470
|
+
onContextAction: (e) => T("context-action", e),
|
|
471
|
+
onHeaderAction: (e) => T("header-action", e),
|
|
472
|
+
filters: z && {
|
|
473
|
+
isActive: (e) => z.isActive(e),
|
|
474
|
+
anyActive: () => z.activeCount.value > 0,
|
|
470
475
|
open: (e) => bt(e),
|
|
471
|
-
clear: (e) =>
|
|
472
|
-
clearAll: () =>
|
|
476
|
+
clear: (e) => z.setColumnFilter(e, void 0),
|
|
477
|
+
clearAll: () => z.clearAll()
|
|
473
478
|
}
|
|
474
|
-
}),
|
|
475
|
-
let e =
|
|
479
|
+
}), Yt = () => {
|
|
480
|
+
let e = b.rowKey;
|
|
476
481
|
return (t) => o(t, e);
|
|
477
|
-
},
|
|
482
|
+
}, Xt = k.rowPinning?.PinnedRows ?? k.aggregation?.PinnedRows, Zt = l(() => z ? z.apply(U.value) : U.value), Y = k.rowPinning?.usePinnedRows({
|
|
478
483
|
model: Ue,
|
|
479
|
-
rows: () =>
|
|
480
|
-
keyOf:
|
|
481
|
-
extraTop: () =>
|
|
482
|
-
extraBottom: () =>
|
|
483
|
-
}), X =
|
|
484
|
-
totals: () =>
|
|
485
|
-
given: () =>
|
|
486
|
-
rows: () =>
|
|
487
|
-
columns: () =>
|
|
488
|
-
}),
|
|
484
|
+
rows: () => U.value,
|
|
485
|
+
keyOf: Yt,
|
|
486
|
+
extraTop: () => b.pinnedTopRows,
|
|
487
|
+
extraBottom: () => b.pinnedBottomRows
|
|
488
|
+
}), X = k.aggregation?.useTotals({
|
|
489
|
+
totals: () => b.totals,
|
|
490
|
+
given: () => b.aggregates,
|
|
491
|
+
rows: () => Zt.value,
|
|
492
|
+
columns: () => b.columns
|
|
493
|
+
}), Qt = [], Z = l(() => {
|
|
489
494
|
if (!Y && !X) return {
|
|
490
|
-
top:
|
|
491
|
-
bottom:
|
|
495
|
+
top: Qt,
|
|
496
|
+
bottom: Qt
|
|
492
497
|
};
|
|
493
498
|
let e = X?.at.value, t = e ? [X.item.value] : [];
|
|
494
499
|
return {
|
|
495
500
|
top: [...e === "top" ? t : [], ...Y?.items.value.top ?? []],
|
|
496
501
|
bottom: [...Y?.items.value.bottom ?? [], ...e === "bottom" ? t : []]
|
|
497
502
|
};
|
|
498
|
-
}),
|
|
499
|
-
function
|
|
503
|
+
}), $t = l(() => Z.value.top.length);
|
|
504
|
+
function en(e, t) {
|
|
500
505
|
Y ? Y.pinRow(e, t) : process.env.NODE_ENV !== "production" && c("feature:rowPinning", "pinRow() needs the row pinning feature (rowPinningFeature).");
|
|
501
506
|
}
|
|
502
|
-
let
|
|
503
|
-
let e = dt(
|
|
507
|
+
let tn = l(() => {
|
|
508
|
+
let e = dt(Zt.value), t = Y?.keys.value;
|
|
504
509
|
if (!t?.size) return e;
|
|
505
|
-
let n =
|
|
510
|
+
let n = Yt();
|
|
506
511
|
return e.filter((e) => !t.has(n(e)));
|
|
507
|
-
}),
|
|
508
|
-
root:
|
|
512
|
+
}), nn = l(() => G?.active.value ? G.groups.value : tn.value), rn = k.virtualScrolling?.useVirtualRows({
|
|
513
|
+
root: D,
|
|
509
514
|
options: () => Qe.value,
|
|
510
|
-
rows: () =>
|
|
511
|
-
keyOf: G ? () => G.keyOf(
|
|
515
|
+
rows: () => nn.value,
|
|
516
|
+
keyOf: G ? () => G.keyOf(Yt()) : Yt,
|
|
512
517
|
expanded: () => G?.expanded(mt.value) ?? mt.value,
|
|
513
518
|
subRows: () => {
|
|
514
|
-
let e =
|
|
519
|
+
let e = L.value && I ? I.snapshot : null;
|
|
515
520
|
return G ? G.tree(e) : e;
|
|
516
521
|
},
|
|
517
522
|
hasDetail: () => pt.value,
|
|
518
523
|
isGroup: () => G?.active.value ? G.isGroup : void 0,
|
|
519
|
-
rowExpandable: () =>
|
|
524
|
+
rowExpandable: () => b.rowExpandable,
|
|
520
525
|
preparer: () => {
|
|
521
|
-
let e =
|
|
526
|
+
let e = z?.visibleKeys.value ?? null, t = ut(), n = Yt(), r = (r) => t(e ? r.filter((t) => e.has(n(Ce(t)))) : r);
|
|
522
527
|
return G ? G.preparer(r) : r;
|
|
523
528
|
}
|
|
524
|
-
}),
|
|
525
|
-
if (
|
|
529
|
+
}), an = () => rn?.onScroll(), Q = l(() => rn?.layout.value ?? null), on = l(() => B.value ? H?.total.value ?? U.value.length : nn.value.length), sn = l(() => {
|
|
530
|
+
if (V.value && !B.value) {
|
|
526
531
|
let e = (Et.value - 1) * Tt.value;
|
|
527
|
-
return
|
|
532
|
+
return nn.value.slice(e, e + Tt.value);
|
|
528
533
|
}
|
|
529
|
-
return
|
|
534
|
+
return nn.value;
|
|
530
535
|
});
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
536
|
+
y([
|
|
537
|
+
V,
|
|
538
|
+
on,
|
|
534
539
|
Tt,
|
|
535
540
|
Et,
|
|
536
|
-
() =>
|
|
537
|
-
() => !
|
|
541
|
+
() => C.value,
|
|
542
|
+
() => !B.value || H?.total.value !== void 0
|
|
538
543
|
], ([e, t, n, r, i, a]) => {
|
|
539
544
|
if (!e) return;
|
|
540
545
|
let o = a && Number.isFinite(t) ? Math.max(1, Math.ceil(t / n)) : Infinity, s = Math.min(r, o);
|
|
541
|
-
i !== s && (
|
|
546
|
+
i !== s && (C.value = s);
|
|
542
547
|
}, { immediate: !0 });
|
|
543
|
-
let
|
|
544
|
-
columns: () =>
|
|
545
|
-
allColumns: () =>
|
|
548
|
+
let cn = k.export?.useExport({
|
|
549
|
+
columns: () => P.value,
|
|
550
|
+
allColumns: () => b.columns,
|
|
546
551
|
resolve: Ze,
|
|
547
552
|
format: () => Ke.value,
|
|
548
|
-
getKey:
|
|
553
|
+
getKey: O,
|
|
549
554
|
isGroup: (e) => !!G?.isGroup(e),
|
|
550
|
-
rows: (e) => e === "page" ?
|
|
551
|
-
children:
|
|
555
|
+
rows: (e) => e === "page" ? sn.value : dt(e === "all" ? U.value : Zt.value),
|
|
556
|
+
children: R,
|
|
552
557
|
prepare: (e, t) => (t ? Ct : dt)(e),
|
|
553
|
-
selected:
|
|
554
|
-
extraRows: () => [...
|
|
558
|
+
selected: S,
|
|
559
|
+
extraRows: () => [...b.pinnedTopRows ?? [], ...b.pinnedBottomRows ?? []],
|
|
555
560
|
totals: () => !!X?.at.value && {
|
|
556
561
|
values: X.values.value,
|
|
557
|
-
label:
|
|
562
|
+
label: b.totalsLabel
|
|
558
563
|
},
|
|
559
|
-
onCopy: (e) =>
|
|
564
|
+
onCopy: (e) => T("copy", e)
|
|
565
|
+
}), ln = k.statusBar?.useStatusBar({
|
|
566
|
+
options: () => b.statusBar,
|
|
567
|
+
rowCount: () => B.value ? H?.total.value ?? U.value.length : Zt.value.length,
|
|
568
|
+
totalRowCount: () => B.value ? void 0 : U.value.length,
|
|
569
|
+
rows: () => U.value,
|
|
570
|
+
selection: W,
|
|
571
|
+
selected: S,
|
|
572
|
+
allMatching: We,
|
|
573
|
+
filterCount: St,
|
|
574
|
+
canClear: !!k.filtering,
|
|
575
|
+
clearFilters: () => _n(),
|
|
576
|
+
children: R,
|
|
577
|
+
getKey: O,
|
|
578
|
+
columns: () => b.columns,
|
|
579
|
+
resolve: Ze,
|
|
580
|
+
format: Ke
|
|
560
581
|
});
|
|
561
582
|
if (process.env.NODE_ENV !== "production") {
|
|
562
|
-
|
|
583
|
+
Ee(() => {
|
|
563
584
|
let e = /* @__PURE__ */ new Set();
|
|
564
|
-
for (let t of
|
|
565
|
-
let n =
|
|
585
|
+
for (let t of U.value) {
|
|
586
|
+
let n = O(t);
|
|
566
587
|
if (e.has(n)) {
|
|
567
588
|
c(`dup:${String(n)}`, `Duplicate row key "${String(n)}". Row keys must be unique.`);
|
|
568
589
|
break;
|
|
@@ -571,93 +592,93 @@ var Oe = ["data-density"], ke = {
|
|
|
571
592
|
}
|
|
572
593
|
});
|
|
573
594
|
let e = (e, t) => c(`feature:${e}`, `${t} needs the ${e} feature. Add ${e}Feature: <VGrid :features="[${e}Feature]"> or createVueGrid({ features: [${e}Feature] }) (allFeatures for everything).`);
|
|
574
|
-
|
|
575
|
-
let t = (e) =>
|
|
576
|
-
!
|
|
577
|
-
let n =
|
|
578
|
-
!
|
|
579
|
-
let r =
|
|
580
|
-
!
|
|
581
|
-
let i =
|
|
582
|
-
!
|
|
583
|
-
let a =
|
|
584
|
-
!
|
|
585
|
-
let o =
|
|
586
|
-
!
|
|
587
|
-
let s = o.find((e) => !
|
|
588
|
-
|
|
589
|
-
}),
|
|
595
|
+
Ee(() => {
|
|
596
|
+
let t = (e) => b.columns.find((t) => t[e])?.key;
|
|
597
|
+
!k.sorting && t("sortable") && e("sorting", `Column "${t("sortable")}" is sortable; that`), !k.filtering && (t("filterable") || b.filterRow || Ve.value) && e("filtering", "Filtering (`filterable` columns, `filter-row`, `v-model:filters`)"), !k.serverData && b.dataSource && e("serverData", "`data-source`"), !k.pagination && b.pagination && e("pagination", "`pagination`"), !k.virtualScrolling && b.virtual && e("virtualScrolling", "`virtual`"), !k.selection && b.selectable && e("selection", "`selectable`"), !k.subGrids && (b.subRows || b.loadSubRows) && e("subGrids", "`sub-rows` / `load-sub-rows`");
|
|
598
|
+
let n = b.columns.find((e) => e.group)?.key;
|
|
599
|
+
!k.columnGroups && n && e("columnGroups", `Column "${n}" has a \`group\`; that`);
|
|
600
|
+
let r = b.columns.find((e) => e.hidden)?.key ?? ze.value?.hidden?.[0];
|
|
601
|
+
!k.columnVisibility && r && e("columnVisibility", `Column "${r}" is hidden; that`);
|
|
602
|
+
let i = b.columns.find((e) => e.pinned)?.key;
|
|
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`");
|
|
604
|
+
let a = b.columns.find((e) => e.exportValue)?.key;
|
|
605
|
+
!k.export && a && e("export", `Column "${a}" has an \`exportValue\`; that`);
|
|
606
|
+
let o = w.value == null ? [] : typeof w.value == "string" ? [w.value] : w.value;
|
|
607
|
+
!k.rowGrouping && o.length && e("rowGrouping", "`group-by`");
|
|
608
|
+
let s = o.find((e) => !b.columns.some((t) => t.key === e));
|
|
609
|
+
k.rowGrouping && s !== void 0 && c(`group-by:${s}`, `\`group-by\` names "${s}", which is not a column key; it is ignored.`);
|
|
610
|
+
}), y(() => b.features, () => c("features-changed", "`features` is read once, when the grid is created; changes are ignored."));
|
|
590
611
|
}
|
|
591
|
-
let
|
|
592
|
-
keyboardNav:
|
|
593
|
-
cellRole:
|
|
594
|
-
rovingTabindex:
|
|
595
|
-
columns:
|
|
612
|
+
let un = l(() => new Set(b.highlightedRows ?? [])), $ = {
|
|
613
|
+
keyboardNav: Ut,
|
|
614
|
+
cellRole: Ut ? "gridcell" : "cell",
|
|
615
|
+
rovingTabindex: Ut ? -1 : void 0,
|
|
616
|
+
columns: P,
|
|
596
617
|
slots: Ge,
|
|
597
|
-
ui: l(() =>
|
|
598
|
-
getKey:
|
|
618
|
+
ui: l(() => b.ui ?? {}),
|
|
619
|
+
getKey: O,
|
|
599
620
|
sortRows: Ct,
|
|
600
621
|
sortable: ct,
|
|
601
|
-
resize:
|
|
602
|
-
Handle:
|
|
622
|
+
resize: F && {
|
|
623
|
+
Handle: k.columnResizing.Handle,
|
|
603
624
|
can: rt,
|
|
604
|
-
start: (e, t) =>
|
|
605
|
-
autosize: (e) => void
|
|
606
|
-
step: (e, t) =>
|
|
607
|
-
isSized: (e) => !!
|
|
625
|
+
start: (e, t) => F.onPointerDown(e, t),
|
|
626
|
+
autosize: (e) => void F.autosize(e),
|
|
627
|
+
step: (e, t) => F.step(e, t),
|
|
628
|
+
isSized: (e) => !!j.value.widths?.[e] || F.resizing.value === e
|
|
608
629
|
},
|
|
609
630
|
headerRows: st,
|
|
610
|
-
pinnedTopCount:
|
|
631
|
+
pinnedTopCount: $t,
|
|
611
632
|
totals: X && {
|
|
612
633
|
values: X.values,
|
|
613
|
-
label: l(() =>
|
|
634
|
+
label: l(() => b.totalsLabel)
|
|
614
635
|
},
|
|
615
|
-
treeMode:
|
|
636
|
+
treeMode: L,
|
|
616
637
|
hasDetail: pt,
|
|
617
638
|
canExpand: ht,
|
|
618
639
|
isExpanded: (e) => mt.value.has(e),
|
|
619
640
|
toggleExpanded: gt,
|
|
620
|
-
children: (e) =>
|
|
621
|
-
subRowState: (e) =>
|
|
622
|
-
ensureSubRows: (e) =>
|
|
623
|
-
retrySubRows: (e) =>
|
|
624
|
-
selectMode:
|
|
625
|
-
Checkbox:
|
|
641
|
+
children: (e) => R(e),
|
|
642
|
+
subRowState: (e) => I?.state(e),
|
|
643
|
+
ensureSubRows: (e) => I?.ensure(e),
|
|
644
|
+
retrySubRows: (e) => I?.retry(e),
|
|
645
|
+
selectMode: N,
|
|
646
|
+
Checkbox: k.selection?.Checkbox,
|
|
626
647
|
isRowSelectable: (e) => W?.isRowSelectable(e) ?? !1,
|
|
627
648
|
rowCheckState: (e) => W?.rowCheckState(e) ?? "none",
|
|
628
649
|
toggleRow: (e, t) => W?.toggleRow(e, t),
|
|
629
|
-
isHighlighted: (e) =>
|
|
630
|
-
rowClass: (e, t) =>
|
|
631
|
-
rowClickable: l(() =>
|
|
632
|
-
flash: l(() =>
|
|
633
|
-
filters:
|
|
634
|
-
FilterButton:
|
|
635
|
-
FilterInput:
|
|
636
|
-
state:
|
|
637
|
-
setSearch:
|
|
638
|
-
setColumnFilter:
|
|
639
|
-
isActive:
|
|
640
|
-
typeOf: (e) =>
|
|
641
|
-
filterRow: l(() =>
|
|
642
|
-
distinct:
|
|
650
|
+
isHighlighted: (e) => un.value.has(e),
|
|
651
|
+
rowClass: (e, t) => b.rowClass?.(e, t),
|
|
652
|
+
rowClickable: l(() => b.rowClickable),
|
|
653
|
+
flash: l(() => b.flash ?? !1),
|
|
654
|
+
filters: z && {
|
|
655
|
+
FilterButton: k.filtering.FilterButton,
|
|
656
|
+
FilterInput: k.filtering.FilterInput,
|
|
657
|
+
state: z.state,
|
|
658
|
+
setSearch: z.setSearch,
|
|
659
|
+
setColumnFilter: z.setColumnFilter,
|
|
660
|
+
isActive: z.isActive,
|
|
661
|
+
typeOf: (e) => z.typeOf(e),
|
|
662
|
+
filterRow: l(() => b.filterRow),
|
|
663
|
+
distinct: z.distinct,
|
|
643
664
|
idFor: yt,
|
|
644
665
|
open: bt
|
|
645
666
|
},
|
|
646
667
|
virtual: $e,
|
|
647
|
-
virtualRows:
|
|
668
|
+
virtualRows: rn?.context,
|
|
648
669
|
pinStyle: (e) => {
|
|
649
|
-
let t =
|
|
670
|
+
let t = Rt?.value[e];
|
|
650
671
|
return t === void 0 ? void 0 : { "--vg-pin-offset": t };
|
|
651
672
|
},
|
|
652
|
-
onRowClick: (e, t, n) =>
|
|
653
|
-
onCellClick: (e, t, n, r) =>
|
|
673
|
+
onRowClick: (e, t, n) => T("row-click", e, n),
|
|
674
|
+
onCellClick: (e, t, n, r) => T("cell-click", {
|
|
654
675
|
row: e,
|
|
655
676
|
rowKey: t,
|
|
656
677
|
column: n.def,
|
|
657
678
|
value: a(e, n.def),
|
|
658
679
|
event: r
|
|
659
680
|
}),
|
|
660
|
-
onCellAction: (e, t, n, r, i) =>
|
|
681
|
+
onCellAction: (e, t, n, r, i) => T("cell-action", {
|
|
661
682
|
name: r,
|
|
662
683
|
payload: i,
|
|
663
684
|
row: e,
|
|
@@ -678,110 +699,115 @@ var Oe = ["data-density"], ke = {
|
|
|
678
699
|
value: a(e, n.def)
|
|
679
700
|
}, r, i) : void 0
|
|
680
701
|
};
|
|
681
|
-
G?.extend($,
|
|
682
|
-
function
|
|
683
|
-
|
|
702
|
+
G?.extend($, k.rowGrouping.GroupCells), ye(te, $);
|
|
703
|
+
function dn() {
|
|
704
|
+
D.value?.scrollTo({ top: 0 });
|
|
684
705
|
}
|
|
685
|
-
function
|
|
686
|
-
|
|
706
|
+
function fn(e) {
|
|
707
|
+
rn?.scrollToKey(e) || (D.value?.querySelector(`[data-row-key="${CSS.escape(String(e))}"] > .vg-cell`))?.scrollIntoView({ block: "nearest" });
|
|
687
708
|
}
|
|
688
|
-
function
|
|
709
|
+
function pn() {
|
|
689
710
|
let e = [];
|
|
690
|
-
U
|
|
691
|
-
ht(t) && e.push(
|
|
711
|
+
Mt(U.value, (t) => {
|
|
712
|
+
ht(t) && e.push(O(t));
|
|
692
713
|
}), Be.value = e, G?.setAll(!0);
|
|
693
714
|
}
|
|
694
|
-
function
|
|
715
|
+
function mn() {
|
|
695
716
|
Be.value = [], G?.setAll(!1);
|
|
696
717
|
}
|
|
697
|
-
function
|
|
698
|
-
return (
|
|
718
|
+
function hn(e) {
|
|
719
|
+
return (I?.patchLoaded(e) ?? 0) + (B.value && H ? H.patch(e) : 0);
|
|
699
720
|
}
|
|
700
|
-
function
|
|
701
|
-
|
|
721
|
+
function gn(e) {
|
|
722
|
+
z ? z.setFilters(e) : process.env.NODE_ENV !== "production" && c("feature:filtering", "setFilters() needs the filtering feature (filteringFeature).");
|
|
702
723
|
}
|
|
703
|
-
let
|
|
704
|
-
function
|
|
705
|
-
return ((t) =>
|
|
724
|
+
let _n = () => z?.clearAll(), vn = () => W?.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 === "getCsv" ? "" : e === "copyRows" ? Promise.resolve(!1) : void 0));
|
|
706
727
|
}
|
|
707
|
-
return
|
|
708
|
-
scrollToTop:
|
|
709
|
-
scrollToRow:
|
|
710
|
-
expandAll:
|
|
711
|
-
collapseAll:
|
|
712
|
-
setColumnState:
|
|
713
|
-
patchLoadedRows:
|
|
714
|
-
setFilters:
|
|
715
|
-
clearFilters:
|
|
728
|
+
return me({
|
|
729
|
+
scrollToTop: dn,
|
|
730
|
+
scrollToRow: fn,
|
|
731
|
+
expandAll: pn,
|
|
732
|
+
collapseAll: mn,
|
|
733
|
+
setColumnState: M,
|
|
734
|
+
patchLoadedRows: hn,
|
|
735
|
+
setFilters: gn,
|
|
736
|
+
clearFilters: _n,
|
|
716
737
|
openFilter: bt,
|
|
717
738
|
reload: At,
|
|
718
739
|
reloadSubRows: jt,
|
|
719
|
-
pinRow:
|
|
720
|
-
getCsv:
|
|
721
|
-
exportCsv:
|
|
722
|
-
copyRows:
|
|
723
|
-
clearSelection:
|
|
724
|
-
}), (e, t) => (
|
|
725
|
-
class:
|
|
726
|
-
"data-density":
|
|
740
|
+
pinRow: en,
|
|
741
|
+
getCsv: yn("getCsv"),
|
|
742
|
+
exportCsv: yn("exportCsv"),
|
|
743
|
+
copyRows: yn("copyRows"),
|
|
744
|
+
clearSelection: vn
|
|
745
|
+
}), (e, t) => (h(), f("div", {
|
|
746
|
+
class: _e(["vg-root", m.ui?.root]),
|
|
747
|
+
"data-density": m.density ?? _(E)?.density
|
|
727
748
|
}, [
|
|
728
|
-
|
|
729
|
-
columns:
|
|
730
|
-
columnState:
|
|
731
|
-
setColumnState:
|
|
749
|
+
_(Ge).toolbar ? (h(), f("div", Oe, [be(e.$slots, "toolbar", {
|
|
750
|
+
columns: m.columns,
|
|
751
|
+
columnState: j.value,
|
|
752
|
+
setColumnState: M,
|
|
732
753
|
filters: xt.value,
|
|
733
|
-
setFilters:
|
|
734
|
-
clearFilters:
|
|
754
|
+
setFilters: gn,
|
|
755
|
+
clearFilters: _n,
|
|
735
756
|
activeFilterCount: St.value,
|
|
736
|
-
selected:
|
|
737
|
-
selectedCount:
|
|
757
|
+
selected: S.value,
|
|
758
|
+
selectedCount: _(W)?.count.value ?? 0,
|
|
738
759
|
selectAllMatching: We.value,
|
|
739
|
-
clearSelection:
|
|
760
|
+
clearSelection: vn
|
|
740
761
|
})])) : d("", !0),
|
|
741
|
-
|
|
762
|
+
_(k).selection && _(W)?.banner.value ? (h(), u(g(_(k).selection.Banner), he({ key: 1 }, _(W).banner.value, {
|
|
742
763
|
onSelectAll: t[0] ||= (e) => We.value = !0,
|
|
743
|
-
onClear:
|
|
764
|
+
onClear: vn
|
|
744
765
|
}), null, 16)) : d("", !0),
|
|
745
|
-
|
|
766
|
+
kt.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", {
|
|
767
|
+
type: "button",
|
|
768
|
+
class: "vg-link-button",
|
|
769
|
+
onClick: t[1] ||= (e) => At()
|
|
770
|
+
}, "Retry")])) : d("", !0),
|
|
771
|
+
p("div", Ae, [Ot.value ? (h(), f("div", je)) : d("", !0), p("div", {
|
|
746
772
|
ref_key: "root",
|
|
747
|
-
ref:
|
|
748
|
-
class:
|
|
773
|
+
ref: D,
|
|
774
|
+
class: _e(["vg", {
|
|
749
775
|
"vg-virtual": $e.value,
|
|
750
|
-
"vg-is-dragging":
|
|
751
|
-
"vg-is-resizing":
|
|
776
|
+
"vg-is-dragging": _(q)?.dragging.value,
|
|
777
|
+
"vg-is-resizing": _(F)?.resizing.value,
|
|
752
778
|
"vg-has-groups": ot.value,
|
|
753
779
|
"vg-pins-dropped": et.value,
|
|
754
|
-
"vg-grouped":
|
|
780
|
+
"vg-grouped": _(G)?.active.value,
|
|
755
781
|
"vg-has-pinned-rows": Z.value.top.length || Z.value.bottom.length,
|
|
756
|
-
"vg-has-cell-menu": !!
|
|
782
|
+
"vg-has-cell-menu": !!_(J) && !!m.contextMenu
|
|
757
783
|
}]),
|
|
758
|
-
role:
|
|
784
|
+
role: qt.value,
|
|
759
785
|
tabindex: "0",
|
|
760
|
-
"aria-label":
|
|
786
|
+
"aria-label": m.ariaLabel,
|
|
761
787
|
"aria-busy": Ot.value || void 0,
|
|
762
788
|
"aria-rowcount": Q.value ? Q.value.rowCount + st.value + Z.value.top.length + Z.value.bottom.length : void 0,
|
|
763
|
-
"aria-colcount":
|
|
764
|
-
"aria-multiselectable":
|
|
765
|
-
style:
|
|
789
|
+
"aria-colcount": P.value.length,
|
|
790
|
+
"aria-multiselectable": Ut && N.value === "multi" || void 0,
|
|
791
|
+
style: ve({
|
|
766
792
|
"--vg-columns": at.value,
|
|
767
793
|
"--vg-row-height": Qe.value ? `${Qe.value.rowHeight}px` : void 0
|
|
768
794
|
}),
|
|
769
|
-
onScrollPassive:
|
|
770
|
-
onKeydown:
|
|
771
|
-
onFocusin:
|
|
795
|
+
onScrollPassive: an,
|
|
796
|
+
onKeydown: Gt,
|
|
797
|
+
onFocusin: Kt
|
|
772
798
|
}, [
|
|
773
|
-
ot.value &&
|
|
774
|
-
|
|
775
|
-
sort:
|
|
776
|
-
"all-state":
|
|
777
|
-
"has-selectable-rows":
|
|
778
|
-
dragging:
|
|
779
|
-
"drop-target":
|
|
780
|
-
"can-reorder":
|
|
799
|
+
ot.value && _(k).columnGroups ? (h(), u(g(_(k).columnGroups.GroupRow), { key: 0 })) : d("", !0),
|
|
800
|
+
fe(le, {
|
|
801
|
+
sort: x.value,
|
|
802
|
+
"all-state": Pt.value,
|
|
803
|
+
"has-selectable-rows": Ft.value,
|
|
804
|
+
dragging: _(q)?.dragging.value ?? null,
|
|
805
|
+
"drop-target": _(q)?.target.value ?? null,
|
|
806
|
+
"can-reorder": Bt,
|
|
781
807
|
onSort: ft,
|
|
782
|
-
onToggleAll: t[
|
|
783
|
-
onDragStart:
|
|
784
|
-
onHeaderClick: t[
|
|
808
|
+
onToggleAll: t[2] ||= (e) => _(W)?.toggleAll(),
|
|
809
|
+
onDragStart: Vt,
|
|
810
|
+
onHeaderClick: t[3] ||= (e) => _(q)?.consumeClick(e)
|
|
785
811
|
}, null, 8, [
|
|
786
812
|
"sort",
|
|
787
813
|
"all-state",
|
|
@@ -789,66 +815,71 @@ var Oe = ["data-density"], ke = {
|
|
|
789
815
|
"dragging",
|
|
790
816
|
"drop-target"
|
|
791
817
|
]),
|
|
792
|
-
|
|
818
|
+
_(Xt) && Z.value.top.length ? (h(), u(g(_(Xt)), {
|
|
793
819
|
key: 1,
|
|
794
820
|
position: "top",
|
|
795
821
|
items: Z.value.top,
|
|
796
822
|
"aria-start": Q.value ? st.value + 1 : void 0
|
|
797
823
|
}, null, 8, ["items", "aria-start"])) : d("", !0),
|
|
798
|
-
|
|
824
|
+
sn.value.length ? (h(), u(ue, {
|
|
799
825
|
key: 2,
|
|
800
|
-
rows:
|
|
826
|
+
rows: sn.value,
|
|
801
827
|
presorted: "",
|
|
802
828
|
layout: Q.value ?? void 0
|
|
803
|
-
}, null, 8, ["rows", "layout"])) : (
|
|
829
|
+
}, null, 8, ["rows", "layout"])) : (h(), f("div", Ne, [p("div", {
|
|
804
830
|
role: $.cellRole,
|
|
805
831
|
tabindex: $.rovingTabindex,
|
|
806
|
-
class:
|
|
807
|
-
}, [Ot.value ?
|
|
832
|
+
class: _e(["vg-empty", m.ui?.empty])
|
|
833
|
+
}, [Ot.value ? be(e.$slots, "loading", {}, () => [t[9] ||= de("Loading…", -1)], void 0, 0) : kt.value ? (h(), f("span", Fe, [t[10] ||= de(" Couldn't load the rows. ", -1), p("button", {
|
|
808
834
|
type: "button",
|
|
809
835
|
class: "vg-link-button",
|
|
810
|
-
onClick: t[
|
|
811
|
-
}, "Retry")])) : (
|
|
836
|
+
onClick: t[4] ||= (e) => At()
|
|
837
|
+
}, "Retry")])) : (B.value || m.rows.length) && St.value ? (h(), f("span", Ie, [de(Se(m.noMatchText) + " ", 1), p("button", {
|
|
812
838
|
type: "button",
|
|
813
839
|
class: "vg-link-button",
|
|
814
|
-
onClick: t[
|
|
815
|
-
}, " Clear filters ")])) :
|
|
816
|
-
|
|
840
|
+
onClick: t[5] ||= (e) => _n()
|
|
841
|
+
}, " Clear filters ")])) : be(e.$slots, "empty", {}, () => [de(Se(m.emptyText), 1)], void 0, 3)], 10, Pe)])),
|
|
842
|
+
_(Xt) && Z.value.bottom.length ? (h(), u(g(_(Xt)), {
|
|
817
843
|
key: 4,
|
|
818
844
|
position: "bottom",
|
|
819
845
|
items: Z.value.bottom,
|
|
820
846
|
"aria-start": Q.value ? st.value + Z.value.top.length + Q.value.rowCount + 1 : void 0
|
|
821
847
|
}, null, 8, ["items", "aria-start"])) : d("", !0)
|
|
822
848
|
], 46, Me)]),
|
|
823
|
-
|
|
824
|
-
key:
|
|
825
|
-
|
|
826
|
-
|
|
849
|
+
_(ln)?.enabled.value && _(k).statusBar ? (h(), u(g(_(k).statusBar.StatusBar), {
|
|
850
|
+
key: 3,
|
|
851
|
+
bar: _(ln),
|
|
852
|
+
render: _(Ge)["status-bar"]
|
|
853
|
+
}, null, 8, ["bar", "render"])) : d("", !0),
|
|
854
|
+
V.value && _(k).pagination ? (h(), u(g(_(k).pagination.Pagination), {
|
|
855
|
+
key: 4,
|
|
856
|
+
page: C.value,
|
|
857
|
+
"onUpdate:page": t[6] ||= (e) => C.value = e,
|
|
827
858
|
"page-size": He.value,
|
|
828
|
-
"onUpdate:pageSize": t[
|
|
859
|
+
"onUpdate:pageSize": t[7] ||= (e) => He.value = e,
|
|
829
860
|
class: "vg-grid-pagination",
|
|
830
|
-
total:
|
|
831
|
-
"page-sizes": typeof
|
|
861
|
+
total: on.value,
|
|
862
|
+
"page-sizes": typeof m.pagination == "object" ? m.pagination.pageSizes : void 0
|
|
832
863
|
}, null, 40, [
|
|
833
864
|
"page",
|
|
834
865
|
"page-size",
|
|
835
866
|
"total",
|
|
836
867
|
"page-sizes"
|
|
837
868
|
])) : d("", !0),
|
|
838
|
-
|
|
839
|
-
key:
|
|
869
|
+
_(k).menus && _(J) ? (h(), u(g(_(k).menus.Menu), {
|
|
870
|
+
key: 5,
|
|
840
871
|
ref_key: "menuRef",
|
|
841
|
-
ref:
|
|
842
|
-
items:
|
|
843
|
-
label:
|
|
872
|
+
ref: Jt,
|
|
873
|
+
items: _(J).items.value,
|
|
874
|
+
label: _(J).label.value,
|
|
844
875
|
placement: "point",
|
|
845
|
-
onSelect:
|
|
876
|
+
onSelect: _(J).onSelect
|
|
846
877
|
}, null, 40, [
|
|
847
878
|
"items",
|
|
848
879
|
"label",
|
|
849
880
|
"onSelect"
|
|
850
881
|
])) : d("", !0)
|
|
851
|
-
], 10,
|
|
882
|
+
], 10, De));
|
|
852
883
|
}
|
|
853
884
|
});
|
|
854
885
|
export { Le as default };
|