@xwiki/cristal-dsvuetify 0.20.0 → 0.21.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 (114) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{index-DNHsU4Fr.js → index-CPGfq5JL.js} +11490 -10285
  3. package/dist/index-CPGfq5JL.js.map +1 -0
  4. package/dist/index.es.js +10 -10
  5. package/dist/index.umd.js +31 -31
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/translations-BVK9UR9x.js.map +1 -1
  8. package/dist/translations.d.ts +19 -0
  9. package/dist/vue/__tests__/utils/vuetify.d.ts +19 -0
  10. package/dist/vue/form/x-form.vue.d.ts +8 -0
  11. package/dist/{x-alert-CAlwFn5B.js → x-alert-Bqf5Ghy4.js} +3 -3
  12. package/dist/x-alert-Bqf5Ghy4.js.map +1 -0
  13. package/dist/{x-avatar-Cp8QVkHc.js → x-avatar-DDWQUeZJ.js} +2 -2
  14. package/dist/x-avatar-DDWQUeZJ.js.map +1 -0
  15. package/dist/{x-breadcrumb-BQVk_ZI_.js → x-breadcrumb-Ca8UqeNm.js} +4 -4
  16. package/dist/x-breadcrumb-Ca8UqeNm.js.map +1 -0
  17. package/dist/{x-btn-BXn20OTM.js → x-btn-CEN-gSJs.js} +2 -2
  18. package/dist/x-btn-CEN-gSJs.js.map +1 -0
  19. package/dist/{x-card-BjsZr1mV.js → x-card-ywmTDQq1.js} +2 -2
  20. package/dist/x-card-ywmTDQq1.js.map +1 -0
  21. package/dist/{x-checkbox-DqUXQoJU.js → x-checkbox-DioEzg6D.js} +2 -2
  22. package/dist/x-checkbox-DioEzg6D.js.map +1 -0
  23. package/dist/{x-dialog-te6-Vgkm.js → x-dialog-BR0aOJnF.js} +11 -11
  24. package/dist/x-dialog-BR0aOJnF.js.map +1 -0
  25. package/dist/{x-divider-B3cbVfv2.js → x-divider-DdCNaWK9.js} +2 -2
  26. package/dist/x-divider-DdCNaWK9.js.map +1 -0
  27. package/dist/{x-file-input-DGLWq0E0.js → x-file-input-CR_baWpm.js} +2 -2
  28. package/dist/x-file-input-CR_baWpm.js.map +1 -0
  29. package/dist/{x-form-C5fVEKNp.js → x-form-DXezCfh2.js} +3 -3
  30. package/dist/x-form-DXezCfh2.js.map +1 -0
  31. package/dist/{x-img-BB3GSMHr.js → x-img-X-qoosGi.js} +2 -2
  32. package/dist/x-img-X-qoosGi.js.map +1 -0
  33. package/dist/{x-load-DPuiSh1i.js → x-load-CXDfm5l3.js} +2 -2
  34. package/dist/x-load-CXDfm5l3.js.map +1 -0
  35. package/dist/{x-menu-9krdqSZB.js → x-menu-C7rglNy2.js} +6 -6
  36. package/dist/x-menu-C7rglNy2.js.map +1 -0
  37. package/dist/{x-menu-item-BSondWPp.js → x-menu-item-CCcPUrHX.js} +2 -2
  38. package/dist/x-menu-item-CCcPUrHX.js.map +1 -0
  39. package/dist/{x-menu-label-Dp7gEYzE.js → x-menu-label-gVnEylDY.js} +2 -2
  40. package/dist/x-menu-label-gVnEylDY.js.map +1 -0
  41. package/dist/x-navigation-tree-BNc0pKUi.js +188 -0
  42. package/dist/x-navigation-tree-BNc0pKUi.js.map +1 -0
  43. package/dist/{x-navigation-tree-select-CZMM_WJl.js → x-navigation-tree-select-CHoauT-L.js} +21 -21
  44. package/dist/x-navigation-tree-select-CHoauT-L.js.map +1 -0
  45. package/dist/{x-search-NPeNBHNh.js → x-search-BgVWZd4f.js} +2 -2
  46. package/dist/x-search-BgVWZd4f.js.map +1 -0
  47. package/dist/{x-select-DCWNJiNk.js → x-select-bQRFdVPL.js} +2 -2
  48. package/dist/x-select-bQRFdVPL.js.map +1 -0
  49. package/dist/{x-tab-UmfRst-i.js → x-tab-CFwL72L6.js} +2 -2
  50. package/dist/x-tab-CFwL72L6.js.map +1 -0
  51. package/dist/{x-tab-group-C0nWDupY.js → x-tab-group-Bs17utO_.js} +2 -2
  52. package/dist/x-tab-group-Bs17utO_.js.map +1 -0
  53. package/dist/{x-tab-panel-CjY4vyG0.js → x-tab-panel-DL228tOt.js} +2 -2
  54. package/dist/x-tab-panel-DL228tOt.js.map +1 -0
  55. package/dist/{x-text-field-CaWcwz2v.js → x-text-field-DtCbDE_F.js} +2 -2
  56. package/dist/x-text-field-DtCbDE_F.js.map +1 -0
  57. package/package.json +17 -16
  58. package/src/components/componentsInit.ts +1 -1
  59. package/src/components/vuetifyDesignSystemLoader.ts +2 -3
  60. package/src/index.ts +1 -1
  61. package/src/translations.ts +1 -1
  62. package/src/vue/__tests__/utils/vuetify.ts +1 -1
  63. package/src/vue/__tests__/x-btn.test.ts +1 -1
  64. package/src/vue/css/style.css +1 -1
  65. package/src/vue/form/x-checkbox.vue +14 -14
  66. package/src/vue/form/x-file-input.vue +19 -0
  67. package/src/vue/form/x-form.vue +19 -0
  68. package/src/vue/form/x-navigation-tree-select.vue +14 -14
  69. package/src/vue/form/x-select.vue +14 -14
  70. package/src/vue/form/x-text-field.vue +19 -0
  71. package/src/vue/x-alert.vue +14 -14
  72. package/src/vue/x-avatar.vue +14 -14
  73. package/src/vue/x-breadcrumb.vue +14 -14
  74. package/src/vue/x-btn.vue +14 -14
  75. package/src/vue/x-card.vue +14 -14
  76. package/src/vue/x-dialog.vue +14 -14
  77. package/src/vue/x-divider.vue +14 -14
  78. package/src/vue/x-img.vue +14 -14
  79. package/src/vue/x-load.vue +14 -14
  80. package/src/vue/x-menu-item.vue +14 -14
  81. package/src/vue/x-menu-label.vue +14 -14
  82. package/src/vue/x-menu.vue +14 -14
  83. package/src/vue/x-navigation-tree.vue +15 -15
  84. package/src/vue/x-search.vue +14 -14
  85. package/src/vue/x-tab-group.vue +14 -14
  86. package/src/vue/x-tab-panel.vue +14 -14
  87. package/src/vue/x-tab.vue +14 -14
  88. package/vite.config.ts +1 -1
  89. package/vitest.config.ts +1 -1
  90. package/dist/index-DNHsU4Fr.js.map +0 -1
  91. package/dist/x-alert-CAlwFn5B.js.map +0 -1
  92. package/dist/x-avatar-Cp8QVkHc.js.map +0 -1
  93. package/dist/x-breadcrumb-BQVk_ZI_.js.map +0 -1
  94. package/dist/x-btn-BXn20OTM.js.map +0 -1
  95. package/dist/x-card-BjsZr1mV.js.map +0 -1
  96. package/dist/x-checkbox-DqUXQoJU.js.map +0 -1
  97. package/dist/x-dialog-te6-Vgkm.js.map +0 -1
  98. package/dist/x-divider-B3cbVfv2.js.map +0 -1
  99. package/dist/x-file-input-DGLWq0E0.js.map +0 -1
  100. package/dist/x-form-C5fVEKNp.js.map +0 -1
  101. package/dist/x-img-BB3GSMHr.js.map +0 -1
  102. package/dist/x-load-DPuiSh1i.js.map +0 -1
  103. package/dist/x-menu-9krdqSZB.js.map +0 -1
  104. package/dist/x-menu-item-BSondWPp.js.map +0 -1
  105. package/dist/x-menu-label-Dp7gEYzE.js.map +0 -1
  106. package/dist/x-navigation-tree-BMLu80ML.js +0 -518
  107. package/dist/x-navigation-tree-BMLu80ML.js.map +0 -1
  108. package/dist/x-navigation-tree-select-CZMM_WJl.js.map +0 -1
  109. package/dist/x-search-NPeNBHNh.js.map +0 -1
  110. package/dist/x-select-DCWNJiNk.js.map +0 -1
  111. package/dist/x-tab-UmfRst-i.js.map +0 -1
  112. package/dist/x-tab-group-C0nWDupY.js.map +0 -1
  113. package/dist/x-tab-panel-CjY4vyG0.js.map +0 -1
  114. package/dist/x-text-field-CaWcwz2v.js.map +0 -1
