@xwiki/cristal-dsvuetify 0.23.1 → 0.24.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 (32) hide show
  1. package/CHANGELOG.md +0 -14
  2. package/dist/{index-DuymNdmD.js → index-CuRY2kJg.js} +7357 -7235
  3. package/dist/index-CuRY2kJg.js.map +1 -0
  4. package/dist/index.es.js +4 -4
  5. package/dist/index.umd.js +9 -9
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/vue/x-tree.vue.d.ts +2 -1
  8. package/dist/x-alert-YX1txXZY.js +48 -0
  9. package/dist/x-alert-YX1txXZY.js.map +1 -0
  10. package/dist/{x-checkbox-DPBHV522.js → x-checkbox-DoxVAidm.js} +2 -2
  11. package/dist/{x-checkbox-DPBHV522.js.map → x-checkbox-DoxVAidm.js.map} +1 -1
  12. package/dist/{x-file-input-BF8IdlrX.js → x-file-input-B50TiQaF.js} +2 -2
  13. package/dist/{x-file-input-BF8IdlrX.js.map → x-file-input-B50TiQaF.js.map} +1 -1
  14. package/dist/{x-form-7_KNhAtf.js → x-form-CMwcPIyL.js} +2 -2
  15. package/dist/{x-form-7_KNhAtf.js.map → x-form-CMwcPIyL.js.map} +1 -1
  16. package/dist/{x-navigation-tree-B5pIL2rS.js → x-navigation-tree-CSpekTTC.js} +2 -2
  17. package/dist/{x-navigation-tree-B5pIL2rS.js.map → x-navigation-tree-CSpekTTC.js.map} +1 -1
  18. package/dist/{x-navigation-tree-select-BHnoY91T.js → x-navigation-tree-select-DgyGTYDy.js} +2 -2
  19. package/dist/{x-navigation-tree-select-BHnoY91T.js.map → x-navigation-tree-select-DgyGTYDy.js.map} +1 -1
  20. package/dist/{x-select-mVjAXRju.js → x-select-D2T4qd71.js} +2 -2
  21. package/dist/{x-select-mVjAXRju.js.map → x-select-D2T4qd71.js.map} +1 -1
  22. package/dist/{x-text-field-DTZ5xunG.js → x-text-field-DoGMe9Qc.js} +2 -2
  23. package/dist/{x-text-field-DTZ5xunG.js.map → x-text-field-DoGMe9Qc.js.map} +1 -1
  24. package/dist/{x-tree-iloM7Rw9.js → x-tree-DFzX3ffS.js} +14 -14
  25. package/dist/x-tree-DFzX3ffS.js.map +1 -0
  26. package/package.json +14 -14
  27. package/src/vue/x-alert.vue +12 -3
  28. package/src/vue/x-tree.vue +4 -3
  29. package/dist/index-DuymNdmD.js.map +0 -1
  30. package/dist/x-alert-CWUIStcc.js +0 -46
  31. package/dist/x-alert-CWUIStcc.js.map +0 -1
  32. package/dist/x-tree-iloM7Rw9.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { TreeProps } from '@xwiki/cristal-dsapi';
2
2
  type __VLS_Props = TreeProps;
3
+ declare const opened: import('vue').ModelRef<string[], string, string[], string[]>;
3
4
  type __VLS_PublicProps = {
4
- "opened"?: string[];
5
+ "opened"?: typeof opened['value'];
5
6
  "activated"?: string | undefined;
6
7
  } & __VLS_Props;
7
8
  declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -0,0 +1,48 @@
