@xwiki/cristal-dsvuetify 0.19.0 → 0.20.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/index-DNHsU4Fr.js +27009 -0
  3. package/dist/index-DNHsU4Fr.js.map +1 -0
  4. package/dist/index.es.js +4 -4
  5. package/dist/index.umd.js +37 -9
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/vue/form/x-navigation-tree-select.vue.d.ts +4 -4
  8. package/dist/x-alert-CAlwFn5B.js +46 -0
  9. package/dist/{x-alert-gEtl8xCI.js.map → x-alert-CAlwFn5B.js.map} +1 -1
  10. package/dist/{x-avatar-WnkeGyHH.js → x-avatar-Cp8QVkHc.js} +5 -5
  11. package/dist/{x-avatar-WnkeGyHH.js.map → x-avatar-Cp8QVkHc.js.map} +1 -1
  12. package/dist/x-breadcrumb-BQVk_ZI_.js +22 -0
  13. package/dist/{x-breadcrumb-CyjqjISE.js.map → x-breadcrumb-BQVk_ZI_.js.map} +1 -1
  14. package/dist/x-btn-BXn20OTM.js +50 -0
  15. package/dist/{x-btn-DzH2bk-f.js.map → x-btn-BXn20OTM.js.map} +1 -1
  16. package/dist/x-card-BjsZr1mV.js +22 -0
  17. package/dist/{x-card-BlUD5hbt.js.map → x-card-BjsZr1mV.js.map} +1 -1
  18. package/dist/x-checkbox-DqUXQoJU.js +27 -0
  19. package/dist/{x-checkbox-CV2j3kg9.js.map → x-checkbox-DqUXQoJU.js.map} +1 -1
  20. package/dist/x-dialog-te6-Vgkm.js +49 -0
  21. package/dist/{x-dialog-Ccb-vGZ2.js.map → x-dialog-te6-Vgkm.js.map} +1 -1
  22. package/dist/x-divider-B3cbVfv2.js +12 -0
  23. package/dist/{x-divider-BOCxsH8h.js.map → x-divider-B3cbVfv2.js.map} +1 -1
  24. package/dist/x-file-input-DGLWq0E0.js +39 -0
  25. package/dist/{x-file-input-WC5u-psN.js.map → x-file-input-DGLWq0E0.js.map} +1 -1
  26. package/dist/x-form-C5fVEKNp.js +32 -0
  27. package/dist/{x-form-66u_n6Xf.js.map → x-form-C5fVEKNp.js.map} +1 -1
  28. package/dist/{x-img-DWbVDNTs.js → x-img-BB3GSMHr.js} +3 -3
  29. package/dist/{x-img-DWbVDNTs.js.map → x-img-BB3GSMHr.js.map} +1 -1
  30. package/dist/x-load-DPuiSh1i.js +11 -0
  31. package/dist/{x-load-Bw4ftl3k.js.map → x-load-DPuiSh1i.js.map} +1 -1
  32. package/dist/x-menu-9krdqSZB.js +31 -0
  33. package/dist/{x-menu-BeWrqcFy.js.map → x-menu-9krdqSZB.js.map} +1 -1
  34. package/dist/x-menu-item-BSondWPp.js +22 -0
  35. package/dist/{x-menu-item-CBdOhZc3.js.map → x-menu-item-BSondWPp.js.map} +1 -1
  36. package/dist/x-menu-label-Dp7gEYzE.js +17 -0
  37. package/dist/{x-menu-label-D-sFcG_g.js.map → x-menu-label-Dp7gEYzE.js.map} +1 -1
  38. package/dist/x-navigation-tree-BMLu80ML.js +518 -0
  39. package/dist/x-navigation-tree-BMLu80ML.js.map +1 -0
  40. package/dist/x-navigation-tree-select-CZMM_WJl.js +109 -0
  41. package/dist/x-navigation-tree-select-CZMM_WJl.js.map +1 -0
  42. package/dist/x-search-NPeNBHNh.js +20 -0
  43. package/dist/{x-search-C7GhoCKj.js.map → x-search-NPeNBHNh.js.map} +1 -1
  44. package/dist/x-select-DCWNJiNk.js +38 -0
  45. package/dist/{x-select-qbcXbRjw.js.map → x-select-DCWNJiNk.js.map} +1 -1
  46. package/dist/x-tab-UmfRst-i.js +22 -0
  47. package/dist/{x-tab-vRrbUjdK.js.map → x-tab-UmfRst-i.js.map} +1 -1
  48. package/dist/x-tab-group-C0nWDupY.js +49 -0
  49. package/dist/{x-tab-group-BfEaq8Nj.js.map → x-tab-group-C0nWDupY.js.map} +1 -1
  50. package/dist/x-tab-panel-CjY4vyG0.js +22 -0
  51. package/dist/{x-tab-panel-DysgiPCz.js.map → x-tab-panel-CjY4vyG0.js.map} +1 -1
  52. package/dist/{x-text-field-B2S1QZum.js → x-text-field-CaWcwz2v.js} +14 -15
  53. package/dist/{x-text-field-B2S1QZum.js.map → x-text-field-CaWcwz2v.js.map} +1 -1
  54. package/package.json +15 -14
  55. package/src/vue/form/x-navigation-tree-select.vue +28 -7
  56. package/src/vue/x-navigation-tree.vue +34 -12
  57. package/dist/index-BZqZR8-g.js +0 -21866
  58. package/dist/index-BZqZR8-g.js.map +0 -1
  59. package/dist/x-alert-gEtl8xCI.js +0 -46
  60. package/dist/x-breadcrumb-CyjqjISE.js +0 -22
  61. package/dist/x-btn-DzH2bk-f.js +0 -50
  62. package/dist/x-card-BlUD5hbt.js +0 -22
  63. package/dist/x-checkbox-CV2j3kg9.js +0 -28
  64. package/dist/x-dialog-Ccb-vGZ2.js +0 -49
  65. package/dist/x-divider-BOCxsH8h.js +0 -12
  66. package/dist/x-file-input-WC5u-psN.js +0 -40
  67. package/dist/x-form-66u_n6Xf.js +0 -36
  68. package/dist/x-load-Bw4ftl3k.js +0 -11
  69. package/dist/x-menu-BeWrqcFy.js +0 -31
  70. package/dist/x-menu-item-CBdOhZc3.js +0 -22
  71. package/dist/x-menu-label-D-sFcG_g.js +0 -17
  72. package/dist/x-navigation-tree-CA9rdB38.js +0 -543
  73. package/dist/x-navigation-tree-CA9rdB38.js.map +0 -1
  74. package/dist/x-navigation-tree-select-D5olgFJB.js +0 -99
  75. package/dist/x-navigation-tree-select-D5olgFJB.js.map +0 -1
  76. package/dist/x-search-C7GhoCKj.js +0 -20
  77. package/dist/x-select-qbcXbRjw.js +0 -39
  78. package/dist/x-tab-group-BfEaq8Nj.js +0 -49
  79. package/dist/x-tab-panel-DysgiPCz.js +0 -22
  80. package/dist/x-tab-vRrbUjdK.js +0 -22
