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