1
+ import { defineComponent as f, resolveComponent as o, createBlock as n, openBlock as t, normalizeClass as u, withCtx as s, createElementBlock as a, createCommentVNode as r, renderSlot as x, Fragment as y, renderList as k, createTextVNode as C, toDisplayString as c } from "vue";
2
+ import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const p = { key: 0 }, v = { key: 1 }, _ = /* @__PURE__ */ f({
4
+ __name: "x-alert",
5
+ props: {
6
+ title: {},
7
+ type: {},
8
+ description: {},
9
+ actions: {},
10
+ closable: { type: Boolean },
11
+ details: {},
12
+ flatCorners: { type: Boolean }
13
+ },
14
+ setup(e) {
15
+ return (i, B) => {
16
+ const d = o("x-btn"), m = o("v-alert");
17
+ return t(), n(m, {
18
+ closable: e.closable,
19
+ title: e.title,
20
+ type: e.type,
21
+ text: e.description,
22
+ class: u({ "flat-corners": e.flatCorners })
23
+ }, {
24
+ default: s(() => [
25
+ (t(!0), a(y, null, k(e.actions, (l) => (t(), n(d, {
26
+ key: l.name,
27
+ size: "small",
28
+ variant: "text",
29
+ onClick: l.callback
30
+ }, {
31
+ default: s(() => [
32
+ C(c(l.name), 1)
33
+ ]),
34
+ _: 2
35
+ }, 1032, ["onClick"]))), 128)),
36
+ e.details ? (t(), a("br", p)) : r("", !0),
37
+ e.details ? (t(), a("small", v, c(e.details), 1)) : r("", !0),
38
+ x(i.$slots, "default", {}, void 0, !0)
39
+ ]),
40
+ _: 3
41
+ }, 8, ["closable", "title", "type", "text", "class"]);
42
+ };
43
+ }
44
+ }), z = /* @__PURE__ */ b(_, [["__scopeId", "data-v-3f38ce3e"]]);
45
+ export {
46
+ z as default
47
+ };
48
+ //# sourceMappingURL=x-alert-YX1txXZY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-alert-YX1txXZY.js","sources":["../src/vue/x-alert.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport type { AlertProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<AlertProps>();\n</script>\n<template>\n <v-alert\n :closable=\"closable\"\n :title=\"title\"\n :type=\"type\"\n :text=\"description\"\n :class=\"{ 'flat-corners': flatCorners }\"\n >\n <x-btn\n v-for=\"action of actions\"\n :key=\"action.name\"\n size=\"small\"\n variant=\"text\"\n @click=\"action.callback\"\n >{{ action.name }}</x-btn\n >\n <br v-if=\"details\" />\n <small v-if=\"details\">{{ details }}</small>\n <slot />\n </v-alert>\n</template>\n\n<style scoped>\n:deep(.v-alert__content a),\n:deep(.v-alert__content a:visited) {\n color: inherit;\n text-decoration-color: inherit;\n}\n.flat-corners {\n border-radius: initial;\n}\n</style>\n"],"names":["_createBlock","_component_v_alert","__props","_createElementBlock","_Fragment","_renderList","action","_component_x_btn","_createTextVNode","_toDisplayString","_hoisted_1","_openBlock","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;kBAyBEA,EAkBUC,GAAA;AAAA,QAjBP,UAAUC,EAAA;AAAA,QACV,OAAOA,EAAA;AAAA,QACP,MAAMA,EAAA;AAAA,QACN,MAAMA,EAAA;AAAA,QACN,2BAAyBA,EAAA,aAAW;AAAA,MAAA;mBAGnC,MAAyB;AAAA,kBAD3BC,EAOCC,GAAA,MAAAC,EANkBH,EAAA,SAAO,CAAjBI,YADTN,EAOCO,GAAA;AAAA,YALE,KAAKD,EAAO;AAAA,YACb,MAAK;AAAA,YACL,SAAQ;AAAA,YACP,SAAOA,EAAO;AAAA,UAAA;uBACd,MAAiB;AAAA,cAAdE,EAAAC,EAAAH,EAAO,IAAI,GAAA,CAAA;AAAA,YAAA;;;UAEPJ,EAAA,gBAAVC,EAAqB,MAAAO,CAAA;UACRR,EAAA,WAAbS,EAAA,GAAAR,EAA2C,cAAlBD,EAAA,OAAO,GAAA,CAAA;UAChCU,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,QAAA;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, mergeModels as t, useModel as d, createBlock as u, openBlock as n, unref as s } from "vue";
2
- import { d as c } from "./index-DuymNdmD.js";
2
+ import { d as c } from "./index-CuRY2kJg.js";
3
3
  const V = /* @__PURE__ */ m({
4
4
  __name: "x-checkbox",
5
5
  props: /* @__PURE__ */ t({
@@ -25,4 +25,4 @@ const V = /* @__PURE__ */ m({
25
25
  export {
26
26
  V as default
27
27
  };
28
- //# sourceMappingURL=x-checkbox-DPBHV522.js.map
28
+ //# sourceMappingURL=x-checkbox-DoxVAidm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-checkbox-DPBHV522.js","sources":["../src/vue/form/x-checkbox.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport { VCheckbox } from \"vuetify/components/VCheckbox\";\nimport type { CheckboxProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<CheckboxProps>();\n\nconst checked = defineModel<boolean | null>();\n</script>\n<template>\n <v-checkbox\n v-model=\"checked\"\n :label=\"label\"\n :messages=\"help\"\n density=\"compact\"\n ></v-checkbox>\n</template>\n"],"names":["checked","_useModel","_createBlock","_unref","VCheckbox","$event","__props"],"mappings":";;;;;;;;;;;;;;AAyBA,UAAMA,IAAUC,iBAA4B;2BAG1CC,EAKcC,EAAAC,CAAA,GAAA;AAAA,kBAJHJ,EAAA;AAAA,oDAAAA,EAAO,QAAAK;AAAA,MACf,OAAOC,EAAA;AAAA,MACP,UAAUA,EAAA;AAAA,MACX,SAAQ;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"x-checkbox-DoxVAidm.js","sources":["../src/vue/form/x-checkbox.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport { VCheckbox } from \"vuetify/components/VCheckbox\";\nimport type { CheckboxProps } from \"@xwiki/cristal-dsapi\";\n\ndefineProps<CheckboxProps>();\n\nconst checked = defineModel<boolean | null>();\n</script>\n<template>\n <v-checkbox\n v-model=\"checked\"\n :label=\"label\"\n :messages=\"help\"\n density=\"compact\"\n ></v-checkbox>\n</template>\n"],"names":["checked","_useModel","_createBlock","_unref","VCheckbox","$event","__props"],"mappings":";;;;;;;;;;;;;;AAyBA,UAAMA,IAAUC,iBAA4B;2BAG1CC,EAKcC,EAAAC,CAAA,GAAA;AAAA,kBAJHJ,EAAA;AAAA,oDAAAA,EAAO,QAAAK;AAAA,MACf,OAAOC,EAAA;AAAA,MACP,UAAUA,EAAA;AAAA,MACX,SAAQ;AAAA,IAAA;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as m, mergeModels as s, useModel as d, computed as i, createBlock as p, openBlock as f, unref as c } from "vue";
2
2
  import { t as V } from "./translations-BVK9UR9x.js";
3
3
  import { useI18n as y } from "vue-i18n";
4
- import { b } from "./index-DuymNdmD.js";
4
+ import { b } from "./index-CuRY2kJg.js";
5
5
  const g = /* @__PURE__ */ m({
6
6
  __name: "x-file-input",
7
7
  props: /* @__PURE__ */ s({
@@ -37,4 +37,4 @@ const g = /* @__PURE__ */ m({
37
37
  export {
38
38
  g as default
39
39
  };
40
- //# sourceMappingURL=x-file-input-BF8IdlrX.js.map
40
+ //# sourceMappingURL=x-file-input-B50TiQaF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-file-input-BF8IdlrX.js","sources":["../src/vue/form/x-file-input.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed, defineModel } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VFileInput } from \"vuetify/components/VFileInput\";\nimport type { FileInputModel, TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst model = defineModel<FileInputModel>();\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","_createBlock","_unref","VFileInput","$event"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,EAAE,GAAAA,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,iBAA4B,GACpCC,IAAQC,GAERC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIJ,EAAM,YACRI,EAAU,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IACT,CAAC;2BAICE,EAKgBC,EAAAC,CAAA,GAAA;AAAA,kBAJLV,EAAA;AAAA,oDAAAA,EAAK,QAAAW;AAAA,MACb,OAAOR,EAAA;AAAA,MACP,MAAMA,EAAA;AAAA,MACN,OAAOC,EAAA;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"x-file-input-B50TiQaF.js","sources":["../src/vue/form/x-file-input.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed, defineModel } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VFileInput } from \"vuetify/components/VFileInput\";\nimport type { FileInputModel, TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\n\nconst model = defineModel<FileInputModel>();\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","_createBlock","_unref","VFileInput","$event"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,EAAE,GAAAA,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,iBAA4B,GACpCC,IAAQC,GAERC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIJ,EAAM,YACRI,EAAU,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IACT,CAAC;2BAICE,EAKgBC,EAAAC,CAAA,GAAA;AAAA,kBAJLV,EAAA;AAAA,oDAAAA,EAAK,QAAAW;AAAA,MACb,OAAOR,EAAA;AAAA,MACP,MAAMA,EAAA;AAAA,MACN,OAAOC,EAAA;AAAA,IAAA;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as s, ref as m, createBlock as f, openBlock as c, unref as u, withModifiers as d, withCtx as _, renderSlot as l } from "vue";
2
- import { V as p } from "./index-DuymNdmD.js";
2
+ import { V as p } from "./index-CuRY2kJg.js";
3
3
  import { _ as v } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const x = /* @__PURE__ */ s({
5
5
  __name: "x-form",
@@ -30,4 +30,4 @@ const x = /* @__PURE__ */ s({
30
30
  export {
31
31
  y as default
32
32
  };
33
- //# sourceMappingURL=x-form-7_KNhAtf.js.map
33
+ //# sourceMappingURL=x-form-CMwcPIyL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-form-7_KNhAtf.js","sources":["../src/vue/form/x-form.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { VForm } from \"vuetify/components/VForm\";\nimport type { Ref } from \"vue\";\n\nconst form: Ref<VForm | undefined> = ref(undefined);\nconst emits = defineEmits([\"formSubmit\"]);\n\ndefineExpose({\n reset,\n});\n\nasync function reset() {\n form.value?.reset();\n}\n\nasync function submit() {\n const validation = await form.value?.validate();\n if (validation?.valid) {\n emits(\"formSubmit\");\n }\n}\n</script>\n\n<template>\n <v-form ref=\"form\" @submit.prevent=\"submit\">\n <slot></slot>\n </v-form>\n</template>\n\n<style scoped>\n.v-form {\n display: flex;\n flex-direction: column;\n gap: var(--cr-spacing-x-small);\n}\n</style>\n"],"names":["form","ref","emits","__emit","__expose","reset","submit","_createBlock","_unref","VForm","_renderSlot","_ctx"],"mappings":";;;;;;;AAwBA,UAAMA,IAA+BC,EAAI,MAAS,GAC5CC,IAAQC;AAEd,IAAAC,EAAa;AAAA,MACX,OAAAC;AAAA,IAAA,CACD;AAED,mBAAeA,IAAQ;AACrB,MAAAL,EAAK,OAAO,MAAA;AAAA,IACd;AAEA,mBAAeM,IAAS;AAEtB,OADmB,MAAMN,EAAK,OAAO,SAAA,IACrB,SACdE,EAAM,YAAY;AAAA,IAEtB;2BAIEK,EAESC,EAAAC,CAAA,GAAA;AAAA,eAFG;AAAA,MAAJ,KAAIT;AAAA,MAAQ,YAAgBM,GAAM,CAAA,SAAA,CAAA;AAAA,IAAA;iBACxC,MAAa;AAAA,QAAbI,EAAaC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;;;;;"}
1
+ {"version":3,"file":"x-form-CMwcPIyL.js","sources":["../src/vue/form/x-form.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport { VForm } from \"vuetify/components/VForm\";\nimport type { Ref } from \"vue\";\n\nconst form: Ref<VForm | undefined> = ref(undefined);\nconst emits = defineEmits([\"formSubmit\"]);\n\ndefineExpose({\n reset,\n});\n\nasync function reset() {\n form.value?.reset();\n}\n\nasync function submit() {\n const validation = await form.value?.validate();\n if (validation?.valid) {\n emits(\"formSubmit\");\n }\n}\n</script>\n\n<template>\n <v-form ref=\"form\" @submit.prevent=\"submit\">\n <slot></slot>\n </v-form>\n</template>\n\n<style scoped>\n.v-form {\n display: flex;\n flex-direction: column;\n gap: var(--cr-spacing-x-small);\n}\n</style>\n"],"names":["form","ref","emits","__emit","__expose","reset","submit","_createBlock","_unref","VForm","_renderSlot","_ctx"],"mappings":";;;;;;;AAwBA,UAAMA,IAA+BC,EAAI,MAAS,GAC5CC,IAAQC;AAEd,IAAAC,EAAa;AAAA,MACX,OAAAC;AAAA,IAAA,CACD;AAED,mBAAeA,IAAQ;AACrB,MAAAL,EAAK,OAAO,MAAA;AAAA,IACd;AAEA,mBAAeM,IAAS;AAEtB,OADmB,MAAMN,EAAK,OAAO,SAAA,IACrB,SACdE,EAAM,YAAY;AAAA,IAEtB;2BAIEK,EAESC,EAAAC,CAAA,GAAA;AAAA,eAFG;AAAA,MAAJ,KAAIT;AAAA,MAAQ,YAAgBM,GAAM,CAAA,SAAA,CAAA;AAAA,IAAA;iBACxC,MAAa;AAAA,QAAbI,EAAaC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as b, mergeDefaults as S, inject as A, ref as _, onBeforeMount as B, watch as E, createBlock as F, openBlock as g, unref as L, withCtx as U, createElementBlock as R, withModifiers as M, toDisplayString as I } from "vue";
2
2
  import { SpaceReference as j } from "@xwiki/cristal-model-api";
3
- import { c as z } from "./index-DuymNdmD.js";
3
+ import { c as z } from "./index-CuRY2kJg.js";
4
4
  import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const $ = {
6
6
  includeTerminals: !0
@@ -186,4 +186,4 @@ const $ = {
186
186
  export {
187
187
  W as default
188
188
  };
189
- //# sourceMappingURL=x-navigation-tree-B5pIL2rS.js.map
189
+ //# sourceMappingURL=x-navigation-tree-CSpekTTC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-navigation-tree-B5pIL2rS.js","sources":["../../api/src/XNavigationTree.ts","../src/vue/x-navigation-tree.vue"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type { NavigationTreeNode } from \"@xwiki/cristal-navigation-tree-api\";\n\n/**\n * @since 0.15\n * @beta\n */\ntype NavigationTreeProps = {\n clickAction?: (node: NavigationTreeNode) => void;\n currentPageReference?: DocumentReference;\n /**\n * Whether to include terminal pages in the tree (default: true).\n * @since 0.16\n * @beta\n */\n includeTerminals?: boolean;\n /**\n * Whether to display a root node (default: false).\n * @since 0.20\n * @beta\n */\n showRootNode?: boolean;\n};\n\n/**\n * Default props values for NavigationTree implementations.\n * @since 0.16\n * @beta\n */\nconst navigationTreePropsDefaults = {\n includeTerminals: true,\n};\n\nexport type { NavigationTreeProps };\nexport { navigationTreePropsDefaults };\n","<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\n/**\n * Navigation Tree implemented using Vuetify's VTreeView component.\n * In order to use the initial component as a proper Navigation Tree for\n * Cristal, a few changes were made:\n * - The only node activated matches the current page, or the clicked link if\n * the component has a custom clickAction. We want to use actual links so\n * that the user can click them normally (to e.g., open them in a new tab).\n * So the default behavior of activating a node by clicking anywhere on the\n * item was disabled. Default hover effects, such as darkening or changing\n * the cursor on items, were also disabled.\n */\nimport { navigationTreePropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { SpaceReference } from \"@xwiki/cristal-model-api\";\nimport { inject, onBeforeMount, ref, watch } from \"vue\";\nimport { VTreeview } from \"vuetify/components/VTreeview\";\nimport type { CristalApp } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type { NavigationTreeProps } from \"@xwiki/cristal-dsapi\";\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type {\n NavigationTreeSource,\n NavigationTreeSourceProvider,\n} from \"@xwiki/cristal-navigation-tree-api\";\nimport type { Ref } from \"vue\";\n\ntype TreeItem = {\n id: string;\n title: string;\n href: string;\n children?: Array<TreeItem>;\n _location: SpaceReference | DocumentReference;\n _is_terminal: boolean;\n};\n\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst documentService: DocumentService = cristal\n .getContainer()\n .get<DocumentService>(\"DocumentService\");\nconst treeSource: NavigationTreeSource = cristal\n .getContainer()\n .get<NavigationTreeSourceProvider>(\"NavigationTreeSourceProvider\")\n .get();\n\nconst rootNodes: Ref<Array<TreeItem>> = ref([]);\n\nconst activatedNodes: Ref<Array<string>> = ref(new Array<string>());\nconst expandedNodes: Ref<unknown> = ref([]);\nvar isExpanding: boolean = false;\n\nconst props = withDefaults(\n defineProps<NavigationTreeProps>(),\n navigationTreePropsDefaults,\n);\n\nonBeforeMount(async () => {\n const newRootNodes: Array<TreeItem> = [];\n for (const node of await getChildNodes(\"\")) {\n newRootNodes.push({\n id: node.id,\n title: node.label,\n href: node.url,\n children: node.has_children ? [] : undefined,\n _location: node.location,\n _is_terminal: node.is_terminal,\n });\n }\n if (props.showRootNode) {\n rootNodes.value.push({\n id: \"\",\n title: \"Root\",\n href: \".\",\n children: newRootNodes,\n _location: new SpaceReference(),\n _is_terminal: false,\n });\n } else {\n rootNodes.value.push(...newRootNodes);\n }\n await expandTree();\n\n documentService.registerDocumentChangeListener(\"delete\", onDocumentDelete);\n documentService.registerDocumentChangeListener(\"update\", onDocumentUpdate);\n});\n\nwatch(() => props.currentPageReference, expandTree);\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function expandTree() {\n if (props.currentPageReference && !isExpanding) {\n isExpanding = true;\n const newExpandedNodes = treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\n props.showRootNode,\n );\n let i;\n let currentNodes = rootNodes.value;\n for (i = 0; i < newExpandedNodes.length - 1; i++) {\n if (currentNodes) {\n for (const node of currentNodes) {\n if (node.id == newExpandedNodes[i]) {\n if (node.children?.length == 0) {\n await lazyLoadChildren(node);\n }\n if (!(expandedNodes.value as unknown[]).includes(node.id)) {\n (expandedNodes.value as unknown[]).push(node.id);\n }\n currentNodes = node.children!;\n }\n }\n }\n }\n if (currentNodes) {\n for (const node of currentNodes) {\n if (node.id == newExpandedNodes[i]) {\n activatedNodes.value = [node.id];\n // If we have a custom click action, we want to use it on dynamic\n // selection.\n if (props.clickAction) {\n props.clickAction({\n id: node.id,\n label: node.title,\n location: node._location,\n url: node.href,\n has_children: node.children !== undefined,\n is_terminal: node._is_terminal,\n });\n }\n }\n }\n }\n isExpanding = false;\n }\n}\n\nasync function lazyLoadChildren(item: unknown) {\n const treeItem = item as TreeItem;\n const childNodes = await getChildNodes(treeItem.id);\n for (const child of childNodes) {\n treeItem.children?.push({\n id: child.id,\n title: child.label,\n href: child.url,\n children: child.has_children ? [] : undefined,\n _location: child.location,\n _is_terminal: child.is_terminal,\n });\n }\n // If the node doesn't have any children, we update it.\n if (childNodes.length == 0) {\n treeItem.children = undefined;\n }\n}\n\nfunction clearSelection() {\n // Clicking on a node would activate it and this can't be disabled easily.\n // With this listener, we ensure that only the first activated node stays\n // active.\n if (activatedNodes.value.length > 1) {\n activatedNodes.value.pop();\n }\n}\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function onDocumentDelete(page: DocumentReference) {\n const parents = treeSource.getParentNodesId(\n page,\n props.includeTerminals,\n props.showRootNode,\n );\n let currentItem: TreeItem | undefined = undefined;\n let currentItemChildren: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\n\n currentItemsLoop: while (currentItemChildren && !notFound) {\n for (const i of currentItemChildren.keys()) {\n if (currentItemChildren[i].id == parents[0]) {\n if (parents.length == 1) {\n currentItemChildren.splice(i, 1);\n if (currentItem && currentItemChildren.length == 0) {\n currentItem!.children = undefined;\n }\n return;\n } else {\n currentItem = currentItemChildren[i];\n currentItemChildren = currentItem.children;\n parents.shift();\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n}\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function onDocumentUpdate(page: DocumentReference) {\n const parents = treeSource.getParentNodesId(\n page,\n props.includeTerminals,\n props.showRootNode,\n );\n let currentParent: string | undefined = undefined;\n let currentItems: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\n let isRoot = true;\n\n currentItemsLoop: while (currentItems && !notFound) {\n for (const i of currentItems.keys()) {\n if (currentItems[i].id == parents[0]) {\n if (parents.length == 1) {\n // Page update\n const newItems = await getChildNodes(\n currentParent ? currentParent : \"\",\n );\n for (const newItem of newItems) {\n if (newItem.id == currentItems[i].id) {\n currentItems[i].title = newItem.label;\n return;\n }\n }\n } else {\n currentParent = currentItems[i].id;\n if (!currentItems[i].children) {\n // This node had no children, we reset this so new ones can be\n // loaded lazily.\n currentItems[i].children = [];\n }\n currentItems = currentItems[i].children;\n parents.shift();\n isRoot = false;\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n\n // New page\n if (currentItems.length == 0 && !isRoot) {\n // We don't do anything because this node will be loaded lazily anyway.\n return;\n }\n const newItems = await getChildNodes(currentParent ? currentParent : \"\");\n const currentPageParents = props.currentPageReference\n ? treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\n )\n : [];\n newItemsLoop: for (const newItem of newItems) {\n for (const i of currentItems!.keys()) {\n if (newItem.id == currentItems![i].id) {\n continue newItemsLoop;\n }\n }\n currentItems!.push({\n id: newItem.id,\n title: newItem.label,\n href: newItem.url,\n children: newItem.has_children ? [] : undefined,\n _location: newItem.location,\n _is_terminal: newItem.is_terminal,\n });\n if (\n currentPageParents.length > 0 &&\n currentPageParents[currentPageParents.length - 1] === newItem.id\n ) {\n // If we add a node, and it's the current page, it should be activated.\n activatedNodes.value = [newItem.id];\n }\n }\n}\n\nasync function getChildNodes(id: string) {\n return (await treeSource.getChildNodes(id)).filter(\n (c) => props.includeTerminals || !c.is_terminal,\n );\n}\n</script>\n\n<template>\n <v-treeview\n v-model:opened=\"expandedNodes\"\n density=\"compact\"\n :activated=\"activatedNodes\"\n :items=\"rootNodes\"\n :load-children=\"lazyLoadChildren\"\n activatable\n active-strategy=\"independent\"\n item-value=\"id\"\n @update:activated=\"clearSelection\"\n >\n <template #title=\"{ item }: { item: any }\">\n <a\n v-if=\"props.clickAction\"\n :href=\"item.href\"\n @click.prevent=\"\n activatedNodes = [item.id];\n clickAction!({\n id: item.id,\n label: item.title,\n location: item._location,\n url: item.href,\n has_children: item.children !== undefined,\n is_terminal: item._is_terminal,\n });\n \"\n >{{ item.title }}</a\n >\n <a v-else :href=\"item.href\">{{ item.title }}</a>\n </template>\n </v-treeview>\n</template>\n\n<style scoped>\n.v-list {\n background: none;\n}\n:deep(a) {\n text-decoration: none;\n color: var(--cr-base-text-color);\n}\n/* Disable hover on items. */\n:deep(.v-list-item__overlay) {\n --v-hover-opacity: 0;\n}\n/* Disable hand cursor on items, since we disable the default click action. */\n:deep(.v-list-item--link) {\n cursor: default;\n}\n</style>\n"],"names":["navigationTreePropsDefaults","cristal","inject","documentService","treeSource","rootNodes","ref","activatedNodes","expandedNodes","isExpanding","props","__props","onBeforeMount","newRootNodes","node","getChildNodes","SpaceReference","expandTree","onDocumentDelete","onDocumentUpdate","watch","newExpandedNodes","i","currentNodes","lazyLoadChildren","item","treeItem","childNodes","child","clearSelection","page","parents","currentItem","currentItemChildren","notFound","currentItemsLoop","currentParent","currentItems","isRoot","newItems","newItem","currentPageParents","newItemsLoop","id","c","_createBlock","_unref","VTreeview","$event","_withCtx","_createElementBlock","_withModifiers","_toDisplayString","_hoisted_1","_hoisted_2"],"mappings":";;;;AAiDA,MAAMA,IAA8B;AAAA,EAClC,kBAAkB;AACpB;;;;;;;;;ACGA,UAAMC,IAAsBC,EAAmB,SAAS,GAClDC,IAAmCF,EACtC,aAAA,EACA,IAAqB,iBAAiB,GACnCG,IAAmCH,EACtC,aAAA,EACA,IAAkC,8BAA8B,EAChE,IAAA,GAEGI,IAAkCC,EAAI,EAAE,GAExCC,IAAqCD,EAAI,IAAI,OAAe,GAC5DE,IAA8BF,EAAI,EAAE;AAC1C,QAAIG,IAAuB;AAE3B,UAAMC,IAAQC;AAKd,IAAAC,EAAc,YAAY;AACxB,YAAMC,IAAgC,CAAA;AACtC,iBAAWC,KAAQ,MAAMC,EAAc,EAAE;AACvC,QAAAF,EAAa,KAAK;AAAA,UAChB,IAAIC,EAAK;AAAA,UACT,OAAOA,EAAK;AAAA,UACZ,MAAMA,EAAK;AAAA,UACX,UAAUA,EAAK,eAAe,CAAA,IAAK;AAAA,UACnC,WAAWA,EAAK;AAAA,UAChB,cAAcA,EAAK;AAAA,QAAA,CACpB;AAEH,MAAIJ,EAAM,eACRL,EAAU,MAAM,KAAK;AAAA,QACnB,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,MAAM;AAAA,QACN,UAAUQ;AAAA,QACV,WAAW,IAAIG,EAAA;AAAA,QACf,cAAc;AAAA,MAAA,CACf,IAEDX,EAAU,MAAM,KAAK,GAAGQ,CAAY,GAEtC,MAAMI,EAAA,GAENd,EAAgB,+BAA+B,UAAUe,CAAgB,GACzEf,EAAgB,+BAA+B,UAAUgB,CAAgB;AAAA,IAC3E,CAAC,GAEDC,EAAM,MAAMV,EAAM,sBAAsBO,CAAU;AAIlD,mBAAeA,IAAa;AAC1B,UAAIP,EAAM,wBAAwB,CAACD,GAAa;AAC9C,QAAAA,IAAc;AACd,cAAMY,IAAmBjB,EAAW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,sBAAkBK;AAAA,IAAA;MAER,OAAKoB,EACd,CAeC,EAhBiB,MAAAxB,QAAI;AAAA,QAEdf,EAAM,oBADdwC,EAeC,KAAA;AAAA;UAbE,MAAMzB,EAAK;AAAA,UACX,SAAK0B,EAAA,CAAAH,MAAA;AAAqB,YAAAzC,EAAA,QAAc,CAAIkB,EAAK,EAAE,GAAad,EAAA,YAAW;AAAA,cAAoB,IAAAc,EAAK;AAAA,cAAuB,OAAAA,EAAK;AAAA,cAA6B,UAAAA,EAAK;AAAA,cAA4B,KAAAA,EAAK;AAAA,4BAAgCA,EAAK,aAAa;AAAA,cAAoC,aAAAA,EAAK;AAAA,YAAA;;WAW3R2B,EAAA3B,EAAK,KAAK,GAAA,GAAA4B,CAAA,WAEhBH,EAAgD,KAAA;AAAA;UAArC,MAAMzB,EAAK;AAAA,QAAA,GAAS2B,EAAA3B,EAAK,KAAK,GAAA,GAAA6B,CAAA;AAAA,MAAA;;;;;"}
1
+ {"version":3,"file":"x-navigation-tree-CSpekTTC.js","sources":["../../api/src/XNavigationTree.ts","../src/vue/x-navigation-tree.vue"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type { NavigationTreeNode } from \"@xwiki/cristal-navigation-tree-api\";\n\n/**\n * @since 0.15\n * @beta\n */\ntype NavigationTreeProps = {\n clickAction?: (node: NavigationTreeNode) => void;\n currentPageReference?: DocumentReference;\n /**\n * Whether to include terminal pages in the tree (default: true).\n * @since 0.16\n * @beta\n */\n includeTerminals?: boolean;\n /**\n * Whether to display a root node (default: false).\n * @since 0.20\n * @beta\n */\n showRootNode?: boolean;\n};\n\n/**\n * Default props values for NavigationTree implementations.\n * @since 0.16\n * @beta\n */\nconst navigationTreePropsDefaults = {\n includeTerminals: true,\n};\n\nexport type { NavigationTreeProps };\nexport { navigationTreePropsDefaults };\n","<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\n/**\n * Navigation Tree implemented using Vuetify's VTreeView component.\n * In order to use the initial component as a proper Navigation Tree for\n * Cristal, a few changes were made:\n * - The only node activated matches the current page, or the clicked link if\n * the component has a custom clickAction. We want to use actual links so\n * that the user can click them normally (to e.g., open them in a new tab).\n * So the default behavior of activating a node by clicking anywhere on the\n * item was disabled. Default hover effects, such as darkening or changing\n * the cursor on items, were also disabled.\n */\nimport { navigationTreePropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { SpaceReference } from \"@xwiki/cristal-model-api\";\nimport { inject, onBeforeMount, ref, watch } from \"vue\";\nimport { VTreeview } from \"vuetify/components/VTreeview\";\nimport type { CristalApp } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type { NavigationTreeProps } from \"@xwiki/cristal-dsapi\";\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type {\n NavigationTreeSource,\n NavigationTreeSourceProvider,\n} from \"@xwiki/cristal-navigation-tree-api\";\nimport type { Ref } from \"vue\";\n\ntype TreeItem = {\n id: string;\n title: string;\n href: string;\n children?: Array<TreeItem>;\n _location: SpaceReference | DocumentReference;\n _is_terminal: boolean;\n};\n\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst documentService: DocumentService = cristal\n .getContainer()\n .get<DocumentService>(\"DocumentService\");\nconst treeSource: NavigationTreeSource = cristal\n .getContainer()\n .get<NavigationTreeSourceProvider>(\"NavigationTreeSourceProvider\")\n .get();\n\nconst rootNodes: Ref<Array<TreeItem>> = ref([]);\n\nconst activatedNodes: Ref<Array<string>> = ref(new Array<string>());\nconst expandedNodes: Ref<unknown> = ref([]);\nvar isExpanding: boolean = false;\n\nconst props = withDefaults(\n defineProps<NavigationTreeProps>(),\n navigationTreePropsDefaults,\n);\n\nonBeforeMount(async () => {\n const newRootNodes: Array<TreeItem> = [];\n for (const node of await getChildNodes(\"\")) {\n newRootNodes.push({\n id: node.id,\n title: node.label,\n href: node.url,\n children: node.has_children ? [] : undefined,\n _location: node.location,\n _is_terminal: node.is_terminal,\n });\n }\n if (props.showRootNode) {\n rootNodes.value.push({\n id: \"\",\n title: \"Root\",\n href: \".\",\n children: newRootNodes,\n _location: new SpaceReference(),\n _is_terminal: false,\n });\n } else {\n rootNodes.value.push(...newRootNodes);\n }\n await expandTree();\n\n documentService.registerDocumentChangeListener(\"delete\", onDocumentDelete);\n documentService.registerDocumentChangeListener(\"update\", onDocumentUpdate);\n});\n\nwatch(() => props.currentPageReference, expandTree);\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function expandTree() {\n if (props.currentPageReference && !isExpanding) {\n isExpanding = true;\n const newExpandedNodes = treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\n props.showRootNode,\n );\n let i;\n let currentNodes = rootNodes.value;\n for (i = 0; i < newExpandedNodes.length - 1; i++) {\n if (currentNodes) {\n for (const node of currentNodes) {\n if (node.id == newExpandedNodes[i]) {\n if (node.children?.length == 0) {\n await lazyLoadChildren(node);\n }\n if (!(expandedNodes.value as unknown[]).includes(node.id)) {\n (expandedNodes.value as unknown[]).push(node.id);\n }\n currentNodes = node.children!;\n }\n }\n }\n }\n if (currentNodes) {\n for (const node of currentNodes) {\n if (node.id == newExpandedNodes[i]) {\n activatedNodes.value = [node.id];\n // If we have a custom click action, we want to use it on dynamic\n // selection.\n if (props.clickAction) {\n props.clickAction({\n id: node.id,\n label: node.title,\n location: node._location,\n url: node.href,\n has_children: node.children !== undefined,\n is_terminal: node._is_terminal,\n });\n }\n }\n }\n }\n isExpanding = false;\n }\n}\n\nasync function lazyLoadChildren(item: unknown) {\n const treeItem = item as TreeItem;\n const childNodes = await getChildNodes(treeItem.id);\n for (const child of childNodes) {\n treeItem.children?.push({\n id: child.id,\n title: child.label,\n href: child.url,\n children: child.has_children ? [] : undefined,\n _location: child.location,\n _is_terminal: child.is_terminal,\n });\n }\n // If the node doesn't have any children, we update it.\n if (childNodes.length == 0) {\n treeItem.children = undefined;\n }\n}\n\nfunction clearSelection() {\n // Clicking on a node would activate it and this can't be disabled easily.\n // With this listener, we ensure that only the first activated node stays\n // active.\n if (activatedNodes.value.length > 1) {\n activatedNodes.value.pop();\n }\n}\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function onDocumentDelete(page: DocumentReference) {\n const parents = treeSource.getParentNodesId(\n page,\n props.includeTerminals,\n props.showRootNode,\n );\n let currentItem: TreeItem | undefined = undefined;\n let currentItemChildren: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\n\n currentItemsLoop: while (currentItemChildren && !notFound) {\n for (const i of currentItemChildren.keys()) {\n if (currentItemChildren[i].id == parents[0]) {\n if (parents.length == 1) {\n currentItemChildren.splice(i, 1);\n if (currentItem && currentItemChildren.length == 0) {\n currentItem!.children = undefined;\n }\n return;\n } else {\n currentItem = currentItemChildren[i];\n currentItemChildren = currentItem.children;\n parents.shift();\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n}\n\n// TODO: reduce the number of statements in the following method and reactivate the disabled eslint rule.\n// eslint-disable-next-line max-statements\nasync function onDocumentUpdate(page: DocumentReference) {\n const parents = treeSource.getParentNodesId(\n page,\n props.includeTerminals,\n props.showRootNode,\n );\n let currentParent: string | undefined = undefined;\n let currentItems: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\n let isRoot = true;\n\n currentItemsLoop: while (currentItems && !notFound) {\n for (const i of currentItems.keys()) {\n if (currentItems[i].id == parents[0]) {\n if (parents.length == 1) {\n // Page update\n const newItems = await getChildNodes(\n currentParent ? currentParent : \"\",\n );\n for (const newItem of newItems) {\n if (newItem.id == currentItems[i].id) {\n currentItems[i].title = newItem.label;\n return;\n }\n }\n } else {\n currentParent = currentItems[i].id;\n if (!currentItems[i].children) {\n // This node had no children, we reset this so new ones can be\n // loaded lazily.\n currentItems[i].children = [];\n }\n currentItems = currentItems[i].children;\n parents.shift();\n isRoot = false;\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n\n // New page\n if (currentItems.length == 0 && !isRoot) {\n // We don't do anything because this node will be loaded lazily anyway.\n return;\n }\n const newItems = await getChildNodes(currentParent ? currentParent : \"\");\n const currentPageParents = props.currentPageReference\n ? treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\n )\n : [];\n newItemsLoop: for (const newItem of newItems) {\n for (const i of currentItems!.keys()) {\n if (newItem.id == currentItems![i].id) {\n continue newItemsLoop;\n }\n }\n currentItems!.push({\n id: newItem.id,\n title: newItem.label,\n href: newItem.url,\n children: newItem.has_children ? [] : undefined,\n _location: newItem.location,\n _is_terminal: newItem.is_terminal,\n });\n if (\n currentPageParents.length > 0 &&\n currentPageParents[currentPageParents.length - 1] === newItem.id\n ) {\n // If we add a node, and it's the current page, it should be activated.\n activatedNodes.value = [newItem.id];\n }\n }\n}\n\nasync function getChildNodes(id: string) {\n return (await treeSource.getChildNodes(id)).filter(\n (c) => props.includeTerminals || !c.is_terminal,\n );\n}\n</script>\n\n<template>\n <v-treeview\n v-model:opened=\"expandedNodes\"\n density=\"compact\"\n :activated=\"activatedNodes\"\n :items=\"rootNodes\"\n :load-children=\"lazyLoadChildren\"\n activatable\n active-strategy=\"independent\"\n item-value=\"id\"\n @update:activated=\"clearSelection\"\n >\n <template #title=\"{ item }: { item: any }\">\n <a\n v-if=\"props.clickAction\"\n :href=\"item.href\"\n @click.prevent=\"\n activatedNodes = [item.id];\n clickAction!({\n id: item.id,\n label: item.title,\n location: item._location,\n url: item.href,\n has_children: item.children !== undefined,\n is_terminal: item._is_terminal,\n });\n \"\n >{{ item.title }}</a\n >\n <a v-else :href=\"item.href\">{{ item.title }}</a>\n </template>\n </v-treeview>\n</template>\n\n<style scoped>\n.v-list {\n background: none;\n}\n:deep(a) {\n text-decoration: none;\n color: var(--cr-base-text-color);\n}\n/* Disable hover on items. */\n:deep(.v-list-item__overlay) {\n --v-hover-opacity: 0;\n}\n/* Disable hand cursor on items, since we disable the default click action. */\n:deep(.v-list-item--link) {\n cursor: default;\n}\n</style>\n"],"names":["navigationTreePropsDefaults","cristal","inject","documentService","treeSource","rootNodes","ref","activatedNodes","expandedNodes","isExpanding","props","__props","onBeforeMount","newRootNodes","node","getChildNodes","SpaceReference","expandTree","onDocumentDelete","onDocumentUpdate","watch","newExpandedNodes","i","currentNodes","lazyLoadChildren","item","treeItem","childNodes","child","clearSelection","page","parents","currentItem","currentItemChildren","notFound","currentItemsLoop","currentParent","currentItems","isRoot","newItems","newItem","currentPageParents","newItemsLoop","id","c","_createBlock","_unref","VTreeview","$event","_withCtx","_createElementBlock","_withModifiers","_toDisplayString","_hoisted_1","_hoisted_2"],"mappings":";;;;AAiDA,MAAMA,IAA8B;AAAA,EAClC,kBAAkB;AAC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B,EAAA,CAAAH,MAAA;AAAqB,YAAAzC,EAAA,QAAc,CAAIkB,EAAK,EAAE,GAAad,EAAA,YAAW;AAAA,cAAoB,IAAAc,EAAK;AAAA,cAAuB,OAAAA,EAAK;AAAA,cAA6B,UAAAA,EAAK;AAAA,cAA4B,KAAAA,EAAK;AAAA,4BAAgCA,EAAK,aAAa;AAAA,cAAoC,aAAAA,EAAK;AAAA,YAAA;;WAW3R2B,EAAA3B,EAAK,KAAK,GAAA,GAAA4B,CAAA,WAEhBH,EAAgD,KAAA;AAAA;UAArC,MAAMzB,EAAK;AAAA,QAAA,GAAS2B,EAAA3B,EAAK,KAAK,GAAA,GAAA6B,CAAA;AAAA,MAAA;;;;;"}
@@ -3,7 +3,7 @@ import { t as M } from "./translations-BVK9UR9x.js";
3
3
  import S from "./x-breadcrumb-DiDfmxr5.js";
4
4
  import { EntityType as E, SpaceReference as I } from "@xwiki/cristal-model-api";
5
5
  import { useI18n as A } from "vue-i18n";
6
- import { a as F } from "./index-DuymNdmD.js";
6
+ import { a as F } from "./index-CuRY2kJg.js";
7
7
  import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const z = {
9
9
  includeTerminals: !1
@@ -107,4 +107,4 @@ const z = {
107
107
  export {
108
108
  Q as default
109
109
  };
110
- //# sourceMappingURL=x-navigation-tree-select-BHnoY91T.js.map
110
+ //# sourceMappingURL=x-navigation-tree-select-DgyGTYDy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-navigation-tree-select-BHnoY91T.js","sources":["../../api/src/XNavigationTreeSelect.ts","../src/vue/form/x-navigation-tree-select.vue"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type {\n DocumentReference,\n SpaceReference,\n} from \"@xwiki/cristal-model-api\";\n\n/**\n * @since 0.15\n * @beta\n */\ntype NavigationTreeSelectProps = {\n label: string;\n help?: string;\n currentPageReference?: DocumentReference;\n modelValue?: SpaceReference;\n /**\n * Whether to include terminal pages as select options (default: false).\n * @since 0.16\n * @beta\n */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTreeSelect implementations.\n * @since 0.16\n * @beta\n */\nconst navigationTreeSelectPropsDefaults = {\n includeTerminals: false,\n};\n\nexport type { NavigationTreeSelectProps };\nexport { navigationTreeSelectPropsDefaults };\n","<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport XBreadcrumb from \"../x-breadcrumb.vue\";\nimport { navigationTreeSelectPropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { EntityType, SpaceReference } from \"@xwiki/cristal-model-api\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { CristalApp } from \"@xwiki/cristal-api\";\nimport type { NavigationTreeSelectProps } from \"@xwiki/cristal-dsapi\";\nimport type {\n PageHierarchyItem,\n PageHierarchyResolver,\n PageHierarchyResolverProvider,\n} from \"@xwiki/cristal-hierarchy-api\";\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type {\n ModelReferenceHandler,\n ModelReferenceHandlerProvider,\n} from \"@xwiki/cristal-model-reference-api\";\nimport type { NavigationTreeNode } from \"@xwiki/cristal-navigation-tree-api\";\nimport type { Ref } from \"vue\";\n\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst hierarchyResolver: PageHierarchyResolver = cristal\n .getContainer()\n .get<PageHierarchyResolverProvider>(\"PageHierarchyResolverProvider\")\n .get()!;\nconst referenceHandler: ModelReferenceHandler = cristal\n .getContainer()\n .get<ModelReferenceHandlerProvider>(\"ModelReferenceHandlerProvider\")\n .get()!;\n\nconst { t } = useI18n({\n messages,\n});\nconst props = withDefaults(\n defineProps<NavigationTreeSelectProps>(),\n navigationTreeSelectPropsDefaults,\n);\nconst model = defineModel<SpaceReference | DocumentReference>();\n\nconst openedLocationDialog: Ref<boolean> = ref(false);\nconst hierarchy: Ref<Array<PageHierarchyItem>> = ref([]);\nlet selectedPage: DocumentReference | undefined;\n\nonMounted(async () => {\n selectedPage = props.currentPageReference;\n model.value = props.currentPageReference!.space;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n props.currentPageReference!.space!,\n false,\n );\n});\n\nasync function treeNodeClickAction(node: NavigationTreeNode) {\n if (node.location.type == EntityType.SPACE) {\n if (node.location.names.length > 0) {\n selectedPage = referenceHandler.createDocumentReference(\n node.location.names[node.location.names.length - 1],\n new SpaceReference(\n node.location.wiki,\n ...node.location.names.slice(0, -1),\n ),\n );\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n selectedPage,\n false,\n );\n } else {\n selectedPage = undefined;\n hierarchy.value = [{ label: node.label, pageId: \"\", url: node.url }];\n }\n } else {\n selectedPage = node.location;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n selectedPage,\n false,\n );\n }\n model.value = node.location;\n}\n</script>\n\n<template>\n <v-text-field\n :label=\"label\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :active=\"hierarchy.length > 0\"\n readonly\n >\n <template #default>\n <XBreadcrumb :items=\"hierarchy\"></XBreadcrumb>\n </template>\n </v-text-field>\n <XDialog\n v-model=\"openedLocationDialog\"\n width=\"auto\"\n :title=\"t('vuetify.tree.select.location.label')\"\n >\n <template #activator>\n <x-btn id=\"change-page-location-button\" size=\"small\" color=\"secondary\">\n {{ t(\"vuetify.tree.select.location.label\") }}\n </x-btn>\n </template>\n <template #default>\n <XNavigationTree\n :current-page-reference=\"selectedPage\"\n :click-action=\"treeNodeClickAction\"\n :include-terminals=\"includeTerminals\"\n show-root-node\n ></XNavigationTree>\n </template>\n <template #footer>\n <XBtn variant=\"primary\" @click=\"openedLocationDialog = false\">\n {{ t(\"vuetify.tree.select.location.select\") }}\n </XBtn>\n </template>\n </XDialog>\n</template>\n\n<style scoped>\n.v-treeview {\n overflow: auto;\n}\n</style>\n"],"names":["navigationTreeSelectPropsDefaults","cristal","inject","hierarchyResolver","referenceHandler","t","useI18n","messages","props","__props","model","_useModel","openedLocationDialog","ref","hierarchy","selectedPage","onMounted","treeNodeClickAction","node","EntityType","SpaceReference","_createVNode","_unref","VTextField","XBreadcrumb","_component_XDialog","$event","_component_x_btn","_component_XNavigationTree","_component_XBtn"],"mappings":";;;;;;;AA+CA,MAAMA,IAAoC;AAAA,EACxC,kBAAkB;AACpB;;;;;;;;;;;;;;ACPA,UAAMC,IAAsBC,EAAmB,SAAS,GAClDC,IAA2CF,EAC9C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAA,GACGG,IAA0CH,EAC7C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAA,GAEG,EAAE,GAAAI,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,C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A;AAAA,UAAA;;;QAGlCO,EAuBUI,GAAA;AAAA,sBAtBCb,EAAA;AAAA,wDAAAA,EAAoB,QAAAc;AAAA,UAC7B,OAAM;AAAA,UACL,OAAOJ,EAAAjB,CAAA,EAAC,oCAAA;AAAA,QAAA;UAEE,aACT,MAEQ;AAAA,YAFRgB,EAEQM,GAAA;AAAA,cAFD,IAAG;AAAA,cAA8B,MAAK;AAAA,cAAQ,OAAM;AAAA,YAAA;yBACzD,MAA6C;AAAA,oBAA1CL,EAAAjB,CAAA,EAAC,oCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;UAGG,WACT,MAKmB;AAAA,YALnBgB,EAKmBO,GAAA;AAAA,cAJhB,0BAAwBN,EAAAP,CAAA;AAAA,cACxB,gBAAcE;AAAA,cACd,qBAAmBR,EAAA;AAAA,cACpB,kBAAA;AAAA,YAAA;;UAGO,UACT,MAEO;AAAA,YAFPY,EAEOQ,GAAA;AAAA,cAFD,SAAQ;AAAA,cAAW,gCAAOjB,EAAA,QAAoB;AAAA,YAAA;yBAClD,MAA8C;AAAA,oBAA3CU,EAAAjB,CAAA,EAAC,qCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"x-navigation-tree-select-DgyGTYDy.js","sources":["../../api/src/XNavigationTreeSelect.ts","../src/vue/form/x-navigation-tree-select.vue"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type {\n DocumentReference,\n SpaceReference,\n} from \"@xwiki/cristal-model-api\";\n\n/**\n * @since 0.15\n * @beta\n */\ntype NavigationTreeSelectProps = {\n label: string;\n help?: string;\n currentPageReference?: DocumentReference;\n modelValue?: SpaceReference;\n /**\n * Whether to include terminal pages as select options (default: false).\n * @since 0.16\n * @beta\n */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTreeSelect implementations.\n * @since 0.16\n * @beta\n */\nconst navigationTreeSelectPropsDefaults = {\n includeTerminals: false,\n};\n\nexport type { NavigationTreeSelectProps };\nexport { navigationTreeSelectPropsDefaults };\n","<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport XBreadcrumb from \"../x-breadcrumb.vue\";\nimport { navigationTreeSelectPropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { EntityType, SpaceReference } from \"@xwiki/cristal-model-api\";\nimport { inject, onMounted, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { CristalApp } from \"@xwiki/cristal-api\";\nimport type { NavigationTreeSelectProps } from \"@xwiki/cristal-dsapi\";\nimport type {\n PageHierarchyItem,\n PageHierarchyResolver,\n PageHierarchyResolverProvider,\n} from \"@xwiki/cristal-hierarchy-api\";\nimport type { DocumentReference } from \"@xwiki/cristal-model-api\";\nimport type {\n ModelReferenceHandler,\n ModelReferenceHandlerProvider,\n} from \"@xwiki/cristal-model-reference-api\";\nimport type { NavigationTreeNode } from \"@xwiki/cristal-navigation-tree-api\";\nimport type { Ref } from \"vue\";\n\nconst cristal: CristalApp = inject<CristalApp>(\"cristal\")!;\nconst hierarchyResolver: PageHierarchyResolver = cristal\n .getContainer()\n .get<PageHierarchyResolverProvider>(\"PageHierarchyResolverProvider\")\n .get()!;\nconst referenceHandler: ModelReferenceHandler = cristal\n .getContainer()\n .get<ModelReferenceHandlerProvider>(\"ModelReferenceHandlerProvider\")\n .get()!;\n\nconst { t } = useI18n({\n messages,\n});\nconst props = withDefaults(\n defineProps<NavigationTreeSelectProps>(),\n navigationTreeSelectPropsDefaults,\n);\nconst model = defineModel<SpaceReference | DocumentReference>();\n\nconst openedLocationDialog: Ref<boolean> = ref(false);\nconst hierarchy: Ref<Array<PageHierarchyItem>> = ref([]);\nlet selectedPage: DocumentReference | undefined;\n\nonMounted(async () => {\n selectedPage = props.currentPageReference;\n model.value = props.currentPageReference!.space;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n props.currentPageReference!.space!,\n false,\n );\n});\n\nasync function treeNodeClickAction(node: NavigationTreeNode) {\n if (node.location.type == EntityType.SPACE) {\n if (node.location.names.length > 0) {\n selectedPage = referenceHandler.createDocumentReference(\n node.location.names[node.location.names.length - 1],\n new SpaceReference(\n node.location.wiki,\n ...node.location.names.slice(0, -1),\n ),\n );\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n selectedPage,\n false,\n );\n } else {\n selectedPage = undefined;\n hierarchy.value = [{ label: node.label, pageId: \"\", url: node.url }];\n }\n } else {\n selectedPage = node.location;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(\n selectedPage,\n false,\n );\n }\n model.value = node.location;\n}\n</script>\n\n<template>\n <v-text-field\n :label=\"label\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :active=\"hierarchy.length > 0\"\n readonly\n >\n <template #default>\n <XBreadcrumb :items=\"hierarchy\"></XBreadcrumb>\n </template>\n </v-text-field>\n <XDialog\n v-model=\"openedLocationDialog\"\n width=\"auto\"\n :title=\"t('vuetify.tree.select.location.label')\"\n >\n <template #activator>\n <x-btn id=\"change-page-location-button\" size=\"small\" color=\"secondary\">\n {{ t(\"vuetify.tree.select.location.label\") }}\n </x-btn>\n </template>\n <template #default>\n <XNavigationTree\n :current-page-reference=\"selectedPage\"\n :click-action=\"treeNodeClickAction\"\n :include-terminals=\"includeTerminals\"\n show-root-node\n ></XNavigationTree>\n </template>\n <template #footer>\n <XBtn variant=\"primary\" @click=\"openedLocationDialog = false\">\n {{ t(\"vuetify.tree.select.location.select\") }}\n </XBtn>\n </template>\n </XDialog>\n</template>\n\n<style scoped>\n.v-treeview {\n overflow: auto;\n}\n</style>\n"],"names":["navigationTreeSelectPropsDefaults","cristal","inject","hierarchyResolver","referenceHandler","t","useI18n","messages","props","__props","model","_useModel","openedLocationDialog","ref","hierarchy","selectedPage","onMounted","treeNodeClickAction","node","EntityType","SpaceReference","_createVNode","_unref","VTextField","XBreadcrumb","_component_XDialog","$event","_component_x_btn","_component_XNavigationTree","_component_XBtn"],"mappings":";;;;;;;AA+CA,MAAMA,IAAoC;AAAA,EACxC,kBAAkB;AACpB;;;;;;;;;;;;;;ACPA,UAAMC,IAAsBC,EAAmB,SAAS,GAClDC,IAA2CF,EAC9C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAA,GACGG,IAA0CH,EAC7C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAA,GAEG,EAAE,GAAAI,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GACKC,IAAQC,GAIRC,IAAQC,EAA+CF,GAAA,YAAC,GAExDG,IAAqCC,EAAI,EAAK,GAC9CC,IAA2CD,EAAI,EAAE;AACvD,QAAIE;AAEJ,IAAAC,EAAU,YAAY;AACpB,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A;AAAA,QAAA;UAEE,aACT,MAEQ;AAAA,YAFRgB,EAEQM,GAAA;AAAA,cAFD,IAAG;AAAA,cAA8B,MAAK;AAAA,cAAQ,OAAM;AAAA,YAAA;yBACzD,MAA6C;AAAA,oBAA1CL,EAAAjB,CAAA,EAAC,oCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;UAGG,WACT,MAKmB;AAAA,YALnBgB,EAKmBO,GAAA;AAAA,cAJhB,0BAAwBN,EAAAP,CAAA;AAAA,cACxB,gBAAcE;AAAA,cACd,qBAAmBR,EAAA;AAAA,cACpB,kBAAA;AAAA,YAAA;;UAGO,UACT,MAEO;AAAA,YAFPY,EAEOQ,GAAA;AAAA,cAFD,SAAQ;AAAA,cAAW,gCAAOjB,EAAA,QAAoB;AAAA,YAAA;yBAClD,MAA8C;AAAA,oBAA3CU,EAAAjB,CAAA,EAAC,qCAAA,CAAA,GAAA,CAAA;AAAA,cAAA;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as m, mergeModels as n, useModel as i, computed as d, createBlock as c, openBlock as f, unref as p } from "vue";
2
2
  import { t as V } from "./translations-BVK9UR9x.js";
3
3
  import { useI18n as b } from "vue-i18n";
4
- import { e as g } from "./index-DuymNdmD.js";
4
+ import { e as g } from "./index-CuRY2kJg.js";
5
5
  const B = /* @__PURE__ */ m({
6
6
  __name: "x-select",
7
7
  props: /* @__PURE__ */ n({
@@ -36,4 +36,4 @@ const B = /* @__PURE__ */ m({
36
36
  export {
37
37
  B as default
38
38
  };
39
- //# sourceMappingURL=x-select-mVjAXRju.js.map
39
+ //# sourceMappingURL=x-select-D2T4qd71.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-select-mVjAXRju.js","sources":["../src/vue/form/x-select.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VSelect } from \"vuetify/components/VSelect\";\nimport type { SelectProps } from \"@xwiki/cristal-dsapi\";\n\nconst props = defineProps<SelectProps>();\nconst selected = defineModel<string>();\n\nconst { t } = useI18n({\n messages,\n});\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.select.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n<template>\n <v-select\n v-model=\"selected\"\n :label=\"label\"\n :messages=\"help\"\n :items=\"items\"\n :rules=\"rules\"\n :clearable=\"!required\"\n ></v-select>\n</template>\n"],"names":["props","__props","selected","_useModel","t","useI18n","messages","rules","computed","rulesList","value","_createBlock","_unref","VSelect","$event"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAQC,GACRC,IAAWC,EAAmBF,GAAA,YAAC,GAE/B,EAAE,GAAAG,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIT,EAAM,YACRS,EAAU,KAAK,CAACC,MACVA,IACK,KAEAN,EAAE,gCAAgC,CAE5C,GAEIK;AAAA,IACT,CAAC;2BAGCE,EAOYC,EAAAC,CAAA,GAAA;AAAA,kBANDX,EAAA;AAAA,oDAAAA,EAAQ,QAAAY;AAAA,MAChB,OAAOb,EAAA;AAAA,MACP,UAAUA,EAAA;AAAA,MACV,OAAOA,EAAA;AAAA,MACP,OAAOM,EAAA;AAAA,MACP,YAAYN,EAAA;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"x-select-D2T4qd71.js","sources":["../src/vue/form/x-select.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VSelect } from \"vuetify/components/VSelect\";\nimport type { SelectProps } from \"@xwiki/cristal-dsapi\";\n\nconst props = defineProps<SelectProps>();\nconst selected = defineModel<string>();\n\nconst { t } = useI18n({\n messages,\n});\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.select.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n<template>\n <v-select\n v-model=\"selected\"\n :label=\"label\"\n :messages=\"help\"\n :items=\"items\"\n :rules=\"rules\"\n :clearable=\"!required\"\n ></v-select>\n</template>\n"],"names":["props","__props","selected","_useModel","t","useI18n","messages","rules","computed","rulesList","value","_createBlock","_unref","VSelect","$event"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAQC,GACRC,IAAWC,EAAmBF,GAAA,YAAC,GAE/B,EAAE,GAAAG,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIT,EAAM,YACRS,EAAU,KAAK,CAACC,MACVA,IACK,KAEAN,EAAE,gCAAgC,CAE5C,GAEIK;AAAA,IACT,CAAC;2BAGCE,EAOYC,EAAAC,CAAA,GAAA;AAAA,kBANDX,EAAA;AAAA,oDAAAA,EAAQ,QAAAY;AAAA,MAChB,OAAOb,EAAA;AAAA,MACP,UAAUA,EAAA;AAAA,MACV,OAAOA,EAAA;AAAA,MACP,OAAOM,EAAA;AAAA,MACP,YAAYN,EAAA;AAAA,IAAA;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as s, mergeModels as m, useModel as i, computed as d, createBlock as f, openBlock as c, unref as p } from "vue";
2
2
  import { t as y } from "./translations-BVK9UR9x.js";
3
3
  import { useI18n as V } from "vue-i18n";
4
- import { a as h } from "./index-DuymNdmD.js";
4
+ import { a as h } from "./index-CuRY2kJg.js";
5
5
  const M = /* @__PURE__ */ s({
6
6
  __name: "x-text-field",
7
7
  props: /* @__PURE__ */ m({
@@ -42,4 +42,4 @@ const M = /* @__PURE__ */ s({
42
42
  export {
43
43
  M as default
44
44
  };
45
- //# sourceMappingURL=x-text-field-DTZ5xunG.js.map
45
+ //# sourceMappingURL=x-text-field-DoGMe9Qc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-text-field-DTZ5xunG.js","sources":["../src/vue/form/x-text-field.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\nconst props = defineProps<TextFieldProps>();\nconst input = defineModel<string>();\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.text.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n\n<template>\n <v-text-field\n v-model=\"input\"\n :label=\"label\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :rules=\"rules\"\n :readonly=\"readonly\"\n :type=\"type ?? 'text'\"\n ></v-text-field>\n</template>\n\n<style scoped></style>\n"],"names":["t","useI18n","messages","props","__props","input","_useModel","rules","computed","rulesList","value","_createBlock","_unref","VTextField","$event"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,EAAE,GAAAA,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GACKC,IAAQC,GACRC,IAAQC,EAAmBF,GAAA,YAAC,GAE5BG,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIN,EAAM,YACRM,EAAU,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IACT,CAAC;2BAICE,EAUgBC,EAAAC,CAAA,GAAA;AAAA,kBATLR,EAAA;AAAA,oDAAAA,EAAK,QAAAS;AAAA,MACb,OAAOV,EAAA;AAAA,MACP,MAAMA,EAAA;AAAA,MACN,WAAWA,EAAA;AAAA,MACX,MAAMA,EAAA;AAAA,MACN,mBAAiBA,EAAA,SAAS;AAAA,MAC1B,OAAOG,EAAA;AAAA,MACP,UAAUH,EAAA;AAAA,MACV,MAAMA,EAAA,QAAI;AAAA,IAAA;;;"}
1
+ {"version":3,"file":"x-text-field-DoGMe9Qc.js","sources":["../src/vue/form/x-text-field.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\nconst props = defineProps<TextFieldProps>();\nconst input = defineModel<string>();\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.text.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n\n<template>\n <v-text-field\n v-model=\"input\"\n :label=\"label\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :hint=\"help\"\n :persistent-hint=\"help !== undefined\"\n :rules=\"rules\"\n :readonly=\"readonly\"\n :type=\"type ?? 'text'\"\n ></v-text-field>\n</template>\n\n<style scoped></style>\n"],"names":["t","useI18n","messages","props","__props","input","_useModel","rules","computed","rulesList","value","_createBlock","_unref","VTextField","$event"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,UAAM,EAAE,GAAAA,EAAA,IAAMC,EAAQ;AAAA,MAAA,UACpBC;AAAAA,IAAA,CACD,GACKC,IAAQC,GACRC,IAAQC,EAAmBF,GAAA,YAAC,GAE5BG,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAA;AAClB,aAAIN,EAAM,YACRM,EAAU,KAAK,CAACC,MACVA,IACK,KAEAV,EAAE,8BAA8B,CAE1C,GAEIS;AAAA,IACT,CAAC;2BAICE,EAUgBC,EAAAC,CAAA,GAAA;AAAA,kBATLR,EAAA;AAAA,oDAAAA,EAAK,QAAAS;AAAA,MACb,OAAOV,EAAA;AAAA,MACP,MAAMA,EAAA;AAAA,MACN,WAAWA,EAAA;AAAA,MACX,MAAMA,EAAA;AAAA,MACN,mBAAiBA,EAAA,SAAS;AAAA,MAC1B,OAAOG,EAAA;AAAA,MACP,UAAUH,EAAA;AAAA,MACV,MAAMA,EAAA,QAAI;AAAA,IAAA;;;"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as s, mergeModels as v, useModel as r, ref as u, watch as p, createBlock as f, openBlock as m, unref as h, withCtx as x, createElementVNode as N, toDisplayString as k } from "vue";
2
- import { c as w } from "./index-DuymNdmD.js";
3
- import { _ as y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const C = ["href", "onClick"], M = /* @__PURE__ */ s({
1
+ import { defineComponent as s, mergeModels as v, useModel as r, ref as p, watch as u, createBlock as f, openBlock as m, unref as h, withCtx as x, createElementVNode as y, toDisplayString as N } from "vue";
2
+ import { c as b } from "./index-CuRY2kJg.js";
3
+ import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const w = ["href", "onClick"], C = /* @__PURE__ */ s({
5
5
  __name: "x-tree",
6
6
  props: /* @__PURE__ */ v({
7
7
  rootNode: {},
@@ -9,22 +9,22 @@ const C = ["href", "onClick"], M = /* @__PURE__ */ s({
9
9
  activated: {},
10
10
  opened: {}
11
11
  }, {
12
- opened: { default: [] },
12
+ opened: { default: [], type: Array },
13
13
  openedModifiers: {},
14
14
  activated: {},
15
15
  activatedModifiers: {}
16
16
  }),
17
17
  emits: ["update:opened", "update:activated"],
18
18
  setup(e) {
19
- const d = r(e, "opened"), a = r(e, "activated"), i = u([]);
20
- p(a, n, { immediate: !0 });
19
+ const d = r(e, "opened"), a = r(e, "activated"), i = p([]);
20
+ u(a, n, { immediate: !0 });
21
21
  function n() {
22
22
  i.value = a.value ? [a.value] : [];
23
23
  }
24
24
  function l(o) {
25
25
  o.activatable && (a.value = o.id);
26
26
  }
27
- return (o, c) => (m(), f(h(w), {
27
+ return (o, c) => (m(), f(h(b), {
28
28
  density: "compact",
29
29
  activated: i.value,
30
30
  items: e.showRootNode ? [e.rootNode] : e.rootNode.children,
@@ -36,16 +36,16 @@ const C = ["href", "onClick"], M = /* @__PURE__ */ s({
36
36
  "onUpdate:activated": n
37
37
  }, {
38
38
  title: x(({ item: t }) => [
39
- N("a", {
39
+ y("a", {
40
40
  href: t.url,
41
- onClick: (_) => l(t)
42
- }, k(t.label), 9, C)
41
+ onClick: (M) => l(t)
42
+ }, N(t.label), 9, w)
43
43
  ]),
44
44
  _: 1
45
45
  }, 8, ["activated", "items", "opened"]));
46
46
  }
47
- }), R = /* @__PURE__ */ y(M, [["__scopeId", "data-v-f28485e4"]]);
47
+ }), A = /* @__PURE__ */ k(C, [["__scopeId", "data-v-492d4cb8"]]);
48
48
  export {
49
- R as default
49
+ A as default
50
50
  };
51
- //# sourceMappingURL=x-tree-iloM7Rw9.js.map
51
+ //# sourceMappingURL=x-tree-DFzX3ffS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-tree-DFzX3ffS.js","sources":["../src/vue/x-tree.vue"],"sourcesContent":["<!--\n See the LICENSE file distributed with this work for additional\n information regarding copyright ownership.\n\n This is free software; you can redistribute it and/or modify it\n under the terms of the GNU Lesser General Public License as\n published by the Free Software Foundation; either version 2.1 of\n the License, or (at your option) any later version.\n\n This software is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this software; if not, write to the Free\n Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport { ref, watch } from \"vue\";\nimport { VTreeview } from \"vuetify/components/VTreeview\";\nimport type { DisplayableTreeNode, TreeProps } from \"@xwiki/cristal-dsapi\";\nimport type { Ref } from \"vue\";\n\ndefineProps<TreeProps>();\nconst opened = defineModel(\"opened\", { default: [], type: Array<string> });\nconst activated = defineModel<string | undefined>(\"activated\");\n\nconst activatedNodes: Ref<Array<string>> = ref([]);\n\nwatch(activated, resetActivated, { immediate: true });\n\nfunction resetActivated() {\n // Clicking on a node would activate it and this can't be disabled easily.\n // With this listener, we ensure that only the node we want stays active.\n activatedNodes.value = activated.value ? [activated.value] : [];\n}\n\nfunction updateActivated(newActivatedNode: DisplayableTreeNode) {\n if (newActivatedNode.activatable) {\n activated.value = newActivatedNode.id;\n }\n}\n</script>\n\n<template>\n <v-treeview\n density=\"compact\"\n :activated=\"activatedNodes\"\n :items=\"showRootNode ? [rootNode] : rootNode.children\"\n activatable\n active-strategy=\"independent\"\n item-value=\"id\"\n :opened=\"opened\"\n @update:opened=\"($event) => (opened = $event as string[])\"\n @update:activated=\"resetActivated\"\n >\n <template #title=\"{ item }\">\n <a :href=\"item.url\" @click=\"updateActivated(item)\">{{ item.label }}</a>\n </template>\n </v-treeview>\n</template>\n\n<style scoped>\n/* Remove the background color from the root div element. */\n.v-list {\n background: none;\n}\n:deep(a) {\n text-decoration: none;\n color: var(--cr-base-text-color);\n}\n/* Disable hover on items. */\n:deep(.v-list-item__overlay) {\n --v-hover-opacity: 0;\n}\n/* Disable hand cursor on items, since we disable the default click action. */\n:deep(.v-list-item--link) {\n cursor: default;\n}\n</style>\n"],"names":["opened","_useModel","__props","activated","activatedNodes","ref","watch","resetActivated","updateActivated","newActivatedNode","_createBlock","_unref","VTreeview","_cache","$event","_withCtx","item","_createElementVNode","_toDisplayString","_hoisted_1"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAASC,EAAWC,GAAC,QAA8C,GACnEC,IAAYF,KAAgC,WAAW,GAEvDG,IAAqCC,EAAI,EAAE;AAEjD,IAAAC,EAAMH,GAAWI,GAAgB,EAAE,WAAW,IAAM;AAEpD,aAASA,IAAiB;AAGxB,MAAAH,EAAe,QAAQD,EAAU,QAAQ,CAACA,EAAU,KAAK,IAAI,CAAA;AAAA,IAC/D;AAEA,aAASK,EAAgBC,GAAuC;AAC9D,MAAIA,EAAiB,gBACnBN,EAAU,QAAQM,EAAiB;AAAA,IAEvC;2BAIEC,EAcaC,EAAAC,CAAA,GAAA;AAAA,MAbX,SAAQ;AAAA,MACP,WAAWR,EAAA;AAAA,MACX,OAAOF,EAAA,eAAY,CAAIA,UAAQ,IAAIA,EAAA,SAAS;AAAA,MAC7C,aAAA;AAAA,MACA,mBAAgB;AAAA,MAChB,cAAW;AAAA,MACV,QAAQF,EAAA;AAAA,MACR,mBAAaa,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAGC,MAAYd,EAAA,QAASc;AAAA,MACrC,sBAAkBP;AAAA,IAAA;MAER,OAAKQ,EACd,CAAuE,EADrD,MAAAC,QAAI;AAAA,QACtBC,EAAuE,KAAA;AAAA,UAAnE,MAAMD,EAAK;AAAA,UAAM,SAAK,CAAAF,MAAEN,EAAgBQ,CAAI;AAAA,QAAA,GAAME,EAAAF,EAAK,KAAK,GAAA,GAAAG,CAAA;AAAA,MAAA;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xwiki/cristal-dsvuetify",
3
- "version": "0.23.1",
3
+ "version": "0.24.0",
4
4
  "license": "LGPL 2.1",
5
5
  "author": "XWiki Org Community <contact@xwiki.org>",
6
6
  "homepage": "https://cristal.xwiki.org/",
@@ -29,14 +29,14 @@
29
29
  "types": "./dist/index.d.ts",
30
30
  "dependencies": {
31
31
  "vue-i18n": "11.1.12",
32
- "vuetify": "3.10.4",
33
- "@xwiki/cristal-api": "0.23.1",
34
- "@xwiki/cristal-document-api": "0.23.1",
35
- "@xwiki/cristal-hierarchy-api": "0.23.1",
36
- "@xwiki/cristal-model-api": "0.23.1",
37
- "@xwiki/cristal-fn-utils": "0.23.1",
38
- "@xwiki/cristal-model-reference-api": "0.23.1",
39
- "@xwiki/cristal-navigation-tree-api": "0.23.1"
32
+ "vuetify": "3.10.8",
33
+ "@xwiki/cristal-api": "0.24.0",
34
+ "@xwiki/cristal-document-api": "0.24.0",
35
+ "@xwiki/cristal-fn-utils": "0.24.0",
36
+ "@xwiki/cristal-hierarchy-api": "0.24.0",
37
+ "@xwiki/cristal-model-reference-api": "0.24.0",
38
+ "@xwiki/cristal-model-api": "0.24.0",
39
+ "@xwiki/cristal-navigation-tree-api": "0.24.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "inversify": "7.x",
@@ -45,14 +45,14 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@vue/test-utils": "2.4.6",
48
- "inversify": "7.10.2",
48
+ "inversify": "7.10.4",
49
49
  "reflect-metadata": "0.2.2",
50
50
  "typescript": "5.9.3",
51
- "vite": "7.1.9",
51
+ "vite": "7.1.12",
52
52
  "vue": "3.5.22",
53
- "vue-tsc": "2.2.12",
54
- "@xwiki/cristal-dev-config": "0.23.1",
55
- "@xwiki/cristal-dsapi": "0.23.1"
53
+ "vue-tsc": "3.1.3",
54
+ "@xwiki/cristal-dev-config": "0.24.0",
55
+ "@xwiki/cristal-dsapi": "0.24.0"
56
56
  },
57
57
  "scripts": {
58
58
  "api-extractor:local": "api-extractor run --local",
@@ -23,7 +23,13 @@ import type { AlertProps } from "@xwiki/cristal-dsapi";
23
23
  defineProps<AlertProps>();
24
24
  </script>
25
25
  <template>
26
- <v-alert :closable="closable" :title="title" :type="type" :text="description">
26
+ <v-alert
27
+ :closable="closable"
28
+ :title="title"
29
+ :type="type"
30
+ :text="description"
31
+ :class="{ 'flat-corners': flatCorners }"
32
+ >
27
33
  <x-btn
28
34
  v-for="action of actions"
29
35
  :key="action.name"
@@ -39,9 +45,12 @@ defineProps<AlertProps>();
39
45
  </template>
40
46
 
41
47
  <style scoped>
42
- :deep(.v-alert__content a.router-link-active),
43
- :deep(.v-alert__content a.router-link-active:visited) {
48
+ :deep(.v-alert__content a),
49
+ :deep(.v-alert__content a:visited) {
44
50
  color: inherit;
45
51
  text-decoration-color: inherit;
46
52
  }
53
+ .flat-corners {
54
+ border-radius: initial;
55
+ }
47
56
  </style>
@@ -24,7 +24,7 @@ import type { DisplayableTreeNode, TreeProps } from "@xwiki/cristal-dsapi";
24
24
  import type { Ref } from "vue";
25
25
 
26
26
  defineProps<TreeProps>();
27
- const opened = defineModel<string[]>("opened", { default: [] });
27
+ const opened = defineModel("opened", { default: [], type: Array<string> });
28
28
  const activated = defineModel<string | undefined>("activated");
29
29
 
30
30
  const activatedNodes: Ref<Array<string>> = ref([]);
@@ -52,10 +52,11 @@ function updateActivated(newActivatedNode: DisplayableTreeNode) {
52
52
  activatable
53
53
  active-strategy="independent"
54
54
  item-value="id"
55
- v-model:opened="opened"
55
+ :opened="opened"
56
+ @update:opened="($event) => (opened = $event as string[])"
56
57
  @update:activated="resetActivated"
57
58
  >
58
- <template #title="{ item }: { item: DisplayableTreeNode }">
59
+ <template #title="{ item }">
59
60
  <a :href="item.url" @click="updateActivated(item)">{{ item.label }}</a>
60
61
  </template>
61
62
  </v-treeview>