@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
@@ -1,29 +0,0 @@
1
- import { resolveComponent as o, openBlock as n, createBlock as p, withCtx as c, renderSlot as l } from "vue";
2
- import { _ as s } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- const i = {
4
- components: {},
5
- props: {
6
- title: { type: String, required: !0 },
7
- type: {
8
- type: Object,
9
- required: !0
10
- }
11
- }
12
- };
13
- function a(e, _, t, u, d, f) {
14
- const r = o("v-alert");
15
- return n(), p(r, {
16
- title: t.title,
17
- type: t.type
18
- }, {
19
- default: c(() => [
20
- l(e.$slots, "default")
21
- ]),
22
- _: 3
23
- }, 8, ["title", "type"]);
24
- }
25
- const x = /* @__PURE__ */ s(i, [["render", a]]);
26
- export {
27
- x as default
28
- };
29
- //# sourceMappingURL=x-alert-Cm6mzRpR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-alert-Cm6mzRpR.js","sources":["../src/vue/x-alert.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<template>\n <v-alert :title=\"title\" :type=\"type\">\n <slot />\n </v-alert>\n</template>\n<script lang=\"ts\">\nimport type { PropType } from \"vue\";\nimport type { VAlert } from \"vuetify/lib/components/VAlert/index.mjs\";\n\nexport default {\n components: {},\n props: {\n title: { type: String, required: true },\n type: {\n type: Object as PropType<VAlert[\"type\"] | undefined>,\n required: true,\n },\n },\n};\n</script>\n"],"names":["_sfc_main","_resolveComponent","_openBlock","_createBlock","_component_v_alert","$props","_renderSlot","_ctx"],"mappings":";;AA4BA,MAAeA,IAAA;AAAA,EACb,YAAY,CAAC;AAAA,EACb,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ,UAAU,GAAK;AAAA,IACtC,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,EACF;AACF;;YAjBEC,EAEU,SAAA;SAFqBC,EAAI,GAAAC,EAAAC,GAAA;AAAA,IAAA,OAAAC,EAAA;AAAA,IApBrC,MAAAA,EAAA;AAAA,EAAA,GAAA;AAAA;MAAAC,EAAAC,EAAA,QAAA,SAAA;AAAA,IAAA,CAAA;AAAA;;;;"}
@@ -1,21 +0,0 @@
1
- import { defineComponent as s, computed as c, resolveComponent as p, openBlock as u, createBlock as a } from "vue";
2
- const _ = /* @__PURE__ */ s({
3
- __name: "x-breadcrumb",
4
- props: {
5
- items: {}
6
- },
7
- setup(r) {
8
- const o = r, n = c(() => o.items.map(({ label: e, url: t }) => ({
9
- title: e,
10
- href: t
11
- })));
12
- return (e, t) => {
13
- const m = p("v-breadcrumbs");
14
- return u(), a(m, { items: n.value }, null, 8, ["items"]);
15
- };
16
- }
17
- });
18
- export {
19
- _ as default
20
- };
21
- //# sourceMappingURL=x-breadcrumb-DBZVExfF.js.map
@@ -1,17 +0,0 @@
1
- import { resolveComponent as o, openBlock as n, createBlock as r, withCtx as c, renderSlot as _ } from "vue";
2
- import { _ as s } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- const l = {};
4
- function f(t, a) {
5
- const e = o("v-btn");
6
- return n(), r(e, null, {
7
- default: c(() => [
8
- _(t.$slots, "default")
9
- ]),
10
- _: 3
11
- });
12
- }
13
- const d = /* @__PURE__ */ s(l, [["render", f]]);
14
- export {
15
- d as default
16
- };
17
- //# sourceMappingURL=x-btn-DsACLwMY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-btn-DsACLwMY.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<template>\n <v-btn>\n <slot />\n </v-btn>\n</template>\n"],"names":["_openBlock","_createBlock","_component_v_btn","_withCtx"],"mappings":";;;;;AAAA,SAAAA,EAqBI,GAAQC,EAAAC,GAAA,MAAA;AAAA,aAAAC,EAAA,MAAA;AAAA;KArBZ;AAAA;;;;"}
@@ -1,16 +0,0 @@
1
- import { resolveComponent as e, 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 o = e("v-divider");
6
- return r(), c(o, {
7
- thickness: 2,
8
- class: "border-opacity-100",
9
- color: "info"
10
- });
11
- }
12
- const f = /* @__PURE__ */ n(t, [["render", i]]);
13
- export {
14
- f as default
15
- };
16
- //# sourceMappingURL=x-divider-7cmRuxTV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-divider-7cmRuxTV.js","sources":["../src/vue/x-divider.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<template>\n <v-divider :thickness=\"2\" class=\"border-opacity-100\" color=\"info\" />\n</template>\n"],"names":["_openBlock","_createBlock","_component_v_divider"],"mappings":";;;;;AAoBc,SAAAA,EAAY,GAAAC,EAAAC,GAAA;AAAA,IAAE,WAA0B;AAAA,IAAC,OAAM;AAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-file-input-B6XyfogW.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,32 +0,0 @@
1
- import { defineComponent as l, resolveComponent as t, openBlock as p, createBlock as c, withCtx as e, createElementVNode as _, normalizeProps as m, guardReactiveProps as u, renderSlot as n, createVNode as i } from "vue";
2
- const h = /* @__PURE__ */ l({
3
- __name: "x-menu",
4
- props: {
5
- title: {}
6
- },
7
- setup(d) {
8
- return (o, v) => {
9
- const r = t("v-list"), a = t("v-menu");
10
- return p(), c(a, { "open-on-hover": "" }, {
11
- activator: e(({ props: s }) => [
12
- _("span", m(u(s)), [
13
- n(o.$slots, "activator")
14
- ], 16)
15
- ]),
16
- default: e(() => [
17
- i(r, null, {
18
- default: e(() => [
19
- n(o.$slots, "default")
20
- ]),
21
- _: 3
22
- })
23
- ]),
24
- _: 3
25
- });
26
- };
27
- }
28
- });
29
- export {
30
- h as default
31
- };
32
- //# sourceMappingURL=x-menu-VerLAd9F.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-menu-VerLAd9F.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,22 +0,0 @@
1
- import { defineComponent as o, resolveComponent as n, openBlock as l, createBlock as r, withCtx as s, renderSlot as _ } from "vue";
2
- const c = /* @__PURE__ */ o({
3
- __name: "x-menu-item",
4
- props: {
5
- title: {}
6
- },
7
- setup(m) {
8
- return (e, p) => {
9
- const t = n("v-list-item");
10
- return l(), r(t, null, {
11
- default: s(() => [
12
- _(e.$slots, "default")
13
- ]),
14
- _: 3
15
- });
16
- };
17
- }
18
- });
19
- export {
20
- c as default
21
- };
22
- //# sourceMappingURL=x-menu-item-DGurfOCF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-menu-item-DGurfOCF.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -1,470 +0,0 @@
1
- import { ref as k, computed as p, createVNode as s, mergeProps as x, Fragment as G, inject as ne, withDirectives as le, resolveDirective as ae, shallowRef as re, withModifiers as X, toRef as I, provide as ce, defineComponent as oe, onBeforeMount as se, watch as ue, openBlock as F, createBlock as de, unref as ve, withCtx as fe, createElementBlock as z, toDisplayString as K } from "vue";
2
- import { p as B, o as Y, m as he, g as D, u as E, c as M, d as me, I as ge, e as we, f as Ie, h as pe, i as ke, j as O, k as ye, l as U, n as j, q, r as be, s as Ce, t as Ve, v as Pe, w as Te, x as Se, y as W, z as Ae, A as xe, B as H } from "./index-BjjXwAdJ.js";
3
- const _e = B({
4
- ...Y(he({
5
- collapseIcon: "$treeviewCollapse",
6
- expandIcon: "$treeviewExpand"
7
- }), ["subgroup"])
8
- }, "VTreeviewGroup"), J = D()({
9
- name: "VTreeviewGroup",
10
- props: _e(),
11
- setup(e, g) {
12
- let {
13
- slots: h
14
- } = g;
15
- const t = k(), w = p(() => {
16
- var f;
17
- return (f = t.value) != null && f.isOpen ? e.collapseIcon : e.expandIcon;
18
- }), v = p(() => {
19
- var f;
20
- return {
21
- VTreeviewItem: {
22
- prependIcon: void 0,
23
- appendIcon: void 0,
24
- active: (f = t.value) == null ? void 0 : f.isOpen,
25
- toggleIcon: w.value
26
- }
27
- };
28
- });
29
- return E(() => {
30
- const f = M.filterProps(e);
31
- return s(M, x(f, {
32
- ref: t,
33
- class: ["v-treeview-group", e.class],
34
- subgroup: !0
35
- }), {
36
- ...h,
37
- activator: h.activator ? (u) => s(G, null, [s(me, {
38
- defaults: v.value
39
- }, {
40
- default: () => {
41
- var l;
42
- return [(l = h.activator) == null ? void 0 : l.call(h, u)];
43
- }
44
- })]) : void 0
45
- });
46
- }), {};
47
- }
48
- }), Z = Symbol.for("vuetify:v-treeview"), Le = B({
49
- loading: Boolean,
50
- toggleIcon: ge,
51
- ...we({
52
- slim: !0
53
- })
54
- }, "VTreeviewItem"), Q = D()({
55
- name: "VTreeviewItem",
56
- props: Le(),
57
- setup(e, g) {
58
- let {
59
- attrs: h,
60
- slots: t,
61
- emit: w
62
- } = g;
63
- const v = Ie(e, h), f = p(() => e.value === void 0 ? v.href.value : e.value), u = k(), {
64
- activate: l,
65
- isActivated: a,
66
- select: i,
67
- isSelected: d,
68
- isIndeterminate: n,
69
- isGroupActivator: y,
70
- root: b,
71
- id: C
72
- } = pe(f, !1), V = p(() => b.activatable.value && y), {
73
- densityClasses: P
74
- } = ke(e, "v-list-item"), c = p(() => ({
75
- isActive: a.value,
76
- select: i,
77
- isSelected: d.value,
78
- isIndeterminate: n.value
79
- })), r = p(() => {
80
- var m;
81
- return !e.disabled && e.link !== !1 && (e.link || v.isClickable.value || e.value != null && !!((m = u.value) != null && m.list));
82
- });
83
- function o(m) {
84
- var _, L;
85
- !r.value || !V.value && y || b.activatable.value && (V.value ? l(!a.value, m) : (L = u.value) == null || L.activate(!((_ = u.value) != null && _.isActivated), m));
86
- }
87
- function T(m) {
88
- (m.key === "Enter" || m.key === " ") && (m.preventDefault(), o(m));
89
- }
90
- const S = ne(Z, {
91
- visibleIds: k()
92
- }).visibleIds;
93
- return E(() => {
94
- var R;
95
- const m = t.title || e.title != null, _ = t.subtitle || e.subtitle != null, L = O.filterProps(e), ie = t.prepend || e.toggleIcon;
96
- return V.value ? le(s("div", {
97
- class: ["v-list-item", "v-list-item--one-line", "v-treeview-item", "v-treeview-item--activetable-group-activator", {
98
- "v-list-item--active": a.value || d.value,
99
- "v-treeview-item--filtered": S.value && !S.value.has(C.value)
100
- }, P.value, e.class],
101
- onClick: o
102
- }, [s(G, null, [ye(a.value || d.value, "v-list-item"), e.toggleIcon && s(U, {
103
- start: !1
104
- }, {
105
- default: () => [s(j, {
106
- density: "compact",
107
- icon: e.toggleIcon,
108
- loading: e.loading,
109
- variant: "text",
110
- onClick: e.onClick
111
- }, {
112
- loader() {
113
- return s(q, {
114
- indeterminate: "disable-shrink",
115
- size: "20",
116
- width: "2"
117
- }, null);
118
- }
119
- })]
120
- })]), s("div", {
121
- class: "v-list-item__content",
122
- "data-no-activator": ""
123
- }, [m && s(be, {
124
- key: "title"
125
- }, {
126
- default: () => {
127
- var A;
128
- return [((A = t.title) == null ? void 0 : A.call(t, {
129
- title: e.title
130
- })) ?? e.title];
131
- }
132
- }), _ && s(Ce, {
133
- key: "subtitle"
134
- }, {
135
- default: () => {
136
- var A;
137
- return [((A = t.subtitle) == null ? void 0 : A.call(t, {
138
- subtitle: e.subtitle
139
- })) ?? e.subtitle];
140
- }
141
- }), (R = t.default) == null ? void 0 : R.call(t, c.value)])]), [[ae("ripple"), r.value && e.ripple]]) : s(O, x({
142
- ref: u
143
- }, L, {
144
- class: ["v-treeview-item", {
145
- "v-treeview-item--filtered": S.value && !S.value.has(C.value)
146
- }, e.class],
147
- value: C.value,
148
- onClick: o,
149
- onKeydown: r.value && T
150
- }), {
151
- ...t,
152
- prepend: ie ? (A) => {
153
- var $;
154
- return s(G, null, [e.toggleIcon && s(U, {
155
- start: !1
156
- }, {
157
- default: () => [s(j, {
158
- density: "compact",
159
- icon: e.toggleIcon,
160
- loading: e.loading,
161
- variant: "text"
162
- }, {
163
- loader() {
164
- return s(q, {
165
- indeterminate: "disable-shrink",
166
- size: "20",
167
- width: "2"
168
- }, null);
169
- }
170
- })]
171
- }), ($ = t.prepend) == null ? void 0 : $.call(t, A)]);
172
- } : void 0
173
- });
174
- }), {};
175
- }
176
- }), ee = B({
177
- loadChildren: Function,
178
- loadingIcon: {
179
- type: String,
180
- default: "$loading"
181
- },
182
- items: Array,
183
- selectable: Boolean,
184
- selectStrategy: [String, Function, Object]
185
- }, "VTreeviewChildren"), N = D()({
186
- name: "VTreeviewChildren",
187
- props: ee(),
188
- setup(e, g) {
189
- let {
190
- emit: h,
191
- slots: t
192
- } = g;
193
- const w = re(null);
194
- function v(u) {
195
- return new Promise((l) => {
196
- var a, i;
197
- if (!((a = e.items) != null && a.length) || !e.loadChildren) return l();
198
- if (((i = u == null ? void 0 : u.children) == null ? void 0 : i.length) === 0) {
199
- w.value = u.value, e.loadChildren(u).then(l);
200
- return;
201
- }
202
- l();
203
- }).finally(() => {
204
- w.value = null;
205
- });
206
- }
207
- function f(u, l) {
208
- e.selectable && u(!l);
209
- }
210
- return () => {
211
- var u, l;
212
- return ((u = t.default) == null ? void 0 : u.call(t)) ?? ((l = e.items) == null ? void 0 : l.map((a) => {
213
- var P;
214
- let {
215
- children: i,
216
- props: d,
217
- raw: n
218
- } = a;
219
- const y = w.value === n.value, b = {
220
- prepend: (c) => {
221
- var r;
222
- return s(G, null, [e.selectable && (!i || i && !["leaf", "single-leaf"].includes(e.selectStrategy)) && s("div", null, [s(Ve, {
223
- key: n.value,
224
- modelValue: c.isSelected,
225
- loading: y,
226
- indeterminate: c.isIndeterminate,
227
- onClick: X(() => f(c.select, c.isSelected), ["stop"]),
228
- onKeydown: (o) => {
229
- ["Enter", "Space"].includes(o.key) && (o.stopPropagation(), f(c.select, c.isSelected));
230
- }
231
- }, null)]), (r = t.prepend) == null ? void 0 : r.call(t, {
232
- ...c,
233
- item: n
234
- })]);
235
- },
236
- append: t.append ? (c) => {
237
- var r;
238
- return (r = t.append) == null ? void 0 : r.call(t, {
239
- ...c,
240
- item: n
241
- });
242
- } : void 0,
243
- title: t.title ? (c) => {
244
- var r;
245
- return (r = t.title) == null ? void 0 : r.call(t, {
246
- ...c,
247
- item: n
248
- });
249
- } : void 0
250
- }, C = J.filterProps(d), V = N.filterProps(e);
251
- return i ? s(J, x({
252
- value: d == null ? void 0 : d.value
253
- }, C), {
254
- activator: (c) => {
255
- let {
256
- props: r
257
- } = c;
258
- const o = {
259
- ...d,
260
- ...r,
261
- value: d == null ? void 0 : d.value
262
- };
263
- return s(Q, x(o, {
264
- loading: y,
265
- onClick: () => v(n)
266
- }), b);
267
- },
268
- default: () => s(N, x(V, {
269
- items: i
270
- }), t)
271
- }) : ((P = t.item) == null ? void 0 : P.call(t, {
272
- props: d
273
- })) ?? s(Q, d, b);
274
- }));
275
- };
276
- }
277
- });
278
- function te(e) {
279
- let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
280
- for (const h of e)
281
- g.push(h), h.children && te(h.children, g);
282
- return g;
283
- }
284
- const Ge = B({
285
- openAll: Boolean,
286
- search: String,
287
- ...Pe({
288
- filterKeys: ["title"]
289
- }),
290
- ...ee(),
291
- ...Y(Te({
292
- collapseIcon: "$treeviewCollapse",
293
- expandIcon: "$treeviewExpand",
294
- slim: !0
295
- }), ["itemType", "nav"])
296
- }, "VTreeview"), Ne = D()({
297
- name: "VTreeview",
298
- props: Ge(),
299
- emits: {
300
- "update:opened": (e) => !0,
301
- "update:activated": (e) => !0,
302
- "update:selected": (e) => !0,
303
- "click:open": (e) => !0,
304
- "click:select": (e) => !0
305
- },
306
- setup(e, g) {
307
- let {
308
- slots: h
309
- } = g;
310
- const {
311
- items: t
312
- } = Se(e), w = I(e, "activeColor"), v = I(e, "baseColor"), f = I(e, "color"), u = W(e, "activated"), l = W(e, "selected"), a = k(), i = p(() => e.openAll ? P(t.value) : e.opened), d = p(() => te(t.value)), n = I(e, "search"), {
313
- filteredItems: y
314
- } = Ae(e, d, n), b = p(() => n.value ? new Set(y.value.flatMap((c) => [...C(c.props.value), ...V(c.props.value)])) : null);
315
- function C(c) {
316
- var T;
317
- const r = [];
318
- let o = c;
319
- for (; o != null; )
320
- r.unshift(o), o = (T = a.value) == null ? void 0 : T.parents.get(o);
321
- return r;
322
- }
323
- function V(c) {
324
- var T, S;
325
- const r = [], o = (((T = a.value) == null ? void 0 : T.children.get(c)) ?? []).slice();
326
- for (; o.length; ) {
327
- const m = o.shift();
328
- m && (r.push(m), o.push(...(((S = a.value) == null ? void 0 : S.children.get(m)) ?? []).slice()));
329
- }
330
- return r;
331
- }
332
- function P(c) {
333
- let r = [];
334
- for (const o of c)
335
- o.children && (r.push(o.value), o.children && (r = r.concat(P(o.children))));
336
- return r;
337
- }
338
- return ce(Z, {
339
- visibleIds: b
340
- }), xe({
341
- VTreeviewGroup: {
342
- activeColor: w,
343
- baseColor: v,
344
- color: f,
345
- collapseIcon: I(e, "collapseIcon"),
346
- expandIcon: I(e, "expandIcon")
347
- },
348
- VTreeviewItem: {
349
- activeClass: I(e, "activeClass"),
350
- activeColor: w,
351
- baseColor: v,
352
- color: f,
353
- density: I(e, "density"),
354
- disabled: I(e, "disabled"),
355
- lines: I(e, "lines"),
356
- variant: I(e, "variant")
357
- }
358
- }), E(() => {
359
- const c = H.filterProps(e), r = N.filterProps(e);
360
- return s(H, x({
361
- ref: a
362
- }, c, {
363
- class: ["v-treeview", e.class],
364
- style: e.style,
365
- opened: i.value,
366
- activated: u.value,
367
- "onUpdate:activated": (o) => u.value = o,
368
- selected: l.value,
369
- "onUpdate:selected": (o) => l.value = o
370
- }), {
371
- default: () => [s(N, x(r, {
372
- items: t.value
373
- }), h)]
374
- });
375
- }), {};
376
- }
377
- }), Be = ["href", "onClick"], De = ["href"], Re = /* @__PURE__ */ oe({
378
- __name: "x-navigation-tree",
379
- props: {
380
- treeSource: {},
381
- clickAction: { type: Function },
382
- currentPage: {}
383
- },
384
- setup(e) {
385
- const g = k([]), h = k(void 0), t = k(new Array()), w = k(new Array()), v = e;
386
- se(async () => {
387
- for (const l of await v.treeSource.getChildNodes(""))
388
- g.value.push({
389
- id: l.id,
390
- title: l.label,
391
- href: l.url,
392
- children: l.has_children ? [] : void 0,
393
- _location: l.location
394
- });
395
- v.currentPage !== void 0 && await f();
396
- }), ue(
397
- () => v.currentPage,
398
- async () => {
399
- v.currentPage && await f();
400
- }
401
- );
402
- async function f() {
403
- var d;
404
- const l = v.treeSource.getParentNodesId(v.currentPage);
405
- let a, i = g.value;
406
- for (a = 0; a < l.length - 1; a++)
407
- if (i)
408
- for (const n of i)
409
- n.id == l[a] && (((d = n.children) == null ? void 0 : d.length) == 0 && await u(n), w.value.includes(n.id) || w.value.push(n.id), i = n.children);
410
- if (i)
411
- for (const n of i)
412
- n.id == l[a] && (t.value = [n.id], v.clickAction && v.clickAction({
413
- id: n.id,
414
- label: n.title,
415
- location: n._location,
416
- url: n.href,
417
- has_children: n.children !== void 0
418
- }));
419
- }
420
- async function u(l) {
421
- var d;
422
- const a = l, i = await v.treeSource.getChildNodes(a.id);
423
- for (const n of i)
424
- (d = a.children) == null || d.push({
425
- id: n.id,
426
- title: n.label,
427
- href: n.url,
428
- children: n.has_children ? [] : void 0,
429
- _location: n.location
430
- });
431
- i.length == 0 && (a.children = void 0);
432
- }
433
- return (l, a) => (F(), de(ve(Ne), {
434
- ref_key: "tree",
435
- ref: h,
436
- activated: t.value,
437
- "onUpdate:activated": a[0] || (a[0] = (i) => t.value = i),
438
- opened: w.value,
439
- "onUpdate:opened": a[1] || (a[1] = (i) => w.value = i),
440
- items: g.value,
441
- "load-children": u,
442
- activatable: "",
443
- "active-strategy": "single-independent",
444
- "item-value": "id",
445
- "open-strategy": "multiple"
446
- }, {
447
- title: fe(({ item: i }) => [
448
- v.clickAction ? (F(), z("a", {
449
- key: 0,
450
- href: i.href,
451
- onClick: X((d) => l.clickAction({
452
- id: i.id,
453
- label: i.title,
454
- location: i._location,
455
- url: i.href,
456
- has_children: i.children !== void 0
457
- }), ["prevent"])
458
- }, K(i.title), 9, Be)) : (F(), z("a", {
459
- key: 1,
460
- href: i.href
461
- }, K(i.title), 9, De))
462
- ]),
463
- _: 1
464
- }, 8, ["activated", "opened", "items"]));
465
- }
466
- });
467
- export {
468
- Re as default
469
- };
470
- //# sourceMappingURL=x-navigation-tree-B8JZ_wJm.js.map