@xwiki/cristal-dsvuetify 0.9.0 → 0.11.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 (86) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/componentsInit.d.ts +0 -1
  3. package/dist/components/vuetifyDesignSystemLoader.d.ts +0 -1
  4. package/dist/{index-CkW0K4NP.js → index-BMliq0dk.js} +7749 -7612
  5. package/dist/index-BMliq0dk.js.map +1 -0
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.es.js +7 -4
  8. package/dist/index.umd.js +12 -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 +2 -22
  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 +13 -0
  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-D8oy1BPL.js +40 -0
  34. package/dist/x-alert-D8oy1BPL.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-COSLRt5u.js → x-file-input-8euR7G64.js} +9 -9
  42. package/dist/{x-file-input-COSLRt5u.js.map → x-file-input-8euR7G64.js.map} +1 -1
  43. package/dist/{x-form-B5rljfJA.js → x-form-UiBYkCKP.js} +2 -2
  44. package/dist/{x-form-B5rljfJA.js.map → x-form-UiBYkCKP.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-DkVWsvlI.js +449 -0
  52. package/dist/x-navigation-tree-DkVWsvlI.js.map +1 -0
  53. package/dist/x-tab-group-ngNByee3.js +49 -0
  54. package/dist/{x-tab-group-DTR-H8Sn.js.map → x-tab-group-ngNByee3.js.map} +1 -1
  55. package/dist/{x-text-field-Ccv2SH00.js → x-text-field-uL1ePP_x.js} +6 -6
  56. package/dist/{x-text-field-Ccv2SH00.js.map → x-text-field-uL1ePP_x.js.map} +1 -1
  57. package/langs/translation-fr.json +1 -0
  58. package/package.json +11 -9
  59. package/src/components/vuetifyDesignSystemLoader.ts +23 -0
  60. package/src/vue/__tests__/utils/vuetify.ts +42 -0
  61. package/src/vue/__tests__/x-btn.test.ts +53 -0
  62. package/src/vue/css/style.css +4 -3
  63. package/src/vue/x-alert.vue +14 -17
  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 +204 -0
  71. package/src/vue/x-tab-group.vue +4 -2
  72. package/tsconfig.json +2 -1
  73. package/{src/vue.d.ts → vitest.config.ts} +17 -7
  74. package/dist/index-CkW0K4NP.js.map +0 -1
  75. package/dist/x-alert-Cm6mzRpR.js +0 -29
  76. package/dist/x-alert-Cm6mzRpR.js.map +0 -1
  77. package/dist/x-breadcrumb-DBZVExfF.js +0 -21
  78. package/dist/x-btn-DsACLwMY.js +0 -17
  79. package/dist/x-btn-DsACLwMY.js.map +0 -1
  80. package/dist/x-divider-7cmRuxTV.js +0 -16
  81. package/dist/x-divider-7cmRuxTV.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-tab-group-DTR-H8Sn.js +0 -49
@@ -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-CkW0K4NP.js";
5
- const k = /* @__PURE__ */ m({
4
+ import { b as v } from "./index-BMliq0dk.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-COSLRt5u.js.map
35
+ //# sourceMappingURL=x-file-input-8euR7G64.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-file-input-COSLRt5u.js","sources":["../src/vue/form/x-file-input.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TextFieldModel, TextFieldProps } from \"@xwiki/cristal-dsapi\";\nimport { computed } from \"vue\";\nimport { VFileInput } from \"vuetify/components/VFileInput\";\nimport messages from \"../../translations\";\nimport { useI18n } from \"vue-i18n\";\nimport { defineModel } from \"vue\";\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":["t","useI18n","messages","model","_useModel","__props","props","rules","computed","rulesList","value"],"mappings":";;;;;;;;;;;;;;;;AAQM,UAAA,EAAE,GAAAA,EAAE,IAAIC,EAAQ;AAAA,MACpB,UAAAC;AAAA,IAAA,CACD,GAEKC,IAAQC,EAA2BC,GAAA,YAAC,GACpCC,IAAQD,GAERE,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIH,EAAM,YACEG,EAAA,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IAAA,CACR;;;;;;;;;;"}
1
+ {"version":3,"file":"x-file-input-8euR7G64.js","sources":["../src/vue/form/x-file-input.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TextFieldModel, TextFieldProps } from \"@xwiki/cristal-dsapi\";\nimport { computed } from \"vue\";\nimport { VFileInput } from \"vuetify/components/VFileInput\";\nimport messages from \"../../translations\";\nimport { useI18n } from \"vue-i18n\";\nimport { defineModel } from \"vue\";\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":";;;;;;;;;;;;;;;;AAQM,UAAA,EAAE,EAAE,IAAIA,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAA2BC,GAAA,YAAC,GACpCC,IAAQD,GAERE,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIH,EAAM,YACEG,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-CkW0K4NP.js";
2
+ import { V as p } from "./index-BMliq0dk.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-B5rljfJA.js.map
32
+ //# sourceMappingURL=x-form-UiBYkCKP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-form-B5rljfJA.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-UiBYkCKP.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,449 @@
1
+ import { ref as y, computed as b, createVNode as f, mergeProps as V, Fragment as G, inject as X, shallowRef as Y, withModifiers as W, toRaw as B, toRef as w, provide as Z, defineComponent as ee, onBeforeMount as te, watch as ne, openBlock as L, createBlock as le, unref as ae, withCtx as ie, createElementBlock as $, toDisplayString as D } from "vue";
2
+ import { p as x, o as N, m as ce, g as S, u as E, c as M, d as oe, E as re, I as T, e as ue, f as de, h as U, i as se, j as ve, k as fe, l as he, n as ge, q as me, r as pe, s as j, t as Ie, v as we, w as q } from "./index-BMliq0dk.js";
3
+ import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const Ce = x({
5
+ ...N(ce({
6
+ collapseIcon: "$treeviewCollapse",
7
+ expandIcon: "$treeviewExpand"
8
+ }), ["subgroup"])
9
+ }, "VTreeviewGroup"), z = S()({
10
+ name: "VTreeviewGroup",
11
+ props: Ce(),
12
+ setup(e, g) {
13
+ let {
14
+ slots: h
15
+ } = g;
16
+ const l = y(), m = b(() => {
17
+ var a;
18
+ return (a = l.value) != null && a.isOpen ? e.collapseIcon : e.expandIcon;
19
+ }), s = b(() => {
20
+ var a;
21
+ return {
22
+ VTreeviewItem: {
23
+ prependIcon: void 0,
24
+ appendIcon: void 0,
25
+ active: (a = l.value) == null ? void 0 : a.isOpen,
26
+ toggleIcon: m.value
27
+ }
28
+ };
29
+ });
30
+ return E(() => {
31
+ const a = M.filterProps(e);
32
+ return f(M, V(a, {
33
+ ref: l,
34
+ class: ["v-treeview-group", e.class],
35
+ subgroup: !0
36
+ }), {
37
+ ...h,
38
+ activator: h.activator ? (p) => f(G, null, [f(oe, {
39
+ defaults: s.value
40
+ }, {
41
+ default: () => {
42
+ var v;
43
+ return [(v = h.activator) == null ? void 0 : v.call(h, p)];
44
+ }
45
+ })]) : void 0
46
+ });
47
+ }), {};
48
+ }
49
+ }), H = Symbol.for("vuetify:v-treeview"), be = x({
50
+ loading: Boolean,
51
+ onToggleExpand: re(),
52
+ toggleIcon: T,
53
+ ...ue({
54
+ slim: !0
55
+ })
56
+ }, "VTreeviewItem"), K = S()({
57
+ name: "VTreeviewItem",
58
+ props: be(),
59
+ setup(e, g) {
60
+ let {
61
+ attrs: h,
62
+ slots: l,
63
+ emit: m
64
+ } = g;
65
+ const s = de(e, h), a = y(), p = b(() => {
66
+ var t, c;
67
+ return ((t = a.value) == null ? void 0 : t.root.activatable.value) && ((c = a.value) == null ? void 0 : c.isGroupActivator);
68
+ }), v = b(() => {
69
+ var t;
70
+ return !e.disabled && e.link !== !1 && (e.link || s.isClickable.value || e.value != null && !!((t = a.value) != null && t.list) || p.value);
71
+ });
72
+ function i(t) {
73
+ var c, n, I, k;
74
+ !v.value || !p.value && ((c = a.value) != null && c.isGroupActivator) || (n = a.value) != null && n.root.activatable.value && ((k = a.value) == null || k.activate(!((I = a.value) != null && I.isActivated), t));
75
+ }
76
+ const u = X(H, {
77
+ visibleIds: y()
78
+ }).visibleIds;
79
+ return E(() => {
80
+ var n, I;
81
+ const t = N(U.filterProps(e), ["onClick"]), c = l.prepend || e.toggleIcon;
82
+ return f(U, V({
83
+ ref: a
84
+ }, t, {
85
+ active: (n = a.value) == null ? void 0 : n.isActivated,
86
+ class: ["v-treeview-item", {
87
+ "v-treeview-item--activatable-group-activator": p.value,
88
+ "v-treeview-item--filtered": u.value && !u.value.has((I = a.value) == null ? void 0 : I.id)
89
+ }, e.class],
90
+ ripple: !1,
91
+ onClick: e.onClick ?? i
92
+ }), {
93
+ ...l,
94
+ prepend: c ? (k) => {
95
+ var C;
96
+ return f(G, null, [e.toggleIcon && f(se, {
97
+ start: !1
98
+ }, {
99
+ default: () => [f(ve, {
100
+ density: "compact",
101
+ icon: e.toggleIcon,
102
+ loading: e.loading,
103
+ variant: "text",
104
+ onClick: e.onToggleExpand
105
+ }, {
106
+ loader() {
107
+ return f(fe, {
108
+ indeterminate: "disable-shrink",
109
+ size: "20",
110
+ width: "2"
111
+ }, null);
112
+ }
113
+ })]
114
+ }), (C = l.prepend) == null ? void 0 : C.call(l, k)]);
115
+ } : void 0
116
+ });
117
+ }), {};
118
+ }
119
+ }), J = x({
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: T,
132
+ default: "$checkboxIndeterminate"
133
+ },
134
+ falseIcon: T,
135
+ trueIcon: T,
136
+ returnObject: Boolean,
137
+ selectable: Boolean,
138
+ selectedColor: String,
139
+ selectStrategy: [String, Function, Object]
140
+ }, "VTreeviewChildren"), _ = S()({
141
+ name: "VTreeviewChildren",
142
+ props: J(),
143
+ setup(e, g) {
144
+ let {
145
+ emit: h,
146
+ slots: l
147
+ } = g;
148
+ const m = Y(null), s = b(() => e.openOnClick != null ? e.openOnClick : e.selectable);
149
+ function a(v) {
150
+ return new Promise((i) => {
151
+ var u, t;
152
+ if (!((u = e.items) != null && u.length) || !e.loadChildren) return i();
153
+ if (((t = v == null ? void 0 : v.children) == null ? void 0 : t.length) === 0) {
154
+ m.value = v.value, e.loadChildren(v).then(i);
155
+ return;
156
+ }
157
+ i();
158
+ }).finally(() => {
159
+ m.value = null;
160
+ });
161
+ }
162
+ function p(v, i) {
163
+ e.selectable && v(!i);
164
+ }
165
+ return () => {
166
+ var v, i;
167
+ return ((v = l.default) == null ? void 0 : v.call(l)) ?? ((i = e.items) == null ? void 0 : i.map((u) => {
168
+ var P;
169
+ let {
170
+ children: t,
171
+ props: c,
172
+ raw: n
173
+ } = u;
174
+ const I = m.value === n.value, k = {
175
+ prepend: (o) => {
176
+ var r;
177
+ return f(G, null, [e.selectable && (!t || t && !["leaf", "single-leaf"].includes(e.selectStrategy)) && f("div", null, [f(he, {
178
+ key: n.value,
179
+ modelValue: o.isSelected,
180
+ loading: I,
181
+ color: e.selectedColor,
182
+ indeterminate: o.isIndeterminate,
183
+ indeterminateIcon: e.indeterminateIcon,
184
+ falseIcon: e.falseIcon,
185
+ trueIcon: e.trueIcon,
186
+ onClick: W(() => p(o.select, o.isSelected), ["stop"]),
187
+ onKeydown: (d) => {
188
+ ["Enter", "Space"].includes(d.key) && (d.stopPropagation(), p(o.select, o.isSelected));
189
+ }
190
+ }, null)]), (r = l.prepend) == null ? void 0 : r.call(l, {
191
+ ...o,
192
+ item: n
193
+ })]);
194
+ },
195
+ append: l.append ? (o) => {
196
+ var r;
197
+ return (r = l.append) == null ? void 0 : r.call(l, {
198
+ ...o,
199
+ item: n
200
+ });
201
+ } : void 0,
202
+ title: l.title ? (o) => {
203
+ var r;
204
+ return (r = l.title) == null ? void 0 : r.call(l, {
205
+ ...o,
206
+ item: n
207
+ });
208
+ } : void 0
209
+ }, C = z.filterProps(c), A = _.filterProps(e);
210
+ return t ? f(z, V(C, {
211
+ value: e.returnObject ? n : C == null ? void 0 : C.value
212
+ }), {
213
+ activator: (o) => {
214
+ let {
215
+ props: r
216
+ } = o;
217
+ const d = {
218
+ ...c,
219
+ ...r,
220
+ value: c == null ? void 0 : c.value,
221
+ onToggleExpand: [() => a(n), r.onClick],
222
+ onClick: s.value ? [() => a(n), r.onClick] : void 0
223
+ };
224
+ return f(K, V(d, {
225
+ value: e.returnObject ? B(n) : c.value,
226
+ loading: I
227
+ }), k);
228
+ },
229
+ default: () => f(_, V(A, {
230
+ items: t,
231
+ returnObject: e.returnObject
232
+ }), l)
233
+ }) : ((P = l.item) == null ? void 0 : P.call(l, {
234
+ props: c
235
+ })) ?? f(K, V(c, {
236
+ value: e.returnObject ? B(n) : c.value
237
+ }), k);
238
+ }));
239
+ };
240
+ }
241
+ });
242
+ function Q(e) {
243
+ let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
244
+ for (const h of e)
245
+ g.push(h), h.children && Q(h.children, g);
246
+ return g;
247
+ }
248
+ const ye = x({
249
+ openAll: Boolean,
250
+ search: String,
251
+ ...ge({
252
+ filterKeys: ["title"]
253
+ }),
254
+ ...J(),
255
+ ...N(me({
256
+ collapseIcon: "$treeviewCollapse",
257
+ expandIcon: "$treeviewExpand",
258
+ slim: !0
259
+ }), ["itemType", "nav", "openStrategy"]),
260
+ modelValue: {
261
+ type: Array,
262
+ default: () => []
263
+ }
264
+ }, "VTreeview"), Ve = S()({
265
+ name: "VTreeview",
266
+ props: ye(),
267
+ emits: {
268
+ "update:opened": (e) => !0,
269
+ "update:activated": (e) => !0,
270
+ "update:selected": (e) => !0,
271
+ "update:modelValue": (e) => !0,
272
+ "click:open": (e) => !0,
273
+ "click:select": (e) => !0
274
+ },
275
+ setup(e, g) {
276
+ let {
277
+ slots: h
278
+ } = g;
279
+ const {
280
+ items: l
281
+ } = pe(e), m = w(e, "activeColor"), s = w(e, "baseColor"), a = w(e, "color"), p = j(e, "activated"), v = j(e, "modelValue"), i = j(e, "selected", e.modelValue), u = b({
282
+ get: () => i.value,
283
+ set(o) {
284
+ i.value = o, v.value = o;
285
+ }
286
+ }), t = y(), c = b(() => e.openAll ? P(l.value) : e.opened), n = b(() => Q(l.value)), I = w(e, "search"), {
287
+ filteredItems: k
288
+ } = Ie(e, n, I), C = b(() => {
289
+ var r;
290
+ if (!I.value) return null;
291
+ const o = (r = t.value) == null ? void 0 : r.getPath;
292
+ return o ? new Set(k.value.flatMap((d) => [...o(d.props.value), ...A(d.props.value)])) : null;
293
+ });
294
+ function A(o) {
295
+ var F, R;
296
+ const r = [], d = (((F = t.value) == null ? void 0 : F.children.get(o)) ?? []).slice();
297
+ for (; d.length; ) {
298
+ const O = d.shift();
299
+ O && (r.push(O), d.push(...(((R = t.value) == null ? void 0 : R.children.get(O)) ?? []).slice()));
300
+ }
301
+ return r;
302
+ }
303
+ function P(o) {
304
+ let r = [];
305
+ for (const d of o)
306
+ d.children && (r.push(e.returnObject ? B(d.raw) : d.value), d.children && (r = r.concat(P(d.children))));
307
+ return r;
308
+ }
309
+ return Z(H, {
310
+ visibleIds: C
311
+ }), we({
312
+ VTreeviewGroup: {
313
+ activeColor: m,
314
+ baseColor: s,
315
+ color: a,
316
+ collapseIcon: w(e, "collapseIcon"),
317
+ expandIcon: w(e, "expandIcon")
318
+ },
319
+ VTreeviewItem: {
320
+ activeClass: w(e, "activeClass"),
321
+ activeColor: m,
322
+ baseColor: s,
323
+ color: a,
324
+ density: w(e, "density"),
325
+ disabled: w(e, "disabled"),
326
+ lines: w(e, "lines"),
327
+ variant: w(e, "variant")
328
+ }
329
+ }), E(() => {
330
+ const o = q.filterProps(e), r = _.filterProps(e);
331
+ return f(q, V({
332
+ ref: t
333
+ }, o, {
334
+ class: ["v-treeview", e.class],
335
+ "open-strategy": "multiple",
336
+ style: e.style,
337
+ opened: c.value,
338
+ activated: p.value,
339
+ "onUpdate:activated": (d) => p.value = d,
340
+ selected: u.value,
341
+ "onUpdate:selected": (d) => u.value = d
342
+ }), {
343
+ default: () => [f(_, V(r, {
344
+ returnObject: e.returnObject,
345
+ items: l.value
346
+ }), h)]
347
+ });
348
+ }), {};
349
+ }
350
+ }), Pe = ["href", "onClick"], Te = ["href"], _e = /* @__PURE__ */ ee({
351
+ __name: "x-navigation-tree",
352
+ props: {
353
+ treeSource: {},
354
+ clickAction: { type: Function },
355
+ currentPage: {}
356
+ },
357
+ setup(e) {
358
+ const g = y([]), h = y(void 0), l = y(new Array()), m = y(new Array()), s = e;
359
+ te(async () => {
360
+ for (const i of await s.treeSource.getChildNodes(""))
361
+ g.value.push({
362
+ id: i.id,
363
+ title: i.label,
364
+ href: i.url,
365
+ children: i.has_children ? [] : void 0,
366
+ _location: i.location
367
+ });
368
+ s.currentPage !== void 0 && await a();
369
+ }), ne(
370
+ () => s.currentPage,
371
+ async () => {
372
+ s.currentPage && await a();
373
+ }
374
+ );
375
+ async function a() {
376
+ var c;
377
+ const i = s.treeSource.getParentNodesId(s.currentPage);
378
+ let u, t = g.value;
379
+ for (u = 0; u < i.length - 1; u++)
380
+ if (t)
381
+ for (const n of t)
382
+ n.id == i[u] && (((c = n.children) == null ? void 0 : c.length) == 0 && await p(n), m.value.includes(n.id) || m.value.push(n.id), t = n.children);
383
+ if (t)
384
+ for (const n of t)
385
+ n.id == i[u] && (l.value = [n.id], s.clickAction && s.clickAction({
386
+ id: n.id,
387
+ label: n.title,
388
+ location: n._location,
389
+ url: n.href,
390
+ has_children: n.children !== void 0
391
+ }));
392
+ }
393
+ async function p(i) {
394
+ var c;
395
+ const u = i, t = await s.treeSource.getChildNodes(u.id);
396
+ for (const n of t)
397
+ (c = u.children) == null || c.push({
398
+ id: n.id,
399
+ title: n.label,
400
+ href: n.url,
401
+ children: n.has_children ? [] : void 0,
402
+ _location: n.location
403
+ });
404
+ t.length == 0 && (u.children = void 0);
405
+ }
406
+ function v() {
407
+ l.value.length > 1 && l.value.pop();
408
+ }
409
+ return (i, u) => (L(), le(ae(Ve), {
410
+ ref_key: "tree",
411
+ ref: h,
412
+ opened: m.value,
413
+ "onUpdate:opened": u[0] || (u[0] = (t) => m.value = t),
414
+ density: "compact",
415
+ activated: l.value,
416
+ items: g.value,
417
+ "load-children": p,
418
+ activatable: "",
419
+ "active-strategy": "independent",
420
+ "item-value": "id",
421
+ "open-strategy": "multiple",
422
+ "onUpdate:activated": v
423
+ }, {
424
+ title: ie(({ item: t }) => [
425
+ s.clickAction ? (L(), $("a", {
426
+ key: 0,
427
+ href: t.href,
428
+ onClick: W((c) => {
429
+ l.value = [t.id], i.clickAction({
430
+ id: t.id,
431
+ label: t.title,
432
+ location: t._location,
433
+ url: t.href,
434
+ has_children: t.children !== void 0
435
+ });
436
+ }, ["prevent"])
437
+ }, D(t.title), 9, Pe)) : (L(), $("a", {
438
+ key: 1,
439
+ href: t.href
440
+ }, D(t.title), 9, Te))
441
+ ]),
442
+ _: 1
443
+ }, 8, ["opened", "activated", "items"]));
444
+ }
445
+ }), Oe = /* @__PURE__ */ ke(_e, [["__scopeId", "data-v-70f4d51b"]]);
446
+ export {
447
+ Oe as default
448
+ };
449
+ //# sourceMappingURL=x-navigation-tree-DkVWsvlI.js.map