@@ -0,0 +1,188 @@
1
+ import { d as b, x as A, y as B, l as _, z as S, A as E, b as F, w as L, u as U, o as g, c as P, m as z, t as R, B as M } from "./index-CPGfq5JL.js";
2
+ import { SpaceReference as j } from "@xwiki/cristal-model-api";
3
+ import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const $ = {
5
+ includeTerminals: !0
6
+ }, q = ["href", "onClick"], G = ["href"], H = /* @__PURE__ */ b({
7
+ __name: "x-navigation-tree",
8
+ props: /* @__PURE__ */ A({
9
+ clickAction: { type: Function },
10
+ currentPageReference: {},
11
+ includeTerminals: { type: Boolean },
12
+ showRootNode: { type: Boolean }
13
+ }, $),
14
+ setup(I) {
15
+ const m = B("cristal"), w = m.getContainer().get("DocumentService"), s = m.getContainer().get("NavigationTreeSourceProvider").get(), a = _([]), l = _(new Array()), f = _([]);
16
+ var h = !1;
17
+ const i = I;
18
+ S(async () => {
19
+ const o = [];
20
+ for (const n of await u(""))
21
+ o.push({
22
+ id: n.id,
23
+ title: n.label,
24
+ href: n.url,
25
+ children: n.has_children ? [] : void 0,
26
+ _location: n.location,
27
+ _is_terminal: n.is_terminal
28
+ });
29
+ i.showRootNode ? a.value.push({
30
+ id: "",
31
+ title: "Root",
32
+ href: ".",
33
+ children: o,
34
+ _location: new j(),
35
+ _is_terminal: !1
36
+ }) : a.value.push(...o), await y(), w.registerDocumentChangeListener("delete", T), w.registerDocumentChangeListener("update", x);
37
+ }), E(() => i.currentPageReference, y);
38
+ async function y() {
39
+ if (i.currentPageReference && !h) {
40
+ h = !0;
41
+ const o = s.getParentNodesId(
42
+ i.currentPageReference,
43
+ i.includeTerminals,
44
+ i.showRootNode
45
+ );
46
+ let n, t = a.value;
47
+ for (n = 0; n < o.length - 1; n++)
48
+ if (t)
49
+ for (const e of t)
50
+ e.id == o[n] && (e.children?.length == 0 && await N(e), f.value.includes(e.id) || f.value.push(e.id), t = e.children);
51
+ if (t)
52
+ for (const e of t)
53
+ e.id == o[n] && (l.value = [e.id], i.clickAction && i.clickAction({
54
+ id: e.id,
55
+ label: e.title,
56
+ location: e._location,
57
+ url: e.href,
58
+ has_children: e.children !== void 0,
59
+ is_terminal: e._is_terminal
60
+ }));
61
+ h = !1;
62
+ }
63
+ }
64
+ async function N(o) {
65
+ const n = o, t = await u(n.id);
66
+ for (const e of t)
67
+ n.children?.push({
68
+ id: e.id,
69
+ title: e.label,
70
+ href: e.url,
71
+ children: e.has_children ? [] : void 0,
72
+ _location: e.location,
73
+ _is_terminal: e.is_terminal
74
+ });
75
+ t.length == 0 && (n.children = void 0);
76
+ }
77
+ function C() {
78
+ l.value.length > 1 && l.value.pop();
79
+ }
80
+ async function T(o) {
81
+ const n = s.getParentNodesId(
82
+ o,
83
+ i.includeTerminals,
84
+ i.showRootNode
85
+ );
86
+ let t, e = a.value, d = !1;
87
+ e: for (; e && !d; ) {
88
+ for (const c of e.keys())
89
+ if (e[c].id == n[0])
90
+ if (n.length == 1) {
91
+ e.splice(c, 1), t && e.length == 0 && (t.children = void 0);
92
+ return;
93
+ } else {
94
+ t = e[c], e = t.children, n.shift();
95
+ continue e;
96
+ }
97
+ d = !0;
98
+ }
99
+ }
100
+ async function x(o) {
101
+ const n = s.getParentNodesId(
102
+ o,
103
+ i.includeTerminals,
104
+ i.showRootNode
105
+ );
106
+ let t, e = a.value, d = !1, c = !0;
107
+ e: for (; e && !d; ) {
108
+ for (const r of e.keys())
109
+ if (e[r].id == n[0])
110
+ if (n.length == 1) {
111
+ const v = await u(
112
+ t || ""
113
+ );
114
+ for (const k of v)
115
+ if (k.id == e[r].id) {
116
+ e[r].title = k.label;
117
+ return;
118
+ }
119
+ } else {
120
+ t = e[r].id, e[r].children || (e[r].children = []), e = e[r].children, n.shift(), c = !1;
121
+ continue e;
122
+ }
123
+ d = !0;
124
+ }
125
+ if (e.length == 0 && !c)
126
+ return;
127
+ const D = await u(t || ""), p = i.currentPageReference ? s.getParentNodesId(
128
+ i.currentPageReference,
129
+ i.includeTerminals
130
+ ) : [];
131
+ e: for (const r of D) {
132
+ for (const v of e.keys())
133
+ if (r.id == e[v].id)
134
+ continue e;
135
+ e.push({
136
+ id: r.id,
137
+ title: r.label,
138
+ href: r.url,
139
+ children: r.has_children ? [] : void 0,
140
+ _location: r.location,
141
+ _is_terminal: r.is_terminal
142
+ }), p.length > 0 && p[p.length - 1] === r.id && (l.value = [r.id]);
143
+ }
144
+ }
145
+ async function u(o) {
146
+ return (await s.getChildNodes(o)).filter(
147
+ (n) => i.includeTerminals || !n.is_terminal
148
+ );
149
+ }
150
+ return (o, n) => (g(), F(U(M), {
151
+ opened: f.value,
152
+ "onUpdate:opened": n[0] || (n[0] = (t) => f.value = t),
153
+ density: "compact",
154
+ activated: l.value,
155
+ items: a.value,
156
+ "load-children": N,
157
+ activatable: "",
158
+ "active-strategy": "independent",
159
+ "item-value": "id",
160
+ "onUpdate:activated": C
161
+ }, {
162
+ title: L(({ item: t }) => [
163
+ i.clickAction ? (g(), P("a", {
164
+ key: 0,
165
+ href: t.href,
166
+ onClick: z((e) => {
167
+ l.value = [t.id], o.clickAction({
168
+ id: t.id,
169
+ label: t.title,
170
+ location: t._location,
171
+ url: t.href,
172
+ has_children: t.children !== void 0,
173
+ is_terminal: t._is_terminal
174
+ });
175
+ }, ["prevent"])
176
+ }, R(t.title), 9, q)) : (g(), P("a", {
177
+ key: 1,
178
+ href: t.href
179
+ }, R(t.title), 9, G))
180
+ ]),
181
+ _: 1
182
+ }, 8, ["opened", "activated", "items"]));
183
+ }
184
+ }), Q = /* @__PURE__ */ V(H, [["__scopeId", "data-v-54e58f7c"]]);
185
+ export {
186
+ Q as default
187
+ };
188
+ //# sourceMappingURL=x-navigation-tree-BNc0pKUi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-navigation-tree-BNc0pKUi.js","sources":["../../api/src/XNavigationTree.ts","../src/vue/x-navigation-tree.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 { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type { NavigationTreeNode } from \"@xwiki/cristal-navigation-tree-api\";\n\n/**\n * @since 0.15\n */\ntype NavigationTreeProps = {\n clickAction?: (node: NavigationTreeNode) => void;\n currentPageReference?: DocumentReference;\n /**\n * Whether to include terminal pages in the tree (default: true).\n * @since 0.16\n */\n includeTerminals?: boolean;\n /**\n * Whether to display a root node (default: false).\n * @since 0.20\n */\n showRootNode?: boolean;\n};\n\n/**\n * Default props values for NavigationTree implementations.\n * @since 0.16\n */\nconst navigationTreePropsDefaults = {\n includeTerminals: true,\n};\n\nexport type { NavigationTreeProps };\nexport { navigationTreePropsDefaults };\n","<!--\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<script setup lang=\"ts\">\n/**\n * Navigation Tree implemented using Vuetify's VTreeView component.\n * In order to use the initial component as a proper Navigation Tree for\n * Cristal, a few changes were made:\n * - The only node activated matches the current page, or the clicked link if\n * the component has a custom clickAction. We want to use actual links so\n * that the user can click them normally (to e.g., open them in a new tab).\n * So the default behavior of activating a node by clicking anywhere on the\n * item was disabled. Default hover effects, such as darkening or changing\n * the cursor on items, were also disabled.\n */\nimport { navigationTreePropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { SpaceReference } from \"@xwiki/cristal-model-api\";\nimport { inject, onBeforeMount, ref, watch } from \"vue\";\nimport { VTreeview } from \"vuetify/components/VTreeview\";\nimport type { CristalApp } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type { NavigationTreeProps } from \"@xwiki/cristal-dsapi\";\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type {\n NavigationTreeSource,\n NavigationTreeSourceProvider,\n} from \"@xwiki/cristal-navigation-tree-api\";\nimport type { Ref } from \"vue\";\n\ntype TreeItem = {\n id: string;\n title: string;\n href: string;\n children?: Array<TreeItem>;\n _location: SpaceReference | DocumentReference;\n _is_terminal: boolean;\n};\n\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst documentService: DocumentService = cristal\n .getContainer()\n .get<DocumentService>(\"DocumentService\");\nconst treeSource: NavigationTreeSource = cristal\n .getContainer()\n .get<NavigationTreeSourceProvider>(\"NavigationTreeSourceProvider\")\n .get();\n\nconst rootNodes: Ref<Array<TreeItem>> = ref([]);\n\nconst activatedNodes: Ref<Array<string>> = ref(new Array<string>());\nconst expandedNodes: Ref<unknown> = ref([]);\nvar isExpanding: boolean = false;\n\nconst props = withDefaults(\n defineProps<NavigationTreeProps>(),\n navigationTreePropsDefaults,\n);\n\nonBeforeMount(async () => {\n const newRootNodes: Array<TreeItem> = [];\n for (const node of await getChildNodes(\"\")) {\n newRootNodes.push({\n id: node.id,\n title: node.label,\n href: node.url,\n children: node.has_children ? [] : undefined,\n _location: node.location,\n _is_terminal: node.is_terminal,\n });\n }\n if (props.showRootNode) {\n rootNodes.value.push({\n id: \"\",\n title: \"Root\",\n href: \".\",\n children: newRootNodes,\n _location: new SpaceReference(),\n _is_terminal: false,\n });\n } else {\n rootNodes.value.push(...newRootNodes);\n }\n await expandTree();\n\n documentService.registerDocumentChangeListener(\"delete\", onDocumentDelete);\n documentService.registerDocumentChangeListener(\"update\", onDocumentUpdate);\n});\n\nwatch(() => props.currentPageReference, expandTree);\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function expandTree() {\n if (props.currentPageReference && !isExpanding) {\n isExpanding = true;\n const newExpandedNodes = treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\n props.showRootNode,\n );\n let i;\n let currentNodes = rootNodes.value;\n for (i = 0; i < newExpandedNodes.length - 1; i++) {\n if (currentNodes) {\n for (const node of currentNodes) {\n if (node.id == newExpandedNodes[i]) {\n if (node.children?.length == 0) {\n await lazyLoadChildren(node);\n }\n if (!(expandedNodes.value as unknown[]).includes(node.id)) {\n (expandedNodes.value as unknown[]).push(node.id);\n }\n currentNodes = node.children!;\n }\n }\n }\n }\n if (currentNodes) {\n for (const node of currentNodes) {\n if (node.id == newExpandedNodes[i]) {\n activatedNodes.value = [node.id];\n // If we have a custom click action, we want to use it on dynamic\n // selection.\n if (props.clickAction) {\n props.clickAction({\n id: node.id,\n label: node.title,\n location: node._location,\n url: node.href,\n has_children: node.children !== undefined,\n is_terminal: node._is_terminal,\n });\n }\n }\n }\n }\n isExpanding = false;\n }\n}\n\nasync function lazyLoadChildren(item: unknown) {\n const treeItem = item as TreeItem;\n const childNodes = await getChildNodes(treeItem.id);\n for (const child of childNodes) {\n treeItem.children?.push({\n id: child.id,\n title: child.label,\n href: child.url,\n children: child.has_children ? [] : undefined,\n _location: child.location,\n _is_terminal: child.is_terminal,\n });\n }\n // If the node doesn't have any children, we update it.\n if (childNodes.length == 0) {\n treeItem.children = undefined;\n }\n}\n\nfunction clearSelection() {\n // Clicking on a node would activate it and this can't be disabled easily.\n // With this listener, we ensure that only the first activated node stays\n // active.\n if (activatedNodes.value.length > 1) {\n activatedNodes.value.pop();\n }\n}\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function onDocumentDelete(page: DocumentReference) {\n const parents = treeSource.getParentNodesId(\n page,\n props.includeTerminals,\n props.showRootNode,\n );\n let currentItem: TreeItem | undefined = undefined;\n let currentItemChildren: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\n\n currentItemsLoop: while (currentItemChildren && !notFound) {\n for (const i of currentItemChildren.keys()) {\n if (currentItemChildren[i].id == parents[0]) {\n if (parents.length == 1) {\n currentItemChildren.splice(i, 1);\n if (currentItem && currentItemChildren.length == 0) {\n currentItem!.children = undefined;\n }\n return;\n } else {\n currentItem = currentItemChildren[i];\n currentItemChildren = currentItem.children;\n parents.shift();\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n}\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function onDocumentUpdate(page: DocumentReference) {\n const parents = treeSource.getParentNodesId(\n page,\n props.includeTerminals,\n props.showRootNode,\n );\n let currentParent: string | undefined = undefined;\n let currentItems: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\n let isRoot = true;\n\n currentItemsLoop: while (currentItems && !notFound) {\n for (const i of currentItems.keys()) {\n if (currentItems[i].id == parents[0]) {\n if (parents.length == 1) {\n // Page update\n const newItems = await getChildNodes(\n currentParent ? currentParent : \"\",\n );\n for (const newItem of newItems) {\n if (newItem.id == currentItems[i].id) {\n currentItems[i].title = newItem.label;\n return;\n }\n }\n } else {\n currentParent = currentItems[i].id;\n if (!currentItems[i].children) {\n // This node had no children, we reset this so new ones can be\n // loaded lazily.\n currentItems[i].children = [];\n }\n currentItems = currentItems[i].children;\n parents.shift();\n isRoot = false;\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n\n // New page\n if (currentItems.length == 0 && !isRoot) {\n // We don't do anything because this node will be loaded lazily anyway.\n return;\n }\n const newItems = await getChildNodes(currentParent ? currentParent : \"\");\n const currentPageParents = props.currentPageReference\n ? treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\n )\n : [];\n newItemsLoop: for (const newItem of newItems) {\n for (const i of currentItems!.keys()) {\n if (newItem.id == currentItems![i].id) {\n continue newItemsLoop;\n }\n }\n currentItems!.push({\n id: newItem.id,\n title: newItem.label,\n href: newItem.url,\n children: newItem.has_children ? [] : undefined,\n _location: newItem.location,\n _is_terminal: newItem.is_terminal,\n });\n if (\n currentPageParents.length > 0 &&\n currentPageParents[currentPageParents.length - 1] === newItem.id\n ) {\n // If we add a node, and it's the current page, it should be activated.\n activatedNodes.value = [newItem.id];\n }\n }\n}\n\nasync function getChildNodes(id: string) {\n return (await treeSource.getChildNodes(id)).filter(\n (c) => props.includeTerminals || !c.is_terminal,\n );\n}\n</script>\n\n<template>\n <v-treeview\n v-model:opened=\"expandedNodes\"\n density=\"compact\"\n :activated=\"activatedNodes\"\n :items=\"rootNodes\"\n :load-children=\"lazyLoadChildren\"\n activatable\n active-strategy=\"independent\"\n item-value=\"id\"\n @update:activated=\"clearSelection\"\n >\n <template #title=\"{ item }: { item: any }\">\n <a\n v-if=\"props.clickAction\"\n :href=\"item.href\"\n @click.prevent=\"\n activatedNodes = [item.id];\n clickAction!({\n id: item.id,\n label: item.title,\n location: item._location,\n url: item.href,\n has_children: item.children !== undefined,\n is_terminal: item._is_terminal,\n });\n \"\n >{{ item.title }}</a\n >\n <a v-else :href=\"item.href\">{{ item.title }}</a>\n </template>\n </v-treeview>\n</template>\n\n<style scoped>\n.v-list {\n background: none;\n}\n:deep(a) {\n text-decoration: none;\n color: var(--cr-base-text-color);\n}\n/* Disable hover on items. */\n:deep(.v-list-item__overlay) {\n --v-hover-opacity: 0;\n}\n/* Disable hand cursor on items, since we disable the default click action. */\n:deep(.v-list-item--link) {\n cursor: default;\n}\n</style>\n"],"names":["navigationTreePropsDefaults","cristal","inject","documentService","treeSource","rootNodes","ref","activatedNodes","expandedNodes","isExpanding","props","__props","onBeforeMount","newRootNodes","node","getChildNodes","SpaceReference","expandTree","onDocumentDelete","onDocumentUpdate","watch","newExpandedNodes","i","currentNodes","lazyLoadChildren","item","treeItem","childNodes","child","clearSelection","page","parents","currentItem","currentItemChildren","notFound","currentItemsLoop","currentParent","currentItems","isRoot","newItems","newItem","currentPageParents","newItemsLoop","id","c","_createBlock","_unref","VTreeview","$event","_withCtx","_createElementBlock","_withModifiers","clickAction","_toDispl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,QAEdf,EAAM,oBADdwC,EAeC,KAAA;AAAA;UAbE,MAAMzB,EAAK;AAAA,UACX,SAAK0B,EAAA,CAAAH,MAAA;AAAqB,YAAAzC,EAAA,QAAc,CAAIkB,EAAK,EAAE,GAAa2B,EAAAA,YAAW;AAAA,cAAoB,IAAA3B,EAAK;AAAA,cAAuB,OAAAA,EAAK;AAAA,cAA6B,UAAAA,EAAK;AAAA,cAA4B,KAAAA,EAAK;AAAA,4BAAgCA,EAAK,aAAa;AAAA,cAAoC,aAAAA,EAAK;AAAA,YAAA;;WAW3R4B,EAAA5B,EAAK,KAAK,GAAA,GAAA6B,CAAA,WAEhBJ,EAAgD,KAAA;AAAA;UAArC,MAAMzB,EAAK;AAAA,QAAA,GAAS4B,EAAA5B,EAAK,KAAK,GAAA,GAAA8B,CAAA;AAAA,MAAA;;;;;"}
@@ -1,12 +1,12 @@
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";
1
+ import { d as R, p as C, y as D, q as x, l as v, D as X, r as i, c as k, i as l, w as n, u as o, F as B, o as H, s as N, h, t as y, x as M } from "./index-CPGfq5JL.js";
2
2
  import { t as S } from "./translations-BVK9UR9x.js";
