@nocopypaste/vue-grid 0.11.0 → 0.12.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 +51 -28
- package/CHANGELOG.md +18 -0
- package/README.md +90 -29
- package/agent/api.json +43 -1
- package/agent/api.md +7 -1
- package/agent/grid-config.schema.json +8 -0
- package/dist/agent/api.js +40 -1
- package/dist/agent/requirements.js +3 -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 +320 -288
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +15 -8
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js +29 -22
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useCellRange.js +206 -0
- package/dist/composables/useCellRange.js.map +1 -0
- package/dist/composables/useStatusBar.js +17 -0
- package/dist/composables/useStatusBar.js.map +1 -1
- package/dist/core.css +1 -1
- package/dist/features/index.js +23 -21
- package/dist/features/index.js.map +1 -1
- package/dist/features/rangeSelection.js +9 -0
- package/dist/features/rangeSelection.js.map +1 -0
- package/dist/index.js +12 -11
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/features.js.map +1 -1
- package/dist/locales/de.js +4 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.js +4 -0
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +4 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +4 -0
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/sr-Latn.js +5 -0
- package/dist/locales/sr-Latn.js.map +1 -1
- package/dist/locales/sr.js +5 -0
- package/dist/locales/sr.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 +14 -2
- package/dist/types/composables/useCellRange.d.ts +72 -0
- package/dist/types/composables/useStatusBar.d.ts +7 -0
- package/dist/types/features/index.d.ts +2 -1
- package/dist/types/features/rangeSelection.d.ts +9 -0
- package/dist/types/internal/context.d.ts +2 -0
- package/dist/types/internal/features.d.ts +2 -1
- package/dist/types/locales/de.d.ts +1 -0
- package/dist/types/locales/en.d.ts +1 -0
- package/dist/types/locales/es.d.ts +1 -0
- package/dist/types/locales/fr.d.ts +1 -0
- package/dist/types/locales/sr-Latn.d.ts +1 -0
- package/dist/types/locales/sr.d.ts +1 -0
- package/dist/types/types.d.ts +54 -3
- package/dist/vue-grid.css +1 -1
- package/llms-full.txt +148 -58
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -51,6 +51,7 @@ var ke = ["data-density"], Ae = {
|
|
|
51
51
|
},
|
|
52
52
|
statusBar: { type: [Boolean, Object] },
|
|
53
53
|
saveCell: {},
|
|
54
|
+
rangeSelection: { type: Boolean },
|
|
54
55
|
messages: {},
|
|
55
56
|
parts: {},
|
|
56
57
|
sortMode: { default: "controlled" },
|
|
@@ -148,7 +149,9 @@ var ke = ["data-density"], Ae = {
|
|
|
148
149
|
},
|
|
149
150
|
selectAllMatchingModifiers: {},
|
|
150
151
|
selectedGroups: { default: () => [] },
|
|
151
|
-
selectedGroupsModifiers: {}
|
|
152
|
+
selectedGroupsModifiers: {},
|
|
153
|
+
range: { default: null },
|
|
154
|
+
rangeModifiers: {}
|
|
152
155
|
}),
|
|
153
156
|
emits: /*@__PURE__*/ ve([
|
|
154
157
|
"query-change",
|
|
@@ -173,28 +176,29 @@ var ke = ["data-density"], Ae = {
|
|
|
173
176
|
"update:pinnedRows",
|
|
174
177
|
"update:groupBy",
|
|
175
178
|
"update:selectAllMatching",
|
|
176
|
-
"update:selectedGroups"
|
|
179
|
+
"update:selectedGroups",
|
|
180
|
+
"update:range"
|
|
177
181
|
]),
|
|
178
182
|
setup(p, { expose: ve, emit: ze }) {
|
|
179
183
|
let Be = Object.freeze({
|
|
180
184
|
columns: Object.freeze({}),
|
|
181
185
|
search: ""
|
|
182
|
-
}), x = p, Ve = y(p, "sort"), He = y(p, "sorts"), Ue = y(p, "columnState"), We = y(p, "expanded"), S = y(p, "selected"), Ge = y(p, "filters"), C = y(p, "page"), Ke = y(p, "pageSize"), qe = y(p, "pinnedRows"), w = y(p, "groupBy"), Je = y(p, "selectAllMatching"), T = y(p, "selectedGroups"), E = ze,
|
|
186
|
+
}), x = p, Ve = y(p, "sort"), He = y(p, "sorts"), Ue = y(p, "columnState"), We = y(p, "expanded"), S = y(p, "selected"), Ge = y(p, "filters"), C = y(p, "page"), Ke = y(p, "pageSize"), qe = y(p, "pinnedRows"), w = y(p, "groupBy"), Je = y(p, "selectAllMatching"), T = y(p, "selectedGroups"), Ye = y(p, "range"), E = ze, Xe = De(), D = _e(ce, void 0), O = we(), Ze = c(() => le({
|
|
183
187
|
locale: x.locale,
|
|
184
188
|
currency: x.currency,
|
|
185
189
|
timeZone: x.timeZone
|
|
186
190
|
}, D));
|
|
187
|
-
Ce(se,
|
|
191
|
+
Ce(se, Ze);
|
|
188
192
|
let k = c(() => ({
|
|
189
193
|
...D?.messages,
|
|
190
194
|
...x.messages
|
|
191
|
-
})),
|
|
195
|
+
})), Qe = c(() => ({
|
|
192
196
|
...D?.parts,
|
|
193
197
|
...x.parts
|
|
194
198
|
}));
|
|
195
|
-
Ce(te, k), Ce(ne,
|
|
196
|
-
let A = (e) => re(
|
|
197
|
-
b(
|
|
199
|
+
Ce(te, k), Ce(ne, Qe);
|
|
200
|
+
let A = (e) => re(Qe.value, e), $e = c(() => x.totalsLabel ?? k.value.total ?? "Total"), j = (e) => o(e, x.rowKey), M = ee(D?.features, x.features), et = c(() => typeof x.storage == "string" ? i(x.storage) : x.storage), tt = we(et.value?.load() ?? null);
|
|
201
|
+
b(et, (e) => tt.value = e?.load() ?? null);
|
|
198
202
|
let N = c(() => {
|
|
199
203
|
let e = !!M.columnPinning, t = !!M.columnVisibility;
|
|
200
204
|
return e && t ? x.columns : x.columns.map((n) => !e && n.pinned || !t && n.hidden ? {
|
|
@@ -203,7 +207,7 @@ var ke = ["data-density"], Ae = {
|
|
|
203
207
|
hidden: t ? n.hidden : void 0
|
|
204
208
|
} : n);
|
|
205
209
|
}), P = c(() => {
|
|
206
|
-
let e = n(N.value, Ue.value ??
|
|
210
|
+
let e = n(N.value, Ue.value ?? tt.value);
|
|
207
211
|
return {
|
|
208
212
|
...e,
|
|
209
213
|
hidden: M.columnVisibility ? e.hidden : [],
|
|
@@ -213,27 +217,27 @@ var ke = ["data-density"], Ae = {
|
|
|
213
217
|
});
|
|
214
218
|
function F(e) {
|
|
215
219
|
let t = n(N.value, e);
|
|
216
|
-
Ue.value = t,
|
|
220
|
+
Ue.value = t, et.value?.save(t);
|
|
217
221
|
}
|
|
218
|
-
let
|
|
219
|
-
function
|
|
222
|
+
let nt = c(() => ue([fe], D?.renderers, x.renderers)), rt = (e) => e.replace(/-(\w)/g, (e, t) => t.toUpperCase());
|
|
223
|
+
function it(e) {
|
|
220
224
|
let t = e.renderer ?? "text";
|
|
221
225
|
if (de(t)) return {
|
|
222
226
|
component: Te(t.component),
|
|
223
227
|
definition: t
|
|
224
228
|
};
|
|
225
229
|
if (typeof t != "string") return { component: Te(t) };
|
|
226
|
-
let n =
|
|
230
|
+
let n = nt.value.get(t);
|
|
227
231
|
return n ? {
|
|
228
232
|
component: Te(n.component),
|
|
229
233
|
definition: n
|
|
230
|
-
} : (process.env.NODE_ENV !== "production" && s(`renderer:${t}`, `Unknown renderer "${t}" (column "${e.key}"); falling back to "text". Pass the definition (renderer: ${
|
|
234
|
+
} : (process.env.NODE_ENV !== "production" && s(`renderer:${t}`, `Unknown renderer "${t}" (column "${e.key}"); falling back to "text". Pass the definition (renderer: ${rt(t)}Renderer) or register it by name: createVueGrid({ renderers: [${rt(t)}Renderer] }) / <VGrid :renderers="[…]">.`), {
|
|
231
235
|
component: fe.component,
|
|
232
236
|
definition: fe,
|
|
233
237
|
fallback: !0
|
|
234
238
|
});
|
|
235
239
|
}
|
|
236
|
-
let
|
|
240
|
+
let at = c(() => M.virtualScrolling && x.virtual || !1), ot = c(() => !!at.value), I = c(() => M.selection ? x.selectable === "single" ? "single" : x.selectable ? "multi" : !1 : !1), st = we(!1), ct = (t, n) => st.value ? void 0 : e(t, n), L = c(() => {
|
|
237
241
|
let e = P.value, t = r(N.value, e), n = [];
|
|
238
242
|
if (I.value && n.push({
|
|
239
243
|
key: oe,
|
|
@@ -246,11 +250,11 @@ var ke = ["data-density"], Ae = {
|
|
|
246
250
|
definition: void 0,
|
|
247
251
|
options: {},
|
|
248
252
|
align: "center",
|
|
249
|
-
pinned: t.some((t) =>
|
|
253
|
+
pinned: t.some((t) => ct(t, e) === "left") ? "left" : void 0,
|
|
250
254
|
pinEdge: !1,
|
|
251
255
|
isTree: !1
|
|
252
256
|
}), t.forEach((t, r) => {
|
|
253
|
-
let { component: i, definition: a, fallback: o } =
|
|
257
|
+
let { component: i, definition: a, fallback: o } = it(t);
|
|
254
258
|
n.push({
|
|
255
259
|
key: t.key,
|
|
256
260
|
kind: "data",
|
|
@@ -262,7 +266,7 @@ var ke = ["data-density"], Ae = {
|
|
|
262
266
|
...t.rendererOptions
|
|
263
267
|
},
|
|
264
268
|
align: t.align ?? a?.align ?? "start",
|
|
265
|
-
pinned:
|
|
269
|
+
pinned: ct(t, e),
|
|
266
270
|
pinEdge: !1,
|
|
267
271
|
isTree: r === 0
|
|
268
272
|
});
|
|
@@ -276,8 +280,8 @@ var ke = ["data-density"], Ae = {
|
|
|
276
280
|
defOf: (e) => x.columns.find((t) => t.key === e),
|
|
277
281
|
state: () => P.value,
|
|
278
282
|
setState: F
|
|
279
|
-
}),
|
|
280
|
-
let t = e.kind === "data" ?
|
|
283
|
+
}), lt = (e) => R?.live.value?.key === e ? R.live.value.width : P.value.widths?.[e], ut = (e) => !!R && e.resizable !== !1, dt = c(() => L.value.map((e) => {
|
|
284
|
+
let t = e.kind === "data" ? lt(e.key) : void 0;
|
|
281
285
|
return t ? {
|
|
282
286
|
...e,
|
|
283
287
|
def: {
|
|
@@ -286,10 +290,10 @@ var ke = ["data-density"], Ae = {
|
|
|
286
290
|
minWidth: void 0
|
|
287
291
|
}
|
|
288
292
|
} : e;
|
|
289
|
-
})),
|
|
290
|
-
function
|
|
293
|
+
})), ft = c(() => t(dt.value.map((e) => e.def))), pt = c(() => !!M.columnGroups && L.value.some((e) => e.kind === "data" && !!e.def.group)), mt = c(() => pt.value ? 2 : 1), ht = (e) => !!M.sorting && !!e.sortable, gt = (e) => e;
|
|
294
|
+
function _t(e) {
|
|
291
295
|
if (e.sortValue) return e.sortValue;
|
|
292
|
-
let { definition: t, fallback: n } =
|
|
296
|
+
let { definition: t, fallback: n } = it(e);
|
|
293
297
|
if (!t?.sortValue) return (t) => a(t, e);
|
|
294
298
|
let r = n ? {} : {
|
|
295
299
|
...t.defaults,
|
|
@@ -297,14 +301,14 @@ var ke = ["data-density"], Ae = {
|
|
|
297
301
|
};
|
|
298
302
|
return (n) => t.sortValue(a(n, e), r);
|
|
299
303
|
}
|
|
300
|
-
let
|
|
304
|
+
let vt = M.sorting?.useSorting({
|
|
301
305
|
sort: Ve,
|
|
302
306
|
sorts: He,
|
|
303
307
|
multiSort: () => !!x.multiSort,
|
|
304
|
-
client: () =>
|
|
308
|
+
client: () => Ft.value,
|
|
305
309
|
columns: () => x.columns,
|
|
306
|
-
valueOf:
|
|
307
|
-
}),
|
|
310
|
+
valueOf: _t
|
|
311
|
+
}), yt = () => vt?.sorter() ?? gt, bt = (e) => yt()(e), z = c(() => vt?.list.value ?? (Ve.value ? [Ve.value] : [])), xt = (e) => vt?.set(e), St = (e, t = !1) => vt?.onSort(e, t), B = M.subGrids?.useSubRows({
|
|
308
312
|
getKey: j,
|
|
309
313
|
subRows: () => x.subRows,
|
|
310
314
|
loadSubRows: () => x.loadSubRows,
|
|
@@ -314,23 +318,23 @@ var ke = ["data-density"], Ae = {
|
|
|
314
318
|
error: t
|
|
315
319
|
}),
|
|
316
320
|
onLoaded: (e, t) => {
|
|
317
|
-
if (!K || !
|
|
321
|
+
if (!K || !Kt.value || !S.value.includes(j(e))) return;
|
|
318
322
|
let n = new Set(S.value);
|
|
319
|
-
|
|
323
|
+
Gt(t, (e) => {
|
|
320
324
|
K.isRowSelectable(e) && n.add(j(e));
|
|
321
325
|
}), n.size !== S.value.length && (S.value = [...n]);
|
|
322
326
|
}
|
|
323
327
|
});
|
|
324
328
|
b(() => x.loadSubRows, () => B?.clear());
|
|
325
|
-
let
|
|
326
|
-
function Tt(e) {
|
|
327
|
-
return St.value && B?.mayHaveChildren(e) ? !0 : Ct.value && (!x.rowExpandable || x.rowExpandable(e));
|
|
328
|
-
}
|
|
329
|
+
let Ct = c(() => !!B && !!(x.subRows || x.loadSubRows)), wt = c(() => !!Xe.detail), Tt = c(() => new Set(We.value)), V = (e) => Ct.value ? B?.children(e) : void 0;
|
|
329
330
|
function Et(e) {
|
|
330
|
-
|
|
331
|
+
return Ct.value && B?.mayHaveChildren(e) ? !0 : wt.value && (!x.rowExpandable || x.rowExpandable(e));
|
|
332
|
+
}
|
|
333
|
+
function Dt(e) {
|
|
334
|
+
let t = j(e), n = new Set(Tt.value);
|
|
331
335
|
n.has(t) ? n.delete(t) : n.add(t), We.value = [...n];
|
|
332
336
|
}
|
|
333
|
-
let
|
|
337
|
+
let Ot = Ee(), kt = c((e) => {
|
|
334
338
|
let t = L.value.filter((e) => e.kind === "data").map((e) => e.def);
|
|
335
339
|
return e && e.length === t.length && t.every((t) => e.includes(t)) ? e : t;
|
|
336
340
|
}), H = M.filtering?.useFilters({
|
|
@@ -338,91 +342,91 @@ var ke = ["data-density"], Ae = {
|
|
|
338
342
|
storage: () => x.filterStorage,
|
|
339
343
|
mode: () => U.value ? "controlled" : x.filterMode,
|
|
340
344
|
columns: () => x.columns,
|
|
341
|
-
visibleColumns: () =>
|
|
342
|
-
definitionOf: (e) =>
|
|
345
|
+
visibleColumns: () => kt.value,
|
|
346
|
+
definitionOf: (e) => it(e).definition,
|
|
343
347
|
rows: () => G.value,
|
|
344
348
|
childrenOf: V,
|
|
345
349
|
getKey: j,
|
|
346
350
|
timeZone: () => x.timeZone ?? D?.timeZone
|
|
347
|
-
}),
|
|
348
|
-
function
|
|
349
|
-
let t = document.getElementById(
|
|
351
|
+
}), At = (e) => `vg-filter-${Ot}-${e.replace(/[^\w-]/g, "_")}`;
|
|
352
|
+
function jt(e) {
|
|
353
|
+
let t = document.getElementById(At(e));
|
|
350
354
|
t && !t.matches(":popover-open") && t.showPopover?.();
|
|
351
355
|
}
|
|
352
|
-
let
|
|
356
|
+
let Mt = c(() => H?.state.value ?? Be), Nt = c(() => H?.activeCount.value ?? 0), Pt = (e) => bt(H ? H.apply(e) : e), U = c(() => !!M.serverData && !!x.dataSource), Ft = c(() => !U.value && x.sortMode === "client"), It = c(() => !!M.pagination && !!x.pagination && !ot.value), Lt = c(() => {
|
|
353
357
|
let e = Math.floor(Ke.value);
|
|
354
358
|
return Number.isFinite(e) && e >= 1 ? e : 25;
|
|
355
|
-
}),
|
|
359
|
+
}), Rt = c(() => {
|
|
356
360
|
let e = Math.floor(C.value);
|
|
357
361
|
return Number.isFinite(e) && e >= 1 ? e : 1;
|
|
358
|
-
}),
|
|
362
|
+
}), zt = c(() => {
|
|
359
363
|
if (!M.serverGrouping || !M.rowGrouping || !U.value || w.value == null) return;
|
|
360
364
|
let e = typeof w.value == "string" ? [w.value] : w.value, t = [...new Set(e)].filter((e) => x.columns.some((t) => t.key === e));
|
|
361
365
|
return t.length ? t : void 0;
|
|
362
|
-
}),
|
|
366
|
+
}), Bt = c(() => ({
|
|
363
367
|
sort: z.value[0] ?? null,
|
|
364
368
|
...x.multiSort ? { sorts: z.value } : {},
|
|
365
|
-
filters:
|
|
366
|
-
page:
|
|
367
|
-
pageSize:
|
|
368
|
-
...
|
|
369
|
-
groupBy:
|
|
369
|
+
filters: Mt.value,
|
|
370
|
+
page: It.value ? Rt.value : 1,
|
|
371
|
+
pageSize: It.value ? Lt.value : null,
|
|
372
|
+
...zt.value ? {
|
|
373
|
+
groupBy: zt.value,
|
|
370
374
|
groupPath: []
|
|
371
375
|
} : {}
|
|
372
376
|
})), W = M.serverData?.useDataSource({
|
|
373
377
|
source: () => x.dataSource,
|
|
374
|
-
query: () =>
|
|
378
|
+
query: () => Bt.value,
|
|
375
379
|
getKey: j,
|
|
376
380
|
onError: (e) => E("load-error", e)
|
|
377
|
-
}), G = c(() => U.value && W ? W.rows.value : x.rows),
|
|
381
|
+
}), G = c(() => U.value && W ? W.rows.value : x.rows), Vt = c(() => x.loading || !!W?.loading.value), Ht = c(() => U.value ? W?.error.value : void 0), Ut = async () => {
|
|
378
382
|
B?.clear(), await W?.reload();
|
|
379
|
-
},
|
|
380
|
-
b(() => JSON.stringify([z.value,
|
|
383
|
+
}, Wt = (e) => B?.clear(e);
|
|
384
|
+
b(() => JSON.stringify([z.value, Mt.value]), () => {
|
|
381
385
|
C.value !== 1 && (C.value = 1);
|
|
382
|
-
}), b(() => JSON.stringify(
|
|
386
|
+
}), b(() => JSON.stringify(Bt.value), () => E("query-change", Bt.value), {
|
|
383
387
|
immediate: !0,
|
|
384
388
|
flush: "post"
|
|
385
389
|
});
|
|
386
|
-
function
|
|
390
|
+
function Gt(e, t) {
|
|
387
391
|
for (let n of e) {
|
|
388
392
|
if (H && !H.isVisible(n)) continue;
|
|
389
393
|
t(n);
|
|
390
394
|
let e = V(n);
|
|
391
|
-
e &&
|
|
395
|
+
e && Gt(e, t);
|
|
392
396
|
}
|
|
393
397
|
}
|
|
394
|
-
let
|
|
398
|
+
let Kt = c(() => I.value === "multi" && x.selectionMode === "cascade" && Ct.value), K = M.selection?.useSelection({
|
|
395
399
|
selected: S,
|
|
396
400
|
mode: () => I.value,
|
|
397
|
-
cascade: () =>
|
|
401
|
+
cascade: () => Kt.value,
|
|
398
402
|
isRowSelectable: () => x.isRowSelectable,
|
|
399
403
|
getKey: j,
|
|
400
404
|
rows: () => G.value,
|
|
401
405
|
children: V,
|
|
402
406
|
visibleChildren: (e) => (V(e) ?? []).filter((e) => !H || H.isVisible(e)),
|
|
403
|
-
walk:
|
|
407
|
+
walk: Gt,
|
|
404
408
|
view: () => ({
|
|
405
|
-
rows:
|
|
406
|
-
ctx:
|
|
409
|
+
rows: jn.value,
|
|
410
|
+
ctx: In
|
|
407
411
|
}),
|
|
408
412
|
prune: () => x.pruneSelection,
|
|
409
413
|
allMatching: Je,
|
|
410
414
|
matchingTotal: () => U.value ? W?.total.value : void 0,
|
|
411
|
-
matchKey: () => JSON.stringify(
|
|
412
|
-
}),
|
|
415
|
+
matchKey: () => JSON.stringify(Mt.value)
|
|
416
|
+
}), qt = c(() => q?.server.value ? q.allServerState.value : K?.allState.value ?? "none"), Jt = c(() => q?.server.value ? q.groups.value.length > 0 : !!K?.selectableKeys.value.length), Yt = () => q?.server.value ? q.toggleAllServer() : K?.toggleAll(), q = M.rowGrouping?.useRowGrouping({
|
|
413
417
|
groupBy: () => w.value,
|
|
414
418
|
setGroupBy: (e) => w.value = e,
|
|
415
419
|
columns: () => x.columns,
|
|
416
|
-
rows: () =>
|
|
420
|
+
rows: () => bn.value,
|
|
417
421
|
sort: () => M.sorting ? z.value : [],
|
|
418
422
|
expandedByDefault: () => x.groupsExpanded,
|
|
419
423
|
selected: S,
|
|
420
|
-
cascade: () =>
|
|
421
|
-
walk:
|
|
424
|
+
cascade: () => Kt.value,
|
|
425
|
+
walk: Gt,
|
|
422
426
|
server: M.serverGrouping?.useServerGroups({
|
|
423
|
-
top: () =>
|
|
427
|
+
top: () => zt.value ? W?.groups.value : void 0,
|
|
424
428
|
load: (e, t) => x.dataSource({
|
|
425
|
-
...
|
|
429
|
+
...Bt.value,
|
|
426
430
|
groupPath: e,
|
|
427
431
|
page: 1,
|
|
428
432
|
pageSize: null
|
|
@@ -432,79 +436,81 @@ var ke = ["data-density"], Ae = {
|
|
|
432
436
|
getKey: j,
|
|
433
437
|
onError: (e) => E("load-error", e)
|
|
434
438
|
})
|
|
435
|
-
}),
|
|
436
|
-
b(() => JSON.stringify([
|
|
439
|
+
}), Xt = c(() => (K?.count.value ?? 0) + (q?.server.value ? q.selectedGroupCount.value : 0));
|
|
440
|
+
b(() => JSON.stringify([Mt.value, zt.value]), () => {
|
|
437
441
|
T.value.length && (T.value = []);
|
|
438
442
|
}), process.env.NODE_ENV !== "production" && M.rowGrouping && !M.serverGrouping && Oe(() => {
|
|
439
443
|
x.dataSource && w.value?.length && s("feature:serverGrouping", "A grid with a data source is grouped, but only the rows it has loaded are grouped. For groups across all the data from the server, add serverGroupingFeature.");
|
|
440
|
-
}), process.env.NODE_ENV !== "production" && b(() =>
|
|
444
|
+
}), process.env.NODE_ENV !== "production" && b(() => zt.value && W && !W.loading.value && !W.error.value && !W.groups.value, (e) => {
|
|
441
445
|
e && s("server-groups", "The data source got a grouped query (query.groupBy) but returned rows, not groups: only the loaded rows are grouped. Return { groups: [{ value, count, aggregates? }] } for groups across all the data.");
|
|
442
446
|
});
|
|
443
|
-
let
|
|
447
|
+
let Zt = M.columnPinning, Qt = Zt?.usePinFit(O, {
|
|
444
448
|
share: () => x.pinnedMaxShare,
|
|
445
449
|
pinnedKeys: () => {
|
|
446
450
|
let t = P.value, n = r(N.value, t).filter((n) => e(n, t)).map((e) => e.key);
|
|
447
451
|
return I.value && n.length ? [oe, ...n] : n;
|
|
448
452
|
}
|
|
449
453
|
});
|
|
450
|
-
|
|
451
|
-
let
|
|
452
|
-
|
|
453
|
-
let
|
|
454
|
-
canDrag:
|
|
455
|
-
canDrop: (e, t) =>
|
|
454
|
+
Qt && b(Qt.dropped, (e) => st.value = e, { immediate: !0 });
|
|
455
|
+
let $t = Zt?.usePinnedOffsets(O, () => dt.value);
|
|
456
|
+
Zt?.useScrollEdges(O, () => ft.value);
|
|
457
|
+
let en = (e) => !!Zt && e.pinnable !== !1, tn = M.columnReorder, nn = (e) => !!tn && x.columns.find((t) => t.key === e)?.reorderable !== !1, J = tn?.useColumnDrag({
|
|
458
|
+
canDrag: nn,
|
|
459
|
+
canDrop: (e, t) => tn.moveColumn(N.value, P.value, e, t) !== P.value,
|
|
456
460
|
onDrop: (e, t) => {
|
|
457
|
-
let n =
|
|
461
|
+
let n = J?.target.value?.side ?? "before", r = tn.moveColumnRelative(N.value, P.value, e, t, n);
|
|
458
462
|
r !== P.value && F(r);
|
|
459
463
|
},
|
|
460
464
|
onHold: (e, t, n, r) => {
|
|
461
465
|
let i = x.columns.find((t) => t.key === e);
|
|
462
|
-
i &&
|
|
466
|
+
i && Y?.openHeaderMenuAt(i, n, r, t);
|
|
463
467
|
}
|
|
464
468
|
});
|
|
465
|
-
function
|
|
466
|
-
if (
|
|
469
|
+
function rn(e, t) {
|
|
470
|
+
if (J) return J.onPointerDown(e, t);
|
|
467
471
|
let n = x.columns.find((e) => e.key === t);
|
|
468
|
-
n &&
|
|
472
|
+
n && Y?.holdHeader(n, e, e.currentTarget);
|
|
469
473
|
}
|
|
470
|
-
function
|
|
471
|
-
if (!
|
|
474
|
+
function an(e, t) {
|
|
475
|
+
if (!tn) return !1;
|
|
472
476
|
let n = L.value.filter((e) => e.kind === "data"), r = n[n.findIndex((t) => t.key === e) + t];
|
|
473
477
|
if (!r) return !1;
|
|
474
|
-
let i =
|
|
478
|
+
let i = tn.moveColumn(N.value, P.value, e, r.key);
|
|
475
479
|
return i !== P.value && (F(i), !0);
|
|
476
480
|
}
|
|
477
|
-
let
|
|
481
|
+
let on = !!M.keyboardNavigation, sn = M.keyboardNavigation?.useGridKeyboard(O, {
|
|
478
482
|
moveColumn(e, t) {
|
|
479
|
-
|
|
483
|
+
an(e, t) && be(() => sn?.focusCell(O.value?.querySelector(`.vg-header > [data-col-key="${CSS.escape(e)}"]`)));
|
|
480
484
|
},
|
|
481
485
|
resizeColumn: R ? (e, t) => {
|
|
482
486
|
let n = x.columns.find((t) => t.key === e);
|
|
483
|
-
n &&
|
|
487
|
+
n && ut(n) && R.step(e, t);
|
|
484
488
|
} : void 0
|
|
485
|
-
}),
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
+
}), cn = (e) => {
|
|
490
|
+
Q?.onKeyDown(e) || (sn?.onKeyDown(e), A("copyShortcut") && Mn?.onKeyDown(e));
|
|
491
|
+
}, ln = (e) => {
|
|
492
|
+
sn?.onFocusIn(e), Q?.onFocusIn(e);
|
|
493
|
+
}, un = (e) => Q?.onPointerDown(e), dn = c(() => on ? In.treeMode.value ? "treegrid" : "grid" : "table"), fn = we(), Y = M.menus?.useMenus({
|
|
494
|
+
menu: fn,
|
|
489
495
|
messages: () => k.value,
|
|
490
496
|
columns: () => N.value,
|
|
491
497
|
columnState: () => P.value,
|
|
492
498
|
setColumnState: F,
|
|
493
499
|
sort: Ve,
|
|
494
500
|
sorts: () => z.value,
|
|
495
|
-
setSorts:
|
|
501
|
+
setSorts: xt,
|
|
496
502
|
multiSort: () => !!x.multiSort,
|
|
497
|
-
sortable:
|
|
498
|
-
pinnable:
|
|
499
|
-
reorderable: (e) =>
|
|
503
|
+
sortable: ht,
|
|
504
|
+
pinnable: en,
|
|
505
|
+
reorderable: (e) => nn(e.key),
|
|
500
506
|
hideColumn: M.columnVisibility && ((e) => F(M.columnVisibility.setColumnHidden(P.value, e, !0))),
|
|
501
507
|
resize: R && {
|
|
502
|
-
can:
|
|
508
|
+
can: ut,
|
|
503
509
|
isResized: (e) => !!P.value.widths?.[e],
|
|
504
510
|
fit: (e) => void R.autosize(e),
|
|
505
511
|
reset: (e) => R.reset(e)
|
|
506
512
|
},
|
|
507
|
-
moveColumnBy:
|
|
513
|
+
moveColumnBy: an,
|
|
508
514
|
contextMenu: () => x.contextMenu,
|
|
509
515
|
headerMenu: () => x.headerMenu,
|
|
510
516
|
grouping: q?.menu,
|
|
@@ -513,72 +519,72 @@ var ke = ["data-density"], Ae = {
|
|
|
513
519
|
filters: H && {
|
|
514
520
|
isActive: (e) => H.isActive(e),
|
|
515
521
|
anyActive: () => H.activeCount.value > 0,
|
|
516
|
-
open: (e) =>
|
|
522
|
+
open: (e) => jt(e),
|
|
517
523
|
clear: (e) => H.setColumnFilter(e, void 0),
|
|
518
524
|
clearAll: () => H.clearAll()
|
|
519
525
|
}
|
|
520
|
-
}),
|
|
526
|
+
}), pn = () => {
|
|
521
527
|
let e = x.rowKey;
|
|
522
528
|
return (t) => o(t, e);
|
|
523
|
-
},
|
|
529
|
+
}, mn = M.rowPinning?.PinnedRows ?? M.aggregation?.PinnedRows, hn = c(() => H ? H.apply(G.value) : G.value), gn = M.rowPinning?.usePinnedRows({
|
|
524
530
|
model: qe,
|
|
525
531
|
rows: () => G.value,
|
|
526
|
-
keyOf:
|
|
532
|
+
keyOf: pn,
|
|
527
533
|
extraTop: () => x.pinnedTopRows,
|
|
528
534
|
extraBottom: () => x.pinnedBottomRows
|
|
529
|
-
}),
|
|
535
|
+
}), X = M.aggregation?.useTotals({
|
|
530
536
|
totals: () => x.totals,
|
|
531
537
|
given: () => x.aggregates,
|
|
532
|
-
rows: () =>
|
|
538
|
+
rows: () => hn.value,
|
|
533
539
|
columns: () => x.columns
|
|
534
|
-
}),
|
|
535
|
-
if (!
|
|
536
|
-
top:
|
|
537
|
-
bottom:
|
|
540
|
+
}), _n = [], Z = c(() => {
|
|
541
|
+
if (!gn && !X) return {
|
|
542
|
+
top: _n,
|
|
543
|
+
bottom: _n
|
|
538
544
|
};
|
|
539
|
-
let e =
|
|
545
|
+
let e = X?.at.value, t = e ? [X.item.value] : [];
|
|
540
546
|
return {
|
|
541
|
-
top: [...e === "top" ? t : [], ...
|
|
542
|
-
bottom: [...
|
|
547
|
+
top: [...e === "top" ? t : [], ...gn?.items.value.top ?? []],
|
|
548
|
+
bottom: [...gn?.items.value.bottom ?? [], ...e === "bottom" ? t : []]
|
|
543
549
|
};
|
|
544
|
-
}),
|
|
545
|
-
function
|
|
546
|
-
|
|
550
|
+
}), vn = c(() => Z.value.top.length);
|
|
551
|
+
function yn(e, t) {
|
|
552
|
+
gn ? gn.pinRow(e, t) : process.env.NODE_ENV !== "production" && s("feature:rowPinning", "pinRow() needs the row pinning feature (rowPinningFeature).");
|
|
547
553
|
}
|
|
548
|
-
let
|
|
549
|
-
let e =
|
|
554
|
+
let bn = c(() => {
|
|
555
|
+
let e = bt(hn.value), t = gn?.keys.value;
|
|
550
556
|
if (!t?.size) return e;
|
|
551
|
-
let n =
|
|
557
|
+
let n = pn();
|
|
552
558
|
return e.filter((e) => !t.has(n(e)));
|
|
553
|
-
}),
|
|
559
|
+
}), xn = c(() => q?.active.value ? q.groups.value : bn.value), Sn = q ? () => q.keyOf(pn()) : pn, Cn = () => q?.expanded(Tt.value) ?? Tt.value, wn = () => {
|
|
560
|
+
let e = Ct.value && B ? B.snapshot : null;
|
|
561
|
+
return q ? q.tree(e) : e;
|
|
562
|
+
}, Tn = () => q?.active.value ? q.isGroup : void 0, En = () => {
|
|
563
|
+
let e = H?.visibleKeys.value ?? null, t = yt(), n = pn(), r = (r) => t(e ? r.filter((t) => e.has(n(Te(t)))) : r);
|
|
564
|
+
return q ? q.preparer(r) : r;
|
|
565
|
+
}, Dn = M.virtualScrolling?.useVirtualRows({
|
|
554
566
|
root: O,
|
|
555
|
-
options: () =>
|
|
556
|
-
rows: () =>
|
|
557
|
-
keyOf:
|
|
558
|
-
expanded:
|
|
559
|
-
subRows:
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
},
|
|
563
|
-
hasDetail: () => Ct.value,
|
|
564
|
-
isGroup: () => q?.active.value ? q.isGroup : void 0,
|
|
567
|
+
options: () => at.value,
|
|
568
|
+
rows: () => xn.value,
|
|
569
|
+
keyOf: Sn,
|
|
570
|
+
expanded: Cn,
|
|
571
|
+
subRows: wn,
|
|
572
|
+
hasDetail: () => wt.value,
|
|
573
|
+
isGroup: Tn,
|
|
565
574
|
rowExpandable: () => x.rowExpandable,
|
|
566
|
-
preparer:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
if (Ft.value && !U.value) {
|
|
572
|
-
let e = (Lt.value - 1) * It.value;
|
|
573
|
-
return _n.value.slice(e, e + It.value);
|
|
575
|
+
preparer: En
|
|
576
|
+
}), On = () => Dn?.onScroll(), kn = c(() => Dn?.layout.value ?? null), An = c(() => U.value ? W?.total.value ?? G.value.length : xn.value.length), jn = c(() => {
|
|
577
|
+
if (It.value && !U.value) {
|
|
578
|
+
let e = (Rt.value - 1) * Lt.value;
|
|
579
|
+
return xn.value.slice(e, e + Lt.value);
|
|
574
580
|
}
|
|
575
|
-
return
|
|
581
|
+
return xn.value;
|
|
576
582
|
});
|
|
577
583
|
b([
|
|
578
|
-
Ft,
|
|
579
|
-
xn,
|
|
580
584
|
It,
|
|
585
|
+
An,
|
|
581
586
|
Lt,
|
|
587
|
+
Rt,
|
|
582
588
|
() => C.value,
|
|
583
589
|
() => !U.value || W?.total.value !== void 0
|
|
584
590
|
], ([e, t, n, r, i, a]) => {
|
|
@@ -586,25 +592,25 @@ var ke = ["data-density"], Ae = {
|
|
|
586
592
|
let o = a && Number.isFinite(t) ? Math.max(1, Math.ceil(t / n)) : Infinity, ee = Math.min(r, o);
|
|
587
593
|
i !== ee && (C.value = ee);
|
|
588
594
|
}, { immediate: !0 });
|
|
589
|
-
let
|
|
595
|
+
let Mn = M.export?.useExport({
|
|
590
596
|
columns: () => L.value,
|
|
591
597
|
allColumns: () => x.columns,
|
|
592
|
-
resolve:
|
|
593
|
-
format: () =>
|
|
598
|
+
resolve: it,
|
|
599
|
+
format: () => Ze.value,
|
|
594
600
|
getKey: j,
|
|
595
601
|
isGroup: (e) => !!q?.isGroup(e),
|
|
596
602
|
groupRows: (e) => q?.rowsIn(e) ?? [],
|
|
597
|
-
rows: (e) => e === "page" ?
|
|
603
|
+
rows: (e) => e === "page" ? jn.value : q?.server.value ? q.groups.value : bt(e === "all" ? G.value : hn.value),
|
|
598
604
|
children: V,
|
|
599
|
-
prepare: (e, t) => (t ?
|
|
605
|
+
prepare: (e, t) => (t ? Pt : bt)(e),
|
|
600
606
|
selected: S,
|
|
601
607
|
extraRows: () => [...x.pinnedTopRows ?? [], ...x.pinnedBottomRows ?? []],
|
|
602
|
-
totals: () => !!
|
|
603
|
-
values:
|
|
604
|
-
label:
|
|
608
|
+
totals: () => !!X?.at.value && {
|
|
609
|
+
values: X.values.value,
|
|
610
|
+
label: $e.value
|
|
605
611
|
},
|
|
606
612
|
onCopy: (e) => E("copy", e)
|
|
607
|
-
}),
|
|
613
|
+
}), Nn = M.editing?.useEditing({
|
|
608
614
|
root: O,
|
|
609
615
|
messages: () => k.value,
|
|
610
616
|
emit: (e) => E("cell-edit", e),
|
|
@@ -612,22 +618,39 @@ var ke = ["data-density"], Ae = {
|
|
|
612
618
|
rows: () => G.value,
|
|
613
619
|
columns: () => x.columns,
|
|
614
620
|
preload: () => M.editing.preload()
|
|
615
|
-
}),
|
|
621
|
+
}), Q = M.rangeSelection?.useCellRange({
|
|
622
|
+
root: O,
|
|
623
|
+
enabled: () => !!x.rangeSelection,
|
|
624
|
+
model: Ye,
|
|
625
|
+
levels: {
|
|
626
|
+
top: () => jn.value,
|
|
627
|
+
keyOf: Sn,
|
|
628
|
+
open: Cn,
|
|
629
|
+
tree: wn,
|
|
630
|
+
prepare: En,
|
|
631
|
+
isGroup: Tn
|
|
632
|
+
},
|
|
633
|
+
columns: () => L.value.filter((e) => e.kind === "data"),
|
|
634
|
+
getKey: j,
|
|
635
|
+
format: () => Ze.value,
|
|
636
|
+
onCopy: (e) => E("copy", e)
|
|
637
|
+
}), Pn = M.statusBar?.useStatusBar({
|
|
616
638
|
options: () => x.statusBar,
|
|
617
|
-
rowCount: () => q?.server.value ? W?.rowTotal.value ?? q.groups.value.reduce((e, t) => e + t.count, 0) : U.value ? W?.total.value ?? G.value.length :
|
|
639
|
+
rowCount: () => q?.server.value ? W?.rowTotal.value ?? q.groups.value.reduce((e, t) => e + t.count, 0) : U.value ? W?.total.value ?? G.value.length : hn.value.length,
|
|
618
640
|
totalRowCount: () => U.value ? void 0 : G.value.length,
|
|
619
641
|
rows: () => G.value,
|
|
620
|
-
selection: K && { count:
|
|
642
|
+
selection: K && { count: Xt },
|
|
621
643
|
selected: S,
|
|
622
644
|
allMatching: Je,
|
|
623
|
-
filterCount:
|
|
645
|
+
filterCount: Nt,
|
|
624
646
|
canClear: !!M.filtering,
|
|
625
|
-
clearFilters: () =>
|
|
647
|
+
clearFilters: () => Un(),
|
|
626
648
|
children: V,
|
|
627
649
|
getKey: j,
|
|
628
650
|
columns: () => x.columns,
|
|
629
|
-
resolve:
|
|
630
|
-
format:
|
|
651
|
+
resolve: it,
|
|
652
|
+
format: Ze,
|
|
653
|
+
range: () => Q?.cells.value ?? null
|
|
631
654
|
});
|
|
632
655
|
if (process.env.NODE_ENV !== "production") {
|
|
633
656
|
Oe(() => {
|
|
@@ -652,7 +675,7 @@ var ke = ["data-density"], Ae = {
|
|
|
652
675
|
let i = x.columns.find((e) => e.pinned)?.key;
|
|
653
676
|
!M.columnPinning && i && e("columnPinning", `Column "${i}" is pinned; that`), !M.menus && (x.contextMenu || typeof x.headerMenu == "function") && e("menus", "`context-menu` / a `header-menu` function"), !M.rowPinning && (qe.value || x.pinnedTopRows || x.pinnedBottomRows) && e("rowPinning", "`pinned-rows` / `pinned-top-rows` / `pinned-bottom-rows`"), !M.aggregation && x.totals && e("aggregation", "`totals`"), !M.statusBar && x.statusBar && e("statusBar", "`status-bar`");
|
|
654
677
|
let a = x.columns.find((e) => e.editable)?.key;
|
|
655
|
-
!M.editing && a && e("editing", `Column "${a}" is \`editable\`; that`);
|
|
678
|
+
!M.editing && a && e("editing", `Column "${a}" is \`editable\`; that`), !M.rangeSelection && x.rangeSelection && e("rangeSelection", "`range-selection`");
|
|
656
679
|
let o = x.columns.find((e) => e.exportValue)?.key;
|
|
657
680
|
!M.export && o && e("export", `Column "${o}" has an \`exportValue\`; that`);
|
|
658
681
|
let ee = w.value == null ? [] : typeof w.value == "string" ? [w.value] : w.value;
|
|
@@ -661,42 +684,43 @@ var ke = ["data-density"], Ae = {
|
|
|
661
684
|
M.rowGrouping && te !== void 0 && s(`group-by:${te}`, `\`group-by\` names "${te}", which is not a column key; it is ignored.`);
|
|
662
685
|
}), b(() => x.features, () => s("features-changed", "`features` is read once, when the grid is created; changes are ignored."));
|
|
663
686
|
}
|
|
664
|
-
let
|
|
665
|
-
keyboardNav:
|
|
687
|
+
let Fn = c(() => new Set(x.highlightedRows ?? [])), In = {
|
|
688
|
+
keyboardNav: on,
|
|
666
689
|
messages: k,
|
|
667
|
-
parts:
|
|
668
|
-
cellRole:
|
|
669
|
-
rovingTabindex:
|
|
690
|
+
parts: Qe,
|
|
691
|
+
cellRole: on ? "gridcell" : "cell",
|
|
692
|
+
rovingTabindex: on ? -1 : void 0,
|
|
670
693
|
columns: L,
|
|
671
|
-
slots:
|
|
694
|
+
slots: Xe,
|
|
672
695
|
ui: c(() => x.ui ?? {}),
|
|
673
696
|
getKey: j,
|
|
674
|
-
sortRows:
|
|
675
|
-
sortable:
|
|
697
|
+
sortRows: Pt,
|
|
698
|
+
sortable: ht,
|
|
676
699
|
SortMarker: M.sorting?.SortMarker,
|
|
677
|
-
editing:
|
|
678
|
-
...
|
|
700
|
+
editing: Nn && {
|
|
701
|
+
...Nn,
|
|
679
702
|
Editor: M.editing.Editor
|
|
680
703
|
},
|
|
704
|
+
range: Q,
|
|
681
705
|
resize: R && {
|
|
682
706
|
Handle: M.columnResizing.Handle,
|
|
683
|
-
can:
|
|
707
|
+
can: ut,
|
|
684
708
|
start: (e, t) => R.onPointerDown(e, t),
|
|
685
709
|
autosize: (e) => void R.autosize(e),
|
|
686
710
|
step: (e, t) => R.step(e, t),
|
|
687
711
|
isSized: (e) => !!P.value.widths?.[e] || R.resizing.value === e
|
|
688
712
|
},
|
|
689
|
-
headerRows:
|
|
690
|
-
pinnedTopCount:
|
|
691
|
-
totals:
|
|
692
|
-
values:
|
|
693
|
-
label:
|
|
713
|
+
headerRows: mt,
|
|
714
|
+
pinnedTopCount: vn,
|
|
715
|
+
totals: X && {
|
|
716
|
+
values: X.values,
|
|
717
|
+
label: $e
|
|
694
718
|
},
|
|
695
|
-
treeMode:
|
|
696
|
-
hasDetail:
|
|
697
|
-
canExpand:
|
|
698
|
-
isExpanded: (e) =>
|
|
699
|
-
toggleExpanded:
|
|
719
|
+
treeMode: Ct,
|
|
720
|
+
hasDetail: wt,
|
|
721
|
+
canExpand: Et,
|
|
722
|
+
isExpanded: (e) => Tt.value.has(e),
|
|
723
|
+
toggleExpanded: Dt,
|
|
700
724
|
children: (e) => V(e),
|
|
701
725
|
subRowState: (e) => B?.state(e),
|
|
702
726
|
ensureSubRows: (e) => B?.ensure(e),
|
|
@@ -706,7 +730,7 @@ var ke = ["data-density"], Ae = {
|
|
|
706
730
|
isRowSelectable: (e) => K?.isRowSelectable(e) ?? !1,
|
|
707
731
|
rowCheckState: (e) => K?.rowCheckState(e) ?? "none",
|
|
708
732
|
toggleRow: (e, t) => K?.toggleRow(e, t),
|
|
709
|
-
isHighlighted: (e) =>
|
|
733
|
+
isHighlighted: (e) => Fn.value.has(e),
|
|
710
734
|
rowClass: (e, t) => x.rowClass?.(e, t),
|
|
711
735
|
rowClickable: c(() => x.rowClickable),
|
|
712
736
|
flash: c(() => x.flash ?? !1),
|
|
@@ -720,13 +744,13 @@ var ke = ["data-density"], Ae = {
|
|
|
720
744
|
typeOf: (e) => H.typeOf(e),
|
|
721
745
|
filterRow: c(() => x.filterRow),
|
|
722
746
|
distinct: H.distinct,
|
|
723
|
-
idFor:
|
|
724
|
-
open:
|
|
747
|
+
idFor: At,
|
|
748
|
+
open: jt
|
|
725
749
|
},
|
|
726
|
-
virtual:
|
|
727
|
-
virtualRows:
|
|
750
|
+
virtual: ot,
|
|
751
|
+
virtualRows: Dn?.context,
|
|
728
752
|
pinStyle: (e) => {
|
|
729
|
-
let t =
|
|
753
|
+
let t = $t?.value[e];
|
|
730
754
|
return t === void 0 ? void 0 : { "--vg-pin-offset": t };
|
|
731
755
|
},
|
|
732
756
|
onRowClick: (e, t, n) => E("row-click", e, n),
|
|
@@ -744,145 +768,153 @@ var ke = ["data-density"], Ae = {
|
|
|
744
768
|
rowKey: t,
|
|
745
769
|
column: n.def
|
|
746
770
|
}),
|
|
747
|
-
onCellContextMenu: (e, t, n, r, i) =>
|
|
771
|
+
onCellContextMenu: (e, t, n, r, i) => Y?.openCellMenu({
|
|
748
772
|
row: e,
|
|
749
773
|
rowKey: t,
|
|
750
774
|
column: n.def,
|
|
751
775
|
value: a(e, n.def)
|
|
752
776
|
}, r, i),
|
|
753
|
-
onHeaderContextMenu: (e, t, n) =>
|
|
754
|
-
onCellPointerDown:
|
|
777
|
+
onHeaderContextMenu: (e, t, n) => Y?.openHeaderMenu(e.def, t, n),
|
|
778
|
+
onCellPointerDown: Y ? (e, t, n, r, i) => Y.holdCell({
|
|
755
779
|
row: e,
|
|
756
780
|
rowKey: t,
|
|
757
781
|
column: n.def,
|
|
758
782
|
value: a(e, n.def)
|
|
759
783
|
}, r, i) : void 0
|
|
760
784
|
};
|
|
761
|
-
q?.extend(
|
|
762
|
-
function
|
|
785
|
+
q?.extend(In, M.rowGrouping.GroupCells), Ce(ae, In);
|
|
786
|
+
function Ln() {
|
|
763
787
|
O.value?.scrollTo({ top: 0 });
|
|
764
788
|
}
|
|
765
|
-
function
|
|
766
|
-
|
|
789
|
+
function Rn(e) {
|
|
790
|
+
Dn?.scrollToKey(e) || (O.value?.querySelector(`[data-row-key="${CSS.escape(String(e))}"] > .vg-cell`))?.scrollIntoView({ block: "nearest" });
|
|
767
791
|
}
|
|
768
|
-
function
|
|
792
|
+
function zn() {
|
|
769
793
|
let e = [];
|
|
770
|
-
|
|
771
|
-
|
|
794
|
+
Gt(G.value, (t) => {
|
|
795
|
+
Et(t) && e.push(j(t));
|
|
772
796
|
}), We.value = e, q?.setAll(!0);
|
|
773
797
|
}
|
|
774
|
-
function
|
|
798
|
+
function Bn() {
|
|
775
799
|
We.value = [], q?.setAll(!1);
|
|
776
800
|
}
|
|
777
|
-
function
|
|
801
|
+
function Vn(e) {
|
|
778
802
|
return (B?.patchLoaded(e) ?? 0) + (U.value && W ? W.patch(e) : 0);
|
|
779
803
|
}
|
|
780
|
-
function
|
|
804
|
+
function Hn(e) {
|
|
781
805
|
H ? H.setFilters(e) : process.env.NODE_ENV !== "production" && s("feature:filtering", "setFilters() needs the filtering feature (filteringFeature).");
|
|
782
806
|
}
|
|
783
|
-
let
|
|
807
|
+
let Un = () => H?.clearAll(), Wn = () => {
|
|
784
808
|
K?.clear(), T.value.length && (T.value = []);
|
|
785
809
|
};
|
|
786
|
-
function
|
|
787
|
-
return ((t) =>
|
|
810
|
+
function $(e) {
|
|
811
|
+
return ((t) => Mn ? Mn[e](t) : (process.env.NODE_ENV !== "production" && s("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" || e === "print" ? Promise.resolve() : void 0));
|
|
812
|
+
}
|
|
813
|
+
let Gn = $("getCsv"), Kn = $("exportCsv"), qn = $("getXlsx"), Jn = $("exportXlsx"), Yn = $("print"), Xn = $("copyRows");
|
|
814
|
+
function Zn(e) {
|
|
815
|
+
process.env.NODE_ENV !== "production" && s("feature:rangeSelection", `${e}() needs the range selection feature (rangeSelectionFeature) and \`range-selection\`.`);
|
|
788
816
|
}
|
|
789
817
|
return ve({
|
|
790
|
-
scrollToTop:
|
|
791
|
-
scrollToRow:
|
|
792
|
-
expandAll:
|
|
793
|
-
collapseAll:
|
|
818
|
+
scrollToTop: Ln,
|
|
819
|
+
scrollToRow: Rn,
|
|
820
|
+
expandAll: zn,
|
|
821
|
+
collapseAll: Bn,
|
|
794
822
|
setColumnState: F,
|
|
795
|
-
patchLoadedRows:
|
|
796
|
-
setFilters:
|
|
797
|
-
clearFilters:
|
|
798
|
-
openFilter:
|
|
799
|
-
reload:
|
|
800
|
-
reloadSubRows:
|
|
801
|
-
pinRow:
|
|
802
|
-
getCsv:
|
|
803
|
-
exportCsv:
|
|
804
|
-
getXlsx:
|
|
805
|
-
exportXlsx:
|
|
806
|
-
print:
|
|
807
|
-
copyRows:
|
|
808
|
-
clearSelection:
|
|
809
|
-
startEdit: (e, t) =>
|
|
810
|
-
stopEdit: (e = !1) =>
|
|
823
|
+
patchLoadedRows: Vn,
|
|
824
|
+
setFilters: Hn,
|
|
825
|
+
clearFilters: Un,
|
|
826
|
+
openFilter: jt,
|
|
827
|
+
reload: Ut,
|
|
828
|
+
reloadSubRows: Wt,
|
|
829
|
+
pinRow: yn,
|
|
830
|
+
getCsv: Gn,
|
|
831
|
+
exportCsv: Kn,
|
|
832
|
+
getXlsx: qn,
|
|
833
|
+
exportXlsx: Jn,
|
|
834
|
+
print: Yn,
|
|
835
|
+
copyRows: Xn,
|
|
836
|
+
clearSelection: Wn,
|
|
837
|
+
startEdit: (e, t) => Nn?.startAt(e, t) ?? !1,
|
|
838
|
+
stopEdit: (e = !1) => Nn?.stop(e),
|
|
839
|
+
selectRange: (e) => Q ? Q.select(e) : Zn("selectRange"),
|
|
840
|
+
getRangeValues: () => Q?.values() ?? (Zn("getRangeValues"), []),
|
|
841
|
+
copyRange: () => Q?.copyRange() ?? (Zn("copyRange"), Promise.resolve(!1))
|
|
811
842
|
}), (e, t) => (m(), d("div", {
|
|
812
843
|
class: xe(["vg-root", p.ui?.root]),
|
|
813
844
|
"data-density": p.density ?? v(D)?.density
|
|
814
845
|
}, [
|
|
815
|
-
v(
|
|
846
|
+
v(Xe).toolbar ? (m(), d("div", Ae, [h(e.$slots, "toolbar", {
|
|
816
847
|
columns: p.columns,
|
|
817
848
|
columnState: P.value,
|
|
818
849
|
setColumnState: F,
|
|
819
|
-
filters:
|
|
820
|
-
setFilters:
|
|
821
|
-
clearFilters:
|
|
822
|
-
activeFilterCount:
|
|
850
|
+
filters: Mt.value,
|
|
851
|
+
setFilters: Hn,
|
|
852
|
+
clearFilters: Un,
|
|
853
|
+
activeFilterCount: Nt.value,
|
|
823
854
|
selected: S.value,
|
|
824
|
-
selectedCount:
|
|
855
|
+
selectedCount: Xt.value,
|
|
825
856
|
selectedGroups: T.value,
|
|
826
857
|
selectAllMatching: Je.value,
|
|
827
|
-
clearSelection:
|
|
858
|
+
clearSelection: Wn
|
|
828
859
|
})])) : u("", !0),
|
|
829
860
|
v(M).selection && v(K)?.banner.value && A("selectAllBanner") ? h(e.$slots, "select-all-banner", ye(v(K).banner.value, {
|
|
830
861
|
selectAll: () => Je.value = !0,
|
|
831
|
-
clearSelection:
|
|
862
|
+
clearSelection: Wn
|
|
832
863
|
}), () => [(m(), l(g(v(M).selection.Banner), ye(v(K).banner.value, {
|
|
833
864
|
onSelectAll: t[0] ||= (e) => Je.value = !0,
|
|
834
|
-
onClear:
|
|
865
|
+
onClear: Wn
|
|
835
866
|
}), null, 16))], void 0, 1) : u("", !0),
|
|
836
|
-
|
|
837
|
-
error:
|
|
838
|
-
retry:
|
|
867
|
+
Ht.value && jn.value.length && A("loadErrorNotice") ? h(e.$slots, "load-error", {
|
|
868
|
+
error: Ht.value,
|
|
869
|
+
retry: Ut,
|
|
839
870
|
stale: !0
|
|
840
871
|
}, () => [f("div", je, [f("span", null, _(k.value.loadError ?? "Couldn't load the rows.") + " " + _(k.value.staleRows ?? "These are from before."), 1), A("retry") ? (m(), d("button", {
|
|
841
872
|
key: 0,
|
|
842
873
|
type: "button",
|
|
843
874
|
class: "vg-link-button",
|
|
844
|
-
onClick: t[1] ||= (e) =>
|
|
875
|
+
onClick: t[1] ||= (e) => Ut()
|
|
845
876
|
}, _(k.value.retry ?? "Retry"), 1)) : u("", !0)])], void 0, 2) : u("", !0),
|
|
846
|
-
f("div", Me, [
|
|
877
|
+
f("div", Me, [Vt.value && A("progressBar") ? (m(), d("div", Ne)) : u("", !0), f("div", {
|
|
847
878
|
ref_key: "root",
|
|
848
879
|
ref: O,
|
|
849
880
|
class: xe(["vg", {
|
|
850
|
-
"vg-virtual":
|
|
851
|
-
"vg-is-dragging": v(
|
|
881
|
+
"vg-virtual": ot.value,
|
|
882
|
+
"vg-is-dragging": v(J)?.dragging.value,
|
|
852
883
|
"vg-is-resizing": v(R)?.resizing.value,
|
|
853
|
-
"vg-has-groups":
|
|
854
|
-
"vg-pins-dropped":
|
|
884
|
+
"vg-has-groups": pt.value,
|
|
885
|
+
"vg-pins-dropped": st.value,
|
|
855
886
|
"vg-grouped": v(q)?.active.value,
|
|
856
|
-
"vg-has-pinned-rows":
|
|
857
|
-
"vg-has-cell-menu": !!v(
|
|
887
|
+
"vg-has-pinned-rows": Z.value.top.length || Z.value.bottom.length,
|
|
888
|
+
"vg-has-cell-menu": !!v(Y) && !!p.contextMenu
|
|
858
889
|
}]),
|
|
859
|
-
role:
|
|
890
|
+
role: dn.value,
|
|
860
891
|
tabindex: "0",
|
|
861
892
|
"aria-label": p.ariaLabel,
|
|
862
|
-
"aria-busy":
|
|
863
|
-
"aria-rowcount":
|
|
893
|
+
"aria-busy": Vt.value || void 0,
|
|
894
|
+
"aria-rowcount": kn.value ? kn.value.rowCount + mt.value + Z.value.top.length + Z.value.bottom.length : void 0,
|
|
864
895
|
"aria-colcount": L.value.length,
|
|
865
|
-
"aria-multiselectable":
|
|
896
|
+
"aria-multiselectable": on && (I.value === "multi" || !!v(Q) && p.rangeSelection) || void 0,
|
|
866
897
|
style: Se({
|
|
867
|
-
"--vg-columns":
|
|
868
|
-
"--vg-row-height":
|
|
898
|
+
"--vg-columns": ft.value,
|
|
899
|
+
"--vg-row-height": at.value ? `${at.value.rowHeight}px` : void 0
|
|
869
900
|
}),
|
|
870
|
-
onScrollPassive:
|
|
871
|
-
onKeydown:
|
|
872
|
-
onFocusin:
|
|
901
|
+
onScrollPassive: On,
|
|
902
|
+
onKeydown: cn,
|
|
903
|
+
onFocusin: ln,
|
|
904
|
+
onPointerdown: un
|
|
873
905
|
}, [
|
|
874
|
-
|
|
906
|
+
pt.value && v(M).columnGroups ? (m(), l(g(v(M).columnGroups.GroupRow), { key: 0 })) : u("", !0),
|
|
875
907
|
ge(pe, {
|
|
876
908
|
sorts: z.value,
|
|
877
|
-
"all-state":
|
|
878
|
-
"has-selectable-rows":
|
|
879
|
-
dragging: v(
|
|
880
|
-
"drop-target": v(
|
|
881
|
-
"can-reorder":
|
|
882
|
-
onSort:
|
|
883
|
-
onToggleAll:
|
|
884
|
-
onDragStart:
|
|
885
|
-
onHeaderClick: t[2] ||= (e) => v(
|
|
909
|
+
"all-state": qt.value,
|
|
910
|
+
"has-selectable-rows": Jt.value,
|
|
911
|
+
dragging: v(J)?.dragging.value ?? null,
|
|
912
|
+
"drop-target": v(J)?.target.value ?? null,
|
|
913
|
+
"can-reorder": nn,
|
|
914
|
+
onSort: St,
|
|
915
|
+
onToggleAll: Yt,
|
|
916
|
+
onDragStart: rn,
|
|
917
|
+
onHeaderClick: t[2] ||= (e) => v(J)?.consumeClick(e)
|
|
886
918
|
}, null, 8, [
|
|
887
919
|
"sorts",
|
|
888
920
|
"all-state",
|
|
@@ -890,72 +922,72 @@ var ke = ["data-density"], Ae = {
|
|
|
890
922
|
"dragging",
|
|
891
923
|
"drop-target"
|
|
892
924
|
]),
|
|
893
|
-
v(
|
|
925
|
+
v(mn) && Z.value.top.length ? (m(), l(g(v(mn)), {
|
|
894
926
|
key: 1,
|
|
895
927
|
position: "top",
|
|
896
|
-
items:
|
|
897
|
-
"aria-start":
|
|
928
|
+
items: Z.value.top,
|
|
929
|
+
"aria-start": kn.value ? mt.value + 1 : void 0
|
|
898
930
|
}, null, 8, ["items", "aria-start"])) : u("", !0),
|
|
899
|
-
|
|
931
|
+
jn.value.length ? (m(), l(me, {
|
|
900
932
|
key: 2,
|
|
901
|
-
rows:
|
|
933
|
+
rows: jn.value,
|
|
902
934
|
presorted: "",
|
|
903
|
-
layout:
|
|
935
|
+
layout: kn.value ?? void 0
|
|
904
936
|
}, null, 8, ["rows", "layout"])) : (m(), d("div", Fe, [f("div", {
|
|
905
|
-
role:
|
|
906
|
-
tabindex:
|
|
937
|
+
role: In.cellRole,
|
|
938
|
+
tabindex: In.rovingTabindex,
|
|
907
939
|
class: xe(["vg-empty", p.ui?.empty])
|
|
908
|
-
}, [
|
|
909
|
-
error:
|
|
910
|
-
retry:
|
|
940
|
+
}, [Vt.value ? h(e.$slots, "loading", {}, () => [he(_(k.value.loading ?? "Loading…"), 1)], void 0, 0) : Ht.value ? h(e.$slots, "load-error", {
|
|
941
|
+
error: Ht.value,
|
|
942
|
+
retry: Ut,
|
|
911
943
|
stale: !1
|
|
912
944
|
}, () => [f("span", Le, [he(_(k.value.loadError ?? "Couldn't load the rows.") + " ", 1), A("retry") ? (m(), d("button", {
|
|
913
945
|
key: 0,
|
|
914
946
|
type: "button",
|
|
915
947
|
class: "vg-link-button",
|
|
916
|
-
onClick: t[3] ||= (e) =>
|
|
917
|
-
}, _(k.value.retry ?? "Retry"), 1)) : u("", !0)])], void 0, 1) : (U.value || p.rows.length) &&
|
|
918
|
-
clearFilters:
|
|
919
|
-
filterCount:
|
|
948
|
+
onClick: t[3] ||= (e) => Ut()
|
|
949
|
+
}, _(k.value.retry ?? "Retry"), 1)) : u("", !0)])], void 0, 1) : (U.value || p.rows.length) && Nt.value ? h(e.$slots, "no-match", {
|
|
950
|
+
clearFilters: Un,
|
|
951
|
+
filterCount: Nt.value
|
|
920
952
|
}, () => [f("span", Re, [he(_(p.noMatchText ?? k.value.noMatch ?? "No rows match the current filters.") + " ", 1), A("clearFiltersButton") ? (m(), d("button", {
|
|
921
953
|
key: 0,
|
|
922
954
|
type: "button",
|
|
923
955
|
class: "vg-link-button",
|
|
924
|
-
onClick: t[4] ||= (e) =>
|
|
956
|
+
onClick: t[4] ||= (e) => Un()
|
|
925
957
|
}, _(k.value.clearFilters ?? "Clear filters"), 1)) : u("", !0)])], void 0, 2) : h(e.$slots, "empty", {}, () => [he(_(p.emptyText ?? k.value.empty ?? "No data to show."), 1)], void 0, 3)], 10, Ie)])),
|
|
926
|
-
v(
|
|
958
|
+
v(mn) && Z.value.bottom.length ? (m(), l(g(v(mn)), {
|
|
927
959
|
key: 4,
|
|
928
960
|
position: "bottom",
|
|
929
|
-
items:
|
|
930
|
-
"aria-start":
|
|
961
|
+
items: Z.value.bottom,
|
|
962
|
+
"aria-start": kn.value ? mt.value + Z.value.top.length + kn.value.rowCount + 1 : void 0
|
|
931
963
|
}, null, 8, ["items", "aria-start"])) : u("", !0)
|
|
932
964
|
], 46, Pe)]),
|
|
933
|
-
v(
|
|
965
|
+
v(Pn)?.enabled.value && v(M).statusBar ? (m(), l(g(v(M).statusBar.StatusBar), {
|
|
934
966
|
key: 3,
|
|
935
|
-
bar: v(
|
|
936
|
-
render: v(
|
|
967
|
+
bar: v(Pn),
|
|
968
|
+
render: v(Xe)["status-bar"]
|
|
937
969
|
}, null, 8, ["bar", "render"])) : u("", !0),
|
|
938
|
-
|
|
970
|
+
It.value && v(M).pagination ? (m(), l(g(v(M).pagination.Pagination), ye({
|
|
939
971
|
key: 4,
|
|
940
972
|
page: C.value,
|
|
941
973
|
"onUpdate:page": t[5] ||= (e) => C.value = e,
|
|
942
974
|
"page-size": Ke.value,
|
|
943
975
|
"onUpdate:pageSize": t[6] ||= (e) => Ke.value = e,
|
|
944
976
|
class: "vg-grid-pagination",
|
|
945
|
-
total:
|
|
977
|
+
total: An.value
|
|
946
978
|
}, typeof p.pagination == "object" ? p.pagination : {}), null, 16, [
|
|
947
979
|
"page",
|
|
948
980
|
"page-size",
|
|
949
981
|
"total"
|
|
950
982
|
])) : u("", !0),
|
|
951
|
-
v(M).menus && v(
|
|
983
|
+
v(M).menus && v(Y) ? (m(), l(g(v(M).menus.Menu), {
|
|
952
984
|
key: 5,
|
|
953
985
|
ref_key: "menuRef",
|
|
954
|
-
ref:
|
|
955
|
-
items: v(
|
|
956
|
-
label: v(
|
|
986
|
+
ref: fn,
|
|
987
|
+
items: v(Y).items.value,
|
|
988
|
+
label: v(Y).label.value,
|
|
957
989
|
placement: "point",
|
|
958
|
-
onSelect: v(
|
|
990
|
+
onSelect: v(Y).onSelect
|
|
959
991
|
}, null, 40, [
|
|
960
992
|
"items",
|
|
961
993
|
"label",
|