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