@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_Fragment","_renderList","_toDisplayString","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","ListCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","all","computed","raw","item","max","first","rest","onToggle","event","openBlock","createElementBlock","createElementVNode","Fragment","renderList","i","toDisplayString","
|
|
1
|
+
{"version":3,"file":"ListCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_Fragment","_renderList","_toDisplayString","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","ListCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","all","computed","raw","item","max","first","rest","onToggle","event","openBlock","createElementBlock","createElementVNode","Fragment","renderList","i","toDisplayString","unref","createCommentVNode"],"sources":["../../src/renderers/ListCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport type { ListOptions } from './options'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, ListOptions>>()\nconst m = useMessages()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst all = computed(() => {\n const raw = props.options.items ? props.options.items(props.value, props.row) : props.value\n const list = Array.isArray(raw) ? raw : []\n return list.map((item) => {\n if (props.options.itemLabel) return props.options.itemLabel(item, props.row)\n return item !== null && typeof item === 'object' ? JSON.stringify(item) : String(item ?? '')\n })\n})\nconst max = computed(() => Math.max(1, props.options.max ?? 1))\nconst first = computed(() => all.value.slice(0, max.value))\nconst rest = computed(() => all.value.slice(max.value))\n\n// Open / closed state, keyboard and a11y come from the native <details>; this only reports it.\nfunction onToggle(event: Event) {\n emit('action', 'expand', (event.target as HTMLDetailsElement).open)\n}\n</script>\n\n<template>\n <span v-if=\"all.length\" class=\"vg-list\">\n <ul class=\"vg-list-items\">\n <li v-for=\"(item, i) in first\" :key=\"i\" class=\"vg-text vg-text-ellipsis\" :title=\"item\">\n {{ item }}\n </li>\n </ul>\n <details v-if=\"rest.length\" class=\"vg-list-more\" @toggle=\"onToggle\">\n <summary class=\"vg-link-button\">\n <span class=\"vg-list-more-closed\">{{\n m.moreItems?.(rest.length) ?? `+${rest.length} more`\n }}</span><span class=\"vg-list-more-open\">{{ m.showLess ?? 'Show less' }}</span>\n </summary>\n <ul class=\"vg-list-items\">\n <li v-for=\"(item, i) in rest\" :key=\"i\" class=\"vg-text vg-text-ellipsis\" :title=\"item\">\n {{ item }}\n </li>\n </ul>\n </details>\n </span>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EAAAc,CAAA,CAAC,CAAC,YAAYS,EAAA,MAAK,MAAM,KAAA,IAASA,EAAA,MAAK,OAAM,MAAA,GAAA,CAAA,GACtC3B,EAAsE,QAAtEU,GAAsEP,EAAnCC,EAAAc,CAAA,CAAC,CAAC,YAAQ,WAAA,GAAA,CAAA,C,IAExDlB,EAIK,MAJLW,GAIK,EAHHb,EAAA,EAAA,GAAAC,EAEKE,GAAA,MAAAC,EAFmByB,EAAA,QAAZ,GAAM,OAAlB7B,EAAA,GAAAC,EAEK,MAAA;GAF0B,KAAKoC;GAAG,OAAM;GAA4B,OAAOX;EAC3E,GAAArB,EAAAqB,CAAI,GAAA,GAAAZ,CAAA,E,mCAKEK,EAAA,QAAQ,eAAzBnB,EAAA,GAAAC,EAES,QAFTc,GAESV,EADPc,EAAA,QAAQ,WAAW,GAAA,CAAA,K"}
|
|
@@ -2,22 +2,23 @@ import { safeHref as e } from "./format.js";
|
|
|
2
2
|
import { safeTone as t } from "./options.js";
|
|
3
3
|
import n from "./parts/ValueBadge.js";
|
|
4
4
|
import { useRouterLink as r } from "./parts/routerLink.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useMessages as i } from "../internal/messages.js";
|
|
6
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, renderList as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
|
|
6
7
|
// src/renderers/MultiLineCell.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
8
|
+
var y = ["title"], b = ["aria-label"], x = {
|
|
8
9
|
key: 0,
|
|
9
10
|
d: "M5 1.5 9 7.5H1z"
|
|
10
|
-
},
|
|
11
|
+
}, S = {
|
|
11
12
|
key: 1,
|
|
12
13
|
d: "M5 8.5 1 2.5h8z"
|
|
13
|
-
},
|
|
14
|
+
}, C = [
|
|
14
15
|
"href",
|
|
15
16
|
"target",
|
|
16
17
|
"rel"
|
|
17
|
-
],
|
|
18
|
+
], w = ["onClick"], T = {
|
|
18
19
|
key: 1,
|
|
19
20
|
class: "vg-text vg-text-muted"
|
|
20
|
-
},
|
|
21
|
+
}, E = /*@__PURE__*/ d({
|
|
21
22
|
__name: "MultiLineCell",
|
|
22
23
|
props: {
|
|
23
24
|
value: {},
|
|
@@ -29,11 +30,11 @@ var v = ["title"], y = ["aria-label"], b = {
|
|
|
29
30
|
options: {}
|
|
30
31
|
},
|
|
31
32
|
emits: ["action"],
|
|
32
|
-
setup(
|
|
33
|
-
let
|
|
34
|
-
let n =
|
|
33
|
+
setup(d, { emit: E }) {
|
|
34
|
+
let D = d, O = i(), k = E, A = r(), j = (e) => typeof e == "object" && e ? e : { text: e ?? "" }, M = o(() => {
|
|
35
|
+
let n = D.options.lines ? D.options.lines(D.value, D.row) : D.value, r = Array.isArray(n) ? n : n == null || n === "" ? [] : [n], i = new Set(D.options.boldLines ?? []);
|
|
35
36
|
return r.map((n, r) => {
|
|
36
|
-
let a =
|
|
37
|
+
let a = j(n), o = a.text === null || a.text === void 0 ? "" : String(a.text), s = a.action ? "button" : a.to !== void 0 && A ? "router" : e(a.href ?? (typeof a.to == "string" ? a.to : void 0)) ? "link" : "text";
|
|
37
38
|
return {
|
|
38
39
|
...a,
|
|
39
40
|
tone: t(a.tone),
|
|
@@ -44,59 +45,59 @@ var v = ["title"], y = ["aria-label"], b = {
|
|
|
44
45
|
bold: a.bold ?? i.has(r)
|
|
45
46
|
};
|
|
46
47
|
});
|
|
47
|
-
}),
|
|
48
|
-
return (e, t) =>
|
|
48
|
+
}), N = o(() => D.options.target === "_blank");
|
|
49
|
+
return (e, t) => M.value.length ? (p(), l("span", {
|
|
49
50
|
key: 0,
|
|
50
|
-
class:
|
|
51
|
-
}, [(
|
|
51
|
+
class: f(["vg-multi-line", { "vg-multi-line-wrap": d.options.ellipsis === !1 }])
|
|
52
|
+
}, [(p(!0), l(a, null, m(M.value, (e) => (p(), l("span", {
|
|
52
53
|
key: e.index,
|
|
53
|
-
class:
|
|
54
|
+
class: f(["vg-line", {
|
|
54
55
|
"vg-text-bold": e.bold,
|
|
55
56
|
"vg-text-muted": e.muted,
|
|
56
57
|
"vg-text-fill": e.tone && e.fill,
|
|
57
58
|
[`vg-tone-${e.tone}`]: e.tone
|
|
58
59
|
}]),
|
|
59
|
-
title: e.tooltip ?? (
|
|
60
|
+
title: e.tooltip ?? (d.options.ellipsis === !1 ? void 0 : e.text)
|
|
60
61
|
}, [
|
|
61
|
-
e.badge ? (
|
|
62
|
+
e.badge ? (p(), s(n, {
|
|
62
63
|
key: 0,
|
|
63
64
|
badge: e.badge
|
|
64
|
-
}, null, 8, ["badge"])) :
|
|
65
|
-
e.trend ? (
|
|
65
|
+
}, null, 8, ["badge"])) : c("", !0),
|
|
66
|
+
e.trend ? (p(), l("svg", {
|
|
66
67
|
key: 1,
|
|
67
|
-
class:
|
|
68
|
+
class: f(["vg-change-icon", e.trend === "up" ? "vg-change-up" : "vg-change-down"]),
|
|
68
69
|
viewBox: "0 0 10 10",
|
|
69
70
|
role: "img",
|
|
70
|
-
"aria-label": e.trend === "up" ? "Increased" : "Decreased"
|
|
71
|
-
}, [e.trend === "up" ? (
|
|
72
|
-
e.kind === "router" ? (
|
|
71
|
+
"aria-label": e.trend === "up" ? _(O).increased ?? "Increased" : _(O).decreased ?? "Decreased"
|
|
72
|
+
}, [e.trend === "up" ? (p(), l("path", x)) : (p(), l("path", S))], 10, b)) : c("", !0),
|
|
73
|
+
e.kind === "router" ? (p(), s(h(_(A)), {
|
|
73
74
|
key: 2,
|
|
74
75
|
class: "vg-link",
|
|
75
76
|
to: e.to,
|
|
76
|
-
target:
|
|
77
|
-
rel:
|
|
77
|
+
target: d.options.target,
|
|
78
|
+
rel: N.value ? "noopener noreferrer" : void 0
|
|
78
79
|
}, {
|
|
79
|
-
default:
|
|
80
|
+
default: v(() => [u(g(e.text), 1)]),
|
|
80
81
|
_: 2
|
|
81
82
|
}, 1032, [
|
|
82
83
|
"to",
|
|
83
84
|
"target",
|
|
84
85
|
"rel"
|
|
85
|
-
])) : e.kind === "link" ? (
|
|
86
|
+
])) : e.kind === "link" ? (p(), l("a", {
|
|
86
87
|
key: 3,
|
|
87
88
|
class: "vg-link",
|
|
88
89
|
href: e.href,
|
|
89
|
-
target:
|
|
90
|
-
rel:
|
|
91
|
-
},
|
|
90
|
+
target: d.options.target,
|
|
91
|
+
rel: N.value ? "noopener noreferrer" : void 0
|
|
92
|
+
}, g(e.text), 9, C)) : e.kind === "button" ? (p(), l("button", {
|
|
92
93
|
key: 4,
|
|
93
94
|
type: "button",
|
|
94
95
|
class: "vg-link-button",
|
|
95
|
-
onClick: (t) =>
|
|
96
|
-
},
|
|
97
|
-
], 10,
|
|
96
|
+
onClick: (t) => k("action", e.action, e.index)
|
|
97
|
+
}, g(e.text), 9, w)) : (p(), l(a, { key: 5 }, [u(g(e.text), 1)], 64))
|
|
98
|
+
], 10, y))), 128))], 2)) : d.options.placeholder ? (p(), l("span", T, g(d.options.placeholder), 1)) : c("", !0);
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
|
-
export {
|
|
101
|
+
export { E as default };
|
|
101
102
|
|
|
102
103
|
//# sourceMappingURL=MultiLineCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiLineCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_Fragment","_renderList","_createBlock","ValueBadge","
|
|
1
|
+
{"version":3,"file":"MultiLineCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_Fragment","_renderList","_createBlock","ValueBadge","_unref","_resolveDynamicComponent","_withCtx","_createTextVNode","_toDisplayString","ValueBadge_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","MultiLineCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","RouterLink","useRouterLink","toSpec","line","lines","computed","raw","list","bold","spec","text","kind","safeHref","safeTone","index","external","openBlock","createElementBlock","normalizeClass","Fragment","renderList","createBlock","createCommentVNode","unref","resolveDynamicComponent","withCtx","createTextVNode","toDisplayString"],"sources":["../../src/renderers/MultiLineCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { safeHref } from './format'\nimport { safeTone, type LineInput, type LineSpec, type MultiLineOptions } from './options'\nimport ValueBadge from './parts/ValueBadge.vue'\nimport { useRouterLink } from './parts/routerLink'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, MultiLineOptions>>()\nconst m = useMessages()\nconst emit = defineEmits<CellRendererEmits>()\nconst RouterLink = useRouterLink()\n\nconst toSpec = (line: LineInput): LineSpec =>\n line !== null && typeof line === 'object' ? line : { text: line ?? '' }\n\nconst lines = computed(() => {\n const raw = props.options.lines ? props.options.lines(props.value, props.row) : props.value\n const list = Array.isArray(raw)\n ? (raw as LineInput[])\n : raw === null || raw === undefined || raw === ''\n ? []\n : [raw as LineInput]\n const bold = new Set(props.options.boldLines ?? [])\n return list.map((line, index) => {\n const spec = toSpec(line)\n const text = spec.text === null || spec.text === undefined ? '' : String(spec.text)\n const kind = spec.action\n ? 'button'\n : spec.to !== undefined && RouterLink\n ? 'router'\n : safeHref(spec.href ?? (typeof spec.to === 'string' ? spec.to : undefined))\n ? 'link'\n : 'text'\n return {\n ...spec,\n tone: safeTone(spec.tone),\n index,\n text,\n kind,\n href: safeHref(spec.href ?? (typeof spec.to === 'string' ? spec.to : undefined)),\n bold: spec.bold ?? bold.has(index),\n }\n })\n})\nconst external = computed(() => props.options.target === '_blank')\n</script>\n\n<template>\n <span\n v-if=\"lines.length\"\n :class=\"['vg-multi-line', { 'vg-multi-line-wrap': options.ellipsis === false }]\"\n >\n <span\n v-for=\"line in lines\"\n :key=\"line.index\"\n :class=\"[\n 'vg-line',\n {\n 'vg-text-bold': line.bold,\n 'vg-text-muted': line.muted,\n 'vg-text-fill': line.tone && line.fill,\n [`vg-tone-${line.tone}`]: line.tone,\n },\n ]\"\n :title=\"line.tooltip ?? (options.ellipsis === false ? undefined : line.text)\"\n >\n <ValueBadge v-if=\"line.badge\" :badge=\"line.badge\" />\n <svg\n v-if=\"line.trend\"\n :class=\"['vg-change-icon', line.trend === 'up' ? 'vg-change-up' : 'vg-change-down']\"\n viewBox=\"0 0 10 10\"\n role=\"img\"\n :aria-label=\"\n line.trend === 'up' ? (m.increased ?? 'Increased') : (m.decreased ?? 'Decreased')\n \"\n >\n <path v-if=\"line.trend === 'up'\" d=\"M5 1.5 9 7.5H1z\" />\n <path v-else d=\"M5 8.5 1 2.5h8z\" />\n </svg>\n <component\n :is=\"RouterLink\"\n v-if=\"line.kind === 'router'\"\n class=\"vg-link\"\n :to=\"line.to\"\n :target=\"options.target\"\n :rel=\"external ? 'noopener noreferrer' : undefined\"\n >{{ line.text }}</component\n >\n <a\n v-else-if=\"line.kind === 'link'\"\n class=\"vg-link\"\n :href=\"line.href\"\n :target=\"options.target\"\n :rel=\"external ? 'noopener noreferrer' : undefined\"\n >{{ line.text }}</a\n >\n <button\n v-else-if=\"line.kind === 'button'\"\n type=\"button\"\n class=\"vg-link-button\"\n @click=\"emit('action', line.action!, line.index)\"\n >\n {{ line.text }}\n </button>\n <template v-else>{{ line.text }}</template>\n </span>\n </span>\n <span v-else-if=\"options.placeholder\" class=\"vg-text vg-text-muted\">{{\n options.placeholder\n }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,IAAMsB,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GACPM,IAAaC,EAAc,GAE3BC,KAAU,MACG,OAAOC,KAAS,YAAjCA,IAA4CA,IAAO,EAAE,MAAMA,KAAQ,GAAG,GAElEC,IAAQC,QAAe;GAC3B,IAAMC,IAAMX,EAAM,QAAQ,QAAQA,EA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K,IAAI,GAAA,CAAA,C;E,2BAGhBP,EAAA,QAAQ,eAAzBvB,EAAA,GAAAC,EAES,QAFTkB,GAESR,EADPY,EAAA,QAAQ,WAAW,GAAA,CAAA,K"}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { copyText as e } from "../../internal/clipboard.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMessages as t } from "../../internal/messages.js";
|
|
3
|
+
import { CheckIcon as n, CopyIcon as r } from "./icons.js";
|
|
4
|
+
import { Fragment as i, createBlock as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, onBeforeUnmount as u, openBlock as d, ref as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, withModifiers as g } from "vue";
|
|
4
5
|
// src/renderers/parts/CopyButton.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var _ = ["aria-label", "title"], v = {
|
|
6
7
|
class: "vg-sr-only",
|
|
7
8
|
"aria-live": "polite"
|
|
8
|
-
},
|
|
9
|
+
}, y = /*@__PURE__*/ c({
|
|
9
10
|
__name: "CopyButton",
|
|
10
11
|
props: {
|
|
11
12
|
text: {},
|
|
12
|
-
label: {
|
|
13
|
+
label: {},
|
|
13
14
|
title: {}
|
|
14
15
|
},
|
|
15
16
|
emits: ["copied", "failed"],
|
|
16
|
-
setup(
|
|
17
|
-
let
|
|
18
|
-
async function
|
|
19
|
-
if (!await e(
|
|
20
|
-
|
|
17
|
+
setup(c, { emit: y }) {
|
|
18
|
+
let b = c, x = t(), S = y, C = f(!1), w = 0;
|
|
19
|
+
async function T() {
|
|
20
|
+
if (!await e(b.text)) return S("failed", b.text);
|
|
21
|
+
S("copied", b.text), C.value = !0, window.clearTimeout(w), w = window.setTimeout(() => C.value = !1, 1500);
|
|
21
22
|
}
|
|
22
|
-
return
|
|
23
|
+
return u(() => window.clearTimeout(w)), (e, t) => (d(), o(i, null, [s("button", {
|
|
23
24
|
type: "button",
|
|
24
|
-
class:
|
|
25
|
+
class: l([
|
|
25
26
|
"vg-icon-button",
|
|
26
27
|
"vg-copy-button",
|
|
27
|
-
{ "vg-copy-done":
|
|
28
|
+
{ "vg-copy-done": C.value }
|
|
28
29
|
]),
|
|
29
|
-
"aria-label":
|
|
30
|
-
title:
|
|
31
|
-
onClick:
|
|
32
|
-
}, [(
|
|
30
|
+
"aria-label": C.value ? h(x).copied ?? "Copied" : c.label ?? h(x).copy ?? "Copy",
|
|
31
|
+
title: c.title ?? c.text,
|
|
32
|
+
onClick: g(T, ["stop"])
|
|
33
|
+
}, [(d(), a(p(C.value ? h(n) : h(r))))], 10, _), s("span", v, m(C.value ? h(x).copied ?? "Copied" : ""), 1)], 64));
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
|
-
export {
|
|
36
|
+
export { y as default };
|
|
36
37
|
|
|
37
38
|
//# sourceMappingURL=CopyButton.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementVNode","_normalizeClass","_withModifiers","_createBlock","_resolveDynamicComponent","
|
|
1
|
+
{"version":3,"file":"CopyButton.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementVNode","_normalizeClass","_unref","_withModifiers","_createBlock","_resolveDynamicComponent","_toDisplayString","_hoisted_1","_hoisted_2","CopyButton_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","done","ref","timer","copy","copyText","onBeforeUnmount","openBlock","createElementBlock","Fragment","createElementVNode","normalizeClass","unref","withModifiers","createBlock","resolveDynamicComponent","CheckIcon","CopyIcon","toDisplayString"],"sources":["../../../src/renderers/parts/CopyButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, ref } from 'vue'\nimport { copyText } from '../../internal/clipboard'\nimport { useMessages } from '../../internal/messages'\nimport { CheckIcon, CopyIcon } from './icons'\n\nconst props = defineProps<{ text: string; label?: string; title?: string }>()\nconst m = useMessages()\nconst emit = defineEmits<{ copied: [text: string]; failed: [text: string] }>()\n\nconst done = ref(false)\nlet timer = 0\n\nasync function copy() {\n const ok = await copyText(props.text)\n if (!ok) return emit('failed', props.text)\n emit('copied', props.text)\n done.value = true\n window.clearTimeout(timer)\n timer = window.setTimeout(() => (done.value = false), 1500)\n}\n\nonBeforeUnmount(() => window.clearTimeout(timer))\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"['vg-icon-button', 'vg-copy-button', { 'vg-copy-done': done }]\"\n :aria-label=\"done ? (m.copied ?? 'Copied') : (label ?? m.copy ?? 'Copy')\"\n :title=\"title ?? text\"\n @click.stop=\"copy\"\n >\n <component :is=\"done ? CheckIcon : CopyIcon\" />\n </button>\n <span class=\"vg-sr-only\" aria-live=\"polite\">{{ done ? (m.copied ?? 'Copied') : '' }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAMA,IAAMY,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAAOC,EAAI,EAAK,GAClBC,IAAQ;EAEZ,eAAeC,IAAO;GAEpB,IAAI,CAAC,MADYC,EAAST,EAAM,IAAI,GAC3B,OAAOI,EAAK,UAAUJ,EAAM,IAAI;GAIzC,AAHAI,EAAK,UAAUJ,EAAM,IAAI,GACzB,EAAK,QAAQ,IACb,OAAO,aAAaO,CAAK,GACzB,IAAQ,OAAO,iBAAkB,EAAK,QAAQ,IAAQ,IAAI;EAC5D;E,OAEAG,QAAsB,OAAO,aAAaH,CAAK,CAAC,I,2BAI9ClB,EAQS,UAAA;GAPP,MAAK;GACJ,OAAKC,EAAA;IAAA;IAAA;IAAA,EAAA,gBAAyDe,EAAA,MAAI;GAAA,CAAA;GAClE,cAAYA,EAAA,QAAQd,EAAAW,CAAA,CAAC,CAAC,UAAM,WAAiBD,EAAA,SAASV,EAAAW,CAAA,CAAC,CAAC,QAAI;GAC5D,OAAOD,EAAA,SAASA,EAAA;GAChB,SAAKT,EAAOgB,GAAI,CAAA,MAAA,CAAA;E,KAEjBpB,EAAA,GAAAK,EAA+CC,EAA/BW,EAAA,QAAOd,EAAA6B,CAAA,IAAY7B,EAAA8B,CAAA,CAAQ,CAAA,E,WAE7ChC,EAA2F,QAA3FQ,GAA2FF,EAA5CU,EAAA,QAAQd,EAAAW,CAAA,CAAC,CAAC,UAAM,WAAA,EAAA,GAAA,CAAA,C"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* one fact about the API the types don't carry: the agent API reference (`api.json`), the JSON
|
|
4
4
|
* Schema and `validateGridConfig()` all read it from here.
|
|
5
5
|
*/
|
|
6
|
-
export type FeatureId = 'sorting' | 'filtering' | 'serverData' | 'pagination' | 'selection' | 'subGrids' | 'menus' | 'columnReorder' | 'columnPinning' | 'virtualScrolling' | 'columnVisibility' | 'keyboardNavigation' | 'columnResizing' | 'columnGroups' | 'rowPinning' | 'aggregation' | 'rowGrouping' | 'export' | 'statusBar';
|
|
6
|
+
export type FeatureId = 'sorting' | 'filtering' | 'serverData' | 'pagination' | 'selection' | 'subGrids' | 'menus' | 'columnReorder' | 'columnPinning' | 'virtualScrolling' | 'columnVisibility' | 'keyboardNavigation' | 'columnResizing' | 'columnGroups' | 'rowPinning' | 'aggregation' | 'rowGrouping' | 'export' | 'statusBar' | 'serverGrouping';
|
|
7
7
|
/** Grid props (and `v-model`s) that need a feature. */
|
|
8
8
|
export declare const propFeatures: Readonly<Record<string, FeatureId>>;
|
|
9
9
|
/** Column options that need a feature. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RowGroup } from '../core/grouping';
|
|
2
2
|
import { type RowKeyGetter } from '../core/value';
|
|
3
|
-
import type { DataSource, GridQuery } from '../composables/useDataSource';
|
|
4
|
-
import type { CellActionEvent, CellClickEvent, CellContext, CellRendererDefinition, ClassValue, ColumnDef, ColumnState, FlashMode, FilterState, GridFeature, FilterStateStorage, ColumnStateStorage, ContextActionEvent, CopyEvent, Density, GridPart, HeaderActionEvent, HeaderMenuContext, MenuItem, PinnedRowsState, RowKey, SortState, StatusBarOptions, StatusBarScope, VGridExposed, VirtualOptions } from '../types';
|
|
3
|
+
import type { DataSource, GridQuery, GroupPath } from '../composables/useDataSource';
|
|
4
|
+
import type { CellActionEvent, CellClickEvent, CellContext, CellRendererDefinition, ClassValue, ColumnDef, ColumnState, FlashMode, FilterState, GridFeature, FilterStateStorage, ColumnStateStorage, ContextActionEvent, CopyEvent, Density, GridPart, HeaderActionEvent, HeaderMenuContext, MenuItem, PinnedRowsState, RowKey, SortState, PaginationOptions, StatusBarOptions, StatusBarScope, GridMessages, GridParts, VGridExposed, VirtualOptions } from '../types';
|
|
5
5
|
declare const _default: typeof __VLS_export;
|
|
6
6
|
export default _default;
|
|
7
7
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
@@ -25,15 +25,17 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
25
25
|
*/
|
|
26
26
|
dataSource?: DataSource<T>;
|
|
27
27
|
/** Built-in pagination under the grid (server-side with `dataSource`, client-side otherwise). */
|
|
28
|
-
pagination?: boolean |
|
|
29
|
-
pageSizes?: number[];
|
|
30
|
-
};
|
|
28
|
+
pagination?: boolean | PaginationOptions;
|
|
31
29
|
/**
|
|
32
30
|
* A status bar under the grid (status bar feature): rows that pass the filters ("84 of 200
|
|
33
31
|
* rows"), selected rows, active filters with Clear; `{ summary: ['total'] }` adds the sum and
|
|
34
32
|
* average of those columns over the selected rows. `#status-bar` replaces its content.
|
|
35
33
|
*/
|
|
36
34
|
statusBar?: boolean | StatusBarOptions;
|
|
35
|
+
/** Built-in text (translations, wording), over `createVueGrid({ messages })`. */
|
|
36
|
+
messages?: GridMessages;
|
|
37
|
+
/** Built-in parts to leave out (`{ progressBar: false }`), over `createVueGrid({ parts })`. */
|
|
38
|
+
parts?: GridParts;
|
|
37
39
|
/**
|
|
38
40
|
* `controlled` (default): a header click only updates `v-model:sort` (sort on the server or in
|
|
39
41
|
* your own code). `client`: the grid sorts the rows itself. Ignored with `dataSource`.
|
|
@@ -45,7 +47,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
45
47
|
filterRow?: boolean;
|
|
46
48
|
/** Persist the filter model (`string` = localStorage key). */
|
|
47
49
|
filterStorage?: FilterStateStorage | string;
|
|
48
|
-
/** Shown when filters hide every row. */
|
|
50
|
+
/** Shown when filters hide every row. Default: `messages.noMatch`, else `No rows match the current filters.` */
|
|
49
51
|
noMatchText?: string;
|
|
50
52
|
/** A selection column: `true` = multi-select (with select-all), `'single'` = one row. */
|
|
51
53
|
selectable?: boolean | "single";
|
|
@@ -99,7 +101,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
99
101
|
density?: Density;
|
|
100
102
|
/** Shows a progress bar and sets `aria-busy` (server data sets it by itself). */
|
|
101
103
|
loading?: boolean;
|
|
102
|
-
/** Shown when there are no rows. */
|
|
104
|
+
/** Shown when there are no rows. Default: `messages.empty`, else `No data to show.` */
|
|
103
105
|
emptyText?: string;
|
|
104
106
|
/** Accessible name of the grid. */
|
|
105
107
|
ariaLabel?: string;
|
|
@@ -121,7 +123,10 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
121
123
|
* it to the bottom, `'top'` under the header.
|
|
122
124
|
*/
|
|
123
125
|
totals?: boolean | "top" | "bottom";
|
|
124
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* The totals row's label, in its first column (unless that column has an aggregate). Default:
|
|
128
|
+
* `messages.total`, else `Total`.
|
|
129
|
+
*/
|
|
125
130
|
totalsLabel?: string;
|
|
126
131
|
/** Totals row values by column key, instead of computing them (e.g. totals from a server). */
|
|
127
132
|
aggregates?: Record<string, unknown>;
|
|
@@ -155,6 +160,12 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
155
160
|
* then, not on `selected`. Needs the selection feature.
|
|
156
161
|
*/
|
|
157
162
|
selectAllMatching?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Server data with row grouping: groups selected by query, by their paths, without loading their
|
|
165
|
+
* rows (a group's checkbox). Act on these with `selected` and the filters. Ends when the filters or
|
|
166
|
+
* the grouping change. Needs the selection and row grouping features.
|
|
167
|
+
*/
|
|
168
|
+
selectedGroups?: GroupPath[];
|
|
158
169
|
}) & {
|
|
159
170
|
onCopy?: ((event: CopyEvent<T>) => any) | undefined;
|
|
160
171
|
"onQuery-change"?: ((query: GridQuery) => any) | undefined;
|
|
@@ -178,6 +189,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
178
189
|
"onUpdate:pinnedRows"?: ((value: PinnedRowsState | null) => any) | undefined;
|
|
179
190
|
"onUpdate:groupBy"?: ((value: string | readonly string[] | null) => any) | undefined;
|
|
180
191
|
"onUpdate:selectAllMatching"?: ((value: boolean) => any) | undefined;
|
|
192
|
+
"onUpdate:selectedGroups"?: ((value: GroupPath[]) => any) | undefined;
|
|
181
193
|
}> & (typeof globalThis extends {
|
|
182
194
|
__VLS_PROPS_FALLBACK: infer P;
|
|
183
195
|
} ? P : {});
|
|
@@ -215,6 +227,28 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
215
227
|
}) => unknown;
|
|
216
228
|
/** Shown when there are no rows. */
|
|
217
229
|
empty?: () => unknown;
|
|
230
|
+
/** Shown when filters hide every row, instead of the message and its Clear filters button. */
|
|
231
|
+
'no-match'?: (scope: {
|
|
232
|
+
clearFilters: () => void;
|
|
233
|
+
filterCount: number;
|
|
234
|
+
}) => unknown;
|
|
235
|
+
/**
|
|
236
|
+
* A failed server request (server data): `stale` when the rows from before stay on screen (the
|
|
237
|
+
* notice above them), else in place of the rows. `retry()` asks again.
|
|
238
|
+
*/
|
|
239
|
+
'load-error'?: (scope: {
|
|
240
|
+
error: unknown;
|
|
241
|
+
retry: () => Promise<void>;
|
|
242
|
+
stale: boolean;
|
|
243
|
+
}) => unknown;
|
|
244
|
+
/** Selection with server data: the "Select all N rows" banner. */
|
|
245
|
+
'select-all-banner'?: (scope: {
|
|
246
|
+
total: number;
|
|
247
|
+
page: number;
|
|
248
|
+
all: boolean;
|
|
249
|
+
selectAll: () => void;
|
|
250
|
+
clearSelection: () => void;
|
|
251
|
+
}) => unknown;
|
|
218
252
|
/** The status bar's content (status bar feature): replaces the counts and the summary. */
|
|
219
253
|
'status-bar'?: (scope: StatusBarScope) => unknown;
|
|
220
254
|
/** Shown while loading with no rows yet. */
|
|
@@ -237,6 +271,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
237
271
|
selected: readonly RowKey[];
|
|
238
272
|
/** How many rows are selected: every matching row with `selectAllMatching`. */
|
|
239
273
|
selectedCount: number;
|
|
274
|
+
/** Server data with row grouping: groups selected by query (`v-model:selected-groups`). */
|
|
275
|
+
selectedGroups: GroupPath[];
|
|
240
276
|
/** Every row matching the query is selected (server data, "Select all N rows"). */
|
|
241
277
|
selectAllMatching: boolean;
|
|
242
278
|
/** Clears the selection (and "all matching"). */
|
|
@@ -246,7 +282,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
246
282
|
emit: (((evt: "copy", event: CopyEvent<T>) => void) & ((evt: "query-change", query: GridQuery) => void) & ((evt: "load-error", error: unknown) => void) & ((evt: "row-click", row: T, event: MouseEvent | KeyboardEvent) => void) & ((evt: "cell-click", event: CellClickEvent<T>) => void) & ((evt: "cell-action", event: CellActionEvent<T>) => void) & ((evt: "sub-rows-error", event: {
|
|
247
283
|
row: T;
|
|
248
284
|
error: unknown;
|
|
249
|
-
}) => void) & ((evt: "context-action", event: ContextActionEvent<T>) => void) & ((evt: "header-action", event: HeaderActionEvent<T>) => void)) & (((event: "update:sort", value: SortState | null) => void) & ((event: "update:columnState", value: ColumnState | undefined) => void) & ((event: "update:expanded", value: RowKey[]) => void) & ((event: "update:selected", value: RowKey[]) => void) & ((event: "update:filters", value: FilterState | null) => void) & ((event: "update:page", value: number) => void) & ((event: "update:pageSize", value: number) => void) & ((event: "update:pinnedRows", value: PinnedRowsState | null) => void) & ((event: "update:groupBy", value: string | readonly string[] | null) => void) & ((event: "update:selectAllMatching", value: boolean) => void));
|
|
285
|
+
}) => void) & ((evt: "context-action", event: ContextActionEvent<T>) => void) & ((evt: "header-action", event: HeaderActionEvent<T>) => void)) & (((event: "update:sort", value: SortState | null) => void) & ((event: "update:columnState", value: ColumnState | undefined) => void) & ((event: "update:expanded", value: RowKey[]) => void) & ((event: "update:selected", value: RowKey[]) => void) & ((event: "update:filters", value: FilterState | null) => void) & ((event: "update:page", value: number) => void) & ((event: "update:pageSize", value: number) => void) & ((event: "update:pinnedRows", value: PinnedRowsState | null) => void) & ((event: "update:groupBy", value: string | readonly string[] | null) => void) & ((event: "update:selectAllMatching", value: boolean) => void) & ((event: "update:selectedGroups", value: GroupPath[]) => void));
|
|
250
286
|
}>) => import("vue").VNode & {
|
|
251
287
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
252
288
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { ColumnDef, ColumnState } from '../types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
columns: readonly ColumnDef[];
|
|
4
|
+
/** The button. Default: `messages.columns`, else `Columns`. */
|
|
4
5
|
label?: string;
|
|
6
|
+
/** Default: `messages.filterColumns`, else `Filter columns…`. */
|
|
5
7
|
filterPlaceholder?: string;
|
|
8
|
+
/** Default: `messages.resetColumns`, else `Reset columns`. */
|
|
6
9
|
resetLabel?: string;
|
|
7
10
|
};
|
|
8
11
|
type __VLS_ModelProps = {
|
|
@@ -13,10 +16,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
13
16
|
"update:columnState": (value: ColumnState | undefined) => any;
|
|
14
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
18
|
"onUpdate:columnState"?: ((value: ColumnState | undefined) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
label: string;
|
|
18
|
-
filterPlaceholder: string;
|
|
19
|
-
resetLabel: string;
|
|
20
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
20
|
declare const _default: typeof __VLS_export;
|
|
22
21
|
export default _default;
|
|
@@ -11,6 +11,7 @@ import type { MenuAction, MenuItem } from '../types';
|
|
|
11
11
|
*/
|
|
12
12
|
type __VLS_Props = {
|
|
13
13
|
items: readonly MenuItem[];
|
|
14
|
+
/** The menu's name for screen readers. Default: `messages.menu`, else `Menu`. */
|
|
14
15
|
label?: string;
|
|
15
16
|
placement?: Placement;
|
|
16
17
|
/** Popover id (for `popovertarget`). Generated when omitted. */
|
|
@@ -35,7 +36,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
35
36
|
onClose?: (() => any) | undefined;
|
|
36
37
|
onOpen?: (() => any) | undefined;
|
|
37
38
|
}>, {
|
|
38
|
-
label: string;
|
|
39
39
|
placement: Placement;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -3,9 +3,15 @@ type __VLS_Props = {
|
|
|
3
3
|
/** Page-size choices; renders a selector when given. */
|
|
4
4
|
pageSizes?: number[];
|
|
5
5
|
siblings?: number;
|
|
6
|
+
/** Default: `messages.pagination`, else `Pagination`. */
|
|
6
7
|
ariaLabel?: string;
|
|
7
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Use `{from}`, `{to}` and `{total}` placeholders; an empty string hides the summary. Default:
|
|
10
|
+
* `messages.pageSummary`, else `{from}–{to} of {total}`.
|
|
11
|
+
*/
|
|
8
12
|
summary?: string;
|
|
13
|
+
/** The first and last page buttons (« »). Default `true`. */
|
|
14
|
+
firstLast?: boolean;
|
|
9
15
|
};
|
|
10
16
|
type __VLS_ModelProps = {
|
|
11
17
|
'page'?: number;
|
|
@@ -19,9 +25,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
19
25
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
20
26
|
"onUpdate:pageSize"?: ((value: number) => any) | undefined;
|
|
21
27
|
}>, {
|
|
22
|
-
summary: string;
|
|
23
|
-
ariaLabel: string;
|
|
24
28
|
siblings: number;
|
|
29
|
+
firstLast: boolean;
|
|
25
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
31
|
declare const _default: typeof __VLS_export;
|
|
27
32
|
export default _default;
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
type __VLS_Props = {
|
|
6
6
|
modelValue?: string;
|
|
7
|
+
/** Default: `messages.searchPlaceholder`, else `Search…`. */
|
|
7
8
|
placeholder?: string;
|
|
9
|
+
/** Default: `messages.searchLabel`, else `Search rows`. */
|
|
8
10
|
label?: string;
|
|
9
11
|
debounce?: number;
|
|
10
12
|
};
|
|
@@ -13,8 +15,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
13
15
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
16
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
17
|
}>, {
|
|
16
|
-
placeholder: string;
|
|
17
|
-
label: string;
|
|
18
18
|
modelValue: string;
|
|
19
19
|
debounce: number;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -9,11 +9,40 @@ export interface GridQuery {
|
|
|
9
9
|
/** 1-based; with `pageSize: null` (no pagination) always 1. */
|
|
10
10
|
page: number;
|
|
11
11
|
pageSize: number | null;
|
|
12
|
+
/**
|
|
13
|
+
* Row grouping with server data: the grouped column keys, outermost first (absent when the grid
|
|
14
|
+
* isn't grouped). Return `groups` for the level `groupPath` asks for, or `rows` at the last level.
|
|
15
|
+
*/
|
|
16
|
+
groupBy?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Which group's contents: `[]` for the top-level groups, `[{ key: 'status', value: 'Won' }]` for
|
|
19
|
+
* the groups (or, at the last level, the rows) inside the "Won" group, and so on.
|
|
20
|
+
*/
|
|
21
|
+
groupPath?: GroupPath;
|
|
22
|
+
}
|
|
23
|
+
/** A group, by the values of its grouped columns from the top: `[{ key: 'status', value: 'Won' }]`. */
|
|
24
|
+
export type GroupPath = {
|
|
25
|
+
key: string;
|
|
26
|
+
value: unknown;
|
|
27
|
+
}[];
|
|
28
|
+
/** A group the server returns (row grouping with server data). */
|
|
29
|
+
export interface ServerGroup {
|
|
30
|
+
/** The value its rows share in the grouped column. */
|
|
31
|
+
value: unknown;
|
|
32
|
+
/** How many rows it holds (sub-groups included). */
|
|
33
|
+
count: number;
|
|
34
|
+
/** Its columns' aggregates, by column key, shown in the group row. */
|
|
35
|
+
aggregates?: Record<string, unknown>;
|
|
12
36
|
}
|
|
13
37
|
export interface DataSourceResult<T> {
|
|
14
|
-
rows
|
|
15
|
-
|
|
38
|
+
/** The rows; with `groupBy`, the rows of a last-level group (`groups` at the levels above). */
|
|
39
|
+
rows?: T[];
|
|
40
|
+
/** With `groupBy`: the groups at `groupPath`'s level, in display order. */
|
|
41
|
+
groups?: ServerGroup[];
|
|
42
|
+
/** Total matching rows (for pagination), or top-level groups when grouped; default the length. */
|
|
16
43
|
total?: number;
|
|
44
|
+
/** When grouped: all matching rows, for the status bar (default: the groups' counts added up). */
|
|
45
|
+
rowTotal?: number;
|
|
17
46
|
}
|
|
18
47
|
/** Loads rows for a query. Honour `signal` to cancel superseded requests. */
|
|
19
48
|
export type DataSource<T> = (query: GridQuery, ctx: {
|
|
@@ -31,7 +60,9 @@ export interface DataSourceOptions<T> {
|
|
|
31
60
|
*/
|
|
32
61
|
export declare function useDataSource<T>(opts: DataSourceOptions<T>): {
|
|
33
62
|
rows: import("vue").ShallowRef<T[], T[]>;
|
|
63
|
+
groups: import("vue").ShallowRef<ServerGroup[] | undefined, ServerGroup[] | undefined>;
|
|
34
64
|
total: import("vue").Ref<number | undefined, number | undefined>;
|
|
65
|
+
rowTotal: import("vue").Ref<number | undefined, number | undefined>;
|
|
35
66
|
loading: import("vue").Ref<boolean, boolean>;
|
|
36
67
|
error: import("vue").ShallowRef<unknown, unknown>;
|
|
37
68
|
reload: () => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
import type { ResolvedColumn } from '../internal/context';
|
|
3
|
-
import type { CellRendererDefinition, ColumnDef, CopyEvent, ExportOptions, FormatContext, RowKey, XlsxExportOptions } from '../types';
|
|
3
|
+
import type { CellRendererDefinition, ColumnDef, CopyEvent, ExportOptions, FormatContext, PrintOptions, RowKey, XlsxExportOptions } from '../types';
|
|
4
4
|
export interface GridExportOptions<T> {
|
|
5
5
|
/** The visible columns, resolved (renderer definition and options). */
|
|
6
6
|
columns: () => readonly ResolvedColumn[];
|
|
@@ -15,6 +15,8 @@ export interface GridExportOptions<T> {
|
|
|
15
15
|
getKey: (row: T) => RowKey;
|
|
16
16
|
/** A group row (row grouping feature): its rows are exported instead. */
|
|
17
17
|
isGroup: (row: T) => boolean;
|
|
18
|
+
/** A group row's rows (server groups: the loaded ones). */
|
|
19
|
+
groupRows?: (group: T) => readonly T[];
|
|
18
20
|
/**
|
|
19
21
|
* Top-level rows, sorted: `filtered` (every page, pinned rows included), `all` (filters
|
|
20
22
|
* ignored), or `page` (the rows in the body, groups included).
|
|
@@ -48,6 +50,7 @@ export declare function useGridExport<T>(opts: GridExportOptions<T>): {
|
|
|
48
50
|
exportXlsx: (o?: XlsxExportOptions & {
|
|
49
51
|
filename?: string;
|
|
50
52
|
}) => Promise<void>;
|
|
53
|
+
print: (o?: PrintOptions) => Promise<void>;
|
|
51
54
|
copyRows: (o?: ExportOptions) => Promise<boolean>;
|
|
52
55
|
onKeyDown: (event: KeyboardEvent) => void;
|
|
53
56
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
import type { AnchorTarget } from '../internal/anchor';
|
|
3
|
-
import type { CellContext, ColumnDef, ColumnState, ContextActionEvent, HeaderActionEvent, HeaderMenuContext, MenuAction, MenuItem, SortState } from '../types';
|
|
3
|
+
import type { GridMessages, CellContext, ColumnDef, ColumnState, ContextActionEvent, HeaderActionEvent, HeaderMenuContext, MenuAction, MenuItem, SortState } from '../types';
|
|
4
4
|
export interface MenuHandle {
|
|
5
5
|
openAt(target: AnchorTarget, focusAfterClose?: HTMLElement | null): Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
export interface GridMenusOptions<T> {
|
|
8
8
|
menu: Ref<MenuHandle | undefined>;
|
|
9
|
+
/** The grid's built-in text. */
|
|
10
|
+
messages: () => GridMessages;
|
|
9
11
|
columns: () => readonly ColumnDef<T>[];
|
|
10
12
|
columnState: () => ColumnState;
|
|
11
13
|
setColumnState: (state: ColumnState) => void;
|