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