@@ -0,0 +1,109 @@
1
+ import { d as R, p as C, G as D, q as X, l as v, a3 as k, r as i, c as x, i as l, w as n, u as o, F as B, o as H, s as N, h, t as y, $ as M } from "./index-DNHsU4Fr.js";
2
+ import { t as S } from "./translations-BVK9UR9x.js";
3
+ import E from "./x-breadcrumb-BQVk_ZI_.js";
4
+ import { EntityType as F, SpaceReference as I } from "@xwiki/cristal-model-api";
5
+ import { useI18n as A } from "vue-i18n";
6
+ import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const j = {
8
+ includeTerminals: !1
9
+ }, q = /* @__PURE__ */ R({
10
+ __name: "x-navigation-tree-select",
11
+ props: /* @__PURE__ */ C(/* @__PURE__ */ M({
12
+ label: {},
13
+ help: {},
14
+ currentPageReference: {},
15
+ modelValue: {},
16
+ includeTerminals: { type: Boolean }
17
+ }, j), {
18
+ modelValue: {},
19
+ modelModifiers: {}
20
+ }),
21
+ emits: ["update:modelValue"],
22
+ setup(f) {
23
+ const p = D("cristal"), s = p.getContainer().get("PageHierarchyResolverProvider").get(), _ = p.getContainer().get("ModelReferenceHandlerProvider").get(), { t: c } = A({
24
+ messages: S
25
+ }), u = f, d = X(f, "modelValue"), m = v(!1), t = v([]);
26
+ let a;
27
+ k(async () => {
28
+ a = u.currentPageReference, d.value = u.currentPageReference.space, t.value = await s.getPageHierarchy(
29
+ u.currentPageReference.space,
30
+ !1
31
+ );
32
+ });
33
+ async function P(e) {
34
+ e.location.type == F.SPACE ? e.location.names.length > 0 ? (a = _.createDocumentReference(
35
+ e.location.names[e.location.names.length - 1],
36
+ new I(
37
+ e.location.wiki,
38
+ ...e.location.names.slice(0, -1)
39
+ )
40
+ ), t.value = await s.getPageHierarchy(
41
+ a,
42
+ !1
43
+ )) : (a = void 0, t.value = [{ label: e.label, pageId: "", url: e.url }]) : (a = e.location, t.value = await s.getPageHierarchy(
44
+ a,
45
+ !1
46
+ )), d.value = e.location;
47
+ }
48
+ return (e, r) => {
49
+ const b = i("x-btn"), T = i("XNavigationTree"), V = i("XBtn"), w = i("XDialog");
50
+ return H(), x(B, null, [
51
+ l(o(N), {
52
+ label: e.label,
53
+ hint: e.help,
54
+ "persistent-hint": e.help !== void 0,
55
+ active: t.value.length > 0,
56
+ readonly: ""
57
+ }, {
58
+ default: n(() => [
59
+ l(E, { items: t.value }, null, 8, ["items"])
60
+ ]),
61
+ _: 1
62
+ }, 8, ["label", "hint", "persistent-hint", "active"]),
63
+ l(w, {
64
+ modelValue: m.value,
65
+ "onUpdate:modelValue": r[1] || (r[1] = (g) => m.value = g),
66
+ width: "auto",
67
+ title: o(c)("vuetify.tree.select.location.label")
68
+ }, {
69
+ activator: n(() => [
70
+ l(b, {
71
+ id: "change-page-location-button",
72
+ size: "small",
73
+ color: "secondary"
74
+ }, {
75
+ default: n(() => [
76
+ h(y(o(c)("vuetify.tree.select.location.label")), 1)
77
+ ]),
78
+ _: 1
79
+ })
80
+ ]),
81
+ default: n(() => [
82
+ l(T, {
83
+ "current-page-reference": o(a),
84
+ "click-action": P,
85
+ "include-terminals": e.includeTerminals,
86
+ "show-root-node": ""
87
+ }, null, 8, ["current-page-reference", "include-terminals"])
88
+ ]),
89
+ footer: n(() => [
90
+ l(V, {
91
+ variant: "primary",
92
+ onClick: r[0] || (r[0] = (g) => m.value = !1)
93
+ }, {
94
+ default: n(() => [
95
+ h(y(o(c)("vuetify.tree.select.location.select")), 1)
96
+ ]),
97
+ _: 1
98
+ })
99
+ ]),
100
+ _: 1
101
+ }, 8, ["modelValue", "title"])
102
+ ], 64);
103
+ };
104
+ }
105
+ }), O = /* @__PURE__ */ $(q, [["__scopeId", "data-v-72a1a984"]]);
106
+ export {
107
+ O as default
108
+ };
109
+ //# sourceMappingURL=x-navigation-tree-select-CZMM_WJl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-navigation-tree-select-CZMM_WJl.js","sources":["../../api/src/XNavigationTreeSelect.ts","../src/vue/form/x-navigation-tree-select.vue"],"sourcesContent":["/*\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type {\n DocumentReference,\n SpaceReference,\n} from \"@xwiki/cristal-model-api\";\n\n/**\n * @since 0.15\n */\ntype NavigationTreeSelectProps = {\n label: string;\n help?: string;\n currentPageReference?: DocumentReference;\n modelValue?: SpaceReference;\n /**\n * Whether to include terminal pages as select options (default: false).\n * @since 0.16\n */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTreeSelect implementations.\n * @since 0.16\n */\nconst navigationTreeSelectPropsDefaults = {\n includeTerminals: false,\n};\n\nexport type { NavigationTreeSelectProps };\nexport { navigationTreeSelectPropsDefaults };\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport XBreadcrumb from \"../x-breadcrumb.vue\";\nimport { navigationTreeSelectPropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { EntityType, SpaceReference } from \"@xwiki/cristal-model-api\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { CristalApp } from \"@xwiki/cristal-api\";\nimport type { NavigationTreeSelectProps } from \"@xwiki/cristal-dsapi\";\nimport type {\n PageHierarchyItem,\n PageHierarchyResolver,\n PageHierarchyResolverProvider,\n} from \"@xwiki/cristal-hierarchy-api\";\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type {\n ModelReferenceHandler,\n ModelReferenceHandlerProvider,\n} from \"@xwiki/cristal-model-reference-api\";\nimport type { NavigationTreeNode } from \"@xwiki/cristal-navigation-tree-api\";\nimport type { Ref } from \"vue\";\n\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst hierarchyResolver: PageHierarchyResolver = cristal\n .getContainer()\n .get<PageHierarchyResolverProvider>(\"PageHierarchyResolverProvider\")\n .get()!;\nconst referenceHandler: ModelReferenceHandler = cristal\n .getContainer()\n .get<ModelReferenceHandlerProvider>(\"ModelReferenceHandlerProvider\")\n .get()!;\n\nconst { t } = useI18n({\n messages,\n});\nconst props = withDefaults(\n defineProps<NavigationTreeSelectProps>(),\n navigationTreeSelectPropsDefaults,\n);\nconst model = defineModel<SpaceReference | DocumentReference>();\n\nconst openedLocationDialog: Ref<boolean> = ref(false);\nconst hierarchy: Ref<Array<PageHierarchyItem>> = ref([]);\nlet selectedPage: DocumentReference | undefined;\n\nonMounted(async () => {\n selectedPage = props.currentPageReference;\n model.value = props.currentPageReference!.space;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n props.currentPageReference!.space!,\n false,\n );\n});\n\nasync function treeNodeClickAction(node: NavigationTreeNode) {\n if (node.location.type == EntityType.SPACE) {\n if (node.location.names.length > 0) {\n selectedPage = referenceHandler.createDocumentReference(\n node.location.names[node.location.names.length - 1],\n new SpaceReference(\n node.location.wiki,\n ...node.location.names.slice(0, -1),\n ),\n );\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n selectedPage,\n false,\n );\n } else {\n selectedPage = undefined;\n hierarchy.value = [{ label: node.label, pageId: \"\", url: node.url }];\n }\n } else {\n selectedPage = node.location;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n selectedPage,\n false,\n );\n }\n model.value = node.location;\n}\n</script>\n\n<template>\n <v-text-field\n :label=\"label\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :active=\"hierarchy.length > 0\"\n readonly\n >\n <template #default>\n <XBreadcrumb :items=\"hierarchy\"></XBreadcrumb>\n </template>\n </v-text-field>\n <XDialog\n v-model=\"openedLocationDialog\"\n width=\"auto\"\n :title=\"t('vuetify.tree.select.location.label')\"\n >\n <template #activator>\n <x-btn id=\"change-page-location-button\" size=\"small\" color=\"secondary\">\n {{ t(\"vuetify.tree.select.location.label\") }}\n </x-btn>\n </template>\n <template #default>\n <XNavigationTree\n :current-page-reference=\"selectedPage\"\n :click-action=\"treeNodeClickAction\"\n :include-terminals=\"includeTerminals\"\n show-root-node\n ></XNavigationTree>\n </template>\n <template #footer>\n <XBtn variant=\"primary\" @click=\"openedLocationDialog = false\">\n {{ t(\"vuetify.tree.select.location.select\") }}\n </XBtn>\n </template>\n </XDialog>\n</template>\n\n<style scoped>\n.v-treeview {\n overflow: auto;\n}\n</style>\n"],"names":["navigationTreeSelectPropsDefaults","cristal","inject","hierarchyResolver","referenceHandler","t","useI18n","messages","props","__props","model","_useModel","openedLocationDialog","ref","hierarchy","selectedPage","onMounted","treeNodeClickAction","node","EntityType","SpaceReference","_createVNode","_unref","VTextField","label","help","XBreadcrumb","_component_XDialog","$event","_component_x_btn","_component_XNavigationTree","includeTerminals","_component_XBtn"],"mappings":";;;;;;AA4CA,MAAMA,IAAoC;AAAA,EACxC,kBAAkB;AACpB;;;;;;;;;;;;;;ACJM,UAAAC,IAAsBC,EAAmB,SAAS,GAClDC,IAA2CF,EAC9C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAI,GACDG,IAA0CH,EAC7C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAI,GAED,EAAE,GAAAI,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GACKC,IAAQC,GAIRC,IAAQC,EAA+CF,GAAA,YAAC,GAExDG,IAAqCC,EAAI,EAAK,GAC9CC,IAA2CD,EAAI,EAAE;AACnD,QAAAE;AAEJ,IAAAC,EAAU,YAAY;AACpB,MAAAD,IAAeP,EAAM,sBACfE,EAAA,QAAQF,EAAM,qBAAsB,OAChCM,EAAA,QAAQ,MAAMX,EAAkB;AAAA,QACxCK,EAAM,qBAAsB;AAAA,QAC5B;AAAA,MACF;AAAA,IAAA,CACD;AAED,mBAAeS,EAAoBC,GAA0B;AAC3D,MAAIA,EAAK,SAAS,QAAQC,EAAW,QAC/BD,EAAK,SAAS,MAAM,SAAS,KAC/BH,IAAeX,EAAiB;AAAA,QAC9Bc,EAAK,SAAS,MAAMA,EAAK,SAAS,MAAM,SAAS,CAAC;AAAA,QAClD,IAAIE;AAAA,UACFF,EAAK,SAAS;AAAA,UACd,GAAGA,EAAK,SAAS,MAAM,MAAM,GAAG,EAAE;AAAA,QAAA;AAAA,MAEtC,GACUJ,EAAA,QAAQ,MAAMX,EAAkB;AAAA,QACxCY;AAAA,QACA;AAAA,MACF,MAEeA,IAAA,QACLD,EAAA,QAAQ,CAAC,EAAE,OAAOI,EAAK,OAAO,QAAQ,IAAI,KAAKA,EAAK,IAAA,CAAK,MAGrEH,IAAeG,EAAK,UACVJ,EAAA,QAAQ,MAAMX,EAAkB;AAAA,QACxCY;AAAA,QACA;AAAA,MACF,IAEFL,EAAM,QAAQQ,EAAK;AAAA,IAAA;;;;QAKnBG,EAUeC,EAAAC,CAAA,GAAA;AAAA,UATZ,OAAOC,EAAK;AAAA,UACZ,MAAMC,EAAI;AAAA,UACV,mBAAiBA,EAAI,SAAK;AAAA,UAC1B,QAAQX,EAAS,MAAC,SAAM;AAAA,UACzB,UAAA;AAAA,QAAA;UAEW,WACT,MAA8C;AAAA,YAA9CO,EAA8CK,GAAA,EAAhC,OAAOZ,EAAS,MAAA,GAAA,MAAA,GAAA,CAAA,OAAA,CAAA;AAAA,UAAA;;;QAGlCO,EAuBUM,GAAA;AAAA,sBAtBCf,EAAoB;AAAA,wDAApBA,EAAoB,QAAAgB;AAAA,UAC7B,OAAM;AAAA,UACL,OAAON,EAACjB,CAAA,EAAA,oCAAA;AAAA,QAAA;UAEE,aACT,MAEQ;AAAA,YAFRgB,EAEQQ,GAAA;AAAA,cAFD,IAAG;AAAA,cAA8B,MAAK;AAAA,cAAQ,OAAM;AAAA,YAAA;yBACzD,MAA6C;AAAA,oBAA1CP,EAACjB,CAAA,EAAA,oCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;UAGG,WACT,MAKmB;AAAA,YALnBgB,EAKmBS,GAAA;AAAA,cAJhB,0BAAwBR,EAAYP,CAAA;AAAA,cACpC,gBAAcE;AAAA,cACd,qBAAmBc,EAAgB;AAAA,cACpC,kBAAA;AAAA;;UAGO,UACT,MAEO;AAAA,YAFPV,EAEOW,GAAA;AAAA,cAFD,SAAQ;AAAA,cAAW,gCAAOpB,EAAoB,QAAA;AAAA,YAAA;yBAClD,MAA8C;AAAA,oBAA3CU,EAACjB,CAAA,EAAA,qCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ import { r as o, b as n, o as r } from "./index-DNHsU4Fr.js";
2
+ import { _ as t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const c = {};
4
+ function a(s, m) {
5
+ const e = o("v-autocomplete");
6
+ return r(), n(e, {
7
+ density: "comfortable",
8
+ "menu-icon": "",
9
+ placeholder: "Search",
10
+ "prepend-inner-icon": "mdi-magnify",
11
+ variant: "solo",
12
+ "auto-select-first": "",
13
+ rounded: ""
14
+ });
15
+ }
16
+ const _ = /* @__PURE__ */ t(c, [["render", a]]);
17
+ export {
18
+ _ as default
19
+ };
20
+ //# sourceMappingURL=x-search-NPeNBHNh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-search-C7GhoCKj.js","sources":["../src/vue/x-search.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\"></script>\n\n<template>\n <v-autocomplete\n density=\"comfortable\"\n menu-icon=\"\"\n placeholder=\"Search\"\n prepend-inner-icon=\"mdi-magnify\"\n variant=\"solo\"\n auto-select-first\n rounded\n ></v-autocomplete>\n</template>\n\n<style scoped></style>\n"],"names":["_createBlock","_component_v_autocomplete"],"mappings":";;;;;cAsBEA,EAQkBC,GAAA;AAAA,IAPhB,SAAQ;AAAA,IACR,aAAU;AAAA,IACV,aAAY;AAAA,IACZ,sBAAmB;AAAA,IACnB,SAAQ;AAAA,IACR,qBAAA;AAAA,IACA,SAAA;AAAA;;;"}
1
+ {"version":3,"file":"x-search-NPeNBHNh.js","sources":["../src/vue/x-search.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\"></script>\n\n<template>\n <v-autocomplete\n density=\"comfortable\"\n menu-icon=\"\"\n placeholder=\"Search\"\n prepend-inner-icon=\"mdi-magnify\"\n variant=\"solo\"\n auto-select-first\n rounded\n ></v-autocomplete>\n</template>\n\n<style scoped></style>\n"],"names":["_createBlock","_component_v_autocomplete"],"mappings":";;;;;cAsBEA,EAQkBC,GAAA;AAAA,IAPhB,SAAQ;AAAA,IACR,aAAU;AAAA,IACV,aAAY;AAAA,IACZ,sBAAmB;AAAA,IACnB,SAAQ;AAAA,IACR,qBAAA;AAAA,IACA,SAAA;AAAA;;;"}
@@ -0,0 +1,38 @@
1
+ import { d as m, p as n, q as d, a as i, b as p, u as c, o as f, a4 as V } from "./index-DNHsU4Fr.js";
2
+ import { t as b } from "./translations-BVK9UR9x.js";
3
+ import { useI18n as g } from "vue-i18n";
4
+ const B = /* @__PURE__ */ m({
5
+ __name: "x-select",
6
+ props: /* @__PURE__ */ n({
7
+ label: {},
8
+ items: {},
9
+ help: {},
10
+ required: { type: Boolean },
11
+ modelValue: {}
12
+ }, {
13
+ modelValue: {},
14
+ modelModifiers: {}
15
+ }),
16
+ emits: ["update:modelValue"],
17
+ setup(s) {
18
+ const t = s, a = d(s, "modelValue"), { t: o } = g({
19
+ messages: b
20
+ }), r = i(() => {
21
+ const e = [];
22
+ return t.required && e.push((l) => l ? !0 : o("vuetify.select.input.mandatory")), e;
23
+ });
24
+ return (e, l) => (f(), p(c(V), {
25
+ modelValue: a.value,
26
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => a.value = u),
27
+ label: e.label,
28
+ messages: e.help,
29
+ items: e.items,
30
+ rules: r.value,
31
+ clearable: !e.required
32
+ }, null, 8, ["modelValue", "label", "messages", "items", "rules", "clearable"]));
33
+ }
34
+ });
35
+ export {
36
+ B as default
37
+ };
38
+ //# sourceMappingURL=x-select-DCWNJiNk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-select-qbcXbRjw.js","sources":["../src/vue/form/x-select.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VSelect } from \"vuetify/components/VSelect\";\nimport type { SelectProps } from \"@xwiki/cristal-dsapi\";\n\nconst props = defineProps<SelectProps>();\nconst selected = defineModel<string>();\n\nconst { t } = useI18n({\n messages,\n});\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.select.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n<template>\n <v-select\n v-model=\"selected\"\n :label=\"label\"\n :messages=\"help\"\n :items=\"items\"\n :rules=\"rules\"\n :clearable=\"!required\"\n ></v-select>\n</template>\n"],"names":["props","__props","selected","_useModel","t","useI18n","messages","rules","computed","rulesList","value","_createBlock","_unref","VSelect","$event","label","help","items","required"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAQC,GACRC,IAAWC,EAAmBF,GAAA,YAAC,GAE/B,EAAE,GAAAG,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAC;AACnB,aAAIT,EAAM,YACES,EAAA,KAAK,CAACC,MACVA,IACK,KAEAN,EAAE,gCAAgC,CAE5C,GAEIK;AAAA,IAAA,CACR;2BAGCE,EAOYC,EAAAC,CAAA,GAAA;AAAA,kBANDX,EAAQ;AAAA,oDAARA,EAAQ,QAAAY;AAAA,MAChB,OAAOC,EAAK;AAAA,MACZ,UAAUC,EAAI;AAAA,MACd,OAAOC,EAAK;AAAA,MACZ,OAAOV,EAAK;AAAA,MACZ,YAAYW,EAAQ;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"x-select-DCWNJiNk.js","sources":["../src/vue/form/x-select.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VSelect } from \"vuetify/components/VSelect\";\nimport type { SelectProps } from \"@xwiki/cristal-dsapi\";\n\nconst props = defineProps<SelectProps>();\nconst selected = defineModel<string>();\n\nconst { t } = useI18n({\n messages,\n});\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.select.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n<template>\n <v-select\n v-model=\"selected\"\n :label=\"label\"\n :messages=\"help\"\n :items=\"items\"\n :rules=\"rules\"\n :clearable=\"!required\"\n ></v-select>\n</template>\n"],"names":["props","__props","selected","_useModel","t","useI18n","messages","rules","computed","rulesList","value","_createBlock","_unref","VSelect","$event","label","help","items","required"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAQC,GACRC,IAAWC,EAAmBF,GAAA,YAAC,GAE/B,EAAE,GAAAG,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAC;AACnB,aAAIT,EAAM,YACES,EAAA,KAAK,CAACC,MACVA,IACK,KAEAN,EAAE,gCAAgC,CAE5C,GAEIK;AAAA,IAAA,CACR;2BAGCE,EAOYC,EAAAC,CAAA,GAAA;AAAA,kBANDX,EAAQ;AAAA,oDAARA,EAAQ,QAAAY;AAAA,MAChB,OAAOC,EAAK;AAAA,MACZ,UAAUC,EAAI;AAAA,MACd,OAAOC,EAAK;AAAA,MACZ,OAAOV,EAAK;AAAA,MACZ,YAAYW,EAAQ;AAAA,IAAA;;;"}
@@ -0,0 +1,22 @@
1
+ import { d as a, r as o, b as s, w as n, o as r, e as p } from "./index-DNHsU4Fr.js";
2
+ const d = /* @__PURE__ */ a({
3
+ __name: "x-tab",
4
+ props: {
5
+ tabId: {}
6
+ },
7
+ setup(l) {
8
+ return (e, _) => {
9
+ const t = o("v-tab");
10
+ return r(), s(t, { value: e.tabId }, {
11
+ default: n(() => [
12
+ p(e.$slots, "default")
13
+ ]),
14
+ _: 3
15
+ }, 8, ["value"]);
16
+ };
17
+ }
18
+ });
19
+ export {
20
+ d as default
21
+ };
22
+ //# sourceMappingURL=x-tab-UmfRst-i.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-tab-vRrbUjdK.js","sources":["../src/vue/x-tab.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { TabProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<TabProps>();\n</script>\n\n<template>\n <v-tab :value=\"tabId\"><slot></slot></v-tab>\n</template>\n\n<style scoped></style>\n"],"names":["_createBlock","_component_v_tab","tabId","_renderSlot","_ctx"],"mappings":";;;;;;;;;kBA0BEA,EAA2CC,GAAA,EAAnC,OAAOC,EAAK,SAAA;AAAA,mBAAE,MAAa;AAAA,UAAbC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
1
+ {"version":3,"file":"x-tab-UmfRst-i.js","sources":["../src/vue/x-tab.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { TabProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<TabProps>();\n</script>\n\n<template>\n <v-tab :value=\"tabId\"><slot></slot></v-tab>\n</template>\n\n<style scoped></style>\n"],"names":["_createBlock","_component_v_tab","tabId","_renderSlot","_ctx"],"mappings":";;;;;;;;;kBA0BEA,EAA2CC,GAAA,EAAnC,OAAOC,EAAK,SAAA;AAAA,mBAAE,MAAa;AAAA,UAAbC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
@@ -0,0 +1,49 @@
1
+ import { d as v, l as f, r as a, b, w as n, o as V, i as l, e as d } from "./index-DNHsU4Fr.js";
2
+ const x = /* @__PURE__ */ v({
3
+ __name: "x-tab-group",
4
+ emits: ["tab-change"],
5
+ setup(w, { emit: u }) {
6
+ const t = f(), r = u;
7
+ function m(e) {
8
+ typeof e == "string" && r("tab-change", e);
9
+ }
10
+ return (e, o) => {
11
+ const _ = a("v-tabs"), c = a("v-tabs-window"), p = a("v-card-text"), i = a("v-card");
12
+ return V(), b(i, { class: "mx-auto" }, {
13
+ default: n(() => [
14
+ l(_, {
15
+ modelValue: t.value,
16
+ "onUpdate:modelValue": [
17
+ o[0] || (o[0] = (s) => t.value = s),
18
+ m
19
+ ]
20
+ }, {
21
+ default: n(() => [
22
+ d(e.$slots, "tabs")
23
+ ]),
24
+ _: 3
25
+ }, 8, ["modelValue"]),
26
+ l(p, null, {
27
+ default: n(() => [
28
+ l(c, {
29
+ modelValue: t.value,
30
+ "onUpdate:modelValue": o[1] || (o[1] = (s) => t.value = s)
31
+ }, {
32
+ default: n(() => [
33
+ d(e.$slots, "panels")
34
+ ]),
35
+ _: 3
36
+ }, 8, ["modelValue"])
37
+ ]),
38
+ _: 3
39
+ })
40
+ ]),
41
+ _: 3
42
+ });
43
+ };
44
+ }
45
+ });
46
+ export {
47
+ x as default
48
+ };
49
+ //# sourceMappingURL=x-tab-group-C0nWDupY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-tab-group-BfEaq8Nj.js","sources":["../src/vue/x-tab-group.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { Ref, ref } from \"vue\";\nconst tab: Ref<unknown> = ref();\n\nconst emits = defineEmits([\"tab-change\"]);\n\nfunction change(tabId: unknown) {\n if (typeof tabId == \"string\") {\n emits(\"tab-change\", tabId);\n }\n}\n</script>\n\n<template>\n <v-card class=\"mx-auto\">\n <v-tabs v-model=\"tab\" @update:model-value=\"change\">\n <slot name=\"tabs\"></slot>\n </v-tabs>\n <v-card-text>\n <v-tabs-window v-model=\"tab\">\n <slot name=\"panels\"></slot>\n </v-tabs-window>\n </v-card-text>\n </v-card>\n</template>\n\n<style scoped></style>\n"],"names":["tab","ref","emits","__emit","change","tabId","_createBlock","_component_v_card","_createVNode","_component_v_tabs","$event","_renderSlot","_ctx","_component_v_card_text","_component_v_tabs_window"],"mappings":";;;;;AAqBA,UAAMA,IAAoBC,EAAI,GAExBC,IAAQC;AAEd,aAASC,EAAOC,GAAgB;AAC1B,MAAA,OAAOA,KAAS,YAClBH,EAAM,cAAcG,CAAK;AAAA,IAC3B;;;eAKA,GAAAC,EASSC,GAAA,EATD,OAAM,aAAS;AAAA,mBACrB,MAES;AAAA,UAFTC,EAESC,GAAA;AAAA,wBAFQT,EAAG;AAAA;qCAAHA,EAAG,QAAAU;AAAA,cAAuBN;AAAA,YAAA;AAAA;uBACzC,MAAyB;AAAA,cAAzBO,EAAyBC,EAAA,QAAA,MAAA;AAAA,YAAA;;;UAE3BJ,EAIcK,GAAA,MAAA;AAAA,uBAHZ,MAEgB;AAAA,cAFhBL,EAEgBM,GAAA;AAAA,4BAFQd,EAAG;AAAA,8DAAHA,EAAG,QAAAU;AAAA,cAAA;2BACzB,MAA2B;AAAA,kBAA3BC,EAA2BC,EAAA,QAAA,QAAA;AAAA,gBAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"x-tab-group-C0nWDupY.js","sources":["../src/vue/x-tab-group.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { Ref, ref } from \"vue\";\nconst tab: Ref<unknown> = ref();\n\nconst emits = defineEmits([\"tab-change\"]);\n\nfunction change(tabId: unknown) {\n if (typeof tabId == \"string\") {\n emits(\"tab-change\", tabId);\n }\n}\n</script>\n\n<template>\n <v-card class=\"mx-auto\">\n <v-tabs v-model=\"tab\" @update:model-value=\"change\">\n <slot name=\"tabs\"></slot>\n </v-tabs>\n <v-card-text>\n <v-tabs-window v-model=\"tab\">\n <slot name=\"panels\"></slot>\n </v-tabs-window>\n </v-card-text>\n </v-card>\n</template>\n\n<style scoped></style>\n"],"names":["tab","ref","emits","__emit","change","tabId","_createBlock","_component_v_card","_createVNode","_component_v_tabs","$event","_renderSlot","_ctx","_component_v_card_text","_component_v_tabs_window"],"mappings":";;;;;AAqBA,UAAMA,IAAoBC,EAAI,GAExBC,IAAQC;AAEd,aAASC,EAAOC,GAAgB;AAC1B,MAAA,OAAOA,KAAS,YAClBH,EAAM,cAAcG,CAAK;AAAA,IAC3B;;;eAKA,GAAAC,EASSC,GAAA,EATD,OAAM,aAAS;AAAA,mBACrB,MAES;AAAA,UAFTC,EAESC,GAAA;AAAA,wBAFQT,EAAG;AAAA;qCAAHA,EAAG,QAAAU;AAAA,cAAuBN;AAAA,YAAA;AAAA;uBACzC,MAAyB;AAAA,cAAzBO,EAAyBC,EAAA,QAAA,MAAA;AAAA,YAAA;;;UAE3BJ,EAIcK,GAAA,MAAA;AAAA,uBAHZ,MAEgB;AAAA,cAFhBL,EAEgBM,GAAA;AAAA,4BAFQd,EAAG;AAAA,8DAAHA,EAAG,QAAAU;AAAA,cAAA;2BACzB,MAA2B;AAAA,kBAA3BC,EAA2BC,EAAA,QAAA,QAAA;AAAA,gBAAA;;;;;;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { d as a, r as o, b as n, w as s, o as r, e as p } from "./index-DNHsU4Fr.js";
2
+ const m = /* @__PURE__ */ a({
3
+ __name: "x-tab-panel",
4
+ props: {
5
+ tabId: {}
6
+ },
7
+ setup(_) {
8
+ return (e, l) => {
9
+ const t = o("v-tabs-window-item");
10
+ return r(), n(t, { value: e.tabId }, {
11
+ default: s(() => [
12
+ p(e.$slots, "default")
13
+ ]),
14
+ _: 3
15
+ }, 8, ["value"]);
16
+ };
17
+ }
18
+ });
19
+ export {
20
+ m as default
21
+ };
22
+ //# sourceMappingURL=x-tab-panel-CjY4vyG0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-tab-panel-DysgiPCz.js","sources":["../src/vue/x-tab-panel.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { TabPanelProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<TabPanelProps>();\n</script>\n\n<template>\n <v-tabs-window-item :value=\"tabId\"><slot></slot></v-tabs-window-item>\n</template>\n"],"names":["_createBlock","_component_v_tabs_window_item","tabId","_renderSlot","_ctx"],"mappings":";;;;;;;;;kBA0BEA,EAAqEC,GAAA,EAAhD,OAAOC,EAAK,SAAA;AAAA,mBAAE,MAAa;AAAA,UAAbC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
1
+ {"version":3,"file":"x-tab-panel-CjY4vyG0.js","sources":["../src/vue/x-tab-panel.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { TabPanelProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<TabPanelProps>();\n</script>\n\n<template>\n <v-tabs-window-item :value=\"tabId\"><slot></slot></v-tabs-window-item>\n</template>\n"],"names":["_createBlock","_component_v_tabs_window_item","tabId","_renderSlot","_ctx"],"mappings":";;;;;;;;;kBA0BEA,EAAqEC,GAAA,EAAhD,OAAOC,EAAK,SAAA;AAAA,mBAAE,MAAa;AAAA,UAAbC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
@@ -1,10 +1,9 @@
1
- import { defineComponent as s, mergeModels as m, useModel as p, computed as i, createBlock as d, openBlock as f, unref as y } from "vue";
2
- import { t as V } from "./translations-BVK9UR9x.js";
3
- import { useI18n as c } from "vue-i18n";
4
- import { a as h } from "./index-BZqZR8-g.js";
5
- const g = /* @__PURE__ */ s({
1
+ import { d as r, p, q as d, a as i, b as m, u as f, o as y, s as V } from "./index-DNHsU4Fr.js";
2
+ import { t as c } from "./translations-BVK9UR9x.js";
3
+ import { useI18n as h } from "vue-i18n";
4
+ const q = /* @__PURE__ */ r({
6
5
  __name: "x-text-field",
7
- props: /* @__PURE__ */ m({
6
+ props: /* @__PURE__ */ p({
8
7
  name: {},
9
8
  label: {},
10
9
  required: { type: Boolean },
@@ -19,27 +18,27 @@ const g = /* @__PURE__ */ s({
19
18
  }),
20
19
  emits: ["update:modelValue"],
21
20
  setup(t) {
22
- const { t: a } = c({
23
- messages: V
24
- }), n = t, l = p(t, "modelValue"), u = i(() => {
21
+ const { t: a } = h({
22
+ messages: c
23
+ }), s = t, l = d(t, "modelValue"), n = i(() => {
25
24
  const e = [];
26
- return n.required && e.push((o) => o ? !0 : a("vuetify.text.input.mandatory")), e;
25
+ return s.required && e.push((o) => o ? !0 : a("vuetify.text.input.mandatory")), e;
27
26
  });
28
- return (e, o) => (f(), d(y(h), {
27
+ return (e, o) => (y(), m(f(V), {
29
28
  modelValue: l.value,
30
- "onUpdate:modelValue": o[0] || (o[0] = (r) => l.value = r),
29
+ "onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
31
30
  label: e.label,
32
31
  name: e.name,
33
32
  autofocus: e.autofocus,
34
33
  hint: e.help,
35
34
  "persistent-hint": e.help !== void 0,
36
- rules: u.value,
35
+ rules: n.value,
37
36
  readonly: e.readonly,
38
37
  type: e.type ?? "text"
39
38
  }, null, 8, ["modelValue", "label", "name", "autofocus", "hint", "persistent-hint", "rules", "readonly", "type"]));
40
39
  }
41
40
  });
42
41
  export {
43
- g as default
42
+ q as default
44
43
  };
45
- //# sourceMappingURL=x-text-field-B2S1QZum.js.map
44
+ //# sourceMappingURL=x-text-field-CaWcwz2v.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-text-field-B2S1QZum.js","sources":["../src/vue/form/x-text-field.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\nconst props = defineProps<TextFieldProps>();\nconst input = defineModel<string>();\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.text.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n\n<template>\n <v-text-field\n v-model=\"input\"\n :label=\"label\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :rules=\"rules\"\n :readonly=\"readonly\"\n :type=\"type ?? 'text'\"\n ></v-text-field>\n</template>\n\n<style scoped></style>\n"],"names":["t","useI18n","messages","props","__props","input","_useModel","rules","computed","rulesList","value","_createBlock","_unref","VTextField","$event","label","name","autofocus","help","readonly","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOM,UAAA,EAAE,GAAAA,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GACKC,IAAQC,GACRC,IAAQC,EAAmBF,GAAA,YAAC,GAE5BG,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAC;AACnB,aAAIN,EAAM,YACEM,EAAA,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IAAA,CACR;2BAICE,EAUgBC,EAAAC,CAAA,GAAA;AAAA,kBATLR,EAAK;AAAA,oDAALA,EAAK,QAAAS;AAAA,MACb,OAAOC,EAAK;AAAA,MACZ,MAAMC,EAAI;AAAA,MACV,WAAWC,EAAS;AAAA,MACpB,MAAMC,EAAI;AAAA,MACV,mBAAiBA,EAAI,SAAK;AAAA,MAC1B,OAAOX,EAAK;AAAA,MACZ,UAAUY,EAAQ;AAAA,MAClB,MAAMC,EAAI,QAAA;AAAA;;;"}
1
+ {"version":3,"file":"x-text-field-CaWcwz2v.js","sources":["../src/vue/form/x-text-field.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\nconst props = defineProps<TextFieldProps>();\nconst input = defineModel<string>();\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.text.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n\n<template>\n <v-text-field\n v-model=\"input\"\n :label=\"label\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :rules=\"rules\"\n :readonly=\"readonly\"\n :type=\"type ?? 'text'\"\n ></v-text-field>\n</template>\n\n<style scoped></style>\n"],"names":["t","useI18n","messages","props","__props","input","_useModel","rules","computed","rulesList","value","_createBlock","_unref","VTextField","$event","label","name","autofocus","help","readonly","type"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOM,UAAA,EAAE,GAAAA,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GACKC,IAAQC,GACRC,IAAQC,EAAmBF,GAAA,YAAC,GAE5BG,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAC;AACnB,aAAIN,EAAM,YACEM,EAAA,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IAAA,CACR;2BAICE,EAUgBC,EAAAC,CAAA,GAAA;AAAA,kBATLR,EAAK;AAAA,oDAALA,EAAK,QAAAS;AAAA,MACb,OAAOC,EAAK;AAAA,MACZ,MAAMC,EAAI;AAAA,MACV,WAAWC,EAAS;AAAA,MACpB,MAAMC,EAAI;AAAA,MACV,mBAAiBA,EAAI,SAAK;AAAA,MAC1B,OAAOX,EAAK;AAAA,MACZ,UAAUY,EAAQ;AAAA,MAClB,MAAMC,EAAI,QAAA;AAAA;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-dsvuetify",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -27,28 +27,29 @@
27
27
  },
28
28
  "main": "./dist/index.es.js",
29
29
  "dependencies": {
30
- "inversify": "7.5.2",
31
- "vue": "3.5.16",
30
+ "inversify": "7.5.4",
32
31
  "vue-i18n": "11.1.5",
33
- "vuetify": "3.8.9",
34
- "@xwiki/cristal-document-api": "0.19.0",
35
- "@xwiki/cristal-api": "0.19.0",
36
- "@xwiki/cristal-hierarchy-api": "0.19.0",
37
- "@xwiki/cristal-model-api": "0.19.0",
38
- "@xwiki/cristal-navigation-tree-api": "0.19.0",
39
- "@xwiki/cristal-model-reference-api": "0.19.0"
32
+ "vuetify": "3.8.11",
33
+ "@xwiki/cristal-api": "0.20.0",
34
+ "@xwiki/cristal-document-api": "0.20.0",
35
+ "@xwiki/cristal-hierarchy-api": "0.20.0",
36
+ "@xwiki/cristal-navigation-tree-api": "0.20.0",
37
+ "@xwiki/cristal-model-api": "0.20.0",
38
+ "@xwiki/cristal-model-reference-api": "0.20.0"
40
39
  },
41
40
  "peerDependencies": {
42
- "reflect-metadata": "0.2.2"
41
+ "reflect-metadata": "0.x",
42
+ "vue": "3.x"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@vue/test-utils": "2.4.6",
46
46
  "reflect-metadata": "0.2.2",
47
47
  "typescript": "5.8.3",
48
- "vite": "6.3.5",
48
+ "vite": "7.0.0",
49
+ "vue": "3.5.17",
49
50
  "vue-tsc": "2.2.10",
50
- "@xwiki/cristal-dev-config": "0.19.0",
51
- "@xwiki/cristal-dsapi": "0.19.0"
51
+ "@xwiki/cristal-dev-config": "0.20.0",
52
+ "@xwiki/cristal-dsapi": "0.20.0"
52
53
  },
53
54
  "scripts": {
54
55
  "build": "pnpm compile",
@@ -21,7 +21,7 @@ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
21
  import messages from "../../translations";
22
22
  import XBreadcrumb from "../x-breadcrumb.vue";
23
23
  import { navigationTreeSelectPropsDefaults } from "@xwiki/cristal-dsapi";
24
- import { SpaceReference } from "@xwiki/cristal-model-api";
24
+ import { EntityType, SpaceReference } from "@xwiki/cristal-model-api";
25
25
  import { inject, onMounted, ref } from "vue";
26
26
  import { useI18n } from "vue-i18n";
27
27
  import { VTextField } from "vuetify/components/VTextField";
@@ -57,7 +57,7 @@ const props = withDefaults(
57
57
  defineProps<NavigationTreeSelectProps>(),
58
58
  navigationTreeSelectPropsDefaults,
59
59
  );
60
- const model = defineModel<SpaceReference>();
60
+ const model = defineModel<SpaceReference | DocumentReference>();
61
61
 
62
62
  const openedLocationDialog: Ref<boolean> = ref(false);
63
63
  const hierarchy: Ref<Array<PageHierarchyItem>> = ref([]);
@@ -68,16 +68,36 @@ onMounted(async () => {
68
68
  model.value = props.currentPageReference!.space;
69
69
  hierarchy.value = await hierarchyResolver.getPageHierarchy(
70
70
  props.currentPageReference!.space!,
71
+ false,
71
72
  );
72
73
  });
73
74
 
74
75
  async function treeNodeClickAction(node: NavigationTreeNode) {
75
- selectedPage = referenceHandler.createDocumentReference(
76
- node.location.names[node.location.names.length - 1],
77
- new SpaceReference(node.location.wiki, ...node.location.names.slice(0, -1)),
78
- );
76
+ if (node.location.type == EntityType.SPACE) {
77
+ if (node.location.names.length > 0) {
78
+ selectedPage = referenceHandler.createDocumentReference(
79
+ node.location.names[node.location.names.length - 1],
80
+ new SpaceReference(
81
+ node.location.wiki,
82
+ ...node.location.names.slice(0, -1),
83
+ ),
84
+ );
85
+ hierarchy.value = await hierarchyResolver.getPageHierarchy(
86
+ selectedPage,
87
+ false,
88
+ );
89
+ } else {
90
+ selectedPage = undefined;
91
+ hierarchy.value = [{ label: node.label, pageId: "", url: node.url }];
92
+ }
93
+ } else {
94
+ selectedPage = node.location;
95
+ hierarchy.value = await hierarchyResolver.getPageHierarchy(
96
+ selectedPage,
97
+ false,
98
+ );
99
+ }
79
100
  model.value = node.location;
80
- hierarchy.value = await hierarchyResolver.getPageHierarchy(selectedPage);
81
101
  }
82
102
  </script>
83
103
 
@@ -108,6 +128,7 @@ async function treeNodeClickAction(node: NavigationTreeNode) {
108
128
  :current-page-reference="selectedPage"
109
129
  :click-action="treeNodeClickAction"
110
130
  :include-terminals="includeTerminals"
131
+ show-root-node
111
132
  ></XNavigationTree>
112
133
  </template>
113
134
  <template #footer>
@@ -30,15 +30,13 @@ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
30
30
  * the cursor on items, were also disabled.
31
31
  */
32
32
  import { navigationTreePropsDefaults } from "@xwiki/cristal-dsapi";
33
+ import { SpaceReference } from "@xwiki/cristal-model-api";
33
34
  import { inject, onBeforeMount, ref, watch } from "vue";
34
35
  import { VTreeview } from "vuetify/labs/VTreeview";
35
36
  import type { CristalApp } from "@xwiki/cristal-api";
36
37
  import type { DocumentService } from "@xwiki/cristal-document-api";
37
38
  import type { NavigationTreeProps } from "@xwiki/cristal-dsapi";
38
- import type {
39
- DocumentReference,
40
- SpaceReference,
41
- } from "@xwiki/cristal-model-api";
39
+ import type { DocumentReference } from "@xwiki/cristal-model-api";
42
40
  import type {
43
41
  NavigationTreeSource,
44
42
  NavigationTreeSourceProvider,
@@ -50,7 +48,7 @@ type TreeItem = {
50
48
  title: string;
51
49
  href: string;
52
50
  children?: Array<TreeItem>;
53
- _location: SpaceReference;
51
+ _location: SpaceReference | DocumentReference;
54
52
  _is_terminal: boolean;
55
53
  };
56
54
 
@@ -75,8 +73,9 @@ const props = withDefaults(
75
73
  );
76
74
 
77
75
  onBeforeMount(async () => {
76
+ const newRootNodes: Array<TreeItem> = [];
78
77
  for (const node of await getChildNodes("")) {
79
- rootNodes.value.push({
78
+ newRootNodes.push({
80
79
  id: node.id,
81
80
  title: node.label,
82
81
  href: node.url,
@@ -85,6 +84,18 @@ onBeforeMount(async () => {
85
84
  _is_terminal: node.is_terminal,
86
85
  });
87
86
  }
87
+ if (props.showRootNode) {
88
+ rootNodes.value.push({
89
+ id: "",
90
+ title: "Root",
91
+ href: ".",
92
+ children: newRootNodes,
93
+ _location: new SpaceReference(),
94
+ _is_terminal: false,
95
+ });
96
+ } else {
97
+ rootNodes.value.push(...newRootNodes);
98
+ }
88
99
  await expandTree();
89
100
 
90
101
  documentService.registerDocumentChangeListener("delete", onDocumentDelete);
@@ -101,6 +112,7 @@ async function expandTree() {
101
112
  const newExpandedNodes = treeSource.getParentNodesId(
102
113
  props.currentPageReference!,
103
114
  props.includeTerminals,
115
+ props.showRootNode,
104
116
  );
105
117
  let i;
106
118
  let currentNodes = rootNodes.value;
@@ -173,7 +185,11 @@ function clearSelection() {
173
185
  // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.
174
186
  // eslint-disable-next-line max-statements
175
187
  async function onDocumentDelete(page: DocumentReference) {
176
- const parents = treeSource.getParentNodesId(page, props.includeTerminals);
188
+ const parents = treeSource.getParentNodesId(
189
+ page,
190
+ props.includeTerminals,
191
+ props.showRootNode,
192
+ );
177
193
  let currentItem: TreeItem | undefined = undefined;
178
194
  let currentItemChildren: TreeItem[] | undefined = rootNodes.value;
179
195
  let notFound = false;
@@ -202,7 +218,11 @@ async function onDocumentDelete(page: DocumentReference) {
202
218
  // TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.
203
219
  // eslint-disable-next-line max-statements
204
220
  async function onDocumentUpdate(page: DocumentReference) {
205
- const parents = treeSource.getParentNodesId(page, props.includeTerminals);
221
+ const parents = treeSource.getParentNodesId(
222
+ page,
223
+ props.includeTerminals,
224
+ props.showRootNode,
225
+ );
206
226
  let currentParent: string | undefined = undefined;
207
227
  let currentItems: TreeItem[] | undefined = rootNodes.value;
208
228
  let notFound = false;
@@ -245,10 +265,12 @@ async function onDocumentUpdate(page: DocumentReference) {
245
265
  return;
246
266
  }
247
267
  const newItems = await getChildNodes(currentParent ? currentParent : "");
248
- const currentPageParents = treeSource.getParentNodesId(
249
- props.currentPageReference!,
250
- props.includeTerminals,
251
- );
268
+ const currentPageParents = props.currentPageReference
269
+ ? treeSource.getParentNodesId(
270
+ props.currentPageReference!,
271
+ props.includeTerminals,
272
+ )
273
+ : [];
252
274
  newItemsLoop: for (const newItem of newItems) {
253
275
  for (const i of currentItems!.keys()) {
254
276
  if (newItem.id == currentItems![i].id) {