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