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