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