@xwiki/cristal-dsvuetify 0.16.0 → 0.18.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 (79) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{index-CLqR2xXr.js → index-C-c8K0Z_.js} +7863 -7315
  3. package/dist/index-C-c8K0Z_.js.map +1 -0
  4. package/dist/index.es.js +5 -5
  5. package/dist/index.umd.js +10 -10
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/{translations-k4crOAds.js → translations-BVK9UR9x.js} +4 -1
  8. package/dist/{translations-k4crOAds.js.map → translations-BVK9UR9x.js.map} +1 -1
  9. package/dist/vue/form/x-form.vue.d.ts +1195 -3
  10. package/dist/vue/form/x-select.vue.d.ts +11 -0
  11. package/dist/{x-alert-CRdF8zFB.js → x-alert-gEtl8xCI.js} +10 -10
  12. package/dist/x-alert-gEtl8xCI.js.map +1 -0
  13. package/dist/{x-avatar-Ds9aYRI9.js → x-avatar-WnkeGyHH.js} +2 -2
  14. package/dist/x-avatar-WnkeGyHH.js.map +1 -0
  15. package/dist/{x-breadcrumb-C2iUd4Sf.js → x-breadcrumb-CyjqjISE.js} +3 -3
  16. package/dist/{x-breadcrumb-C2iUd4Sf.js.map → x-breadcrumb-CyjqjISE.js.map} +1 -1
  17. package/dist/{x-btn-DwTcXGgx.js → x-btn-DzH2bk-f.js} +4 -4
  18. package/dist/{x-btn-DwTcXGgx.js.map → x-btn-DzH2bk-f.js.map} +1 -1
  19. package/dist/{x-card-CRM9KUby.js → x-card-BlUD5hbt.js} +3 -3
  20. package/dist/{x-card-CRM9KUby.js.map → x-card-BlUD5hbt.js.map} +1 -1
  21. package/dist/{x-checkbox-BMonacnS.js → x-checkbox-D6cpCtlt.js} +4 -4
  22. package/dist/{x-checkbox-BMonacnS.js.map → x-checkbox-D6cpCtlt.js.map} +1 -1
  23. package/dist/x-dialog-Ccb-vGZ2.js +49 -0
  24. package/dist/x-dialog-Ccb-vGZ2.js.map +1 -0
  25. package/dist/{x-divider-Buudf0KI.js → x-divider-BOCxsH8h.js} +3 -3
  26. package/dist/x-divider-BOCxsH8h.js.map +1 -0
  27. package/dist/{x-file-input-CUcSVuxz.js → x-file-input-DubSSwF4.js} +5 -5
  28. package/dist/{x-file-input-CUcSVuxz.js.map → x-file-input-DubSSwF4.js.map} +1 -1
  29. package/dist/x-form-B2T8k_wn.js +36 -0
  30. package/dist/x-form-B2T8k_wn.js.map +1 -0
  31. package/dist/{x-img-BYgs_O1F.js → x-img-DWbVDNTs.js} +3 -3
  32. package/dist/{x-img-BYgs_O1F.js.map → x-img-DWbVDNTs.js.map} +1 -1
  33. package/dist/x-load-Bw4ftl3k.js +11 -0
  34. package/dist/x-load-Bw4ftl3k.js.map +1 -0
  35. package/dist/{x-menu-DDC7z1Wb.js → x-menu-BeWrqcFy.js} +5 -5
  36. package/dist/{x-menu-DDC7z1Wb.js.map → x-menu-BeWrqcFy.js.map} +1 -1
  37. package/dist/{x-menu-item-ByE5R9Bf.js → x-menu-item-CBdOhZc3.js} +3 -3
  38. package/dist/x-menu-item-CBdOhZc3.js.map +1 -0
  39. package/dist/{x-menu-label-DniImc0U.js → x-menu-label-D-sFcG_g.js} +3 -3
  40. package/dist/{x-menu-label-DniImc0U.js.map → x-menu-label-D-sFcG_g.js.map} +1 -1
  41. package/dist/{x-navigation-tree-CeAKceG7.js → x-navigation-tree-Cx21xHVH.js} +70 -70
  42. package/dist/x-navigation-tree-Cx21xHVH.js.map +1 -0
  43. package/dist/{x-navigation-tree-select-C6j0iSBP.js → x-navigation-tree-select-B3fRZYec.js} +10 -10
  44. package/dist/{x-navigation-tree-select-C6j0iSBP.js.map → x-navigation-tree-select-B3fRZYec.js.map} +1 -1
  45. package/dist/{x-search-C4yZLrSp.js → x-search-C7GhoCKj.js} +3 -3
  46. package/dist/{x-search-C4yZLrSp.js.map → x-search-C7GhoCKj.js.map} +1 -1
  47. package/dist/x-select-CgIqNkk3.js +39 -0
  48. package/dist/x-select-CgIqNkk3.js.map +1 -0
  49. package/dist/{x-tab-group-D1jmHXyJ.js → x-tab-group-BfEaq8Nj.js} +3 -3
  50. package/dist/{x-tab-group-D1jmHXyJ.js.map → x-tab-group-BfEaq8Nj.js.map} +1 -1
  51. package/dist/{x-tab-panel-YsSPuuLL.js → x-tab-panel-DysgiPCz.js} +3 -3
  52. package/dist/x-tab-panel-DysgiPCz.js.map +1 -0
  53. package/dist/{x-tab-OWsxC4de.js → x-tab-vRrbUjdK.js} +3 -3
  54. package/dist/x-tab-vRrbUjdK.js.map +1 -0
  55. package/dist/{x-text-field-D94TCr6e.js → x-text-field-KwBy_u7M.js} +8 -8
  56. package/dist/{x-text-field-D94TCr6e.js.map → x-text-field-KwBy_u7M.js.map} +1 -1
  57. package/langs/translation-de.json +1 -0
  58. package/langs/translation-en.json +1 -0
  59. package/langs/translation-fr.json +1 -0
  60. package/package.json +15 -15
  61. package/src/components/vuetifyDesignSystemLoader.ts +5 -0
  62. package/src/vue/css/style.css +4 -0
  63. package/src/vue/form/x-form.vue +19 -3
  64. package/src/vue/form/x-select.vue +57 -0
  65. package/src/vue/x-dialog.vue +1 -1
  66. package/dist/index-CLqR2xXr.js.map +0 -1
  67. package/dist/x-alert-CRdF8zFB.js.map +0 -1
  68. package/dist/x-avatar-Ds9aYRI9.js.map +0 -1
  69. package/dist/x-dialog-DCEnccuq.js +0 -48
  70. package/dist/x-dialog-DCEnccuq.js.map +0 -1
  71. package/dist/x-divider-Buudf0KI.js.map +0 -1
  72. package/dist/x-form-DWpzuKe6.js +0 -25
  73. package/dist/x-form-DWpzuKe6.js.map +0 -1
  74. package/dist/x-load-DipiCmNY.js +0 -11
  75. package/dist/x-load-DipiCmNY.js.map +0 -1
  76. package/dist/x-menu-item-ByE5R9Bf.js.map +0 -1
  77. package/dist/x-navigation-tree-CeAKceG7.js.map +0 -1
  78. package/dist/x-tab-OWsxC4de.js.map +0 -1
  79. package/dist/x-tab-panel-YsSPuuLL.js.map +0 -1
