@xwiki/cristal-dsvuetify 0.21.0 → 0.22.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 (85) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/api-extractor.json +4 -0
  3. package/dist/components/componentsInit.d.ts +3 -0
  4. package/dist/index-D8yc5V3N.js +22384 -0
  5. package/dist/index-D8yc5V3N.js.map +1 -0
  6. package/dist/index.es.js +3 -3
  7. package/dist/index.umd.js +8 -36
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/vue/form/x-form.vue.d.ts +58 -58
  10. package/dist/x-alert-DKgk3dOE.js +46 -0
  11. package/dist/{x-alert-Bqf5Ghy4.js.map → x-alert-DKgk3dOE.js.map} +1 -1
  12. package/dist/{x-avatar-DDWQUeZJ.js → x-avatar-WnkeGyHH.js} +5 -5
  13. package/dist/{x-avatar-DDWQUeZJ.js.map → x-avatar-WnkeGyHH.js.map} +1 -1
  14. package/dist/x-breadcrumb-DiDfmxr5.js +22 -0
  15. package/dist/{x-breadcrumb-Ca8UqeNm.js.map → x-breadcrumb-DiDfmxr5.js.map} +1 -1
  16. package/dist/x-btn-DzH2bk-f.js +50 -0
  17. package/dist/{x-btn-CEN-gSJs.js.map → x-btn-DzH2bk-f.js.map} +1 -1
  18. package/dist/x-card-BlUD5hbt.js +22 -0
  19. package/dist/{x-card-ywmTDQq1.js.map → x-card-BlUD5hbt.js.map} +1 -1
  20. package/dist/x-checkbox-EzA-ce8R.js +28 -0
  21. package/dist/{x-checkbox-DioEzg6D.js.map → x-checkbox-EzA-ce8R.js.map} +1 -1
  22. package/dist/{x-dialog-BR0aOJnF.js → x-dialog-CvZUbP80.js} +10 -10
  23. package/dist/{x-dialog-BR0aOJnF.js.map → x-dialog-CvZUbP80.js.map} +1 -1
  24. package/dist/x-divider-BOCxsH8h.js +12 -0
  25. package/dist/{x-divider-DdCNaWK9.js.map → x-divider-BOCxsH8h.js.map} +1 -1
  26. package/dist/x-file-input-7TdHHaG2.js +40 -0
  27. package/dist/{x-file-input-CR_baWpm.js.map → x-file-input-7TdHHaG2.js.map} +1 -1
  28. package/dist/x-form-DrjHf0um.js +33 -0
  29. package/dist/{x-form-DXezCfh2.js.map → x-form-DrjHf0um.js.map} +1 -1
  30. package/dist/{x-img-X-qoosGi.js → x-img-DWbVDNTs.js} +3 -3
  31. package/dist/{x-img-X-qoosGi.js.map → x-img-DWbVDNTs.js.map} +1 -1
  32. package/dist/x-load-Bw4ftl3k.js +11 -0
  33. package/dist/{x-load-CXDfm5l3.js.map → x-load-Bw4ftl3k.js.map} +1 -1
  34. package/dist/x-menu-CZMwPcag.js +31 -0
  35. package/dist/{x-menu-C7rglNy2.js.map → x-menu-CZMwPcag.js.map} +1 -1
  36. package/dist/x-menu-item-CBdOhZc3.js +22 -0
  37. package/dist/{x-menu-item-CCcPUrHX.js.map → x-menu-item-CBdOhZc3.js.map} +1 -1
  38. package/dist/x-menu-label-D-sFcG_g.js +17 -0
  39. package/dist/{x-menu-label-gVnEylDY.js.map → x-menu-label-D-sFcG_g.js.map} +1 -1
  40. package/dist/{x-navigation-tree-BNc0pKUi.js → x-navigation-tree-BcW_691Y.js} +27 -26
  41. package/dist/x-navigation-tree-BcW_691Y.js.map +1 -0
  42. package/dist/{x-navigation-tree-select-CHoauT-L.js → x-navigation-tree-select-_13SOFbP.js} +28 -27
  43. package/dist/x-navigation-tree-select-_13SOFbP.js.map +1 -0
  44. package/dist/x-search-C7GhoCKj.js +20 -0
  45. package/dist/{x-search-BgVWZd4f.js.map → x-search-C7GhoCKj.js.map} +1 -1
  46. package/dist/x-select-DnRsSLAX.js +39 -0
  47. package/dist/{x-select-bQRFdVPL.js.map → x-select-DnRsSLAX.js.map} +1 -1
  48. package/dist/x-tab-group-BfEaq8Nj.js +49 -0
  49. package/dist/x-tab-group-BfEaq8Nj.js.map +1 -0
  50. package/dist/x-tab-panel-DysgiPCz.js +22 -0
  51. package/dist/{x-tab-panel-DL228tOt.js.map → x-tab-panel-DysgiPCz.js.map} +1 -1
  52. package/dist/x-tab-vRrbUjdK.js +22 -0
  53. package/dist/{x-tab-CFwL72L6.js.map → x-tab-vRrbUjdK.js.map} +1 -1
  54. package/dist/{x-text-field-DtCbDE_F.js → x-text-field-BWaRETwR.js} +15 -14
  55. package/dist/{x-text-field-DtCbDE_F.js.map → x-text-field-BWaRETwR.js.map} +1 -1
  56. package/etc/cristal-dsvuetify.api.md +16 -0
  57. package/package.json +19 -18
  58. package/src/components/componentsInit.ts +3 -0
  59. package/src/vue/x-breadcrumb.vue +1 -1
  60. package/src/vue/x-tab-group.vue +2 -1
  61. package/src/vue/x-tab-panel.vue +1 -1
  62. package/src/vue/x-tab.vue +1 -1
  63. package/vitest.config.ts +1 -1
  64. package/dist/index-CPGfq5JL.js +0 -28214
  65. package/dist/index-CPGfq5JL.js.map +0 -1
  66. package/dist/x-alert-Bqf5Ghy4.js +0 -46
  67. package/dist/x-breadcrumb-Ca8UqeNm.js +0 -22
  68. package/dist/x-btn-CEN-gSJs.js +0 -50
  69. package/dist/x-card-ywmTDQq1.js +0 -22
  70. package/dist/x-checkbox-DioEzg6D.js +0 -27
  71. package/dist/x-divider-DdCNaWK9.js +0 -12
  72. package/dist/x-file-input-CR_baWpm.js +0 -39
  73. package/dist/x-form-DXezCfh2.js +0 -32
  74. package/dist/x-load-CXDfm5l3.js +0 -11
  75. package/dist/x-menu-C7rglNy2.js +0 -31
  76. package/dist/x-menu-item-CCcPUrHX.js +0 -22
  77. package/dist/x-menu-label-gVnEylDY.js +0 -17
  78. package/dist/x-navigation-tree-BNc0pKUi.js.map +0 -1
  79. package/dist/x-navigation-tree-select-CHoauT-L.js.map +0 -1
  80. package/dist/x-search-BgVWZd4f.js +0 -20
  81. package/dist/x-select-bQRFdVPL.js +0 -38
  82. package/dist/x-tab-CFwL72L6.js +0 -22
  83. package/dist/x-tab-group-Bs17utO_.js +0 -49
  84. package/dist/x-tab-group-Bs17utO_.js.map +0 -1
  85. package/dist/x-tab-panel-DL228tOt.js +0 -22
