@xwiki/cristal-dsvuetify 0.10.0 → 0.12.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 (87) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/componentsInit.d.ts +0 -1
  3. package/dist/components/vuetifyDesignSystemLoader.d.ts +1 -2
  4. package/dist/{index-BjjXwAdJ.js → index-DCILSBLH.js} +7359 -7287
  5. package/dist/index-DCILSBLH.js.map +1 -0
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.es.js +6 -4
  8. package/dist/index.umd.js +11 -7
  9. package/dist/index.umd.js.map +1 -1
  10. package/dist/{translations-CFfpgNrx.js → translations-BNEIsfPR.js} +3 -3
  11. package/dist/{translations-CFfpgNrx.js.map → translations-BNEIsfPR.js.map} +1 -1
  12. package/dist/vue/__tests__/utils/vuetify.d.ts +5 -0
  13. package/dist/vue/form/x-file-input.vue.d.ts +10 -31
  14. package/dist/vue/form/x-form.vue.d.ts +9 -4
  15. package/dist/vue/form/x-text-field.vue.d.ts +1 -11
  16. package/dist/vue/x-alert.vue.d.ts +15 -21
  17. package/dist/vue/x-avatar.vue.d.ts +3 -3
  18. package/dist/vue/x-breadcrumb.vue.d.ts +1 -11
  19. package/dist/vue/x-btn.vue.d.ts +9 -3
  20. package/dist/vue/x-card.vue.d.ts +3 -3
  21. package/dist/vue/x-dialog.vue.d.ts +11 -15
  22. package/dist/vue/x-divider.vue.d.ts +1 -1
  23. package/dist/vue/x-img.vue.d.ts +3 -3
  24. package/dist/vue/x-load.vue.d.ts +1 -2
  25. package/dist/vue/x-menu-item.vue.d.ts +12 -16
  26. package/dist/vue/x-menu-label.vue.d.ts +16 -0
  27. package/dist/vue/x-menu.vue.d.ts +9 -17
  28. package/dist/vue/x-navigation-tree.vue.d.ts +4 -16
  29. package/dist/vue/x-search.vue.d.ts +1 -1
  30. package/dist/vue/x-tab-group.vue.d.ts +10 -5
  31. package/dist/vue/x-tab-panel.vue.d.ts +8 -13
  32. package/dist/vue/x-tab.vue.d.ts +8 -13
  33. package/dist/x-alert-C3nY6ghP.js +42 -0
  34. package/dist/x-alert-C3nY6ghP.js.map +1 -0
  35. package/dist/x-breadcrumb-C2iUd4Sf.js +22 -0
  36. package/dist/{x-breadcrumb-DBZVExfF.js.map → x-breadcrumb-C2iUd4Sf.js.map} +1 -1
  37. package/dist/x-btn-DNlhiqjD.js +48 -0
  38. package/dist/x-btn-DNlhiqjD.js.map +1 -0
  39. package/dist/x-divider-Buudf0KI.js +12 -0
  40. package/dist/x-divider-Buudf0KI.js.map +1 -0
  41. package/dist/{x-file-input-B6XyfogW.js → x-file-input-BtGTZtfq.js} +9 -9
  42. package/dist/x-file-input-BtGTZtfq.js.map +1 -0
  43. package/dist/{x-form-leyAZnAr.js → x-form-pSj3365X.js} +2 -2
  44. package/dist/{x-form-leyAZnAr.js.map → x-form-pSj3365X.js.map} +1 -1
  45. package/dist/x-menu-DDC7z1Wb.js +31 -0
  46. package/dist/x-menu-DDC7z1Wb.js.map +1 -0
  47. package/dist/x-menu-item-ByE5R9Bf.js +22 -0
  48. package/dist/x-menu-item-ByE5R9Bf.js.map +1 -0
  49. package/dist/x-menu-label-DniImc0U.js +17 -0
  50. package/dist/x-menu-label-DniImc0U.js.map +1 -0
  51. package/dist/x-navigation-tree-W6QDS4uh.js +499 -0
  52. package/dist/x-navigation-tree-W6QDS4uh.js.map +1 -0
  53. package/dist/{x-text-field-B88odaud.js → x-text-field-CAVD3OjY.js} +6 -6
  54. package/dist/{x-text-field-B88odaud.js.map → x-text-field-CAVD3OjY.js.map} +1 -1
  55. package/package.json +13 -10
  56. package/src/components/componentsInit.ts +1 -1
  57. package/src/components/vuetifyDesignSystemLoader.ts +25 -6
  58. package/src/vue/__tests__/utils/vuetify.ts +43 -0
  59. package/src/vue/__tests__/x-btn.test.ts +54 -0
  60. package/src/vue/css/style.css +2 -0
  61. package/src/vue/form/x-file-input.vue +3 -4
  62. package/src/vue/form/x-text-field.vue +3 -3
  63. package/src/vue/x-alert.vue +14 -16
  64. package/src/vue/x-breadcrumb.vue +5 -1
  65. package/src/vue/x-btn.vue +34 -1
  66. package/src/vue/x-divider.vue +1 -1
  67. package/src/vue/x-menu-item.vue +2 -2
  68. package/src/vue/x-menu-label.vue +25 -0
  69. package/src/vue/x-menu.vue +13 -6
  70. package/src/vue/x-navigation-tree.vue +132 -11
  71. package/tsconfig.json +2 -1
  72. package/{src/vue.d.ts → vitest.config.ts} +17 -7
  73. package/dist/index-BjjXwAdJ.js.map +0 -1
  74. package/dist/x-alert-Cm6mzRpR.js +0 -29
  75. package/dist/x-alert-Cm6mzRpR.js.map +0 -1
  76. package/dist/x-breadcrumb-DBZVExfF.js +0 -21
  77. package/dist/x-btn-DsACLwMY.js +0 -17
  78. package/dist/x-btn-DsACLwMY.js.map +0 -1
  79. package/dist/x-divider-7cmRuxTV.js +0 -16
  80. package/dist/x-divider-7cmRuxTV.js.map +0 -1
  81. package/dist/x-file-input-B6XyfogW.js.map +0 -1
  82. package/dist/x-menu-VerLAd9F.js +0 -32
  83. package/dist/x-menu-VerLAd9F.js.map +0 -1
  84. package/dist/x-menu-item-DGurfOCF.js +0 -22
  85. package/dist/x-menu-item-DGurfOCF.js.map +0 -1
  86. package/dist/x-navigation-tree-B8JZ_wJm.js +0 -470
  87. package/dist/x-navigation-tree-B8JZ_wJm.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-btn-DNlhiqjD.js","sources":["../src/vue/x-btn.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport { computed } from \"vue\";\nimport type { BtnProps } from \"@xwiki/cristal-dsapi\";\n\nconst { variant } = defineProps<BtnProps>();\n\n// Map the variants to corresponding vuetify colors.\nconst color = computed(() => {\n let color = undefined;\n switch (variant) {\n case \"default\":\n break;\n case \"primary\":\n color = \"primary\";\n break;\n case \"success\":\n color = \"success\";\n break;\n case \"neutral\":\n color = \"secondary\";\n break;\n case \"warning\":\n color = \"warning\";\n break;\n case \"danger\":\n color = \"error\";\n break;\n }\n return color;\n});\n\nconst vVariant = computed(() => (variant == \"text\" ? \"text\" : \"tonal\"));\n</script>\n<template>\n <v-btn :color=\"color\" :variant=\"vVariant\">\n <slot />\n </v-btn>\n</template>\n"],"names":["color","computed","__props","vVariant"],"mappings":";;;;;;;AA0BM,UAAAA,IAAQC,EAAS,MAAM;AAC3B,UAAID;AACJ,cAAQE,EAAO,SAAE;AAAA,QACf,KAAK;AACH;AAAA,QACF,KAAK;AACHF,UAAAA,IAAQ;AACR;AAAA,QACF,KAAK;AACHA,UAAAA,IAAQ;AACR;AAAA,QACF,KAAK;AACHA,UAAAA,IAAQ;AACR;AAAA,QACF,KAAK;AACHA,UAAAA,IAAQ;AACR;AAAA,QACF,KAAK;AACHA,UAAAA,IAAQ;AACR;AAAA,MACJ;AACOA,aAAAA;AAAAA,IAAA,CACR,GAEKG,IAAWF,EAAS,MAAOC,EAAA,WAAW,SAAS,SAAS,OAAQ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,12 @@