@@ -1,14 +1,14 @@
1
- import { ref as S, computed as V, createVNode as p, mergeProps as T, Fragment as R, inject as H, toRaw as O, reactive as Z, withModifiers as J, toRef as _, provide as ee, defineComponent as te, mergeDefaults as ne, onBeforeMount as ie, watch as le, openBlock as D, createBlock as ae, unref as re, withCtx as ce, createElementBlock as $, toDisplayString as U } from "vue";
2
- import { p as N, o as G, m as oe, g as B, u as F, c as M, d as de, I as A, e as se, f as q, h as ue, i as ve, j as fe, k as he, l as me, n as ge, q as Ie, r as we, s as j, t as pe, v as be, w as z } from "./index-CLqR2xXr.js";
1
+ import { ref as S, computed as V, createVNode as p, mergeProps as T, Fragment as R, inject as H, toRaw as O, reactive as Z, withModifiers as J, toRef as _, provide as ee, defineComponent as te, mergeDefaults as ne, onBeforeMount as ie, watch as le, createBlock as ae, openBlock as D, unref as re, withCtx as ce, createElementBlock as $, toDisplayString as U } from "vue";
2
+ import { g as N, p as B, u as G, c as M, d as oe, o as F, m as se, e as q, f as de, h as ue, i as ve, j as fe, I as A, k as he, l as me, n as ge, q as j, r as Ie, s as we, t as pe, v as be, w as z } from "./index-C-c8K0Z_.js";
3
3
  import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const Ce = {
5
5
  includeTerminals: !0
6
- }, ye = N({
7
- ...G(oe({
6
+ }, ye = B({
7
+ ...F(se({
8
8
  collapseIcon: "$treeviewCollapse",
9
9
  expandIcon: "$treeviewExpand"
10
10
  }), ["subgroup"])
11
- }, "VTreeviewGroup"), K = B()({
11
+ }, "VTreeviewGroup"), K = N()({
12
12
  name: "VTreeviewGroup",
13
13
  props: ye(),
14
14
  setup(e, C) {
@@ -16,29 +16,29 @@ const Ce = {
16
16
  slots: l
17
17
  } = C;
18
18
  const h = S(), k = V(() => {
19
- var s;
20
- return (s = h.value) != null && s.isOpen ? e.collapseIcon : e.expandIcon;
21
- }), d = V(() => {
22
- var s;
19
+ var d;
20
+ return (d = h.value) != null && d.isOpen ? e.collapseIcon : e.expandIcon;
21
+ }), s = V(() => {
22
+ var d;
23
23
  return {
24
24
  VTreeviewItem: {
25
25
  prependIcon: void 0,
26
26
  appendIcon: void 0,
27
- active: (s = h.value) == null ? void 0 : s.isOpen,
27
+ active: (d = h.value) == null ? void 0 : d.isOpen,
28
28
  toggleIcon: k.value
29
29
  }
30
30
  };
31
31
  });
32
- return F(() => {
33
- const s = M.filterProps(e);
34
- return p(M, T(s, {
32
+ return G(() => {
33
+ const d = M.filterProps(e);
34
+ return p(M, T(d, {
35
35
  ref: h,
36
36
  class: ["v-treeview-group", e.class],
37
37
  subgroup: !0
38
38
  }), {
39
39
  ...l,
40
- activator: l.activator ? (u) => p(R, null, [p(de, {
41
- defaults: d.value
40
+ activator: l.activator ? (u) => p(R, null, [p(oe, {
41
+ defaults: s.value
42
42
  }, {
43
43
  default: () => {
44
44
  var c;
@@ -48,13 +48,13 @@ const Ce = {
48
48
  });
49
49
  }), {};
50
50
  }
51
- }), Q = Symbol.for("vuetify:v-treeview"), _e = N({
51
+ }), Q = Symbol.for("vuetify:v-treeview"), _e = B({
52
52
  loading: Boolean,
53
53
  toggleIcon: A,
54
- ...se({
54
+ ...fe({
55
55
  slim: !0
56
56
  })
57
- }, "VTreeviewItem"), W = B()({
57
+ }, "VTreeviewItem"), W = N()({
58
58
  name: "VTreeviewItem",
59
59
  props: _e(),
60
60
  emits: {
@@ -67,32 +67,32 @@ const Ce = {
67
67
  } = C;
68
68
  const k = H(Q, {
69
69
  visibleIds: S()
70
- }).visibleIds, d = S(), s = V(() => {
70
+ }).visibleIds, s = S(), d = V(() => {
71
71
  var v, b;
72
- return ((v = d.value) == null ? void 0 : v.root.activatable.value) && ((b = d.value) == null ? void 0 : b.isGroupActivator);
72
+ return ((v = s.value) == null ? void 0 : v.root.activatable.value) && ((b = s.value) == null ? void 0 : b.isGroupActivator);
73
73
  }), u = V(() => {
74
74
  var v, b;
75
- return ((v = d.value) == null ? void 0 : v.link.isClickable.value) || e.value != null && !!((b = d.value) != null && b.list);
76
- }), c = V(() => !e.disabled && e.link !== !1 && (e.link || u.value || s.value)), a = V(() => {
75
+ return ((v = s.value) == null ? void 0 : v.link.isClickable.value) || e.value != null && !!((b = s.value) != null && b.list);
76
+ }), c = V(() => !e.disabled && e.link !== !1 && (e.link || u.value || d.value)), a = V(() => {
77
77
  var v;
78
- return k.value && !k.value.has(O((v = d.value) == null ? void 0 : v.id));
78
+ return k.value && !k.value.has(O((v = s.value) == null ? void 0 : v.id));
79
79
  });
80
80
  function y(v) {
81
81
  var b, I;
82
- c.value && s.value && ((I = d.value) == null || I.activate(!((b = d.value) != null && b.isActivated), v));
82
+ c.value && d.value && ((I = s.value) == null || I.activate(!((b = s.value) != null && b.isActivated), v));
83
83
  }
84
84
  function g(v) {
85
85
  v.preventDefault(), h("toggleExpand", v);
86
86
  }
87
- return F(() => {
87
+ return G(() => {
88
88
  var I;
89
- const v = G(q.filterProps(e), ["onClick"]), b = l.prepend || e.toggleIcon;
89
+ const v = F(q.filterProps(e), ["onClick"]), b = l.prepend || e.toggleIcon;
90
90
  return p(q, T({
91
- ref: d
91
+ ref: s
92
92
  }, v, {
93
- active: (I = d.value) == null ? void 0 : I.isActivated,
93
+ active: (I = s.value) == null ? void 0 : I.isActivated,
94
94
  class: ["v-treeview-item", {
95
- "v-treeview-item--activatable-group-activator": s.value,
95
+ "v-treeview-item--activatable-group-activator": d.value,
96
96
  "v-treeview-item--filtered": a.value
97
97
  }, e.class],
98
98
  ripple: !1,
@@ -101,10 +101,10 @@ const Ce = {
101
101
  ...l,
102
102
  prepend: b ? (o) => {
103
103
  var r;
104
- return p(R, null, [p(ue, {
104
+ return p(R, null, [p(de, {
105
105
  start: !1
106
106
  }, {
107
- default: () => [e.toggleIcon ? p(ve, {
107
+ default: () => [e.toggleIcon ? p(ue, {
108
108
  density: "compact",
109
109
  icon: e.toggleIcon,
110
110
  loading: e.loading,
@@ -112,7 +112,7 @@ const Ce = {
112
112
  onClick: g
113
113
  }, {
114
114
  loader() {
115
- return p(fe, {
115
+ return p(ve, {
116
116
  indeterminate: "disable-shrink",
117
117
  size: "20",
118
118
  width: "2"
@@ -126,7 +126,7 @@ const Ce = {
126
126
  });
127
127
  }), {};
128
128
  }
129
- }), X = N({
129
+ }), X = B({
130
130
  disabled: Boolean,
131
131
  loadChildren: Function,
132
132
  loadingIcon: {
@@ -149,7 +149,7 @@ const Ce = {
149
149
  selectedColor: String,
150
150
  selectStrategy: [String, Function, Object],
151
151
  ...he()
152
- }, "VTreeviewChildren"), L = B()({
152
+ }, "VTreeviewChildren"), L = N()({
153
153
  name: "VTreeviewChildren",
154
154
  props: X(),
155
155
  setup(e, C) {
@@ -157,7 +157,7 @@ const Ce = {
157
157
  slots: l
158
158
  } = C;
159
159
  const h = Z(/* @__PURE__ */ new Set()), k = V(() => !e.disabled && (e.openOnClick != null ? e.openOnClick : e.selectable));
160
- async function d(u) {
160
+ async function s(u) {
161
161
  var c, a;
162
162
  try {
163
163
  if (!((c = e.items) != null && c.length) || !e.loadChildren) return;
@@ -166,7 +166,7 @@ const Ce = {
166
166
  h.delete(u.value);
167
167
  }
168
168
  }
169
- function s(u, c) {
169
+ function d(u, c) {
170
170
  e.selectable && u(!c);
171
171
  }
172
172
  return () => {
@@ -190,9 +190,9 @@ const Ce = {
190
190
  indeterminateIcon: e.indeterminateIcon,
191
191
  falseIcon: e.falseIcon,
192
192
  trueIcon: e.trueIcon,
193
- onClick: J(() => s(t.select, t.isSelected), ["stop"]),
193
+ onClick: J(() => d(t.select, t.isSelected), ["stop"]),
194
194
  onKeydown: (i) => {
195
- ["Enter", "Space"].includes(i.key) && (i.stopPropagation(), s(t.select, t.isSelected));
195
+ ["Enter", "Space"].includes(i.key) && (i.stopPropagation(), d(t.select, t.isSelected));
196
196
  }
197
197
  }, null)]), (n = l.prepend) == null ? void 0 : n.call(l, {
198
198
  ...t,
@@ -236,8 +236,8 @@ const Ce = {
236
236
  ...g,
237
237
  ...n,
238
238
  value: g == null ? void 0 : g.value,
239
- onToggleExpand: [() => d(a), n.onClick],
240
- onClick: k.value ? [() => d(a), n.onClick] : void 0
239
+ onToggleExpand: [() => s(a), n.onClick],
240
+ onClick: k.value ? [() => s(a), n.onClick] : void 0
241
241
  };
242
242
  return p(W, T(i, {
243
243
  value: e.returnObject ? a.raw : g.value,
@@ -265,15 +265,15 @@ function Y(e) {
265
265
  C.push(l), l.children && Y(l.children, C);
266
266
  return C;
267
267
  }
268
- const Ve = N({
268
+ const Ve = B({
269
269
  fluid: Boolean,
270
270
  openAll: Boolean,
271
271
  search: String,
272
- ...ge({
272
+ ...pe({
273
273
  filterKeys: ["title"]
274
274
  }),
275
275
  ...X(),
276
- ...G(Ie({
276
+ ...F(be({
277
277
  collapseIcon: "$treeviewCollapse",
278
278
  expandIcon: "$treeviewExpand",
279
279
  slim: !0
@@ -282,7 +282,7 @@ const Ve = N({
282
282
  type: Array,
283
283
  default: () => []
284
284
  }
285
- }, "VTreeview"), Pe = B()({
285
+ }, "VTreeview"), Pe = N()({
286
286
  name: "VTreeview",
287
287
  props: Ve(),
288
288
  emits: {
@@ -299,14 +299,14 @@ const Ve = N({
299
299
  } = C;
300
300
  const {
301
301
  items: h
302
- } = we(e), k = _(e, "activeColor"), d = _(e, "baseColor"), s = _(e, "color"), u = j(e, "activated"), c = j(e, "modelValue"), a = j(e, "selected", e.modelValue), y = V({
302
+ } = ge(e), k = _(() => e.activeColor), s = _(() => e.baseColor), d = _(() => e.color), u = j(e, "activated"), c = j(e, "modelValue"), a = j(e, "selected", e.modelValue), y = V({
303
303
  get: () => a.value,
304
304
  set(i) {
305
305
  a.value = i, c.value = i;
306
306
  }
307
- }), g = S(), v = V(() => e.openAll ? n(h.value) : e.opened), b = V(() => Y(h.value)), I = _(e, "search"), {
307
+ }), g = S(), v = V(() => e.openAll ? n(h.value) : e.opened), b = V(() => Y(h.value)), I = _(() => e.search), {
308
308
  filteredItems: o
309
- } = pe(e, b, I), r = V(() => {
309
+ } = Ie(e, b, I), r = V(() => {
310
310
  var m;
311
311
  if (!I.value) return null;
312
312
  const i = (m = g.value) == null ? void 0 : m.getPath;
@@ -332,25 +332,25 @@ const Ve = N({
332
332
  }
333
333
  return ee(Q, {
334
334
  visibleIds: r
335
- }), be({
335
+ }), we({
336
336
  VTreeviewGroup: {
337
337
  activeColor: k,
338
- baseColor: d,
339
- color: s,
340
- collapseIcon: _(e, "collapseIcon"),
341
- expandIcon: _(e, "expandIcon")
338
+ baseColor: s,
339
+ color: d,
340
+ collapseIcon: _(() => e.collapseIcon),
341
+ expandIcon: _(() => e.expandIcon)
342
342
  },
343
343
  VTreeviewItem: {
344
- activeClass: _(e, "activeClass"),
344
+ activeClass: _(() => e.activeClass),
345
345
  activeColor: k,
346
- baseColor: d,
347
- color: s,
348
- density: _(e, "density"),
349
- disabled: _(e, "disabled"),
350
- lines: _(e, "lines"),
351
- variant: _(e, "variant")
346
+ baseColor: s,
347
+ color: d,
348
+ density: _(() => e.density),
349
+ disabled: _(() => e.disabled),
350
+ lines: _(() => e.lines),
351
+ variant: _(() => e.variant)
352
352
  }
353
- }), F(() => {
353
+ }), G(() => {
354
354
  const i = z.filterProps(e), m = L.filterProps(e);
355
355
  return p(z, T({
356
356
  ref: g
@@ -382,7 +382,7 @@ const Ve = N({
382
382
  includeTerminals: { type: Boolean }
383
383
  }, Ce),
384
384
  setup(e) {
385
- const C = H("cristal"), l = C.getContainer().get("DocumentService"), h = C.getContainer().get("NavigationTreeSourceProvider").get(), k = S([]), d = S(new Array()), s = S([]);
385
+ const C = H("cristal"), l = C.getContainer().get("DocumentService"), h = C.getContainer().get("NavigationTreeSourceProvider").get(), k = S([]), s = S(new Array()), d = S([]);
386
386
  var u = !1;
387
387
  const c = e;
388
388
  ie(async () => {
@@ -409,10 +409,10 @@ const Ve = N({
409
409
  for (t = 0; t < r.length - 1; t++)
410
410
  if (n)
411
411
  for (const i of n)
412
- i.id == r[t] && (((o = i.children) == null ? void 0 : o.length) == 0 && await y(i), s.value.includes(i.id) || s.value.push(i.id), n = i.children);
412
+ i.id == r[t] && (((o = i.children) == null ? void 0 : o.length) == 0 && await y(i), d.value.includes(i.id) || d.value.push(i.id), n = i.children);
413
413
  if (n)
414
414
  for (const i of n)
415
- i.id == r[t] && (d.value = [i.id], c.clickAction && c.clickAction({
415
+ i.id == r[t] && (s.value = [i.id], c.clickAction && c.clickAction({
416
416
  id: i.id,
417
417
  label: i.title,
418
418
  location: i._location,
@@ -438,7 +438,7 @@ const Ve = N({
438
438
  t.length == 0 && (r.children = void 0);
439
439
  }
440
440
  function g() {
441
- d.value.length > 1 && d.value.pop();
441
+ s.value.length > 1 && s.value.pop();
442
442
  }
443
443
  async function v(o) {
444
444
  const r = h.getParentNodesId(o, c.includeTerminals);
@@ -494,7 +494,7 @@ const Ve = N({
494
494
  children: f.has_children ? [] : void 0,
495
495
  _location: f.location,
496
496
  _is_terminal: f.is_terminal
497
- }), P.length > 0 && P[P.length - 1] === f.id && (d.value = [f.id]);
497
+ }), P.length > 0 && P[P.length - 1] === f.id && (s.value = [f.id]);
498
498
  }
499
499
  }
500
500
  async function I(o) {
@@ -503,10 +503,10 @@ const Ve = N({
503
503
  );
504
504
  }
505
505
  return (o, r) => (D(), ae(re(Pe), {
506
- opened: s.value,
507
- "onUpdate:opened": r[0] || (r[0] = (t) => s.value = t),
506
+ opened: d.value,
507
+ "onUpdate:opened": r[0] || (r[0] = (t) => d.value = t),
508
508
  density: "compact",
509
- activated: d.value,
509
+ activated: s.value,
510
510
  items: k.value,
511
511
  "load-children": y,
512
512
  activatable: "",
@@ -519,7 +519,7 @@ const Ve = N({
519
519
  key: 0,
520
520
  href: t.href,
521
521
  onClick: J((n) => {
522
- d.value = [t.id], o.clickAction({
522
+ s.value = [t.id], o.clickAction({
523
523
  id: t.id,
524
524
  label: t.title,
525
525
  location: t._location,
@@ -540,4 +540,4 @@ const Ve = N({
540
540
  export {
541
541
  Ne as default
542
542
  };
543
- //# sourceMappingURL=x-navigation-tree-CeAKceG7.js.map
543
+ //# sourceMappingURL=x-navigation-tree-Cx21xHVH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-navigation-tree-Cx21xHVH.js","sources":["../../api/src/XNavigationTree.ts","../../../node_modules/.pnpm/vuetify@3.8.3_typescript@5.8.3_vite-plugin-vuetify@2.1.1_vue@3.5.13_typescript@5.8.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeviewGroup.js","../../../node_modules/.pnpm/vuetify@3.8.3_typescript@5.8.3_vite-plugin-vuetify@2.1.1_vue@3.5.13_typescript@5.8.3_/node_modules/vuetify/lib/labs/VTreeview/shared.js","../../../node_modules/.pnpm/vuetify@3.8.3_typescript@5.8.3_vite-plugin-vuetify@2.1.1_vue@3.5.13_typescript@5.8.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeviewItem.js","../../../node_modules/.pnpm/vuetify@3.8.3_typescript@5.8.3_vite-plugin-vuetify@2.1.1_vue@3.5.13_typescript@5.8.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeviewChildren.js","../../../node_modules/.pnpm/vuetify@3.8.3_typescript@5.8.3_vite-plugin-vuetify@2.1.1_vue@3.5.13_typescript@5.8.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeview.js","../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 */\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 */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTree implementations.\n * @since 0.16\n */\nconst navigationTreePropsDefaults = {\n includeTerminals: true,\n};\n\nexport type { NavigationTreeProps };\nexport { navigationTreePropsDefaults };\n","import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\";\n// Components\nimport { VDefaultsProvider } from \"../../components/VDefaultsProvider/index.js\";\nimport { makeVListGroupProps, VListGroup } from \"../../components/VList/VListGroup.js\"; // Utilities\nimport { computed, ref } from 'vue';\nimport { genericComponent, omit, propsFactory, useRender } from \"../../util/index.js\"; // Types\nexport const makeVTreeviewGroupProps = propsFactory({\n ...omit(makeVListGroupProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand'\n }), ['subgroup'])\n}, 'VTreeviewGroup');\nexport const VTreeviewGroup = genericComponent()({\n name: 'VTreeviewGroup',\n props: makeVTreeviewGroupProps(),\n setup(props, _ref) {\n let {\n slots\n } = _ref;\n const vListGroupRef = ref();\n const toggleIcon = computed(() => vListGroupRef.value?.isOpen ? props.collapseIcon : props.expandIcon);\n const activatorDefaults = computed(() => ({\n VTreeviewItem: {\n prependIcon: undefined,\n appendIcon: undefined,\n active: vListGroupRef.value?.isOpen,\n toggleIcon: toggleIcon.value\n }\n }));\n useRender(() => {\n const listGroupProps = VListGroup.filterProps(props);\n return _createVNode(VListGroup, _mergeProps(listGroupProps, {\n \"ref\": vListGroupRef,\n \"class\": ['v-treeview-group', props.class],\n \"subgroup\": true\n }), {\n ...slots,\n activator: slots.activator ? slotProps => _createVNode(_Fragment, null, [_createVNode(VDefaultsProvider, {\n \"defaults\": activatorDefaults.value\n }, {\n default: () => [slots.activator?.(slotProps)]\n })]) : undefined\n });\n });\n return {};\n }\n});\n//# sourceMappingURL=VTreeviewGroup.js.map","// Types\n\nexport const VTreeviewSymbol = Symbol.for('vuetify:v-treeview');\n//# sourceMappingURL=shared.js.map","import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\";\n// Styles\nimport \"./VTreeviewItem.css\";\n\n// Components\nimport { VBtn } from \"../../components/VBtn/index.js\";\nimport { VListItemAction } from \"../../components/VList/index.js\";\nimport { makeVListItemProps, VListItem } from \"../../components/VList/VListItem.js\";\nimport { VProgressCircular } from \"../../components/VProgressCircular/index.js\"; // Composables\nimport { IconValue } from \"../../composables/icons.js\"; // Utilities\nimport { computed, inject, ref, toRaw } from 'vue';\nimport { genericComponent, omit, propsFactory, useRender } from \"../../util/index.js\"; // Types\nimport { VTreeviewSymbol } from \"./shared.js\";\nexport const makeVTreeviewItemProps = propsFactory({\n loading: Boolean,\n toggleIcon: IconValue,\n ...makeVListItemProps({\n slim: true\n })\n}, 'VTreeviewItem');\nexport const VTreeviewItem = genericComponent()({\n name: 'VTreeviewItem',\n props: makeVTreeviewItemProps(),\n emits: {\n toggleExpand: value => true\n },\n setup(props, _ref) {\n let {\n slots,\n emit\n } = _ref;\n const visibleIds = inject(VTreeviewSymbol, {\n visibleIds: ref()\n }).visibleIds;\n const vListItemRef = ref();\n const isActivatableGroupActivator = computed(() => vListItemRef.value?.root.activatable.value && vListItemRef.value?.isGroupActivator);\n const vListItemRefIsClickable = computed(() => vListItemRef.value?.link.isClickable.value || props.value != null && !!vListItemRef.value?.list);\n const isClickable = computed(() => !props.disabled && props.link !== false && (props.link || vListItemRefIsClickable.value || isActivatableGroupActivator.value));\n const isFiltered = computed(() => visibleIds.value && !visibleIds.value.has(toRaw(vListItemRef.value?.id)));\n function activateGroupActivator(e) {\n if (isClickable.value && isActivatableGroupActivator.value) {\n vListItemRef.value?.activate(!vListItemRef.value?.isActivated, e);\n }\n }\n function onClickAction(e) {\n e.preventDefault();\n emit('toggleExpand', e);\n }\n useRender(() => {\n const listItemProps = omit(VListItem.filterProps(props), ['onClick']);\n const hasPrepend = slots.prepend || props.toggleIcon;\n return _createVNode(VListItem, _mergeProps({\n \"ref\": vListItemRef\n }, listItemProps, {\n \"active\": vListItemRef.value?.isActivated,\n \"class\": ['v-treeview-item', {\n 'v-treeview-item--activatable-group-activator': isActivatableGroupActivator.value,\n 'v-treeview-item--filtered': isFiltered.value\n }, props.class],\n \"ripple\": false,\n \"onClick\": props.onClick ?? activateGroupActivator\n }), {\n ...slots,\n prepend: hasPrepend ? slotProps => {\n return _createVNode(_Fragment, null, [_createVNode(VListItemAction, {\n \"start\": false\n }, {\n default: () => [props.toggleIcon ? _createVNode(VBtn, {\n \"density\": \"compact\",\n \"icon\": props.toggleIcon,\n \"loading\": props.loading,\n \"variant\": \"text\",\n \"onClick\": onClickAction\n }, {\n loader() {\n return _createVNode(VProgressCircular, {\n \"indeterminate\": \"disable-shrink\",\n \"size\": \"20\",\n \"width\": \"2\"\n }, null);\n }\n }) : _createVNode(\"div\", {\n \"class\": \"v-treeview-item__level\"\n }, null)]\n }), slots.prepend?.(slotProps)]);\n } : undefined\n });\n });\n return {};\n }\n});\n//# sourceMappingURL=VTreeviewItem.js.map","import { Fragment as _Fragment, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\";\n// Components\nimport { VTreeviewGroup } from \"./VTreeviewGroup.js\";\nimport { VTreeviewItem } from \"./VTreeviewItem.js\";\nimport { VCheckboxBtn } from \"../../components/VCheckbox/index.js\"; // Composables\nimport { makeDensityProps } from \"../../composables/density.js\";\nimport { IconValue } from \"../../composables/icons.js\"; // Utilities\nimport { computed, reactive, toRaw, withModifiers } from 'vue';\nimport { genericComponent, propsFactory } from \"../../util/index.js\"; // Types\nexport const makeVTreeviewChildrenProps = propsFactory({\n disabled: Boolean,\n loadChildren: Function,\n loadingIcon: {\n type: String,\n default: '$loading'\n },\n items: Array,\n openOnClick: {\n type: Boolean,\n default: undefined\n },\n indeterminateIcon: {\n type: IconValue,\n default: '$checkboxIndeterminate'\n },\n falseIcon: IconValue,\n trueIcon: IconValue,\n returnObject: Boolean,\n selectable: Boolean,\n selectedColor: String,\n selectStrategy: [String, Function, Object],\n ...makeDensityProps()\n}, 'VTreeviewChildren');\nexport const VTreeviewChildren = genericComponent()({\n name: 'VTreeviewChildren',\n props: makeVTreeviewChildrenProps(),\n setup(props, _ref) {\n let {\n slots\n } = _ref;\n const isLoading = reactive(new Set());\n const isClickOnOpen = computed(() => !props.disabled && (props.openOnClick != null ? props.openOnClick : props.selectable));\n async function checkChildren(item) {\n try {\n if (!props.items?.length || !props.loadChildren) return;\n if (item?.children?.length === 0) {\n isLoading.add(item.value);\n await props.loadChildren(item.raw);\n }\n } finally {\n isLoading.delete(item.value);\n }\n }\n function selectItem(select, isSelected) {\n if (props.selectable) {\n select(!isSelected);\n }\n }\n return () => slots.default?.() ?? props.items?.map(item => {\n const {\n children,\n props: itemProps\n } = item;\n const loading = isLoading.has(item.value);\n const slotsWithItem = {\n prepend: slotProps => _createVNode(_Fragment, null, [props.selectable && (!children || children && !['leaf', 'single-leaf'].includes(props.selectStrategy)) && _createVNode(\"div\", null, [_createVNode(VCheckboxBtn, {\n \"key\": item.value,\n \"modelValue\": slotProps.isSelected,\n \"disabled\": props.disabled,\n \"loading\": loading,\n \"color\": props.selectedColor,\n \"density\": props.density,\n \"indeterminate\": slotProps.isIndeterminate,\n \"indeterminateIcon\": props.indeterminateIcon,\n \"falseIcon\": props.falseIcon,\n \"trueIcon\": props.trueIcon,\n \"onClick\": withModifiers(() => selectItem(slotProps.select, slotProps.isSelected), ['stop']),\n \"onKeydown\": e => {\n if (!['Enter', 'Space'].includes(e.key)) return;\n e.stopPropagation();\n selectItem(slotProps.select, slotProps.isSelected);\n }\n }, null)]), slots.prepend?.({\n ...slotProps,\n item: item.raw,\n internalItem: item\n })]),\n append: slots.append ? slotProps => slots.append?.({\n ...slotProps,\n item: item.raw,\n internalItem: item\n }) : undefined,\n title: slots.title ? slotProps => slots.title?.({\n ...slotProps,\n item: item.raw,\n internalItem: item\n }) : undefined,\n subtitle: slots.subtitle ? slotProps => slots.subtitle?.({\n ...slotProps,\n item: item.raw,\n internalItem: item\n }) : undefined\n };\n const treeviewGroupProps = VTreeviewGroup.filterProps(itemProps);\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props);\n return children ? _createVNode(VTreeviewGroup, _mergeProps(treeviewGroupProps, {\n \"value\": props.returnObject ? item.raw : treeviewGroupProps?.value\n }), {\n activator: _ref2 => {\n let {\n props: activatorProps\n } = _ref2;\n const listItemProps = {\n ...itemProps,\n ...activatorProps,\n value: itemProps?.value,\n onToggleExpand: [() => checkChildren(item), activatorProps.onClick],\n onClick: isClickOnOpen.value ? [() => checkChildren(item), activatorProps.onClick] : undefined\n };\n return _createVNode(VTreeviewItem, _mergeProps(listItemProps, {\n \"value\": props.returnObject ? item.raw : itemProps.value,\n \"loading\": loading\n }), slotsWithItem);\n },\n default: () => _createVNode(VTreeviewChildren, _mergeProps(treeviewChildrenProps, {\n \"items\": children,\n \"returnObject\": props.returnObject\n }), slots)\n }) : slots.item?.({\n props: itemProps,\n item: item.raw,\n internalItem: item\n }) ?? _createVNode(VTreeviewItem, _mergeProps(itemProps, {\n \"value\": props.returnObject ? toRaw(item.raw) : itemProps.value\n }), slotsWithItem);\n });\n }\n});\n//# sourceMappingURL=VTreeviewChildren.js.map","import { mergeProps as _mergeProps, createVNode as _createVNode } from \"vue\";\n// Components\nimport { makeVTreeviewChildrenProps, VTreeviewChildren } from \"./VTreeviewChildren.js\";\nimport { makeVListProps, useListItems, VList } from \"../../components/VList/VList.js\"; // Composables\nimport { provideDefaults } from \"../../composables/defaults.js\";\nimport { makeFilterProps, useFilter } from \"../../composables/filter.js\";\nimport { useProxiedModel } from \"../../composables/proxiedModel.js\"; // Utilities\nimport { computed, provide, ref, toRaw, toRef } from 'vue';\nimport { genericComponent, omit, propsFactory, useRender } from \"../../util/index.js\"; // Types\nimport { VTreeviewSymbol } from \"./shared.js\";\nfunction flatten(items) {\n let flat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n for (const item of items) {\n flat.push(item);\n if (item.children) flatten(item.children, flat);\n }\n return flat;\n}\nexport const makeVTreeviewProps = propsFactory({\n fluid: Boolean,\n openAll: Boolean,\n search: String,\n ...makeFilterProps({\n filterKeys: ['title']\n }),\n ...makeVTreeviewChildrenProps(),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true\n }), ['itemType', 'nav', 'openStrategy']),\n modelValue: {\n type: Array,\n default: () => []\n }\n}, 'VTreeview');\nexport const VTreeview = genericComponent()({\n name: 'VTreeview',\n props: makeVTreeviewProps(),\n emits: {\n 'update:opened': val => true,\n 'update:activated': val => true,\n 'update:selected': val => true,\n 'update:modelValue': val => true,\n 'click:open': value => true,\n 'click:select': value => true\n },\n setup(props, _ref) {\n let {\n slots\n } = _ref;\n const {\n items\n } = useListItems(props);\n const activeColor = toRef(() => props.activeColor);\n const baseColor = toRef(() => props.baseColor);\n const color = toRef(() => props.color);\n const activated = useProxiedModel(props, 'activated');\n const model = useProxiedModel(props, 'modelValue');\n const _selected = useProxiedModel(props, 'selected', props.modelValue);\n const selected = computed({\n get: () => _selected.value,\n set(val) {\n _selected.value = val;\n model.value = val;\n }\n });\n const vListRef = ref();\n const opened = computed(() => props.openAll ? openAll(items.value) : props.opened);\n const flatItems = computed(() => flatten(items.value));\n const search = toRef(() => props.search);\n const {\n filteredItems\n } = useFilter(props, flatItems, search);\n const visibleIds = computed(() => {\n if (!search.value) return null;\n const getPath = vListRef.value?.getPath;\n if (!getPath) return null;\n return new Set(filteredItems.value.flatMap(item => {\n const itemVal = props.returnObject ? item.raw : item.props.value;\n return [...getPath(itemVal), ...getChildren(itemVal)].map(toRaw);\n }));\n });\n function getChildren(id) {\n const arr = [];\n const queue = (vListRef.value?.children.get(id) ?? []).slice();\n while (queue.length) {\n const child = queue.shift();\n if (!child) continue;\n arr.push(child);\n queue.push(...(vListRef.value?.children.get(child) ?? []).slice());\n }\n return arr;\n }\n function openAll(items) {\n let ids = [];\n for (const i of items) {\n if (!i.children) continue;\n ids.push(props.returnObject ? toRaw(i.raw) : i.value);\n if (i.children) {\n ids = ids.concat(openAll(i.children));\n }\n }\n return ids;\n }\n provide(VTreeviewSymbol, {\n visibleIds\n });\n provideDefaults({\n VTreeviewGroup: {\n activeColor,\n baseColor,\n color,\n collapseIcon: toRef(() => props.collapseIcon),\n expandIcon: toRef(() => props.expandIcon)\n },\n VTreeviewItem: {\n activeClass: toRef(() => props.activeClass),\n activeColor,\n baseColor,\n color,\n density: toRef(() => props.density),\n disabled: toRef(() => props.disabled),\n lines: toRef(() => props.lines),\n variant: toRef(() => props.variant)\n }\n });\n useRender(() => {\n const listProps = VList.filterProps(props);\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props);\n return _createVNode(VList, _mergeProps({\n \"ref\": vListRef\n }, listProps, {\n \"class\": ['v-treeview', {\n 'v-treeview--fluid': props.fluid\n }, props.class],\n \"open-strategy\": \"multiple\",\n \"style\": props.style,\n \"opened\": opened.value,\n \"activated\": activated.value,\n \"onUpdate:activated\": $event => activated.value = $event,\n \"selected\": selected.value,\n \"onUpdate:selected\": $event => selected.value = $event\n }), {\n default: () => [_createVNode(VTreeviewChildren, _mergeProps(treeviewChildrenProps, {\n \"density\": props.density,\n \"returnObject\": props.returnObject,\n \"items\": items.value\n }), slots)]\n });\n });\n return {};\n }\n});\n//# sourceMappingURL=VTreeview.js.map","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script 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 { inject, onBeforeMount, ref, watch } from \"vue\";\nimport { VTreeview } from \"vuetify/labs/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 {\n DocumentReference,\n SpaceReference,\n} 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;\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 for (const node of await getChildNodes(\"\")) {\n rootNodes.value.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 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 );\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(page, props.includeTerminals);\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(page, props.includeTerminals);\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 = treeSource.getParentNodesId(\n props.currentPageReference!,\n props.includeTerminals,\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","makeVTreeviewGroupProps","propsFactory","omit","makeVListGroupProps","VTreeviewGroup","genericComponent","props","_ref","slots","vListGroupRef","ref","toggleIcon","computed","_a","activatorDefaults","useRender","listGroupProps","VListGroup","_createVNode","_mergeProps","slotProps","_Fragment","VDefaultsProvider","VTreeviewSymbol","makeVTreeviewItemProps","IconValue","makeVListItemProps","VTreeviewItem","value","emit","visibleIds","inject","vListItemRef","isActivatableGroupActivator","_b","vListItemRefIsClickable","isClickable","isFiltered","toRaw","activateGroupActivator","e","onClickAction","listItemProps","VListItem","hasPrepend","VListItemAction","VBtn","VProgressCircular","makeVTreeviewChildrenProps","makeDensityProps","VTreeviewChildren","isLoading","reactive","isClickOnOpen","checkChildren","item","selectItem","select","isSelected","children","itemProps","loading","slotsWithItem","VCheckboxBtn","withModifiers","treeviewGroupProps","treeviewChildrenProps","_ref2","activatorProps","flatten","items","flat","makeVTreeviewProps","makeFilterProps","makeVListProps","VTreeview","val","useListItems","activeColor","toRef","baseColor","color","activated","useProxiedModel","model","_selected","selected","vListRef","opened","openAll","flatItems","search","filteredItems","useFilter","getPath","itemVal","getChildren","id","arr","queue","child","ids","i","provide","provideDefaults","listProps","VList","$event","cristal","documentService","treeSource","rootNodes","activatedNodes","expandedNodes","isExpanding","__props","onBeforeMount","node","getChildNodes","expandTree","onDocumentDelete","onDocumentUpdate","watch","newExpandedNodes","currentNodes","lazyLoadChildren","treeItem","childNodes","clearSelection","page","parents","currentItem","currentItemChildren","notFound","currentItemsLoop","currentParent","currentItems","isRoot","newItems","newItem","currentPageParents","newItemsLoop","c"],"mappings":";;;AAwCA,MAAMA,KAA8B;AAAA,EAClC,kBAAkB;AACpB,GCpCaC,KAA0BC,EAAa;AAAA,EAClD,GAAGC,EAAKC,GAAoB;AAAA,IAC1B,cAAc;AAAA,IACd,YAAY;AAAA,EAChB,CAAG,GAAG,CAAC,UAAU,CAAC;AAClB,GAAG,gBAAgB,GACNC,IAAiBC,EAAgB,EAAG;AAAA,EAC/C,MAAM;AAAA,EACN,OAAOL,GA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;AAGF,mBAAerB,EAAcrB,GAAY;AACvC,cAAQ,MAAMa,EAAW,cAAcb,CAAE,GAAG;AAAA,QAC1C,CAAC6C,MAAMxI,EAAM,oBAAoB,CAACwI,EAAE;AAAA,MACtC;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1,2,3,4,5]}
@@ -1,15 +1,15 @@
1
- import { defineComponent as C, mergeModels as D, mergeDefaults as X, inject as k, useModel as w, ref as v, onMounted as x, resolveComponent as i, openBlock as B, createElementBlock as N, Fragment as H, createVNode as t, unref as n, withCtx as a, createTextVNode as h, toDisplayString as y } from "vue";
2
- import { t as M } from "./translations-k4crOAds.js";
3
- import S from "./x-breadcrumb-C2iUd4Sf.js";
1
+ import { defineComponent as C, mergeModels as D, inject as X, useModel as k, ref as v, onMounted as w, resolveComponent as i, createElementBlock as x, openBlock as B, Fragment as N, createVNode as t, unref as n, withCtx as a, createTextVNode as h, toDisplayString as y, mergeDefaults as H } from "vue";
2
+ import { t as M } from "./translations-BVK9UR9x.js";
3
+ import S from "./x-breadcrumb-CyjqjISE.js";
4
4
  import { SpaceReference as F } from "@xwiki/cristal-model-api";
5
5
  import { useI18n as I } from "vue-i18n";
6
- import { a as j } from "./index-CLqR2xXr.js";
6
+ import { a as j } from "./index-C-c8K0Z_.js";
7
7
  import { _ as z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  const A = {
9
9
  includeTerminals: !1
10
10
  }, E = /* @__PURE__ */ C({
11
11
  __name: "x-navigation-tree-select",
12
- props: /* @__PURE__ */ D(/* @__PURE__ */ X({
12
+ props: /* @__PURE__ */ D(/* @__PURE__ */ H({
13
13
  label: {},
14
14
  help: {},
15
15
  currentPageReference: {},
@@ -21,11 +21,11 @@ const A = {
21
21
  }),
22
22
  emits: ["update:modelValue"],
23
23
  setup(m) {
24
- const d = k("cristal"), f = d.getContainer().get("PageHierarchyResolverProvider").get(), _ = d.getContainer().get("ModelReferenceHandlerProvider").get(), { t: c } = I({
24
+ const d = X("cristal"), f = d.getContainer().get("PageHierarchyResolverProvider").get(), _ = d.getContainer().get("ModelReferenceHandlerProvider").get(), { t: c } = I({
25
25
  messages: M
26
- }), s = m, p = w(m, "modelValue"), u = v(!1), o = v([]);
26
+ }), s = m, p = k(m, "modelValue"), u = v(!1), o = v([]);
27
27
  let l;
28
- x(async () => {
28
+ w(async () => {
29
29
  l = s.currentPageReference, p.value = s.currentPageReference.space, o.value = await f.getPageHierarchy(
30
30
  s.currentPageReference.space
31
31
  );
@@ -38,7 +38,7 @@ const A = {
38
38
  }
39
39
  return (e, r) => {
40
40
  const P = i("x-btn"), V = i("XNavigationTree"), R = i("XBtn"), T = i("XDialog");
41
- return B(), N(H, null, [
41
+ return B(), x(N, null, [
42
42
  t(n(j), {
43
43
  label: e.label,
44
44
  hint: e.help,
@@ -96,4 +96,4 @@ const A = {
96
96
  export {
97
97
  O as default
98
98
  };
99
- //# sourceMappingURL=x-navigation-tree-select-C6j0iSBP.js.map
99
+ //# sourceMappingURL=x-navigation-tree-select-B3fRZYec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-navigation-tree-select-C6j0iSBP.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 */\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 */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTreeSelect implementations.\n * @since 0.16\n */\nconst navigationTreeSelectPropsDefaults = {\n includeTerminals: false,\n};\n\nexport type { NavigationTreeSelectProps };\nexport { navigationTreeSelectPropsDefaults };\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport XBreadcrumb from \"../x-breadcrumb.vue\";\nimport { navigationTreeSelectPropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { 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>();\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 );\n});\n\nasync function treeNodeClickAction(node: NavigationTreeNode) {\n selectedPage = referenceHandler.createDocumentReference(\n node.location.names[node.location.names.length - 1],\n new SpaceReference(node.location.wiki, ...node.location.names.slice(0, -1)),\n );\n model.value = node.location;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(selectedPage);\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 ></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","SpaceReference"],"mappings":";;;;;;;AA4CA,MAAMA,IAAoC;AAAA,EACxC,kBAAkB;AACpB;;;;;;;;;;;;;;ACJM,UAAAC,IAAsBC,EAAmB,SAAS,GAClDC,IAA2CF,EAC9C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAI,GACDG,IAA0CH,EAC7C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAI,GAED,EAAE,GAAAI,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GACKC,IAAQC,GAIRC,IAAQC,iBAA4B,GAEpCC,IAAqCC,EAAI,EAAK,GAC9CC,IAA2CD,EAAI,EAAE;AACnD,QAAAE;AAEJ,IAAAC,EAAU,YAAY;AACpB,MAAAD,IAAeP,EAAM,sBACfE,EAAA,QAAQF,EAAM,qBAAsB,OAChCM,EAAA,QAAQ,MAAMX,EAAkB;AAAA,QACxCK,EAAM,qBAAsB;AAAA,MAC9B;AAAA,IAAA,CACD;AAED,mBAAeS,EAAoBC,GAA0B;AAC3D,MAAAH,IAAeX,EAAiB;AAAA,QAC9Bc,EAAK,SAAS,MAAMA,EAAK,SAAS,MAAM,SAAS,CAAC;AAAA,QAClD,IAAIC,EAAeD,EAAK,SAAS,MAAM,GAAGA,EAAK,SAAS,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,MAC5E,GACAR,EAAM,QAAQQ,EAAK,UACnBJ,EAAU,QAAQ,MAAMX,EAAkB,iBAAiBY,CAAY;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"x-navigation-tree-select-B3fRZYec.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 */\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 */\n includeTerminals?: boolean;\n};\n\n/**\n * Default props values for NavigationTreeSelect implementations.\n * @since 0.16\n */\nconst navigationTreeSelectPropsDefaults = {\n includeTerminals: false,\n};\n\nexport type { NavigationTreeSelectProps };\nexport { navigationTreeSelectPropsDefaults };\n","<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport XBreadcrumb from \"../x-breadcrumb.vue\";\nimport { navigationTreeSelectPropsDefaults } from \"@xwiki/cristal-dsapi\";\nimport { 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>();\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 );\n});\n\nasync function treeNodeClickAction(node: NavigationTreeNode) {\n selectedPage = referenceHandler.createDocumentReference(\n node.location.names[node.location.names.length - 1],\n new SpaceReference(node.location.wiki, ...node.location.names.slice(0, -1)),\n );\n model.value = node.location;\n hierarchy.value = await hierarchyResolver.getPageHierarchy(selectedPage);\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 ></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","SpaceReference"],"mappings":";;;;;;;AA4CA,MAAMA,IAAoC;AAAA,EACxC,kBAAkB;AACpB;;;;;;;;;;;;;;ACJM,UAAAC,IAAsBC,EAAmB,SAAS,GAClDC,IAA2CF,EAC9C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAI,GACDG,IAA0CH,EAC7C,aAAA,EACA,IAAmC,+BAA+B,EAClE,IAAI,GAED,EAAE,GAAAI,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GACKC,IAAQC,GAIRC,IAAQC,iBAA4B,GAEpCC,IAAqCC,EAAI,EAAK,GAC9CC,IAA2CD,EAAI,EAAE;AACnD,QAAAE;AAEJ,IAAAC,EAAU,YAAY;AACpB,MAAAD,IAAeP,EAAM,sBACfE,EAAA,QAAQF,EAAM,qBAAsB,OAChCM,EAAA,QAAQ,MAAMX,EAAkB;AAAA,QACxCK,EAAM,qBAAsB;AAAA,MAC9B;AAAA,IAAA,CACD;AAED,mBAAeS,EAAoBC,GAA0B;AAC3D,MAAAH,IAAeX,EAAiB;AAAA,QAC9Bc,EAAK,SAAS,MAAMA,EAAK,SAAS,MAAM,SAAS,CAAC;AAAA,QAClD,IAAIC,EAAeD,EAAK,SAAS,MAAM,GAAGA,EAAK,SAAS,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,MAC5E,GACAR,EAAM,QAAQQ,EAAK,UACnBJ,EAAU,QAAQ,MAAMX,EAAkB,iBAAiBY,CAAY;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,9 +1,9 @@
1
- import { resolveComponent as o, openBlock as n, createBlock as t } from "vue";
1
+ import { resolveComponent as o, createBlock as n, openBlock as t } from "vue";
2
2
  import { _ as c } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
3
  const r = {};
4
4
  function a(m, s) {
5
5
  const e = o("v-autocomplete");
6
- return n(), t(e, {
6
+ return t(), n(e, {
7
7
  density: "comfortable",
8
8
  "menu-icon": "",
9
9
  placeholder: "Search",
@@ -17,4 +17,4 @@ const _ = /* @__PURE__ */ c(r, [["render", a]]);
17
17
  export {
18
18
  _ as default
19
19
  };
20
- //# sourceMappingURL=x-search-C4yZLrSp.js.map
20
+ //# sourceMappingURL=x-search-C7GhoCKj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"x-search-C4yZLrSp.js","sources":["../src/vue/x-search.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\"></script>\n\n<template>\n <v-autocomplete\n density=\"comfortable\"\n menu-icon=\"\"\n placeholder=\"Search\"\n prepend-inner-icon=\"mdi-magnify\"\n variant=\"solo\"\n auto-select-first\n rounded\n ></v-autocomplete>\n</template>\n\n<style scoped></style>\n"],"names":["_openBlock","_createBlock","_component_v_autocomplete"],"mappings":";;;;;AAuBI,SAAAA,EAAqB,GAAAC,EAAAC,GAAA;AAAA,IACrB,SAAA;AAAA,IACA,aAAY;AAAA,IACZ,aAAA;AAAA,IACA,sBAAc;AAAA,IACd,SAAA;AAAA,IACA,qBAAO;AAAA;;;;"}
1
+ {"version":3,"file":"x-search-C7GhoCKj.js","sources":["../src/vue/x-search.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script setup lang=\"ts\"></script>\n\n<template>\n <v-autocomplete\n density=\"comfortable\"\n menu-icon=\"\"\n placeholder=\"Search\"\n prepend-inner-icon=\"mdi-magnify\"\n variant=\"solo\"\n auto-select-first\n rounded\n ></v-autocomplete>\n</template>\n\n<style scoped></style>\n"],"names":["_openBlock","_createBlock","_component_v_autocomplete"],"mappings":";;;;;AAuBI,SAAAA,EAAqB,GAAAC,EAAAC,GAAA;AAAA,IACrB,SAAA;AAAA,IACA,aAAY;AAAA,IACZ,aAAA;AAAA,IACA,sBAAc;AAAA,IACd,SAAA;AAAA,IACA,qBAAO;AAAA;;;;"}
@@ -0,0 +1,39 @@
1
+ import { defineComponent as m, mergeModels as n, useModel as i, computed as d, createBlock as p, openBlock as c, unref as f } from "vue";
2
+ import { t as V } from "./translations-BVK9UR9x.js";
3
+ import { useI18n as b } from "vue-i18n";
4
+ import { y as g } from "./index-C-c8K0Z_.js";
5
+ const M = /* @__PURE__ */ m({
6
+ __name: "x-select",
7
+ props: /* @__PURE__ */ n({
8
+ label: {},
9
+ items: {},
10
+ help: {},
11
+ required: { type: Boolean },
12
+ modelValue: {}
13
+ }, {
14
+ modelValue: {},
15
+ modelModifiers: {}
16
+ }),
17
+ emits: ["update:modelValue"],
18
+ setup(s) {
19
+ const t = s, r = i(s, "modelValue"), { t: o } = b({
20
+ messages: V
21
+ }), a = d(() => {
22
+ const e = [];
23
+ return t.required && e.push((l) => l ? !0 : o("vuetify.select.input.mandatory")), e;
24
+ });
25
+ return (e, l) => (c(), p(f(g), {
26
+ modelValue: r.value,
27
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => r.value = u),
28
+ label: e.label,
29
+ messages: e.help,
30
+ items: e.items,
31
+ rules: a.value,
32
+ clearable: !e.required
33
+ }, null, 8, ["modelValue", "label", "messages", "items", "rules", "clearable"]));
34
+ }
35
+ });
36
+ export {
37
+ M as default
38
+ };
39
+ //# sourceMappingURL=x-select-CgIqNkk3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-select-CgIqNkk3.js","sources":["../src/vue/form/x-select.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<script lang=\"ts\" setup>\nimport 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"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAQC,GACRC,IAAWC,EAAmBF,GAAA,YAAC,GAE/B,EAAE,GAAAG,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GAEKC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAC;AACnB,aAAIT,EAAM,YACES,EAAA,KAAK,CAACC,MACVA,IACK,KAEAN,EAAE,gCAAgC,CAE5C,GAEIK;AAAA,IAAA,CACR;;;;;;;;;;;;"}