@nocopypaste/vue-grid 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +7 -1
- package/CHANGELOG.md +24 -0
- package/README.md +143 -67
- package/agent/api.json +51 -9
- package/agent/api.md +14 -6
- package/agent/grid-config.schema.json +9 -11
- package/dist/agent/api.js +51 -9
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js +545 -520
- package/dist/components/VGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/VGridCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js +58 -53
- package/dist/components/VGridColumnMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js +50 -49
- package/dist/components/VGridFilterInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js +151 -146
- package/dist/components/VGridFilterPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js +44 -43
- package/dist/components/VGridFilterPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js +10 -8
- package/dist/components/VGridGroupCells.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js +62 -57
- package/dist/components/VGridHeader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js +59 -58
- package/dist/components/VGridMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js +62 -55
- package/dist/components/VGridPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/VGridResizeHandle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js +60 -59
- package/dist/components/VGridRows.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/components/VGridSearch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js +12 -11
- package/dist/components/VGridSelectionBanner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js +37 -30
- package/dist/components/VGridStatusBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/composables/useGridExport.js +21 -6
- package/dist/composables/useGridExport.js.map +1 -1
- package/dist/composables/useGridMenus.js +41 -41
- package/dist/composables/useGridMenus.js.map +1 -1
- package/dist/composables/useStatusBar.js +9 -0
- package/dist/composables/useStatusBar.js.map +1 -1
- package/dist/features/export.js.map +1 -1
- package/dist/internal/context.js.map +1 -1
- package/dist/internal/messages.js +20 -0
- package/dist/internal/messages.js.map +1 -0
- package/dist/internal/print.js +51 -0
- package/dist/internal/print.js.map +1 -0
- package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js +31 -30
- package/dist/renderers/ActionsMenuCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js +28 -27
- package/dist/renderers/ChangeCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js +22 -21
- package/dist/renderers/CopyCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js +37 -36
- package/dist/renderers/DetailsCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js +16 -15
- package/dist/renderers/EditCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/renderers/IconToggleCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js +21 -20
- package/dist/renderers/JsonCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js +21 -20
- package/dist/renderers/JsonTreeCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/renderers/ListCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/renderers/MultiLineCell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/renderers/parts/CopyButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/types/components/VGrid.vue.d.ts +34 -7
- package/dist/types/components/VGridColumnMenu.vue.d.ts +4 -5
- package/dist/types/components/VGridMenu.vue.d.ts +1 -1
- package/dist/types/components/VGridPagination.vue.d.ts +8 -3
- package/dist/types/components/VGridSearch.vue.d.ts +2 -2
- package/dist/types/composables/useGridExport.d.ts +2 -1
- package/dist/types/composables/useGridMenus.d.ts +3 -1
- package/dist/types/composables/useStatusBar.d.ts +7 -0
- package/dist/types/features/export.d.ts +2 -1
- package/dist/types/internal/context.d.ts +5 -1
- package/dist/types/internal/messages.d.ts +16 -0
- package/dist/types/internal/print.d.ts +16 -0
- package/dist/types/renderers/parts/CopyButton.vue.d.ts +1 -3
- package/dist/types/types.d.ts +300 -0
- package/llms-full.txt +164 -74
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { resolveOption as e } from "./options.js";
|
|
2
2
|
import { PencilIcon as t } from "./parts/icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useMessages as n } from "../internal/messages.js";
|
|
4
|
+
import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, toDisplayString as d, unref as f } from "vue";
|
|
4
5
|
// src/renderers/EditCell.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var p = { class: "vg-edit" }, m = ["title"], h = ["aria-label", "title"], g = /*@__PURE__*/ c({
|
|
6
7
|
__name: "EditCell",
|
|
7
8
|
props: {
|
|
8
9
|
value: {},
|
|
@@ -14,28 +15,28 @@ var f = { class: "vg-edit" }, p = ["title"], m = ["aria-label", "title"], h = /*
|
|
|
14
15
|
options: {}
|
|
15
16
|
},
|
|
16
17
|
emits: ["action"],
|
|
17
|
-
setup(
|
|
18
|
-
let
|
|
19
|
-
return (e, n) => (
|
|
20
|
-
class:
|
|
18
|
+
setup(c, { emit: g }) {
|
|
19
|
+
let _ = c, v = n(), y = g, b = r(() => _.options.format ? _.options.format(_.value, _.row) : _.value === null || _.value === void 0 ? "" : String(_.value)), x = r(() => !!e(_.options.disabled, _.value, _.row)), S = r(() => `${_.options.label ?? v.value.edit ?? "Edit"} ${_.column.header ?? _.column.key}`.trim());
|
|
20
|
+
return (e, n) => (u(), a("span", p, [o("span", {
|
|
21
|
+
class: l([
|
|
21
22
|
"vg-text",
|
|
22
23
|
"vg-text-ellipsis",
|
|
23
24
|
{
|
|
24
|
-
"vg-text-bold":
|
|
25
|
-
"vg-text-muted": !
|
|
25
|
+
"vg-text-bold": c.options.bold,
|
|
26
|
+
"vg-text-muted": !b.value
|
|
26
27
|
}
|
|
27
28
|
]),
|
|
28
|
-
title:
|
|
29
|
-
},
|
|
29
|
+
title: b.value || void 0
|
|
30
|
+
}, d(b.value || c.options.placeholder || ""), 11, m), x.value ? i("", !0) : (u(), a("button", {
|
|
30
31
|
key: 0,
|
|
31
32
|
type: "button",
|
|
32
33
|
class: "vg-icon-button vg-edit-button",
|
|
33
|
-
"aria-label":
|
|
34
|
-
title:
|
|
35
|
-
onClick: n[0] ||= (e) =>
|
|
36
|
-
}, [
|
|
34
|
+
"aria-label": S.value,
|
|
35
|
+
title: S.value,
|
|
36
|
+
onClick: n[0] ||= (e) => y("action", "edit", c.value)
|
|
37
|
+
}, [s(f(t))], 8, h))]));
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
|
-
export {
|
|
40
|
+
export { g as default };
|
|
40
41
|
|
|
41
42
|
//# sourceMappingURL=EditCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_toDisplayString","_createVNode","_unref","_hoisted_1","_hoisted_2","_hoisted_3","EditCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","text","computed","disabled","resolveOption","label","openBlock","createElementBlock","createElementVNode","normalizeClass","toDisplayString","createCommentVNode","_cache","createVNode","unref","PencilIcon"],"sources":["../../src/renderers/EditCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { resolveOption, type EditOptions } from './options'\nimport { PencilIcon } from './parts/icons'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, EditOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst text = computed(() => {\n if (props.options.format) return props.options.format(props.value, props.row)\n return props.value === null || props.value === undefined ? '' : String(props.value)\n})\nconst disabled = computed(() => !!resolveOption(props.options.disabled, props.value, props.row))\nconst label = computed(() =>\n `${props.options.label ?? 'Edit'} ${props.column.header ?? props.column.key}`.trim(),\n)\n</script>\n\n<template>\n <span class=\"vg-edit\">\n <span\n :class=\"[\n 'vg-text',\n 'vg-text-ellipsis',\n { 'vg-text-bold': options.bold, 'vg-text-muted': !text },\n ]\"\n :title=\"text || undefined\"\n >{{ text || options.placeholder || '' }}</span\n >\n <button\n v-if=\"!disabled\"\n type=\"button\"\n class=\"vg-icon-button vg-edit-button\"\n :aria-label=\"label\"\n :title=\"label\"\n @click=\"emit('action', 'edit', value)\"\n >\n <PencilIcon />\n </button>\n </span>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EditCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_toDisplayString","_createVNode","_unref","_hoisted_1","_hoisted_2","_hoisted_3","EditCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","text","computed","disabled","resolveOption","label","openBlock","createElementBlock","createElementVNode","normalizeClass","toDisplayString","createCommentVNode","_cache","createVNode","unref","PencilIcon"],"sources":["../../src/renderers/EditCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { resolveOption, type EditOptions } from './options'\nimport { PencilIcon } from './parts/icons'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, EditOptions>>()\nconst m = useMessages()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst text = computed(() => {\n if (props.options.format) return props.options.format(props.value, props.row)\n return props.value === null || props.value === undefined ? '' : String(props.value)\n})\nconst disabled = computed(() => !!resolveOption(props.options.disabled, props.value, props.row))\nconst label = computed(() =>\n `${props.options.label ?? m.value.edit ?? 'Edit'} ${props.column.header ?? props.column.key}`.trim(),\n)\n</script>\n\n<template>\n <span class=\"vg-edit\">\n <span\n :class=\"[\n 'vg-text',\n 'vg-text-ellipsis',\n { 'vg-text-bold': options.bold, 'vg-text-muted': !text },\n ]\"\n :title=\"text || undefined\"\n >{{ text || options.placeholder || '' }}</span\n >\n <button\n v-if=\"!disabled\"\n type=\"button\"\n class=\"vg-icon-button vg-edit-button\"\n :aria-label=\"label\"\n :title=\"label\"\n @click=\"emit('action', 'edit', value)\"\n >\n <PencilIcon />\n </button>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAOA,IAAMY,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAAOC,QACPN,EAAM,QAAQ,SAAeA,EAAM,QAAQ,OAAOA,EAAM,OAAOA,EAAM,GAAG,IACrEA,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,IAAY,KAAK,OAAOA,EAAM,KAAK,CACnF,GACKO,IAAWD,QAAe,CAAC,CAACE,EAAcR,EAAM,QAAQ,UAAUA,EAAM,OAAOA,EAAM,GAAG,CAAC,GACzFS,IAAQH,QACZ,GAAGN,EAAM,QAAQ,SAASE,EAAE,MAAM,QAAQ,OAAO,GAAGF,EAAM,OAAO,UAAUA,EAAM,OAAO,MAAM,KAAK,CACrG;E,kBAIEZ,EAAA,GAAAC,EAoBO,QApBPM,GAoBO,CAnBLL,EAQC,QAAA;GAPE,OAAKC,EAAA;;;IAA6E;KAAA,gBAAAU,EAAA,QAAQ;KAAI,iBAAA,CAAoBI,EAAA;IAAI;;GAKtH,OAAOA,EAAA,SAAQ,KAAA;EACZ,GAAAb,EAAAa,EAAA,SAAQJ,EAAA,QAAQ,eAAW,EAAA,GAAA,IAAAL,CAAA,GAGxBW,EAAA,Q,aADTnB,EAAA,GAAAC,EASS,UAAA;;GAPP,MAAK;GACL,OAAM;GACL,cAAYoB,EAAA;GACZ,OAAOA,EAAA;GACP,SAAK,AAAAO,EAAA,QAAA,MAAEZ,EAAI,UAAA,QAAmBH,EAAA,KAAK;E,IAEpCR,EAAcC,EAAAyB,CAAA,CAAA,C"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { resolveOption as e } from "./options.js";
|
|
2
2
|
import { StarFilledIcon as t, StarIcon as n } from "./parts/icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useMessages as r } from "../internal/messages.js";
|
|
4
|
+
import { computed as i, createBlock as a, createElementBlock as o, defineComponent as s, normalizeClass as c, openBlock as l, resolveDynamicComponent as u, toRaw as d } from "vue";
|
|
4
5
|
// src/renderers/IconToggleCell.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var f = [
|
|
6
7
|
"aria-pressed",
|
|
7
8
|
"aria-label",
|
|
8
9
|
"title",
|
|
9
10
|
"disabled"
|
|
10
|
-
],
|
|
11
|
+
], p = /*@__PURE__*/ s({
|
|
11
12
|
__name: "IconToggleCell",
|
|
12
13
|
props: {
|
|
13
14
|
value: {},
|
|
@@ -19,26 +20,26 @@ var d = [
|
|
|
19
20
|
options: {}
|
|
20
21
|
},
|
|
21
22
|
emits: ["action"],
|
|
22
|
-
setup(
|
|
23
|
-
let
|
|
24
|
-
let { icon: e, activeIcon: r } =
|
|
25
|
-
return
|
|
26
|
-
}),
|
|
27
|
-
return (e, t) => (
|
|
23
|
+
setup(s, { emit: p }) {
|
|
24
|
+
let m = s, h = r(), g = p, _ = i(() => m.options.active ? !!m.options.active(m.value, m.row) : !!m.value), v = i(() => {
|
|
25
|
+
let { icon: e, activeIcon: r } = m.options, i = _.value ? r ?? (e || t) : e ?? n;
|
|
26
|
+
return d(i);
|
|
27
|
+
}), y = i(() => e(m.options.label, m.value, m.row) ?? h.value.toggle ?? "Toggle"), b = i(() => !!e(m.options.disabled, m.value, m.row));
|
|
28
|
+
return (e, t) => (l(), o("button", {
|
|
28
29
|
type: "button",
|
|
29
|
-
class:
|
|
30
|
+
class: c([
|
|
30
31
|
"vg-icon-button",
|
|
31
32
|
"vg-icon-toggle",
|
|
32
|
-
|
|
33
|
+
_.value && `vg-tone-${s.options.activeTone ?? "warning"}`
|
|
33
34
|
]),
|
|
34
|
-
"aria-pressed":
|
|
35
|
-
"aria-label":
|
|
36
|
-
title:
|
|
37
|
-
disabled:
|
|
38
|
-
onClick: t[0] ||= (e) =>
|
|
39
|
-
}, [(
|
|
35
|
+
"aria-pressed": _.value,
|
|
36
|
+
"aria-label": y.value,
|
|
37
|
+
title: y.value,
|
|
38
|
+
disabled: b.value,
|
|
39
|
+
onClick: t[0] ||= (e) => g("action", "toggle", !_.value)
|
|
40
|
+
}, [(l(), a(u(v.value)))], 10, f));
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
|
-
export {
|
|
43
|
+
export { p as default };
|
|
43
44
|
|
|
44
45
|
//# sourceMappingURL=IconToggleCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconToggleCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","_resolveDynamicComponent","_hoisted_1","IconToggleCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","active","computed","icon","off","on","chosen","StarFilledIcon","StarIcon","toRaw","label","resolveOption","disabled","openBlock","createElementBlock","normalizeClass","_cache","createBlock","resolveDynamicComponent"],"sources":["../../src/renderers/IconToggleCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRaw } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { resolveOption, type IconToggleOptions } from './options'\nimport { StarFilledIcon, StarIcon } from './parts/icons'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, IconToggleOptions>>()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst active = computed(() =>\n props.options.active ? !!props.options.active(props.value, props.row) : !!props.value,\n)\nconst icon = computed(() => {\n const { icon: off, activeIcon: on } = props.options\n const chosen = active.value ? (on ?? (off ? off : StarFilledIcon)) : (off ?? StarIcon)\n return toRaw(chosen)\n})\nconst label = computed(() => resolveOption(props.options.label, props.value, props.row) ?? 'Toggle')\nconst disabled = computed(() => !!resolveOption(props.options.disabled, props.value, props.row))\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"[\n 'vg-icon-button',\n 'vg-icon-toggle',\n active && `vg-tone-${options.activeTone ?? 'warning'}`,\n ]\"\n :aria-pressed=\"active\"\n :aria-label=\"label\"\n :title=\"label\"\n :disabled=\"disabled\"\n @click=\"emit('action', 'toggle', !active)\"\n >\n <component :is=\"icon\" />\n </button>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconToggleCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_createBlock","_resolveDynamicComponent","_hoisted_1","IconToggleCell_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","m","useMessages","emit","active","computed","icon","off","on","chosen","StarFilledIcon","StarIcon","toRaw","label","resolveOption","disabled","openBlock","createElementBlock","normalizeClass","_cache","createBlock","resolveDynamicComponent"],"sources":["../../src/renderers/IconToggleCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRaw } from 'vue'\nimport type { CellRendererEmits, CellRendererProps } from '../types'\nimport { resolveOption, type IconToggleOptions } from './options'\nimport { StarFilledIcon, StarIcon } from './parts/icons'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, IconToggleOptions>>()\nconst m = useMessages()\nconst emit = defineEmits<CellRendererEmits>()\n\nconst active = computed(() =>\n props.options.active ? !!props.options.active(props.value, props.row) : !!props.value,\n)\nconst icon = computed(() => {\n const { icon: off, activeIcon: on } = props.options\n const chosen = active.value ? (on ?? (off ? off : StarFilledIcon)) : (off ?? StarIcon)\n return toRaw(chosen)\n})\nconst label = computed(\n () => resolveOption(props.options.label, props.value, props.row) ?? m.value.toggle ?? 'Toggle',\n)\nconst disabled = computed(() => !!resolveOption(props.options.disabled, props.value, props.row))\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"[\n 'vg-icon-button',\n 'vg-icon-toggle',\n active && `vg-tone-${options.activeTone ?? 'warning'}`,\n ]\"\n :aria-pressed=\"active\"\n :aria-label=\"label\"\n :title=\"label\"\n :disabled=\"disabled\"\n @click=\"emit('action', 'toggle', !active)\"\n >\n <component :is=\"icon\" />\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAOA,IAAMQ,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAASC,QACbN,EAAM,QAAQ,SAAS,CAAC,CAACA,EAAM,QAAQ,OAAOA,EAAM,OAAOA,EAAM,GAAG,IAAI,CAAC,CAACA,EAAM,KAClF,GACMO,IAAOD,QAAe;GAC1B,IAAM,EAAE,MAAME,GAAK,YAAYC,MAAOT,EAAM,SACtCU,IAASL,EAAO,QAASI,MAAOD,KAAYG,KAAoBH,KAAOI;GAC7E,OAAOC,EAAMH,CAAM;EACrB,CAAC,GACKI,IAAQR,QACNS,EAAcf,EAAM,QAAQ,OAAOA,EAAM,OAAOA,EAAM,GAAG,KAAKE,EAAE,MAAM,UAAU,QACxF,GACMc,IAAWV,QAAe,CAAC,CAACS,EAAcf,EAAM,QAAQ,UAAUA,EAAM,OAAOA,EAAM,GAAG,CAAC;E,kBAI7FR,EAAA,GAAAC,EAcS,UAAA;GAbP,MAAK;GACJ,OAAKC,EAAA;;;IAA0DW,EAAA,SAAM,WAAeJ,EAAA,QAAQ,cAAU;;GAKtG,gBAAcI,EAAA;GACd,cAAYS,EAAA;GACZ,OAAOA,EAAA;GACP,UAAUE,EAAA;GACV,SAAK,AAAAI,EAAA,QAAA,MAAEhB,EAAI,UAAA,UAAA,CAAsBC,EAAA,KAAM;E,KAExCb,EAAA,GAAAG,EAAwBC,EAARW,EAAA,KAAI,CAAA,E"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { stringifyJson as e } from "./format.js";
|
|
2
2
|
import { resolveOption as t } from "./options.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useMessages as n } from "../internal/messages.js";
|
|
4
|
+
import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, openBlock as c, shallowRef as l, toDisplayString as u, unref as d, withModifiers as f } from "vue";
|
|
4
5
|
// src/renderers/JsonCell.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var p = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "vg-json"
|
|
8
|
-
},
|
|
9
|
+
}, m = { class: "vg-dialog-header" }, h = { method: "dialog" }, g = ["aria-label"], _ = { class: "vg-json-pre" }, v = /*@__PURE__*/ s({
|
|
9
10
|
__name: "JsonCell",
|
|
10
11
|
props: {
|
|
11
12
|
value: {},
|
|
@@ -16,32 +17,32 @@ var d = {
|
|
|
16
17
|
column: {},
|
|
17
18
|
options: {}
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
let
|
|
21
|
-
function
|
|
22
|
-
|
|
20
|
+
setup(s) {
|
|
21
|
+
let v = s, y = n(), b = l(), x = r(() => v.value !== null && v.value !== void 0 && v.value !== ""), S = r(() => x.value ? e(v.value) : ""), C = r(() => t(v.options.dialogTitle, v.value, v.row) ?? v.column.header ?? "JSON");
|
|
22
|
+
function w() {
|
|
23
|
+
b.value?.showModal();
|
|
23
24
|
}
|
|
24
|
-
let
|
|
25
|
-
function
|
|
26
|
-
|
|
25
|
+
let T = typeof HTMLDialogElement < "u" && !("closedBy" in HTMLDialogElement.prototype);
|
|
26
|
+
function E(e) {
|
|
27
|
+
T && e.target === b.value && b.value?.close();
|
|
27
28
|
}
|
|
28
|
-
return (e, t) =>
|
|
29
|
+
return (e, t) => x.value ? (c(), a("span", p, [o("button", {
|
|
29
30
|
type: "button",
|
|
30
31
|
class: "vg-link-button",
|
|
31
|
-
onClick:
|
|
32
|
-
},
|
|
32
|
+
onClick: f(w, ["stop"])
|
|
33
|
+
}, u(s.options.label ?? d(y).view ?? "View"), 1), o("dialog", {
|
|
33
34
|
ref_key: "dialog",
|
|
34
|
-
ref:
|
|
35
|
+
ref: b,
|
|
35
36
|
class: "vg-dialog",
|
|
36
37
|
closedby: "any",
|
|
37
|
-
onClick:
|
|
38
|
-
onKeydown: t[0] ||=
|
|
39
|
-
}, [
|
|
38
|
+
onClick: f(E, ["stop"]),
|
|
39
|
+
onKeydown: t[0] ||= f(() => {}, ["stop"])
|
|
40
|
+
}, [o("header", m, [o("strong", null, u(C.value), 1), o("form", h, [o("button", {
|
|
40
41
|
class: "vg-icon-button",
|
|
41
|
-
"aria-label": "Close"
|
|
42
|
-
}, "✕"
|
|
42
|
+
"aria-label": d(y).close ?? "Close"
|
|
43
|
+
}, "✕", 8, g)])]), o("pre", _, u(S.value), 1)], 544)])) : i("", !0);
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
|
-
export {
|
|
46
|
+
export { v as default };
|
|
46
47
|
|
|
47
48
|
//# sourceMappingURL=JsonCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_withModifiers","_toDisplayString","_hoisted_1","_hoisted_2","_hoisted_3","JsonCell_vue_vue_type_script_setup_true_lang_default","props","__props","dialog","shallowRef","hasValue","computed","pretty","stringifyJson","title","resolveOption","open","needsLightDismissFallback","onDialogClick","event","openBlock","createElementBlock","createElementVNode","withModifiers","toDisplayString","_cache","createCommentVNode"],"sources":["../../src/renderers/JsonCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, shallowRef } from 'vue'\nimport type { CellRendererProps } from '../types'\nimport { stringifyJson } from './format'\nimport { resolveOption, type JsonOptions } from './options'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, JsonOptions>>()\n\nconst dialog = shallowRef<HTMLDialogElement>()\nconst hasValue = computed(\n () => props.value !== null && props.value !== undefined && props.value !== '',\n)\n// Rendered as a text node inside <pre>: never interpreted as HTML.\nconst pretty = computed(() => (hasValue.value ? stringifyJson(props.value) : ''))\nconst title = computed(\n () =>\n resolveOption(props.options.dialogTitle, props.value, props.row) ??\n props.column.header ??\n 'JSON',\n)\n\nfunction open() {\n dialog.value?.showModal()\n}\n\n// Light dismiss comes from `closedby=\"any\"`; this is the fallback for browsers without it:\n// a click whose target is the <dialog> itself landed on the backdrop.\nconst needsLightDismissFallback =\n typeof HTMLDialogElement !== 'undefined' && !('closedBy' in HTMLDialogElement.prototype)\nfunction onDialogClick(event: MouseEvent) {\n if (needsLightDismissFallback && event.target === dialog.value) dialog.value?.close()\n}\n</script>\n\n<template>\n <span v-if=\"hasValue\" class=\"vg-json\">\n <button type=\"button\" class=\"vg-link-button\" @click.stop=\"open\">\n {{ options.label ?? 'View' }}\n </button>\n <dialog ref=\"dialog\" class=\"vg-dialog\" closedby=\"any\" @click.stop=\"onDialogClick\" @keydown.stop>\n <header class=\"vg-dialog-header\">\n <strong>{{ title }}</strong>\n <form method=\"dialog\"
|
|
1
|
+
{"version":3,"file":"JsonCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_withModifiers","_toDisplayString","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","JsonCell_vue_vue_type_script_setup_true_lang_default","props","__props","m","useMessages","dialog","shallowRef","hasValue","computed","pretty","stringifyJson","title","resolveOption","open","needsLightDismissFallback","onDialogClick","event","openBlock","createElementBlock","createElementVNode","withModifiers","toDisplayString","unref","_cache","createCommentVNode"],"sources":["../../src/renderers/JsonCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, shallowRef } from 'vue'\nimport type { CellRendererProps } from '../types'\nimport { stringifyJson } from './format'\nimport { resolveOption, type JsonOptions } from './options'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, JsonOptions>>()\nconst m = useMessages()\n\nconst dialog = shallowRef<HTMLDialogElement>()\nconst hasValue = computed(\n () => props.value !== null && props.value !== undefined && props.value !== '',\n)\n// Rendered as a text node inside <pre>: never interpreted as HTML.\nconst pretty = computed(() => (hasValue.value ? stringifyJson(props.value) : ''))\nconst title = computed(\n () =>\n resolveOption(props.options.dialogTitle, props.value, props.row) ??\n props.column.header ??\n 'JSON',\n)\n\nfunction open() {\n dialog.value?.showModal()\n}\n\n// Light dismiss comes from `closedby=\"any\"`; this is the fallback for browsers without it:\n// a click whose target is the <dialog> itself landed on the backdrop.\nconst needsLightDismissFallback =\n typeof HTMLDialogElement !== 'undefined' && !('closedBy' in HTMLDialogElement.prototype)\nfunction onDialogClick(event: MouseEvent) {\n if (needsLightDismissFallback && event.target === dialog.value) dialog.value?.close()\n}\n</script>\n\n<template>\n <span v-if=\"hasValue\" class=\"vg-json\">\n <button type=\"button\" class=\"vg-link-button\" @click.stop=\"open\">\n {{ options.label ?? m.view ?? 'View' }}\n </button>\n <dialog ref=\"dialog\" class=\"vg-dialog\" closedby=\"any\" @click.stop=\"onDialogClick\" @keydown.stop>\n <header class=\"vg-dialog-header\">\n <strong>{{ title }}</strong>\n <form method=\"dialog\">\n <button class=\"vg-icon-button\" :aria-label=\"m.close ?? 'Close'\">✕</button>\n </form>\n </header>\n <pre class=\"vg-json-pre\">{{ pretty }}</pre>\n </dialog>\n </span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAOA,IAAMY,IAAQC,GACRC,IAAIC,EAAY,GAEhBC,IAASC,EAA8B,GACvCC,IAAWC,QACTP,EAAM,UAAU,QAAQA,EAAM,UAAU,KAAA,KAAaA,EAAM,UAAU,EAC7E,GAEMQ,IAASD,QAAgBD,EAAS,QAAQG,EAAcT,EAAM,KAAK,IAAI,EAAG,GAC1EU,IAAQH,QAEVI,EAAcX,EAAM,QAAQ,aAAaA,EAAM,OAAOA,EAAM,GAAG,KAC/DA,EAAM,OAAO,UACb,MACJ;EAEA,SAASY,IAAO;GACd,EAAO,OAAO,UAAU;EAC1B;EAIA,IAAMC,IACJ,OAAO,oBAAsB,OAAe,EAAE,cAAc,kBAAkB;EAChF,SAASC,EAAc,GAAmB;GACxC,AAAID,KAA6BE,EAAM,WAAWX,EAAO,SAAOA,EAAO,OAAO,MAAM;EACtF;E,iBAIcE,EAAA,SAAZlB,EAAA,GAAAC,EAaO,QAbPK,GAaO,CAZLJ,EAES,UAAA;GAFD,MAAK;GAAS,OAAM;GAAkB,SAAKC,EAAOqB,GAAI,CAAA,MAAA,CAAA;EACzD,GAAApB,EAAAS,EAAA,QAAQ,SAASR,EAAAS,CAAA,CAAC,CAAC,QAAI,MAAA,GAAA,CAAA,GAE5BZ,EAQS,UAAA;GARG,SAAA;GAAJ,KAAIc;GAAS,OAAM;GAAY,UAAS;GAAO,SAAKb,EAAOuB,GAAa,CAAA,MAAA,CAAA;GAAG,WAAO,AAAAQ,EAAA,OAAA/B,QAAR,CAAA,GAAa,CAAA,MAAA,CAAA;E,IAC7FD,EAKS,UALTK,GAKS,CAJPL,EAA4B,UAAA,MAAAE,EAAjBkB,EAAA,KAAK,GAAA,CAAA,GAChBpB,EAEO,QAFPM,GAEO,CADLN,EAA0E,UAAA;GAAlE,OAAM;GAAkB,cAAYG,EAAAS,CAAA,CAAC,CAAC,SAAK;EAAa,GAAA,KAAC,GAAAL,CAAA,C,MAGrEP,EAA2C,OAA3CQ,GAA2CN,EAAfgB,EAAA,KAAM,GAAA,CAAA,C"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { parseJsonish as e } from "./format.js";
|
|
2
2
|
import t from "./JsonTreeNode.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useMessages as n } from "../internal/messages.js";
|
|
4
|
+
import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, openBlock as l, toDisplayString as u, unref as d, withModifiers as f } from "vue";
|
|
4
5
|
// src/renderers/JsonTreeCell.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var p = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "vg-text vg-text-muted"
|
|
8
|
-
},
|
|
9
|
+
}, m = { class: "vg-link-button" }, h = { class: "vg-json-tree" }, g = /*@__PURE__*/ c({
|
|
9
10
|
__name: "JsonTreeCell",
|
|
10
11
|
props: {
|
|
11
12
|
value: {},
|
|
@@ -16,33 +17,33 @@ var d = {
|
|
|
16
17
|
column: {},
|
|
17
18
|
options: {}
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
let
|
|
21
|
-
return (e, n) =>
|
|
20
|
+
setup(c) {
|
|
21
|
+
let g = c, _ = n(), v = r(() => e(g.value)), y = r(() => v.value === void 0 || v.value === null || v.value === "");
|
|
22
|
+
return (e, n) => y.value && c.options.emptyText ? (l(), a("span", p, u(c.options.emptyText), 1)) : !y.value && c.options.collapsed ? (l(), a("details", {
|
|
22
23
|
key: 1,
|
|
23
24
|
class: "vg-json-reveal",
|
|
24
|
-
onClick: n[0] ||=
|
|
25
|
-
}, [
|
|
26
|
-
value:
|
|
25
|
+
onClick: n[0] ||= f(() => {}, ["stop"])
|
|
26
|
+
}, [o("summary", m, u(c.options.toggleLabel ?? d(_).moreInfo ?? "More info"), 1), o("ul", h, [s(t, {
|
|
27
|
+
value: v.value,
|
|
27
28
|
level: 0,
|
|
28
|
-
"collapse-at":
|
|
29
|
-
"max-depth":
|
|
30
|
-
"parse-nested": !!
|
|
29
|
+
"collapse-at": c.options.collapseAt ?? 1,
|
|
30
|
+
"max-depth": c.options.maxDepth ?? Infinity,
|
|
31
|
+
"parse-nested": !!c.options.parseNested
|
|
31
32
|
}, null, 8, [
|
|
32
33
|
"value",
|
|
33
34
|
"collapse-at",
|
|
34
35
|
"max-depth",
|
|
35
36
|
"parse-nested"
|
|
36
|
-
])])])) :
|
|
37
|
+
])])])) : y.value ? i("", !0) : (l(), a("ul", {
|
|
37
38
|
key: 2,
|
|
38
39
|
class: "vg-json-tree",
|
|
39
|
-
onClick: n[1] ||=
|
|
40
|
-
}, [
|
|
41
|
-
value:
|
|
40
|
+
onClick: n[1] ||= f(() => {}, ["stop"])
|
|
41
|
+
}, [s(t, {
|
|
42
|
+
value: v.value,
|
|
42
43
|
level: 0,
|
|
43
|
-
"collapse-at":
|
|
44
|
-
"max-depth":
|
|
45
|
-
"parse-nested": !!
|
|
44
|
+
"collapse-at": c.options.collapseAt ?? 1,
|
|
45
|
+
"max-depth": c.options.maxDepth ?? Infinity,
|
|
46
|
+
"parse-nested": !!c.options.parseNested
|
|
46
47
|
}, null, 8, [
|
|
47
48
|
"value",
|
|
48
49
|
"collapse-at",
|
|
@@ -51,6 +52,6 @@ var d = {
|
|
|
51
52
|
])]));
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
|
-
export {
|
|
55
|
+
export { g as default };
|
|
55
56
|
|
|
56
57
|
//# sourceMappingURL=JsonTreeCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonTreeCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_toDisplayString","_withModifiers","_createElementVNode","_createVNode","JsonTreeNode","JsonTreeNode_default","_hoisted_1","_hoisted_2","_hoisted_3","JsonTreeCell_vue_vue_type_script_setup_true_lang_default","props","__props","data","computed","parseJsonish","isEmpty","openBlock","createElementBlock","toDisplayString","_cache","withModifiers","createElementVNode","createVNode","createCommentVNode"],"sources":["../../src/renderers/JsonTreeCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererProps } from '../types'\nimport { parseJsonish } from './format'\nimport JsonTreeNode from './JsonTreeNode.vue'\nimport type { JsonTreeOptions } from './options'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, JsonTreeOptions>>()\nconst data = computed(() => parseJsonish(props.value))\nconst isEmpty = computed(() => data.value === undefined || data.value === null || data.value === '')\n</script>\n\n<template>\n <span v-if=\"isEmpty && options.emptyText\" class=\"vg-text vg-text-muted\">{{\n options.emptyText\n }}</span>\n <!-- `collapsed`: a native <details> disclosure — no JS state. -->\n <details v-else-if=\"!isEmpty && options.collapsed\" class=\"vg-json-reveal\" @click.stop>\n <summary class=\"vg-link-button\">{{ options.toggleLabel ?? 'More info' }}</summary>\n <ul class=\"vg-json-tree\">\n <JsonTreeNode\n :value=\"data\"\n :level=\"0\"\n :collapse-at=\"options.collapseAt ?? 1\"\n :max-depth=\"options.maxDepth ?? Infinity\"\n :parse-nested=\"!!options.parseNested\"\n />\n </ul>\n </details>\n <ul v-else-if=\"!isEmpty\" class=\"vg-json-tree\" @click.stop>\n <JsonTreeNode\n :value=\"data\"\n :level=\"0\"\n :collapse-at=\"options.collapseAt ?? 1\"\n :max-depth=\"options.maxDepth ?? Infinity\"\n :parse-nested=\"!!options.parseNested\"\n />\n </ul>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"JsonTreeCell.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_toDisplayString","_withModifiers","_createElementVNode","_unref","_createVNode","JsonTreeNode","JsonTreeNode_default","_hoisted_1","_hoisted_2","_hoisted_3","JsonTreeCell_vue_vue_type_script_setup_true_lang_default","props","__props","m","useMessages","data","computed","parseJsonish","isEmpty","openBlock","createElementBlock","toDisplayString","_cache","withModifiers","createElementVNode","unref","createVNode","createCommentVNode"],"sources":["../../src/renderers/JsonTreeCell.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { CellRendererProps } from '../types'\nimport { parseJsonish } from './format'\nimport JsonTreeNode from './JsonTreeNode.vue'\nimport type { JsonTreeOptions } from './options'\nimport { useMessages } from '../internal/messages'\n\nconst props = defineProps<CellRendererProps<unknown, unknown, JsonTreeOptions>>()\nconst m = useMessages()\nconst data = computed(() => parseJsonish(props.value))\nconst isEmpty = computed(() => data.value === undefined || data.value === null || data.value === '')\n</script>\n\n<template>\n <span v-if=\"isEmpty && options.emptyText\" class=\"vg-text vg-text-muted\">{{\n options.emptyText\n }}</span>\n <!-- `collapsed`: a native <details> disclosure — no JS state. -->\n <details v-else-if=\"!isEmpty && options.collapsed\" class=\"vg-json-reveal\" @click.stop>\n <summary class=\"vg-link-button\">{{ options.toggleLabel ?? m.moreInfo ?? 'More info' }}</summary>\n <ul class=\"vg-json-tree\">\n <JsonTreeNode\n :value=\"data\"\n :level=\"0\"\n :collapse-at=\"options.collapseAt ?? 1\"\n :max-depth=\"options.maxDepth ?? Infinity\"\n :parse-nested=\"!!options.parseNested\"\n />\n </ul>\n </details>\n <ul v-else-if=\"!isEmpty\" class=\"vg-json-tree\" @click.stop>\n <JsonTreeNode\n :value=\"data\"\n :level=\"0\"\n :collapse-at=\"options.collapseAt ?? 1\"\n :max-depth=\"options.maxDepth ?? Infinity\"\n :parse-nested=\"!!options.parseNested\"\n />\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAQA,IAAMa,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOC,QAAeC,EAAaN,EAAM,KAAK,CAAC,GAC/CO,IAAUF,QAAeD,EAAK,UAAU,KAAA,KAAaA,EAAK,UAAU,QAAQA,EAAK,UAAU,EAAE;E,iBAIrFG,EAAA,SAAWN,EAAA,QAAQ,aAA/Bd,EAAA,GAAAC,EAES,QAFTQ,GAESP,EADPY,EAAA,QAAQ,SAAS,GAAA,CAAA,KAGE,CAAAM,EAAA,SAAWN,EAAA,QAAQ,aAAxCd,EAAA,GAAAC,EAWU,WAAA;;GAXyC,OAAM;GAAkB,SAAK,AAAAuB,EAAA,OAAArB,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;E,IACnFC,EAAgG,WAAhGM,GAAgGR,EAA7DY,EAAA,QAAQ,eAAeT,EAAAU,CAAA,CAAC,CAAC,YAAQ,WAAA,GAAA,CAAA,GACpEX,EAQK,MARLO,GAQK,CAPHL,EAMEC,GAAA;GALC,OAAOU,EAAA;GACP,OAAO;GACP,eAAaH,EAAA,QAAQ,cAAU;GAC/B,aAAWA,EAAA,QAAQ,YAAY;GAC/B,gBAAY,CAAA,CAAIA,EAAA,QAAQ;;;;;;E,UAIfM,EAAA,Q,aAAhBpB,EAAA,GAAAC,EAQK,MAAA;;GARoB,OAAM;GAAgB,SAAK,AAAAuB,EAAA,OAAArB,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;E,IACvDG,EAMEC,GAAA;GALC,OAAOU,EAAA;GACP,OAAO;GACP,eAAaH,EAAA,QAAQ,cAAU;GAC/B,aAAWA,EAAA,QAAQ,YAAY;GAC/B,gBAAY,CAAA,CAAIA,EAAA,QAAQ"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMessages as e } from "../internal/messages.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, openBlock as s, renderList as c, toDisplayString as l, unref as u } from "vue";
|
|
2
3
|
// src/renderers/ListCell.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
4
|
+
var d = {
|
|
4
5
|
key: 0,
|
|
5
6
|
class: "vg-list"
|
|
6
|
-
},
|
|
7
|
+
}, f = { class: "vg-list-items" }, p = ["title"], m = { class: "vg-link-button" }, h = { class: "vg-list-more-closed" }, g = { class: "vg-list-more-open" }, _ = { class: "vg-list-items" }, v = ["title"], y = {
|
|
7
8
|
key: 1,
|
|
8
9
|
class: "vg-text vg-text-muted"
|
|
9
|
-
},
|
|
10
|
+
}, b = /*@__PURE__*/ o({
|
|
10
11
|
__name: "ListCell",
|
|
11
12
|
props: {
|
|
12
13
|
value: {},
|
|
@@ -18,29 +19,29 @@ var l = {
|
|
|
18
19
|
options: {}
|
|
19
20
|
},
|
|
20
21
|
emits: ["action"],
|
|
21
|
-
setup(
|
|
22
|
-
let
|
|
23
|
-
let e =
|
|
24
|
-
return (Array.isArray(e) ? e : []).map((e) =>
|
|
25
|
-
}),
|
|
26
|
-
function
|
|
27
|
-
|
|
22
|
+
setup(o, { emit: b }) {
|
|
23
|
+
let x = o, S = e(), C = b, w = n(() => {
|
|
24
|
+
let e = x.options.items ? x.options.items(x.value, x.row) : x.value;
|
|
25
|
+
return (Array.isArray(e) ? e : []).map((e) => x.options.itemLabel ? x.options.itemLabel(e, x.row) : typeof e == "object" && e ? JSON.stringify(e) : String(e ?? ""));
|
|
26
|
+
}), T = n(() => Math.max(1, x.options.max ?? 1)), E = n(() => w.value.slice(0, T.value)), D = n(() => w.value.slice(T.value));
|
|
27
|
+
function O(e) {
|
|
28
|
+
C("action", "expand", e.target.open);
|
|
28
29
|
}
|
|
29
|
-
return (
|
|
30
|
+
return (e, n) => w.value.length ? (s(), i("span", d, [a("ul", f, [(s(!0), i(t, null, c(E.value, (e, t) => (s(), i("li", {
|
|
30
31
|
key: t,
|
|
31
32
|
class: "vg-text vg-text-ellipsis",
|
|
32
33
|
title: e
|
|
33
|
-
},
|
|
34
|
+
}, l(e), 9, p))), 128))]), D.value.length ? (s(), i("details", {
|
|
34
35
|
key: 0,
|
|
35
36
|
class: "vg-list-more",
|
|
36
|
-
onToggle:
|
|
37
|
-
}, [
|
|
37
|
+
onToggle: O
|
|
38
|
+
}, [a("summary", m, [a("span", h, l(u(S).moreItems?.(D.value.length) ?? `+${D.value.length} more`), 1), a("span", g, l(u(S).showLess ?? "Show less"), 1)]), a("ul", _, [(s(!0), i(t, null, c(D.value, (e, t) => (s(), i("li", {
|
|
38
39
|
key: t,
|
|
39
40
|
class: "vg-text vg-text-ellipsis",
|
|
40
41
|
title: e
|
|
41
|
-
},
|
|
42
|
+
}, l(e), 9, v))), 128))])], 32)) : r("", !0)])) : o.options.placeholder ? (s(), i("span", y, l(o.options.placeholder), 1)) : r("", !0);
|
|
42
43
|
}
|
|
43
44
|
});
|
|
44
|
-
export {
|
|
45
|
+
export { b as default };
|
|
45
46
|
|
|
46
47
|
//# sourceMappingURL=ListCell.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -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>\n <span v-else-if=\"options.placeholder\" class=\"vg-text vg-text-muted\">{{\n options.placeholder\n }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAMA,IAAMkB,IAAQC,GACRC,IAAIC,EAAY,GAChBC,IAAOL,GAEPM,IAAMC,QAAe;GACzB,IAAMC,IAAMP,EAAM,QAAQ,QAAQA,EAAM,QAAQ,MAAMA,EAAM,OAAOA,EAAM,GAAG,IAAIA,EAAM;GAEtF,QADa,MAAM,QAAQO,CAAG,IAAIA,IAAM,CAAC,EAAA,CAC7B,KAAK,MACXP,EAAM,QAAQ,YAAkBA,EAAM,QAAQ,UAAUQ,GAAMR,EAAM,GAAG,IACnD,OAAOQ,KAAS,YAAjCA,IAA4C,KAAK,UAAUA,CAAI,IAAI,OAAOA,KAAQ,EAAE,CAC5F;EACH,CAAC,GACKC,IAAMH,QAAe,KAAK,IAAI,GAAGN,EAAM,QAAQ,OAAO,CAAC,CAAC,GACxDU,IAAQJ,QAAeD,EAAI,MAAM,MAAM,GAAGI,EAAI,KAAK,CAAC,GACpDE,IAAOL,QAAeD,EAAI,MAAM,MAAMI,EAAI,KAAK,CAAC;EAGtD,SAASG,EAAS,GAAc;GAC9B,EAAK,UAAU,UAAWC,EAAM,OAA8B,IAAI;EACpE;E,iBAIcR,EAAA,MAAI,UAAhBvB,EAAA,GAAAC,EAkBO,QAlBPM,GAkBO,CAjBLL,EAIK,MAJLM,GAIK,EAHHR,EAAA,EAAA,GAAAC,EAEKE,GAAA,MAAAC,EAFmBwB,EAAA,QAAZ,GAAM,OAAlB5B,EAAA,GAAAC,EAEK,MAAA;GAF2B,KAAKoC;GAAG,OAAM;GAA4B,OAAOX;EAC5E,GAAArB,EAAAqB,CAAI,GAAA,GAAAjB,CAAA,E,YAGIoB,EAAA,MAAK,UAApB7B,EAAA,GAAAC,EAWU,WAAA;;GAXkB,OAAM;GAAwB;E,IACxDC,EAIU,WAJVQ,GAIU,CAHRR,EAES,QAFTS,GAESN,EADPC,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
|