@@ -1,21 +1,22 @@
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";
1
+ import { defineComponent as b, mergeDefaults as S, inject as A, ref as _, onBeforeMount as B, watch as E, createBlock as F, openBlock as g, unref as L, withCtx as U, createElementBlock as P, withModifiers as M, toDisplayString as R } from "vue";
2
2
  import { SpaceReference as j } from "@xwiki/cristal-model-api";
3
+ import { c as z } from "./index-D8yc5V3N.js";
3
4
  import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
5
  const $ = {
5
6
  includeTerminals: !0
6
7
  }, q = ["href", "onClick"], G = ["href"], H = /* @__PURE__ */ b({
7
8
  __name: "x-navigation-tree",
8
- props: /* @__PURE__ */ A({
9
+ props: /* @__PURE__ */ S({
9
10
  clickAction: { type: Function },
10
11
  currentPageReference: {},
11
12
  includeTerminals: { type: Boolean },
12
13
  showRootNode: { type: Boolean }
13
14
  }, $),
14
15
  setup(I) {
15
- const m = B("cristal"), w = m.getContainer().get("DocumentService"), s = m.getContainer().get("NavigationTreeSourceProvider").get(), a = _([]), l = _(new Array()), f = _([]);
16
+ const m = A("cristal"), w = m.getContainer().get("DocumentService"), s = m.getContainer().get("NavigationTreeSourceProvider").get(), l = _([]), a = _(new Array()), f = _([]);
16
17
  var h = !1;
17
18
  const i = I;
18
- S(async () => {
19
+ B(async () => {
19
20
  const o = [];
20
21
  for (const n of await u(""))
21
22
  o.push({
@@ -26,16 +27,16 @@ const $ = {
26
27
  _location: n.location,
27
28
  _is_terminal: n.is_terminal
28
29
  });
29
- i.showRootNode ? a.value.push({
30
+ i.showRootNode ? l.value.push({
30
31
  id: "",
31
32
  title: "Root",
32
33
  href: ".",
33
34
  children: o,
34
35
  _location: new j(),
35
36
  _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() {
37
+ }) : l.value.push(...o), await N(), w.registerDocumentChangeListener("delete", T), w.registerDocumentChangeListener("update", x);
38
+ }), E(() => i.currentPageReference, N);
39
+ async function N() {
39
40
  if (i.currentPageReference && !h) {
40
41
  h = !0;
41
42
  const o = s.getParentNodesId(
@@ -43,14 +44,14 @@ const $ = {
43
44
  i.includeTerminals,
44
45
  i.showRootNode
45
46
  );
46
- let n, t = a.value;
47
+ let n, t = l.value;
47
48
  for (n = 0; n < o.length - 1; n++)
48
49
  if (t)
49
50
  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
+ e.id == o[n] && (e.children?.length == 0 && await y(e), f.value.includes(e.id) || f.value.push(e.id), t = e.children);
51
52
  if (t)
52
53
  for (const e of t)
53
- e.id == o[n] && (l.value = [e.id], i.clickAction && i.clickAction({
54
+ e.id == o[n] && (a.value = [e.id], i.clickAction && i.clickAction({
54
55
  id: e.id,
55
56
  label: e.title,
56
57
  location: e._location,
@@ -61,7 +62,7 @@ const $ = {
61
62
  h = !1;
62
63
  }
63
64
  }
64
- async function N(o) {
65
+ async function y(o) {
65
66
  const n = o, t = await u(n.id);
66
67
  for (const e of t)
67
68
  n.children?.push({
@@ -75,7 +76,7 @@ const $ = {
75
76
  t.length == 0 && (n.children = void 0);
76
77
  }
77
78
  function C() {
78
- l.value.length > 1 && l.value.pop();
79
+ a.value.length > 1 && a.value.pop();
79
80
  }
80
81
  async function T(o) {
81
82
  const n = s.getParentNodesId(
@@ -83,7 +84,7 @@ const $ = {
83
84
  i.includeTerminals,
84
85
  i.showRootNode
85
86
  );
86
- let t, e = a.value, d = !1;
87
+ let t, e = l.value, d = !1;
87
88
  e: for (; e && !d; ) {
88
89
  for (const c of e.keys())
89
90
  if (e[c].id == n[0])
@@ -103,7 +104,7 @@ const $ = {
103
104
  i.includeTerminals,
104
105
  i.showRootNode
105
106
  );
106
- let t, e = a.value, d = !1, c = !0;
107
+ let t, e = l.value, d = !1, c = !0;
107
108
  e: for (; e && !d; ) {
108
109
  for (const r of e.keys())
109
110
  if (e[r].id == n[0])
@@ -139,7 +140,7 @@ const $ = {
139
140
  children: r.has_children ? [] : void 0,
140
141
  _location: r.location,
141
142
  _is_terminal: r.is_terminal
142
- }), p.length > 0 && p[p.length - 1] === r.id && (l.value = [r.id]);
143
+ }), p.length > 0 && p[p.length - 1] === r.id && (a.value = [r.id]);
143
144
  }
144
145
  }
145
146
  async function u(o) {
@@ -147,24 +148,24 @@ const $ = {
147
148
  (n) => i.includeTerminals || !n.is_terminal
148
149
  );
149
150
  }
150
- return (o, n) => (g(), F(U(M), {
151
+ return (o, n) => (g(), F(L(z), {
151
152
  opened: f.value,
152
153
  "onUpdate:opened": n[0] || (n[0] = (t) => f.value = t),
153
154
  density: "compact",
154
- activated: l.value,
155
- items: a.value,
156
- "load-children": N,
155
+ activated: a.value,
156
+ items: l.value,
157
+ "load-children": y,
157
158
  activatable: "",
158
159
  "active-strategy": "independent",
159
160
  "item-value": "id",
160
161
  "onUpdate:activated": C
161
162
  }, {
162
- title: L(({ item: t }) => [
163
+ title: U(({ item: t }) => [
163
164
  i.clickAction ? (g(), P("a", {
164
165
  key: 0,
165
166
  href: t.href,
166
- onClick: z((e) => {
167
- l.value = [t.id], o.clickAction({
167
+ onClick: M((e) => {
168
+ a.value = [t.id], o.clickAction({
168
169
  id: t.id,
169
170
  label: t.title,
170
171
  location: t._location,
@@ -181,8 +182,8 @@ const $ = {
181
182
  _: 1
182
183
  }, 8, ["opened", "activated", "items"]));
183
184
  }
184
- }), Q = /* @__PURE__ */ V(H, [["__scopeId", "data-v-54e58f7c"]]);
185
+ }), W = /* @__PURE__ */ V(H, [["__scopeId", "data-v-54e58f7c"]]);
185
186
  export {
186
- Q as default
187
+ W as default
187
188
  };
188
- //# sourceMappingURL=x-navigation-tree-BNc0pKUi.js.map
189
+ //# sourceMappingURL=x-navigation-tree-BcW_691Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-navigation-tree-BcW_691Y.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 * @beta\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 * @beta\n */\n includeTerminals?: boolean;\n /**\n * Whether to display a root node (default: false).\n * @since 0.20\n * @beta\n */\n showRootNode?: boolean;\n};\n\n/**\n * Default props values for NavigationTree implementations.\n * @since 0.16\n * @beta\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","_toDisplayString","_hoisted_1","_hoisted_2"],"mappings":";;;;AAiDA,MAAMA,IAA8B;AAAA,EAClC,kBAAkB;AACpB;;;;;;;;;ACGA,UAAMC,IAAsBC,EAAmB,SAAS,GAClDC,IAAmCF,EACtC,aAAA,EACA,IAAqB,iBAAiB,GACnCG,IAAmCH,EACtC,aAAA,EACA,IAAkC,8BAA8B,EAChE,IAAA,GAEGI,IAAkCC,EAAI,EAAE,GAExCC,IAAqCD,EAAI,IAAI,OAAe,GAC5DE,IAA8BF,EAAI,EAAE;AAC1C,QAAIG,IAAuB;AAE3B,UAAMC,IAAQC;AAKd,IAAAC,EAAc,YAAY;AACxB,YAAMC,IAAgC,CAAA;AACtC,iBAAWC,KAAQ,MAAMC,EAAc,EAAE;AACvC,QAAAF,EAAa,KAAK;AAAA,UAChB,IAAIC,EAAK;AAAA,UACT,OAAOA,EAAK;AAAA,UACZ,MAAMA,EAAK;AAAA,UACX,UAAUA,EAAK,eAAe,CAAA,IAAK;AAAA,UACnC,WAAWA,EAAK;AAAA,UAChB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Gfq5JL.js";
2
- import { t as S } from "./translations-BVK9UR9x.js";
3
- import E from "./x-breadcrumb-Ca8UqeNm.js";
4
- import { EntityType as F, SpaceReference as I } from "@xwiki/cristal-model-api";
1
+ import { defineComponent as w, mergeModels as C, inject as D, useModel as X, ref as v, onMounted as k, resolveComponent as i, createElementBlock as x, openBlock as B, Fragment as H, createVNode as l, unref as o, withCtx as n, createTextVNode as h, toDisplayString as y, mergeDefaults as N } from "vue";
2
+ import { t as M } from "./translations-BVK9UR9x.js";
3
+ import S from "./x-breadcrumb-DiDfmxr5.js";
4
+ import { EntityType as E, SpaceReference as I } from "@xwiki/cristal-model-api";
5
5
  import { useI18n as A } from "vue-i18n";
6
+ import { a as F } from "./index-D8yc5V3N.js";
6
7
  import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- const q = {
8
+ const z = {
8
9
  includeTerminals: !1
9
- }, z = /* @__PURE__ */ R({
10
+ }, L = /* @__PURE__ */ w({
10
11
  __name: "x-navigation-tree-select",
11
- props: /* @__PURE__ */ C(/* @__PURE__ */ M({
12
+ props: /* @__PURE__ */ C(/* @__PURE__ */ N({
12
13
  label: {},
13
14
  help: {},
14
15
  currentPageReference: {},
15
16
  modelValue: {},
16
17
  includeTerminals: { type: Boolean }
17
- }, q), {
18
+ }, z), {
18
19
  modelValue: {},
19
20
  modelModifiers: {}
20
21
  }),
21
22
  emits: ["update:modelValue"],
22
23
  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), a = v([]);
24
+ const p = D("cristal"), c = p.getContainer().get("PageHierarchyResolverProvider").get(), _ = p.getContainer().get("ModelReferenceHandlerProvider").get(), { t: s } = A({
25
+ messages: M
26
+ }), u = f, d = X(f, "modelValue"), m = v(!1), a = v([]);
26
27
  let t;
27
- X(async () => {
28
- t = u.currentPageReference, d.value = u.currentPageReference.space, a.value = await s.getPageHierarchy(
28
+ k(async () => {
29
+ t = u.currentPageReference, d.value = u.currentPageReference.space, a.value = await c.getPageHierarchy(
29
30
  u.currentPageReference.space,
30
31
  !1
31
32
  );
32
33
  });
33
34
  async function P(e) {
34
- e.location.type == F.SPACE ? e.location.names.length > 0 ? (t = _.createDocumentReference(
35
+ e.location.type == E.SPACE ? e.location.names.length > 0 ? (t = _.createDocumentReference(
35
36
  e.location.names[e.location.names.length - 1],
36
37
  new I(
37
38
  e.location.wiki,
38
39
  ...e.location.names.slice(0, -1)
39
40
  )
40
- ), a.value = await s.getPageHierarchy(
41
+ ), a.value = await c.getPageHierarchy(
41
42
  t,
42
43
  !1
43
- )) : (t = void 0, a.value = [{ label: e.label, pageId: "", url: e.url }]) : (t = e.location, a.value = await s.getPageHierarchy(
44
+ )) : (t = void 0, a.value = [{ label: e.label, pageId: "", url: e.url }]) : (t = e.location, a.value = await c.getPageHierarchy(
44
45
  t,
45
46
  !1
46
47
  )), d.value = e.location;
47
48
  }
48
49
  return (e, r) => {
49
- const b = i("x-btn"), T = i("XNavigationTree"), V = i("XBtn"), w = i("XDialog");
50
- return H(), k(B, null, [
51
- l(o(N), {
50
+ const b = i("x-btn"), T = i("XNavigationTree"), V = i("XBtn"), R = i("XDialog");
51
+ return B(), x(H, null, [
52
+ l(o(F), {
52
53
  label: e.label,
53
54
  hint: e.help,
54
55
  "persistent-hint": e.help !== void 0,
@@ -56,15 +57,15 @@ const q = {
56
57
  readonly: ""
57
58
  }, {
58
59
  default: n(() => [
59
- l(E, { items: a.value }, null, 8, ["items"])
60
+ l(S, { items: a.value }, null, 8, ["items"])
60
61
  ]),
61
62
  _: 1
62
63
  }, 8, ["label", "hint", "persistent-hint", "active"]),
63
- l(w, {
64
+ l(R, {
64
65
  modelValue: m.value,
65
66
  "onUpdate:modelValue": r[1] || (r[1] = (g) => m.value = g),
66
67
  width: "auto",
67
- title: o(c)("vuetify.tree.select.location.label")
68
+ title: o(s)("vuetify.tree.select.location.label")
68
69
  }, {
69
70
  activator: n(() => [
70
71
  l(b, {
@@ -73,7 +74,7 @@ const q = {
73
74
  color: "secondary"
74
75
  }, {
75
76
  default: n(() => [
76
- h(y(o(c)("vuetify.tree.select.location.label")), 1)
77
+ h(y(o(s)("vuetify.tree.select.location.label")), 1)
77
78
  ]),
78
79
  _: 1
79
80
  })
@@ -92,7 +93,7 @@ const q = {
92
93
  onClick: r[0] || (r[0] = (g) => m.value = !1)
93
94
  }, {
94
95
  default: n(() => [
95
- h(y(o(c)("vuetify.tree.select.location.select")), 1)
96
+ h(y(o(s)("vuetify.tree.select.location.select")), 1)
96
97
  ]),
97
98
  _: 1
98
99
  })
@@ -102,8 +103,8 @@ const q = {
102
103
  ], 64);
103
104
  };
104
105
  }
105
- }), O = /* @__PURE__ */ j(z, [["__scopeId", "data-v-09118322"]]);
106
+ }), Q = /* @__PURE__ */ j(L, [["__scopeId", "data-v-09118322"]]);
106
107
  export {
107
- O as default
108
+ Q as default
108
109
  };
109
- //# sourceMappingURL=x-navigation-tree-select-CHoauT-L.js.map
110
+ //# sourceMappingURL=x-navigation-tree-select-_13SOFbP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-navigation-tree-select-_13SOFbP.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 * @beta\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 * @beta\n */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTreeSelect implementations.\n * @since 0.16\n * @beta\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":";;;;;;;AA+CA,MAAMA,IAAoC;AAAA,EACxC,kBAAkB;AACpB;;;;;;;;;;;;;;ACPA,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;AACp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AC,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,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;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ import { resolveComponent as o, createBlock as n, openBlock as t } from "vue";
2
+ import { _ as c } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const r = {};
4
+ function a(m, s) {
5
+ const e = o("v-autocomplete");
6
+ return t(), 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__ */ c(r, [["render", a]]);
17
+ export {
18
+ _ as default
19
+ };
20
+ //# sourceMappingURL=x-search-C7GhoCKj.js.map
@@ -1 +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
+ {"version":3,"file":"x-search-C7GhoCKj.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;;;"}
@@ -0,0 +1,39 @@
1
+ import { defineComponent as m, mergeModels as n, useModel as i, computed as d, createBlock as p, openBlock as c, unref as f } from "vue";
2
+ import { t as V } from "./translations-BVK9UR9x.js";
3
+ import { useI18n as b } from "vue-i18n";
4
+ import { e as g } from "./index-D8yc5V3N.js";
5
+ const M = /* @__PURE__ */ m({
6
+ __name: "x-select",
7
+ props: /* @__PURE__ */ n({
8
+ label: {},
9
+ items: {},
10
+ help: {},
11
+ required: { type: Boolean },
12
+ modelValue: {}
13
+ }, {
14
+ modelValue: {},
15
+ modelModifiers: {}
16
+ }),
17
+ emits: ["update:modelValue"],
18
+ setup(s) {
19
+ const t = s, r = i(s, "modelValue"), { t: o } = b({
20
+ messages: V
21
+ }), a = d(() => {
22
+ const e = [];
23
+ return t.required && e.push((l) => l ? !0 : o("vuetify.select.input.mandatory")), e;
24
+ });
25
+ return (e, l) => (c(), p(f(g), {
26
+ modelValue: r.value,
27
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => r.value = u),
28
+ label: e.label,
29
+ messages: e.help,
30
+ items: e.items,
31
+ rules: a.value,
32
+ clearable: !e.required
33
+ }, null, 8, ["modelValue", "label", "messages", "items", "rules", "clearable"]));
34
+ }
35
+ });
36
+ export {
37
+ M as default
38
+ };
39
+ //# sourceMappingURL=x-select-DnRsSLAX.js.map
@@ -1 +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
+ {"version":3,"file":"x-select-DnRsSLAX.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;;;"}
@@ -0,0 +1,49 @@
1
+ import { defineComponent as f, ref as i, resolveComponent as n, createBlock as b, openBlock as V, withCtx as a, createVNode as s, renderSlot as u } from "vue";
2
+ const x = /* @__PURE__ */ f({
3
+ __name: "x-tab-group",
4
+ emits: ["tab-change"],
5
+ setup(g, { emit: d }) {
6
+ const t = i(), m = d;
7
+ function r(e) {
8
+ typeof e == "string" && m("tab-change", e);
9
+ }
10
+ return (e, o) => {
11
+ const _ = n("v-tabs"), c = n("v-tabs-window"), p = n("v-card-text"), v = n("v-card");
12
+ return V(), b(v, { class: "mx-auto" }, {
13
+ default: a(() => [
14
+ s(_, {
15
+ modelValue: t.value,
16
+ "onUpdate:modelValue": [
17
+ o[0] || (o[0] = (l) => t.value = l),
18
+ r
19
+ ]
20
+ }, {
21
+ default: a(() => [
22
+ u(e.$slots, "tabs")
23
+ ]),
24
+ _: 3
25
+ }, 8, ["modelValue"]),
26
+ s(p, null, {
27
+ default: a(() => [
28
+ s(c, {
29
+ modelValue: t.value,
30
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => t.value = l)
31
+ }, {
32
+ default: a(() => [
33
+ u(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-BfEaq8Nj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-tab-group-BfEaq8Nj.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 } from \"vue\";\nimport type { 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":";;;;;AAsBA,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;;;;;;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { defineComponent as o, resolveComponent as n, createBlock as a, openBlock as r, withCtx as p, renderSlot as s } from "vue";
2
+ const m = /* @__PURE__ */ o({
3
+ __name: "x-tab-panel",
4
+ props: {
5
+ tabId: {}
6
+ },
7
+ setup(_) {
8
+ return (e, l) => {
9
+ const t = n("v-tabs-window-item");
10
+ return r(), a(t, { value: e.tabId }, {
11
+ default: p(() => [
12
+ s(e.$slots, "default")
13
+ ]),
14
+ _: 3
15
+ }, 8, ["value"]);
16
+ };
17
+ }
18
+ });
19
+ export {
20
+ m as default
21
+ };
22
+ //# sourceMappingURL=x-tab-panel-DysgiPCz.js.map
@@ -1 +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
+ {"version":3,"file":"x-tab-panel-DysgiPCz.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 type { 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;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { defineComponent as o, resolveComponent as a, createBlock as n, openBlock as r, withCtx as p, renderSlot as l } from "vue";
2
+ const u = /* @__PURE__ */ o({
3
+ __name: "x-tab",
4
+ props: {
5
+ tabId: {}
6
+ },
7
+ setup(s) {
8
+ return (e, _) => {
9
+ const t = a("v-tab");
10
+ return r(), n(t, { value: e.tabId }, {
11
+ default: p(() => [
12
+ l(e.$slots, "default")
13
+ ]),
14
+ _: 3
15
+ }, 8, ["value"]);
16
+ };
17
+ }
18
+ });
19
+ export {
20
+ u as default
21
+ };
22
+ //# sourceMappingURL=x-tab-vRrbUjdK.js.map
@@ -1 +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
+ {"version":3,"file":"x-tab-vRrbUjdK.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 type { 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,9 +1,10 @@
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
- import { t as c } from "./translations-BVK9UR9x.js";
3
- import { useI18n as h } from "vue-i18n";
4
- const q = /* @__PURE__ */ r({
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-D8yc5V3N.js";
5
+ const g = /* @__PURE__ */ s({
5
6
  __name: "x-text-field",
6
- props: /* @__PURE__ */ p({
7
+ props: /* @__PURE__ */ m({
7
8
  name: {},
8
9
  label: {},
9
10
  required: { type: Boolean },
@@ -18,27 +19,27 @@ const q = /* @__PURE__ */ r({
18
19
  }),
19
20
  emits: ["update:modelValue"],
20
21
  setup(t) {
21
- const { t: a } = h({
22
- messages: c
23
- }), s = t, l = d(t, "modelValue"), n = i(() => {
22
+ const { t: a } = c({
23
+ messages: V
24
+ }), n = t, l = p(t, "modelValue"), u = i(() => {
24
25
  const e = [];
25
- return s.required && e.push((o) => o ? !0 : a("vuetify.text.input.mandatory")), e;
26
+ return n.required && e.push((o) => o ? !0 : a("vuetify.text.input.mandatory")), e;
26
27
  });
27
- return (e, o) => (y(), m(f(V), {
28
+ return (e, o) => (f(), d(y(h), {
28
29
  modelValue: l.value,
29
- "onUpdate:modelValue": o[0] || (o[0] = (u) => l.value = u),
30
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => l.value = r),
30
31
  label: e.label,
31
32
  name: e.name,
32
33
  autofocus: e.autofocus,
33
34
  hint: e.help,
34
35
  "persistent-hint": e.help !== void 0,
35
- rules: n.value,
36
+ rules: u.value,
36
37
  readonly: e.readonly,
37
38
  type: e.type ?? "text"
38
39
  }, null, 8, ["modelValue", "label", "name", "autofocus", "hint", "persistent-hint", "rules", "readonly", "type"]));
39
40
  }
40
41
  });
41
42
  export {
42
- q as default
43
+ g as default
43
44
  };
44
- //# sourceMappingURL=x-text-field-DtCbDE_F.js.map
45
+ //# sourceMappingURL=x-text-field-BWaRETwR.js.map