3
- import E from "./x-breadcrumb-BQVk_ZI_.js";
3
+ import E from "./x-breadcrumb-Ca8UqeNm.js";
4
4
  import { EntityType as F, SpaceReference as I } from "@xwiki/cristal-model-api";
5
5
  import { useI18n as A } from "vue-i18n";
6
- import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const j = {
6
+ import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const q = {
8
8
  includeTerminals: !1
9
- }, q = /* @__PURE__ */ R({
9
+ }, z = /* @__PURE__ */ R({
10
10
  __name: "x-navigation-tree-select",
11
11
  props: /* @__PURE__ */ C(/* @__PURE__ */ M({
12
12
  label: {},
@@ -14,7 +14,7 @@ const j = {
14
14
  currentPageReference: {},
15
15
  modelValue: {},
16
16
  includeTerminals: { type: Boolean }
17
- }, j), {
17
+ }, q), {
18
18
  modelValue: {},
19
19
  modelModifiers: {}
20
20
  }),
@@ -22,41 +22,41 @@ const j = {
22
22
  setup(f) {
23
23
  const p = D("cristal"), s = p.getContainer().get("PageHierarchyResolverProvider").get(), _ = p.getContainer().get("ModelReferenceHandlerProvider").get(), { t: c } = A({
24
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(
25
+ }), u = f, d = x(f, "modelValue"), m = v(!1), a = v([]);
26
+ let t;
27
+ X(async () => {
28
+ t = u.currentPageReference, d.value = u.currentPageReference.space, a.value = await s.getPageHierarchy(
29
29
  u.currentPageReference.space,
30
30
  !1
31
31
  );
32
32
  });
33
33
  async function P(e) {
34
- e.location.type == F.SPACE ? e.location.names.length > 0 ? (a = _.createDocumentReference(
34
+ e.location.type == F.SPACE ? e.location.names.length > 0 ? (t = _.createDocumentReference(
35
35
  e.location.names[e.location.names.length - 1],
36
36
  new I(
37
37
  e.location.wiki,
38
38
  ...e.location.names.slice(0, -1)
39
39
  )
40
- ), t.value = await s.getPageHierarchy(
41
- a,
40
+ ), a.value = await s.getPageHierarchy(
41
+ t,
42
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,
43
+ )) : (t = void 0, a.value = [{ label: e.label, pageId: "", url: e.url }]) : (t = e.location, a.value = await s.getPageHierarchy(
44
+ t,
45
45
  !1
46
46
  )), d.value = e.location;
47
47
  }
48
48
  return (e, r) => {
49
49
  const b = i("x-btn"), T = i("XNavigationTree"), V = i("XBtn"), w = i("XDialog");
50
- return H(), x(B, null, [
50
+ return H(), k(B, null, [
51
51
  l(o(N), {
52
52
  label: e.label,
53
53
  hint: e.help,
54
54
  "persistent-hint": e.help !== void 0,
55
- active: t.value.length > 0,
55
+ active: a.value.length > 0,
56
56
  readonly: ""
57
57
  }, {
58
58
  default: n(() => [
59
- l(E, { items: t.value }, null, 8, ["items"])
59
+ l(E, { items: a.value }, null, 8, ["items"])
60
60
  ]),
61
61
  _: 1
62
62
  }, 8, ["label", "hint", "persistent-hint", "active"]),
@@ -80,7 +80,7 @@ const j = {
80
80
  ]),
81
81
  default: n(() => [
82
82
  l(T, {
83
- "current-page-reference": o(a),
83
+ "current-page-reference": o(t),
84
84
  "click-action": P,
85
85
  "include-terminals": e.includeTerminals,
86
86
  "show-root-node": ""
@@ -102,8 +102,8 @@ const j = {
102
102
  ], 64);
103
103
  };
104
104
  }
105
- }), O = /* @__PURE__ */ $(q, [["__scopeId", "data-v-72a1a984"]]);
105
+ }), O = /* @__PURE__ */ j(z, [["__scopeId", "data-v-09118322"]]);
106
106
  export {
107
107
  O as default
108
108
  };
109
- //# sourceMappingURL=x-navigation-tree-select-CZMM_WJl.js.map
109
+ //# sourceMappingURL=x-navigation-tree-select-CHoauT-L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-navigation-tree-select-CHoauT-L.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","<!--\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<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;;;;;;;;;;;;;;ACJA,UAAMC,IAAsBC,EAAmB,SAAS,GAClDC,IAA2CF,EAC9C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAA,GACGG,IAA0CH,EAC7C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAA,GAEG,EAAE,GAAAI,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GACKC,IAAQC,GAIRC,IAAQC,EAA+CF,GAAA,YAAC,GAExDG,IAAqCC,EAAI,EAAK,GAC9CC,IAA2CD,EAAI,EAAE;AACvD,QAAIE;AAEJ,IAAAC,EAAU,YAAY;AACpB,MAAAD,IAAeP,EAAM,sBACrBE,EAAM,QAAQF,EAAM,qBAAsB,OAC1CM,E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;AAAA,cAFD,IAAG;AAAA,cAA8B,MAAK;AAAA,cAAQ,OAAM;AAAA,YAAA;yBACzD,MAA6C;AAAA,oBAA1CP,EAAAjB,CAAA,EAAC,oCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;UAGG,WACT,MAKmB;AAAA,YALnBgB,EAKmBS,GAAA;AAAA,cAJhB,0BAAwBR,EAAAP,CAAA;AAAA,cACxB,gBAAcE;AAAA,cACd,qBAAmBc,EAAAA;AAAAA,cACpB,kBAAA;AAAA,YAAA;;UAGO,UACT,MAEO;AAAA,YAFPV,EAEOW,GAAA;AAAA,cAFD,SAAQ;AAAA,cAAW,gCAAOpB,EAAA,QAAoB;AAAA,YAAA;yBAClD,MAA8C;AAAA,oBAA3CU,EAAAjB,CAAA,EAAC,qCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { r as o, b as n, o as r } from "./index-DNHsU4Fr.js";
1
+ import { r as o, b as n, o as r } from "./index-CPGfq5JL.js";
2
2
  import { _ as t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  const c = {};
4
4
  function a(s, m) {
@@ -17,4 +17,4 @@ const _ = /* @__PURE__ */ t(c, [["render", a]]);
17
17
  export {
18
18
  _ as default
19
19
  };
20
- //# sourceMappingURL=x-search-NPeNBHNh.js.map
20
+ //# sourceMappingURL=x-search-BgVWZd4f.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-search-BgVWZd4f.js","sources":["../src/vue/x-search.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<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,4 +1,4 @@
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";
1
+ import { d as m, p as n, q as d, a as i, b as p, u as c, o as f, E as V } from "./index-CPGfq5JL.js";
2
2
  import { t as b } from "./translations-BVK9UR9x.js";
3
3
  import { useI18n as g } from "vue-i18n";
4
4
  const B = /* @__PURE__ */ m({
@@ -35,4 +35,4 @@ const B = /* @__PURE__ */ m({
35
35
  export {
36
36
  B as default
37
37
  };
38
- //# sourceMappingURL=x-select-DCWNJiNk.js.map
38
+ //# sourceMappingURL=x-select-bQRFdVPL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-select-bQRFdVPL.js","sources":["../src/vue/form/x-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<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,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIT,EAAM,YACRS,EAAU,KAAK,CAACC,MACVA,IACK,KAEAN,EAAE,gCAAgC,CAE5C,GAEIK;AAAA,IACT,CAAC;2BAGCE,EAOYC,EAAAC,CAAA,GAAA;AAAA,kBANDX,EAAA;AAAA,oDAAAA,EAAQ,QAAAY;AAAA,MAChB,OAAOC,EAAAA;AAAAA,MACP,UAAUC,EAAAA;AAAAA,MACV,OAAOC,EAAAA;AAAAA,MACP,OAAOV,EAAA;AAAA,MACP,YAAYW,EAAAA;AAAAA,IAAAA;;;"}
@@ -1,4 +1,4 @@
1
- import { d as a, r as o, b as s, w as n, o as r, e as p } from "./index-DNHsU4Fr.js";
1
+ import { d as a, r as o, b as s, w as n, o as r, e as p } from "./index-CPGfq5JL.js";
2
2
  const d = /* @__PURE__ */ a({
3
3
  __name: "x-tab",
4
4
  props: {
@@ -19,4 +19,4 @@ const d = /* @__PURE__ */ a({
19
19
  export {
20
20
  d as default
21
21
  };
22
- //# sourceMappingURL=x-tab-UmfRst-i.js.map
22
+ //# sourceMappingURL=x-tab-CFwL72L6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-tab-CFwL72L6.js","sources":["../src/vue/x-tab.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<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,EAAAA,SAAK;AAAA,mBAAE,MAAa;AAAA,UAAbC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
@@ -1,4 +1,4 @@
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";
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-CPGfq5JL.js";
2
2
  const x = /* @__PURE__ */ v({
3
3
  __name: "x-tab-group",
4
4
  emits: ["tab-change"],
@@ -46,4 +46,4 @@ const x = /* @__PURE__ */ v({
46
46
  export {
47
47
  x as default
48
48
  };
49
- //# sourceMappingURL=x-tab-group-C0nWDupY.js.map
49
+ //# sourceMappingURL=x-tab-group-Bs17utO_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-tab-group-Bs17utO_.js","sources":["../src/vue/x-tab-group.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<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,EAAA,GAEpBC,IAAQC;AAEd,aAASC,EAAOC,GAAgB;AAC9B,MAAI,OAAOA,KAAS,YAClBH,EAAM,cAAcG,CAAK;AAAA,IAE7B;;;kBAIEC,EASSC,GAAA,EATD,OAAM,aAAS;AAAA,mBACrB,MAES;AAAA,UAFTC,EAESC,GAAA;AAAA,wBAFQT,EAAA;AAAA;qCAAAA,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,EAAA;AAAA,8DAAAA,EAAG,QAAAU;AAAA,cAAA;2BACzB,MAA2B;AAAA,kBAA3BC,EAA2BC,EAAA,QAAA,QAAA;AAAA,gBAAA;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { d as a, r as o, b as n, w as s, o as r, e as p } from "./index-DNHsU4Fr.js";
1
+ import { d as a, r as o, b as n, w as s, o as r, e as p } from "./index-CPGfq5JL.js";
2
2
  const m = /* @__PURE__ */ a({
3
3
  __name: "x-tab-panel",
4
4
  props: {
@@ -19,4 +19,4 @@ const m = /* @__PURE__ */ a({
19
19
  export {
20
20
  m as default
21
21
  };
22
- //# sourceMappingURL=x-tab-panel-CjY4vyG0.js.map
22
+ //# sourceMappingURL=x-tab-panel-DL228tOt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-tab-panel-DL228tOt.js","sources":["../src/vue/x-tab-panel.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<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,EAAAA,SAAK;AAAA,mBAAE,MAAa;AAAA,UAAbC,EAAaC,EAAA,QAAA,SAAA;AAAA,QAAA;;;;;;"}
@@ -1,4 +1,4 @@
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";
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-CPGfq5JL.js";
2
2
  import { t as c } from "./translations-BVK9UR9x.js";
3
3
  import { useI18n as h } from "vue-i18n";
4
4
  const q = /* @__PURE__ */ r({
@@ -41,4 +41,4 @@ const q = /* @__PURE__ */ r({
41
41
  export {
42
42
  q as default
43
43
  };
44
- //# sourceMappingURL=x-text-field-CaWcwz2v.js.map
44
+ //# sourceMappingURL=x-text-field-DtCbDE_F.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-text-field-DtCbDE_F.js","sources":["../src/vue/form/x-text-field.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<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":";;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,EAAE,GAAAA,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GACKC,IAAQC,GACRC,IAAQC,EAAmBF,GAAA,YAAC,GAE5BG,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIN,EAAM,YACRM,EAAU,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IACT,CAAC;2BAICE,EAUgBC,EAAAC,CAAA,GAAA;AAAA,kBATLR,EAAA;AAAA,oDAAAA,EAAK,QAAAS;AAAA,MACb,OAAOC,EAAAA;AAAAA,MACP,MAAMC,EAAAA;AAAAA,MACN,WAAWC,EAAAA;AAAAA,MACX,MAAMC,EAAAA;AAAAA,MACN,mBAAiBA,EAAAA,SAAS;AAAA,MAC1B,OAAOX,EAAA;AAAA,MACP,UAAUY,EAAAA;AAAAA,MACV,MAAMC,EAAAA,QAAI;AAAA,IAAA;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-dsvuetify",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -27,29 +27,30 @@
27
27
  },
28
28
  "main": "./dist/index.es.js",
29
29
  "dependencies": {
30
- "inversify": "7.5.4",
31
- "vue-i18n": "11.1.5",
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"
30
+ "vue-i18n": "11.1.11",
31
+ "vuetify": "3.9.3",
32
+ "@xwiki/cristal-api": "0.21.0",
33
+ "@xwiki/cristal-document-api": "0.21.0",
34
+ "@xwiki/cristal-hierarchy-api": "0.21.0",
35
+ "@xwiki/cristal-model-api": "0.21.0",
36
+ "@xwiki/cristal-model-reference-api": "0.21.0",
37
+ "@xwiki/cristal-navigation-tree-api": "0.21.0"
39
38
  },
40
39
  "peerDependencies": {
40
+ "inversify": "7.x",
41
41
  "reflect-metadata": "0.x",
42
42
  "vue": "3.x"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@vue/test-utils": "2.4.6",
46
+ "inversify": "7.7.0",
46
47
  "reflect-metadata": "0.2.2",
47
- "typescript": "5.8.3",
48
- "vite": "7.0.0",
49
- "vue": "3.5.17",
50
- "vue-tsc": "2.2.10",
51
- "@xwiki/cristal-dev-config": "0.20.0",
52
- "@xwiki/cristal-dsapi": "0.20.0"
48
+ "typescript": "5.9.2",
49
+ "vite": "7.0.6",
50
+ "vue": "3.5.18",
51
+ "vue-tsc": "2.2.12",
52
+ "@xwiki/cristal-dsapi": "0.21.0",
53
+ "@xwiki/cristal-dev-config": "0.21.0"
53
54
  },
54
55
  "scripts": {
55
56
  "build": "pnpm compile",
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *
@@ -22,7 +22,7 @@ import { registerAsyncComponent } from "@xwiki/cristal-api";
22
22
  import { injectable } from "inversify";
23
23
  import { createVuetify } from "vuetify";
24
24
  import * as components from "vuetify/components";
25
- import { VCol, VContainer, VRow, VTextField } from "vuetify/components";
25
+ import { VCol, VContainer, VRow } from "vuetify/components";
26
26
 
27
27
  import * as directives from "vuetify/directives";
28
28
  import { aliases, mdi } from "vuetify/iconsets/mdi-svg";
@@ -78,7 +78,6 @@ export class VuetifyDesignSystemLoader implements DesignSystemLoader {
78
78
  app.component("XContainer", VContainer);
79
79
  app.component("XRow", VRow);
80
80
  app.component("XCol", VCol);
81
- app.component("XTextField", VTextField);
82
81
 
83
82
  // Custom wrapped components
84
83
  registerAsyncComponent(app, "XLoad", () => import("../vue/x-load.vue"));
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*
1
+ /**
2
2
  * See the LICENSE file distributed with this work for additional
3
3
  * information regarding copyright ownership.
4
4
  *