@xwiki/cristal-dsvuetify 0.22.0 → 0.23.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 (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{index-D8yc5V3N.js → index-DuymNdmD.js} +8211 -7780
  3. package/dist/index-DuymNdmD.js.map +1 -0
  4. package/dist/index.es.js +5 -4
  5. package/dist/index.umd.js +10 -9
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/vue/form/x-form.vue.d.ts +178 -174
  8. package/dist/vue/x-menu-item.vue.d.ts +2 -4
  9. package/dist/vue/x-tree.vue.d.ts +14 -0
  10. package/dist/x-alert-CWUIStcc.js +46 -0
  11. package/dist/{x-alert-DKgk3dOE.js.map → x-alert-CWUIStcc.js.map} +1 -1
  12. package/dist/x-avatar-B5IoAQPQ.js +28 -0
  13. package/dist/{x-avatar-WnkeGyHH.js.map → x-avatar-B5IoAQPQ.js.map} +1 -1
  14. package/dist/x-checkbox-DPBHV522.js +28 -0
  15. package/dist/{x-checkbox-EzA-ce8R.js.map → x-checkbox-DPBHV522.js.map} +1 -1
  16. package/dist/x-dialog-C3nQDBym.js +49 -0
  17. package/dist/{x-dialog-CvZUbP80.js.map → x-dialog-C3nQDBym.js.map} +1 -1
  18. package/dist/{x-file-input-7TdHHaG2.js → x-file-input-BF8IdlrX.js} +13 -13
  19. package/dist/{x-file-input-7TdHHaG2.js.map → x-file-input-BF8IdlrX.js.map} +1 -1
  20. package/dist/{x-form-DrjHf0um.js → x-form-7_KNhAtf.js} +2 -2
  21. package/dist/{x-form-DrjHf0um.js.map → x-form-7_KNhAtf.js.map} +1 -1
  22. package/dist/x-menu-item-Ph5-wwcR.js +26 -0
  23. package/dist/{x-menu-item-CBdOhZc3.js.map → x-menu-item-Ph5-wwcR.js.map} +1 -1
  24. package/dist/{x-navigation-tree-BcW_691Y.js → x-navigation-tree-B5pIL2rS.js} +48 -48
  25. package/dist/{x-navigation-tree-BcW_691Y.js.map → x-navigation-tree-B5pIL2rS.js.map} +1 -1
  26. package/dist/x-navigation-tree-select-BHnoY91T.js +110 -0
  27. package/dist/{x-navigation-tree-select-_13SOFbP.js.map → x-navigation-tree-select-BHnoY91T.js.map} +1 -1
  28. package/dist/{x-select-DnRsSLAX.js → x-select-mVjAXRju.js} +14 -14
  29. package/dist/{x-select-DnRsSLAX.js.map → x-select-mVjAXRju.js.map} +1 -1
  30. package/dist/x-tab-B8YFmNK2.js +22 -0
  31. package/dist/{x-tab-vRrbUjdK.js.map → x-tab-B8YFmNK2.js.map} +1 -1
  32. package/dist/x-tab-panel-B7a_xbQd.js +22 -0
  33. package/dist/{x-tab-panel-DysgiPCz.js.map → x-tab-panel-B7a_xbQd.js.map} +1 -1
  34. package/dist/x-text-field-DTZ5xunG.js +45 -0
  35. package/dist/{x-text-field-BWaRETwR.js.map → x-text-field-DTZ5xunG.js.map} +1 -1
  36. package/dist/x-tree-iloM7Rw9.js +51 -0
  37. package/dist/x-tree-iloM7Rw9.js.map +1 -0
  38. package/package.json +16 -15
  39. package/src/components/vuetifyDesignSystemLoader.ts +1 -0
  40. package/src/vue/css/style.css +1 -0
  41. package/src/vue/x-menu-item.vue +4 -4
  42. package/src/vue/x-tree.vue +81 -0
  43. package/dist/index-D8yc5V3N.js.map +0 -1
  44. package/dist/x-alert-DKgk3dOE.js +0 -46
  45. package/dist/x-avatar-WnkeGyHH.js +0 -28
  46. package/dist/x-checkbox-EzA-ce8R.js +0 -28
  47. package/dist/x-dialog-CvZUbP80.js +0 -49
  48. package/dist/x-menu-item-CBdOhZc3.js +0 -22
  49. package/dist/x-navigation-tree-select-_13SOFbP.js +0 -110
  50. package/dist/x-tab-panel-DysgiPCz.js +0 -22
  51. package/dist/x-tab-vRrbUjdK.js +0 -22
  52. package/dist/x-text-field-BWaRETwR.js +0 -45
@@ -0,0 +1,81 @@
1
+ <!--
2
+ See the LICENSE file distributed with this work for additional
3
+ information regarding copyright ownership.
4
+
5
+ This is free software; you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as
7
+ published by the Free Software Foundation; either version 2.1 of
8
+ the License, or (at your option) any later version.
9
+
10
+ This software is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Lesser General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public
16
+ License along with this software; if not, write to the Free
17
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19
+ -->
20
+ <script setup lang="ts">
21
+ import { ref, watch } from "vue";
22
+ import { VTreeview } from "vuetify/components/VTreeview";
23
+ import type { DisplayableTreeNode, TreeProps } from "@xwiki/cristal-dsapi";
24
+ import type { Ref } from "vue";
25
+
26
+ defineProps<TreeProps>();
27
+ const opened = defineModel<string[]>("opened", { default: [] });
28
+ const activated = defineModel<string | undefined>("activated");
29
+
30
+ const activatedNodes: Ref<Array<string>> = ref([]);
31
+
32
+ watch(activated, resetActivated, { immediate: true });
33
+
34
+ function resetActivated() {
35
+ // Clicking on a node would activate it and this can't be disabled easily.
36
+ // With this listener, we ensure that only the node we want stays active.
37
+ activatedNodes.value = activated.value ? [activated.value] : [];
38
+ }
39
+
40
+ function updateActivated(newActivatedNode: DisplayableTreeNode) {
41
+ if (newActivatedNode.activatable) {
42
+ activated.value = newActivatedNode.id;
43
+ }
44
+ }
45
+ </script>
46
+
47
+ <template>
48
+ <v-treeview
49
+ density="compact"
50
+ :activated="activatedNodes"
51
+ :items="showRootNode ? [rootNode] : rootNode.children"
52
+ activatable
53
+ active-strategy="independent"
54
+ item-value="id"
55
+ v-model:opened="opened"
56
+ @update:activated="resetActivated"
57
+ >
58
+ <template #title="{ item }: { item: DisplayableTreeNode }">
59
+ <a :href="item.url" @click="updateActivated(item)">{{ item.label }}</a>
60
+ </template>
61
+ </v-treeview>
62
+ </template>
63
+
64
+ <style scoped>
65
+ /* Remove the background color from the root div element. */
66
+ .v-list {
67
+ background: none;
68
+ }
69
+ :deep(a) {
70
+ text-decoration: none;
71
+ color: var(--cr-base-text-color);
72
+ }
73
+ /* Disable hover on items. */
74
+ :deep(.v-list-item__overlay) {
75
+ --v-hover-opacity: 0;
76
+ }
77
+ /* Disable hand cursor on items, since we disable the default click action. */
78
+ :deep(.v-list-item--link) {
79
+ cursor: default;
80
+ }
81
+ </style>