1
+ import { resolveComponent as o, openBlock as r, createBlock as c } from "vue";
2
+ import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const t = {};
4
+ function _(i, s) {
5
+ const e = o("v-divider");
6
+ return r(), c(e);
7
+ }
8
+ const m = /* @__PURE__ */ n(t, [["render", _]]);
9
+ export {
10
+ m as default
11
+ };
12
+ //# sourceMappingURL=x-divider-Buudf0KI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-divider-Buudf0KI.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,10 +1,10 @@
1
- import { defineComponent as m, mergeModels as s, useModel as i, computed as d, openBlock as p, createBlock as f, unref as c } from "vue";
2
- import { m as V } from "./translations-CFfpgNrx.js";
1
+ import { defineComponent as s, mergeModels as m, useModel as i, computed as d, openBlock as p, createBlock as f, unref as c } from "vue";
2
+ import { t as V } from "./translations-BNEIsfPR.js";
3
3
  import { useI18n as b } from "vue-i18n";
4
- import { b as v } from "./index-BjjXwAdJ.js";
5
- const k = /* @__PURE__ */ m({
4
+ import { b as v } from "./index-DCILSBLH.js";
5
+ const k = /* @__PURE__ */ s({
6
6
  __name: "x-file-input",
7
- props: /* @__PURE__ */ s({
7
+ props: /* @__PURE__ */ m({
8
8
  name: {},
9
9
  label: {},
10
10
  required: { type: Boolean }
@@ -14,11 +14,11 @@ const k = /* @__PURE__ */ m({
14
14
  }),
15
15
  emits: ["update:modelValue"],
16
16
  setup(o) {
17
- const { t: u } = b({
17
+ const { t } = b({
18
18
  messages: V
19
- }), r = i(o, "modelValue"), t = o, n = d(() => {
19
+ }), r = i(o, "modelValue"), u = o, n = d(() => {
20
20
  const e = [];
21
- return t.required && e.push((l) => l ? !0 : u("vuetify.file.input.mandatory")), e;
21
+ return u.required && e.push((l) => l ? !0 : t("vuetify.file.input.mandatory")), e;
22
22
  });
23
23
  return (e, l) => (p(), f(c(v), {
24
24
  modelValue: r.value,
@@ -32,4 +32,4 @@ const k = /* @__PURE__ */ m({
32
32
  export {
33
33
  k as default
34
34
  };
35
- //# sourceMappingURL=x-file-input-B6XyfogW.js.map
35
+ //# sourceMappingURL=x-file-input-BtGTZtfq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-file-input-BtGTZtfq.js","sources":["../src/vue/form/x-file-input.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed, defineModel } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VFileInput } from \"vuetify/components/VFileInput\";\nimport type { TextFieldModel, TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst model = defineModel<TextFieldModel>();\nconst props = defineProps<TextFieldProps>();\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.file.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n\n<template>\n <v-file-input\n v-model=\"model\"\n :label=\"label\"\n :name=\"name\"\n :rules=\"rules\"\n ></v-file-input>\n</template>\n\n<style scoped></style>\n"],"names":["useI18n","messages","model","_useModel","props","__props","rules","computed","rulesList","value"],"mappings":";;;;;;;;;;;;;;;;AAOM,UAAA,EAAE,EAAE,IAAIA,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,iBAA4B,GACpCC,IAAQC,GAERC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIJ,EAAM,YACEI,EAAA,KAAK,CAACC,MACVA,IACK,KAEA,EAAE,8BAA8B,CAE1C,GAEID;AAAA,IAAA,CACR;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, resolveComponent as s, openBlock as c, createBlock as f, unref as u, withModifiers as a, withCtx as e, createVNode as _, renderSlot as l } from "vue";
2
- import { V as p } from "./index-BjjXwAdJ.js";
2
+ import { V as p } from "./index-DCILSBLH.js";
3
3
  const h = /* @__PURE__ */ i({
4
4
  __name: "x-form",
5
5
  emits: ["formSubmit"],
@@ -29,4 +29,4 @@ const h = /* @__PURE__ */ i({
29
29
  export {
30
30
  h as default
31
31
  };
32
- //# sourceMappingURL=x-form-leyAZnAr.js.map
32
+ //# sourceMappingURL=x-form-pSj3365X.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-form-leyAZnAr.js","sources":["../src/vue/form/x-form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { VForm } from \"vuetify/components/VForm\";\nconst emits = defineEmits([\"formSubmit\"]);\nfunction submit() {\n emits(\"formSubmit\");\n}\n</script>\n\n<template>\n <v-form @submit.prevent=\"submit\">\n <v-container>\n <slot></slot>\n </v-container>\n </v-form>\n</template>\n\n<style scoped></style>\n"],"names":["emits","__emit","submit"],"mappings":";;;;;;AAEA,UAAMA,IAAQC;AACd,aAASC,IAAS;AAChB,MAAAF,EAAM,YAAY;AAAA,IACpB;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"x-form-pSj3365X.js","sources":["../src/vue/form/x-form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { VForm } from \"vuetify/components/VForm\";\nconst emits = defineEmits([\"formSubmit\"]);\nfunction submit() {\n emits(\"formSubmit\");\n}\n</script>\n\n<template>\n <v-form @submit.prevent=\"submit\">\n <v-container>\n <slot></slot>\n </v-container>\n </v-form>\n</template>\n\n<style scoped></style>\n"],"names":["emits","__emit","submit"],"mappings":";;;;;;AAEA,UAAMA,IAAQC;AACd,aAASC,IAAS;AAChB,MAAAF,EAAM,YAAY;AAAA,IACpB;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,31 @@
1
+ import { resolveComponent as o, openBlock as s, createBlock as l, withCtx as e, createElementVNode as i, normalizeProps as d, guardReactiveProps as _, renderSlot as n, createVNode as u } from "vue";
2
+ import { _ as f } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const p = {};
4
+ function m(t, v) {
5
+ const a = o("v-list"), r = o("v-menu");
6
+ return s(), l(r, {
7
+ "close-on-content-click": !1,
8
+ attach: "#xwCristalApp",
9
+ "z-index": "initial"
10
+ }, {
11
+ activator: e(({ props: c }) => [
12
+ i("span", d(_(c)), [
13
+ n(t.$slots, "activator", {}, void 0, !0)
14
+ ], 16)
15
+ ]),
16
+ default: e(() => [
17
+ u(a, null, {
18
+ default: e(() => [
19
+ n(t.$slots, "default", {}, void 0, !0)
20
+ ]),
21
+ _: 3
22
+ })
23
+ ]),
24
+ _: 3
25
+ });
26
+ }
27
+ const k = /* @__PURE__ */ f(p, [["render", m], ["__scopeId", "data-v-ef2ba5a0"]]);
28
+ export {
29
+ k as default
30
+ };
31
+ //# sourceMappingURL=x-menu-DDC7z1Wb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-menu-DDC7z1Wb.js","sources":["../src/vue/x-menu.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup></script>\n<template>\n <!-- v-menu needs to be attached inside Cristal DOM to fix its z-index.\n We also reset the default z-index to set it in the style section. -->\n <v-menu\n :close-on-content-click=\"false\"\n attach=\"#xwCristalApp\"\n z-index=\"initial\"\n >\n <template #activator=\"{ props }\">\n <span v-bind=\"props\">\n <slot name=\"activator\" />\n </span>\n </template>\n <v-list>\n <slot name=\"default\" />\n </v-list>\n </v-menu>\n</template>\n<style scoped>\n.v-overlay {\n z-index: var(--cr-z-index-dropdown);\n}\n</style>\n"],"names":["_openBlock","_createBlock","_component_v_menu","_withCtx","props","_normalizeProps","_guardReactiveProps","_createVNode","_component_v_list"],"mappings":";;;;;AAwBK,SAAAA,EAAA,GAAAC,EAA6BC,GAAA;AAAA,IAC9B,0BAAsB;AAAA,IACtB,QAAA;AAAA;KAEoB;AAAA,eAGXC,EAAA,CAAA,EAAA,OAAAC,QA/Bb;AAAA,QA8BiC,QAAAC,EAAAC,EAAAF,CAAA,CAAA,GAAA;AAAA;;IA9BjC,CAAA;AAAA,aAmCaD,EAAA,MAAA;AAAA,MAnCbI,EAAAC,GAkC6B,MAAA;AAAA,iBAAAL,EAAA,MAAA;AAAA;SAlC7B;AAAA;;KAAA;AAAA;;;;"}
@@ -0,0 +1,22 @@
1
+ import { defineComponent as o, resolveComponent as n, openBlock as l, createBlock as r, withCtx as a, renderSlot as s } from "vue";
2
+ const _ = /* @__PURE__ */ o({
3
+ __name: "x-menu-item",
4
+ props: {
5
+ value: {}
6
+ },
7
+ setup(m) {
8
+ return (e, p) => {
9
+ const t = n("v-list-item");
10
+ return l(), r(t, { value: e.value }, {
11
+ default: a(() => [
12
+ s(e.$slots, "default")
13
+ ]),
14
+ _: 3
15
+ }, 8, ["value"]);
16
+ };
17
+ }
18
+ });
19
+ export {
20
+ _ as default
21
+ };
22
+ //# sourceMappingURL=x-menu-item-ByE5R9Bf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-menu-item-ByE5R9Bf.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,17 @@
1
+ import { resolveComponent as o, openBlock as r, createBlock as n, withCtx as s, renderSlot as c } from "vue";
2
+ import { _ as l } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const _ = {};
4
+ function a(e, f) {
5
+ const t = o("v-list-subheader");
6
+ return r(), n(t, null, {
7
+ default: s(() => [
8
+ c(e.$slots, "default")
9
+ ]),
10
+ _: 3
11
+ });
12
+ }
13
+ const i = /* @__PURE__ */ l(_, [["render", a]]);
14
+ export {
15
+ i as default
16
+ };
17
+ //# sourceMappingURL=x-menu-label-DniImc0U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-menu-label-DniImc0U.js","sources":["../src/vue/x-menu-label.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup></script>\n<template>\n <v-list-subheader>\n <slot name=\"default\" />\n </v-list-subheader>\n</template>\n"],"names":["_openBlock","_createBlock","_component_v_list_subheader","_withCtx"],"mappings":";;;;;AAAA,SAAAA,EAsBI,GAAuBC,EAAAC,GAAA,MAAA;AAAA,aAAAC,EAAA,MAAA;AAAA;KAtB3B;AAAA;;;;"}
@@ -0,0 +1,499 @@
1
+ import { ref as P, computed as V, createVNode as g, mergeProps as T, Fragment as G, inject as W, reactive as Y, withModifiers as H, toRaw as S, toRef as y, provide as Z, defineComponent as ee, onBeforeMount as te, watch as ne, openBlock as j, createBlock as ae, unref as ie, withCtx as le, createElementBlock as $, toDisplayString as R } from "vue";
2
+ import { p as O, o as D, m as oe, g as L, u as E, c as U, d as re, E as ce, I as x, e as de, f as se, h as M, i as ue, j as ve, k as fe, l as he, n as ge, q as me, r as Ie, s as B, t as we, v as pe, w as q } from "./index-DCILSBLH.js";
3
+ import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const Ce = O({
5
+ ...D(oe({
6
+ collapseIcon: "$treeviewCollapse",
7
+ expandIcon: "$treeviewExpand"
8
+ }), ["subgroup"])
9
+ }, "VTreeviewGroup"), z = L()({
10
+ name: "VTreeviewGroup",
11
+ props: Ce(),
12
+ setup(e, I) {
13
+ let {
14
+ slots: i
15
+ } = I;
16
+ const u = P(), p = V(() => {
17
+ var o;
18
+ return (o = u.value) != null && o.isOpen ? e.collapseIcon : e.expandIcon;
19
+ }), b = V(() => {
20
+ var o;
21
+ return {
22
+ VTreeviewItem: {
23
+ prependIcon: void 0,
24
+ appendIcon: void 0,
25
+ active: (o = u.value) == null ? void 0 : o.isOpen,
26
+ toggleIcon: p.value
27
+ }
28
+ };
29
+ });
30
+ return E(() => {
31
+ const o = U.filterProps(e);
32
+ return g(U, T(o, {
33
+ ref: u,
34
+ class: ["v-treeview-group", e.class],
35
+ subgroup: !0
36
+ }), {
37
+ ...i,
38
+ activator: i.activator ? (v) => g(G, null, [g(re, {
39
+ defaults: b.value
40
+ }, {
41
+ default: () => {
42
+ var f;
43
+ return [(f = i.activator) == null ? void 0 : f.call(i, v)];
44
+ }
45
+ })]) : void 0
46
+ });
47
+ }), {};
48
+ }
49
+ }), J = Symbol.for("vuetify:v-treeview"), be = O({
50
+ loading: Boolean,
51
+ onToggleExpand: ce(),
52
+ toggleIcon: x,
53
+ ...de({
54
+ slim: !0
55
+ })
56
+ }, "VTreeviewItem"), K = L()({
57
+ name: "VTreeviewItem",
58
+ props: be(),
59
+ setup(e, I) {
60
+ let {
61
+ attrs: i,
62
+ slots: u,
63
+ emit: p
64
+ } = I;
65
+ const b = se(e, i), o = P(), v = V(() => {
66
+ var s, w;
67
+ return ((s = o.value) == null ? void 0 : s.root.activatable.value) && ((w = o.value) == null ? void 0 : w.isGroupActivator);
68
+ }), f = V(() => {
69
+ var s;
70
+ return !e.disabled && e.link !== !1 && (e.link || b.isClickable.value || e.value != null && !!((s = o.value) != null && s.list) || v.value);
71
+ });
72
+ function d(s) {
73
+ var w, C, l, r;
74
+ !f.value || !v.value && ((w = o.value) != null && w.isGroupActivator) || (C = o.value) != null && C.root.activatable.value && ((r = o.value) == null || r.activate(!((l = o.value) != null && l.isActivated), s));
75
+ }
76
+ const k = W(J, {
77
+ visibleIds: P()
78
+ }).visibleIds;
79
+ return E(() => {
80
+ var C, l;
81
+ const s = D(M.filterProps(e), ["onClick"]), w = u.prepend || e.toggleIcon;
82
+ return g(M, T({
83
+ ref: o
84
+ }, s, {
85
+ active: (C = o.value) == null ? void 0 : C.isActivated,
86
+ class: ["v-treeview-item", {
87
+ "v-treeview-item--activatable-group-activator": v.value,
88
+ "v-treeview-item--filtered": k.value && !k.value.has((l = o.value) == null ? void 0 : l.id)
89
+ }, e.class],
90
+ ripple: !1,
91
+ onClick: e.onClick ?? d
92
+ }), {
93
+ ...u,
94
+ prepend: w ? (r) => {
95
+ var t;
96
+ return g(G, null, [e.toggleIcon && g(ue, {
97
+ start: !1
98
+ }, {
99
+ default: () => [g(ve, {
100
+ density: "compact",
101
+ icon: e.toggleIcon,
102
+ loading: e.loading,
103
+ variant: "text",
104
+ onClick: e.onToggleExpand
105
+ }, {
106
+ loader() {
107
+ return g(fe, {
108
+ indeterminate: "disable-shrink",
109
+ size: "20",
110
+ width: "2"
111
+ }, null);
112
+ }
113
+ })]
114
+ }), (t = u.prepend) == null ? void 0 : t.call(u, r)]);
115
+ } : void 0
116
+ });
117
+ }), {};
118
+ }
119
+ }), Q = O({
120
+ loadChildren: Function,
121
+ loadingIcon: {
122
+ type: String,
123
+ default: "$loading"
124
+ },
125
+ items: Array,
126
+ openOnClick: {
127
+ type: Boolean,
128
+ default: void 0
129
+ },
130
+ indeterminateIcon: {
131
+ type: x,
132
+ default: "$checkboxIndeterminate"
133
+ },
134
+ falseIcon: x,
135
+ trueIcon: x,
136
+ returnObject: Boolean,
137
+ selectable: Boolean,
138
+ selectedColor: String,
139
+ selectStrategy: [String, Function, Object]
140
+ }, "VTreeviewChildren"), A = L()({
141
+ name: "VTreeviewChildren",
142
+ props: Q(),
143
+ setup(e, I) {
144
+ let {
145
+ slots: i
146
+ } = I;
147
+ const u = Y(/* @__PURE__ */ new Set()), p = V(() => e.openOnClick != null ? e.openOnClick : e.selectable);
148
+ async function b(v) {
149
+ var f, d;
150
+ try {
151
+ if (!((f = e.items) != null && f.length) || !e.loadChildren) return;
152
+ ((d = v == null ? void 0 : v.children) == null ? void 0 : d.length) === 0 && (u.add(v.value), await e.loadChildren(v.raw));
153
+ } finally {
154
+ u.delete(v.value);
155
+ }
156
+ }
157
+ function o(v, f) {
158
+ e.selectable && v(!f);
159
+ }
160
+ return () => {
161
+ var v, f;
162
+ return ((v = i.default) == null ? void 0 : v.call(i)) ?? ((f = e.items) == null ? void 0 : f.map((d) => {
163
+ var t;
164
+ const {
165
+ children: k,
166
+ props: s
167
+ } = d, w = u.has(d.value), C = {
168
+ prepend: (n) => {
169
+ var a;
170
+ return g(G, null, [e.selectable && (!k || k && !["leaf", "single-leaf"].includes(e.selectStrategy)) && g("div", null, [g(he, {
171
+ key: d.value,
172
+ modelValue: n.isSelected,
173
+ loading: w,
174
+ color: e.selectedColor,
175
+ indeterminate: n.isIndeterminate,
176
+ indeterminateIcon: e.indeterminateIcon,
177
+ falseIcon: e.falseIcon,
178
+ trueIcon: e.trueIcon,
179
+ onClick: H(() => o(n.select, n.isSelected), ["stop"]),
180
+ onKeydown: (c) => {
181
+ ["Enter", "Space"].includes(c.key) && (c.stopPropagation(), o(n.select, n.isSelected));
182
+ }
183
+ }, null)]), (a = i.prepend) == null ? void 0 : a.call(i, {
184
+ ...n,
185
+ item: d.raw,
186
+ internalItem: d
187
+ })]);
188
+ },
189
+ append: i.append ? (n) => {
190
+ var a;
191
+ return (a = i.append) == null ? void 0 : a.call(i, {
192
+ ...n,
193
+ item: d.raw,
194
+ internalItem: d
195
+ });
196
+ } : void 0,
197
+ title: i.title ? (n) => {
198
+ var a;
199
+ return (a = i.title) == null ? void 0 : a.call(i, {
200
+ ...n,
201
+ item: d.raw,
202
+ internalItem: d
203
+ });
204
+ } : void 0
205
+ }, l = z.filterProps(s), r = A.filterProps(e);
206
+ return k ? g(z, T(l, {
207
+ value: e.returnObject ? d.raw : l == null ? void 0 : l.value
208
+ }), {
209
+ activator: (n) => {
210
+ let {
211
+ props: a
212
+ } = n;
213
+ const c = {
214
+ ...s,
215
+ ...a,
216
+ value: s == null ? void 0 : s.value,
217
+ onToggleExpand: [() => b(d), a.onClick],
218
+ onClick: p.value ? [() => b(d), a.onClick] : void 0
219
+ };
220
+ return g(K, T(c, {
221
+ value: e.returnObject ? S(d.raw) : s.value,
222
+ loading: w
223
+ }), C);
224
+ },
225
+ default: () => g(A, T(r, {
226
+ items: k,
227
+ returnObject: e.returnObject
228
+ }), i)
229
+ }) : ((t = i.item) == null ? void 0 : t.call(i, {
230
+ props: s,
231
+ item: d.raw,
232
+ internalItem: d
233
+ })) ?? g(K, T(s, {
234
+ value: e.returnObject ? S(d.raw) : s.value
235
+ }), C);
236
+ }));
237
+ };
238
+ }
239
+ });
240
+ function X(e) {
241
+ let I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
242
+ for (const i of e)
243
+ I.push(i), i.children && X(i.children, I);
244
+ return I;
245
+ }
246
+ const ye = O({
247
+ openAll: Boolean,
248
+ search: String,
249
+ ...ge({
250
+ filterKeys: ["title"]
251
+ }),
252
+ ...Q(),
253
+ ...D(me({
254
+ collapseIcon: "$treeviewCollapse",
255
+ expandIcon: "$treeviewExpand",
256
+ slim: !0
257
+ }), ["itemType", "nav", "openStrategy"]),
258
+ modelValue: {
259
+ type: Array,
260
+ default: () => []
261
+ }
262
+ }, "VTreeview"), Ve = L()({
263
+ name: "VTreeview",
264
+ props: ye(),
265
+ emits: {
266
+ "update:opened": (e) => !0,
267
+ "update:activated": (e) => !0,
268
+ "update:selected": (e) => !0,
269
+ "update:modelValue": (e) => !0,
270
+ "click:open": (e) => !0,
271
+ "click:select": (e) => !0
272
+ },
273
+ setup(e, I) {
274
+ let {
275
+ slots: i
276
+ } = I;
277
+ const {
278
+ items: u
279
+ } = Ie(e), p = y(e, "activeColor"), b = y(e, "baseColor"), o = y(e, "color"), v = B(e, "activated"), f = B(e, "modelValue"), d = B(e, "selected", e.modelValue), k = V({
280
+ get: () => d.value,
281
+ set(c) {
282
+ d.value = c, f.value = c;
283
+ }
284
+ }), s = P(), w = V(() => e.openAll ? a(u.value) : e.opened), C = V(() => X(u.value)), l = y(e, "search"), {
285
+ filteredItems: r
286
+ } = we(e, C, l), t = V(() => {
287
+ var m;
288
+ if (!l.value) return null;
289
+ const c = (m = s.value) == null ? void 0 : m.getPath;
290
+ return c ? new Set(r.value.flatMap((h) => {
291
+ const _ = e.returnObject ? h.raw : h.props.value;
292
+ return [...c(_), ...n(_)].map(S);
293
+ })) : null;
294
+ });
295
+ function n(c) {
296
+ var _, F;
297
+ const m = [], h = (((_ = s.value) == null ? void 0 : _.children.get(c)) ?? []).slice();
298
+ for (; h.length; ) {
299
+ const N = h.shift();
300
+ N && (m.push(N), h.push(...(((F = s.value) == null ? void 0 : F.children.get(N)) ?? []).slice()));
301
+ }
302
+ return m;
303
+ }
304
+ function a(c) {
305
+ let m = [];
306
+ for (const h of c)
307
+ h.children && (m.push(e.returnObject ? S(h.raw) : h.value), h.children && (m = m.concat(a(h.children))));
308
+ return m;
309
+ }
310
+ return Z(J, {
311
+ visibleIds: t
312
+ }), pe({
313
+ VTreeviewGroup: {
314
+ activeColor: p,
315
+ baseColor: b,
316
+ color: o,
317
+ collapseIcon: y(e, "collapseIcon"),
318
+ expandIcon: y(e, "expandIcon")
319
+ },
320
+ VTreeviewItem: {
321
+ activeClass: y(e, "activeClass"),
322
+ activeColor: p,
323
+ baseColor: b,
324
+ color: o,
325
+ density: y(e, "density"),
326
+ disabled: y(e, "disabled"),
327
+ lines: y(e, "lines"),
328
+ variant: y(e, "variant")
329
+ }
330
+ }), E(() => {
331
+ const c = q.filterProps(e), m = A.filterProps(e);
332
+ return g(q, T({
333
+ ref: s
334
+ }, c, {
335
+ class: ["v-treeview", e.class],
336
+ "open-strategy": "multiple",
337
+ style: e.style,
338
+ opened: w.value,
339
+ activated: v.value,
340
+ "onUpdate:activated": (h) => v.value = h,
341
+ selected: k.value,
342
+ "onUpdate:selected": (h) => k.value = h
343
+ }), {
344
+ default: () => [g(A, T(m, {
345
+ returnObject: e.returnObject,
346
+ items: u.value
347
+ }), i)]
348
+ });
349
+ }), {};
350
+ }
351
+ }), Pe = ["href", "onClick"], Te = ["href"], _e = /* @__PURE__ */ ee({
352
+ __name: "x-navigation-tree",
353
+ props: {
354
+ clickAction: { type: Function },
355
+ currentPage: {}
356
+ },
357
+ setup(e) {
358
+ const I = W("cristal"), i = I.getContainer().get("DocumentService"), u = I.getContainer().get("NavigationTreeSourceProvider").get(), p = P([]), b = P(void 0), o = P(new Array()), v = P(new Array()), f = e;
359
+ te(async () => {
360
+ for (const l of await u.getChildNodes(""))
361
+ p.value.push({
362
+ id: l.id,
363
+ title: l.label,
364
+ href: l.url,
365
+ children: l.has_children ? [] : void 0,
366
+ _location: l.location
367
+ });
368
+ f.currentPage !== void 0 && await d(), i.registerDocumentChangeListener("delete", w), i.registerDocumentChangeListener("update", C);
369
+ }), ne(
370
+ () => f.currentPage,
371
+ async () => {
372
+ f.currentPage && await d();
373
+ }
374
+ );
375
+ async function d() {
376
+ var n;
377
+ const l = u.getParentNodesId(f.currentPage);
378
+ let r, t = p.value;
379
+ for (r = 0; r < l.length - 1; r++)
380
+ if (t)
381
+ for (const a of t)
382
+ a.id == l[r] && (((n = a.children) == null ? void 0 : n.length) == 0 && await k(a), v.value.includes(a.id) || v.value.push(a.id), t = a.children);
383
+ if (t)
384
+ for (const a of t)
385
+ a.id == l[r] && (o.value = [a.id], f.clickAction && f.clickAction({
386
+ id: a.id,
387
+ label: a.title,
388
+ location: a._location,
389
+ url: a.href,
390
+ has_children: a.children !== void 0
391
+ }));
392
+ }
393
+ async function k(l) {
394
+ var n;
395
+ const r = l, t = await u.getChildNodes(r.id);
396
+ for (const a of t)
397
+ (n = r.children) == null || n.push({
398
+ id: a.id,
399
+ title: a.label,
400
+ href: a.url,
401
+ children: a.has_children ? [] : void 0,
402
+ _location: a.location
403
+ });
404
+ t.length == 0 && (r.children = void 0);
405
+ }
406
+ function s() {
407
+ o.value.length > 1 && o.value.pop();
408
+ }
409
+ async function w(l) {
410
+ const r = u.getParentNodesId(l);
411
+ let t = p.value;
412
+ for (; t; )
413
+ for (const n of t.keys())
414
+ if (t[n].id == r[0])
415
+ if (r.length == 1) {
416
+ t.splice(n, 1);
417
+ return;
418
+ } else {
419
+ t = t[n].children, r.shift();
420
+ break;
421
+ }
422
+ }
423
+ async function C(l) {
424
+ const r = u.getParentNodesId(l);
425
+ let t, n = p.value;
426
+ for (; n; ) {
427
+ for (const c of n.keys())
428
+ if (n[c].id == r[0])
429
+ if (r.length == 1) {
430
+ const m = await u.getChildNodes(
431
+ t || ""
432
+ );
433
+ for (const h of m)
434
+ if (h.id == n[c].id) {
435
+ n[c].title = h.label;
436
+ return;
437
+ }
438
+ } else {
439
+ t = n[c].id, n = n[c].children, r.shift();
440
+ break;
441
+ }
442
+ const a = await u.getChildNodes(
443
+ t || ""
444
+ );
445
+ e: for (const c of a) {
446
+ for (const m of n.keys())
447
+ if (c.id == n[m].id)
448
+ continue e;
449
+ n.push({
450
+ id: c.id,
451
+ title: c.label,
452
+ href: c.url,
453
+ children: c.has_children ? [] : void 0,
454
+ _location: c.location
455
+ });
456
+ }
457
+ }
458
+ }
459
+ return (l, r) => (j(), ae(ie(Ve), {
460
+ ref_key: "tree",
461
+ ref: b,
462
+ opened: v.value,
463
+ "onUpdate:opened": r[0] || (r[0] = (t) => v.value = t),
464
+ density: "compact",
465
+ activated: o.value,
466
+ items: p.value,
467
+ "load-children": k,
468
+ activatable: "",
469
+ "active-strategy": "independent",
470
+ "item-value": "id",
471
+ "open-strategy": "multiple",
472
+ "onUpdate:activated": s
473
+ }, {
474
+ title: le(({ item: t }) => [
475
+ f.clickAction ? (j(), $("a", {
476
+ key: 0,
477
+ href: t.href,
478
+ onClick: H((n) => {
479
+ o.value = [t.id], l.clickAction({
480
+ id: t.id,
481
+ label: t.title,
482
+ location: t._location,
483
+ url: t.href,
484
+ has_children: t.children !== void 0
485
+ });
486
+ }, ["prevent"])
487
+ }, R(t.title), 9, Pe)) : (j(), $("a", {
488
+ key: 1,
489
+ href: t.href
490
+ }, R(t.title), 9, Te))
491
+ ]),
492
+ _: 1
493
+ }, 8, ["opened", "activated", "items"]));
494
+ }
495
+ }), Oe = /* @__PURE__ */ ke(_e, [["__scopeId", "data-v-cf1d31bb"]]);
496
+ export {
497
+ Oe as default
498
+ };
499
+ //# sourceMappingURL=x-navigation-tree-W6QDS4uh.js.map