@xwiki/cristal-dsvuetify 0.14.0 → 0.16.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 (57) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/{index-C4ioHAez.js → index-CLqR2xXr.js} +5946 -5812
  3. package/dist/index-CLqR2xXr.js.map +1 -0
  4. package/dist/index.es.js +7 -5
  5. package/dist/index.umd.js +11 -9
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/translations-k4crOAds.js +24 -0
  8. package/dist/{translations-BNEIsfPR.js.map → translations-k4crOAds.js.map} +1 -1
  9. package/dist/vue/form/x-checkbox.vue.d.ts +3 -3
  10. package/dist/vue/form/x-navigation-tree-select.vue.d.ts +14 -0
  11. package/dist/vue/x-navigation-tree.vue.d.ts +4 -8
  12. package/dist/{x-alert-CTAhsN6L.js → x-alert-CRdF8zFB.js} +4 -4
  13. package/dist/x-alert-CRdF8zFB.js.map +1 -0
  14. package/dist/{x-btn-BsiSIiiO.js → x-btn-DwTcXGgx.js} +2 -2
  15. package/dist/{x-btn-BsiSIiiO.js.map → x-btn-DwTcXGgx.js.map} +1 -1
  16. package/dist/{x-checkbox-CJ3_IJ-Y.js → x-checkbox-BMonacnS.js} +7 -7
  17. package/dist/{x-checkbox-CJ3_IJ-Y.js.map → x-checkbox-BMonacnS.js.map} +1 -1
  18. package/dist/x-dialog-DCEnccuq.js +48 -0
  19. package/dist/x-dialog-DCEnccuq.js.map +1 -0
  20. package/dist/{x-file-input-CMM5DWJc.js → x-file-input-CUcSVuxz.js} +14 -11
  21. package/dist/{x-file-input-CMM5DWJc.js.map → x-file-input-CUcSVuxz.js.map} +1 -1
  22. package/dist/x-form-DWpzuKe6.js +25 -0
  23. package/dist/x-form-DWpzuKe6.js.map +1 -0
  24. package/dist/x-navigation-tree-CeAKceG7.js +543 -0
  25. package/dist/x-navigation-tree-CeAKceG7.js.map +1 -0
  26. package/dist/x-navigation-tree-select-C6j0iSBP.js +99 -0
  27. package/dist/x-navigation-tree-select-C6j0iSBP.js.map +1 -0
  28. package/dist/{x-tab-group-Bp7V46k9.js → x-tab-group-D1jmHXyJ.js} +2 -2
  29. package/dist/x-tab-group-D1jmHXyJ.js.map +1 -0
  30. package/dist/x-text-field-D94TCr6e.js +45 -0
  31. package/dist/{x-text-field-BxSiyeFc.js.map → x-text-field-D94TCr6e.js.map} +1 -1
  32. package/langs/translation-de.json +3 -1
  33. package/langs/translation-en.json +3 -1
  34. package/langs/translation-fr.json +3 -1
  35. package/package.json +15 -13
  36. package/src/components/componentsInit.ts +1 -1
  37. package/src/components/vuetifyDesignSystemLoader.ts +7 -2
  38. package/src/translations.ts +4 -0
  39. package/src/vue/__tests__/utils/vuetify.ts +0 -1
  40. package/src/vue/css/style.css +1 -1
  41. package/src/vue/form/x-checkbox.vue +1 -1
  42. package/src/vue/form/x-form.vue +8 -4
  43. package/src/vue/form/x-navigation-tree-select.vue +125 -0
  44. package/src/vue/form/x-text-field.vue +4 -0
  45. package/src/vue/x-navigation-tree.vue +43 -37
  46. package/src/vue/x-tab-group.vue +2 -2
  47. package/dist/index-C4ioHAez.js.map +0 -1
  48. package/dist/translations-BNEIsfPR.js +0 -10
  49. package/dist/x-alert-CTAhsN6L.js.map +0 -1
  50. package/dist/x-dialog-C4gz0mOu.js +0 -48
  51. package/dist/x-dialog-C4gz0mOu.js.map +0 -1
  52. package/dist/x-form-BLg386BG.js +0 -32
  53. package/dist/x-form-BLg386BG.js.map +0 -1
  54. package/dist/x-navigation-tree-BW05Yivz.js +0 -502
  55. package/dist/x-navigation-tree-BW05Yivz.js.map +0 -1
  56. package/dist/x-tab-group-Bp7V46k9.js.map +0 -1
  57. package/dist/x-text-field-BxSiyeFc.js +0 -38
@@ -1,10 +0,0 @@
1
- const t = {
2
- "vuetify.file.input.mandatory": "Mandatory field",
3
- "vuetify.text.input.mandatory": "Mandatory field"
4
- }, a = {
5
- en: t
6
- };
7
- export {
8
- a as t
9
- };
10
- //# sourceMappingURL=translations-BNEIsfPR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-alert-CTAhsN6L.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,48 +0,0 @@
1
- import { defineComponent as p, resolveComponent as e, openBlock as r, createBlock as n, withCtx as o, createElementVNode as m, normalizeProps as v, guardReactiveProps as u, renderSlot as a, createVNode as d, createCommentVNode as f } from "vue";
2
- import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- const g = /* @__PURE__ */ p({
4
- __name: "x-dialog",
5
- props: {
6
- title: {},
7
- width: {}
8
- },
9
- setup(w) {
10
- return (t, C) => {
11
- const l = e("v-card-text"), s = e("v-card-actions"), c = e("v-card"), i = e("v-dialog");
12
- return r(), n(i, {
13
- width: t.width,
14
- scrollable: ""
15
- }, {
16
- activator: o(({ props: _ }) => [
17
- m("span", v(u(_)), [
18
- a(t.$slots, "activator", {}, void 0, !0)
19
- ], 16)
20
- ]),
21
- default: o(() => [
22
- d(c, { title: t.title }, {
23
- default: o(() => [
24
- d(l, null, {
25
- default: o(() => [
26
- a(t.$slots, "default", {}, void 0, !0)
27
- ]),
28
- _: 3
29
- }),
30
- t.$slots.footer ? (r(), n(s, { key: 0 }, {
31
- default: o(() => [
32
- a(t.$slots, "footer", {}, void 0, !0)
33
- ]),
34
- _: 3
35
- })) : f("", !0)
36
- ]),
37
- _: 3
38
- }, 8, ["title"])
39
- ]),
40
- _: 3
41
- }, 8, ["width"]);
42
- };
43
- }
44
- }), N = /* @__PURE__ */ h(g, [["__scopeId", "data-v-35b45241"]]);
45
- export {
46
- N as default
47
- };
48
- //# sourceMappingURL=x-dialog-C4gz0mOu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-dialog-C4gz0mOu.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,32 +0,0 @@
1
- import { defineComponent as i, resolveComponent as s, openBlock as c, createBlock as f, unref as u, withModifiers as a, withCtx as e, createVNode as _, renderSlot as l } from "vue";
2
- import { V as p } from "./index-C4ioHAez.js";
3
- const h = /* @__PURE__ */ i({
4
- __name: "x-form",
5
- emits: ["formSubmit"],
6
- setup(d, { emit: t }) {
7
- const o = t;
8
- function n() {
9
- o("formSubmit");
10
- }
11
- return (r, b) => {
12
- const m = s("v-container");
13
- return c(), f(u(p), {
14
- onSubmit: a(n, ["prevent"])
15
- }, {
16
- default: e(() => [
17
- _(m, null, {
18
- default: e(() => [
19
- l(r.$slots, "default")
20
- ]),
21
- _: 3
22
- })
23
- ]),
24
- _: 3
25
- });
26
- };
27
- }
28
- });
29
- export {
30
- h as default
31
- };
32
- //# sourceMappingURL=x-form-BLg386BG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-form-BLg386BG.js","sources":["../src/vue/form/x-form.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { VForm } from \"vuetify/components/VForm\";\nconst emits = defineEmits([\"formSubmit\"]);\nfunction submit() {\n emits(\"formSubmit\");\n}\n</script>\n\n<template>\n <v-form @submit.prevent=\"submit\">\n <v-container>\n <slot></slot>\n </v-container>\n </v-form>\n</template>\n\n<style scoped></style>\n"],"names":["emits","__emit","submit"],"mappings":";;;;;;AAEA,UAAMA,IAAQC;AACd,aAASC,IAAS;AAChB,MAAAF,EAAM,YAAY;AAAA,IAAA;;;;;;;;;;;;;;;;;;;"}
@@ -1,502 +0,0 @@
1
- import { ref as _, computed as P, createVNode as m, mergeProps as T, Fragment as G, inject as W, reactive as Y, withModifiers as H, toRaw as O, toRef as V, provide as Z, defineComponent as ee, onBeforeMount as te, watch as ne, openBlock as B, createBlock as ie, unref as le, withCtx as ae, createElementBlock as R, toDisplayString as $ } from "vue";
2
- import { p as L, o as D, m as oe, g as j, u as F, c as U, d as re, E as ce, I as A, e as de, f as se, h as M, i as ue, j as ve, k as fe, l as he, n as ge, q as me, r as Ie, s as E, t as we, v as pe, w as q } from "./index-C4ioHAez.js";
3
- import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const ke = L({
5
- ...D(oe({
6
- collapseIcon: "$treeviewCollapse",
7
- expandIcon: "$treeviewExpand"
8
- }), ["subgroup"])
9
- }, "VTreeviewGroup"), z = j()({
10
- name: "VTreeviewGroup",
11
- props: ke(),
12
- setup(e, w) {
13
- let {
14
- slots: l
15
- } = w;
16
- const c = _(), k = P(() => {
17
- var a;
18
- return (a = c.value) != null && a.isOpen ? e.collapseIcon : e.expandIcon;
19
- }), I = P(() => {
20
- var a;
21
- return {
22
- VTreeviewItem: {
23
- prependIcon: void 0,
24
- appendIcon: void 0,
25
- active: (a = c.value) == null ? void 0 : a.isOpen,
26
- toggleIcon: k.value
27
- }
28
- };
29
- });
30
- return F(() => {
31
- const a = U.filterProps(e);
32
- return m(U, T(a, {
33
- ref: c,
34
- class: ["v-treeview-group", e.class],
35
- subgroup: !0
36
- }), {
37
- ...l,
38
- activator: l.activator ? (s) => m(G, null, [m(re, {
39
- defaults: I.value
40
- }, {
41
- default: () => {
42
- var f;
43
- return [(f = l.activator) == null ? void 0 : f.call(l, s)];
44
- }
45
- })]) : void 0
46
- });
47
- }), {};
48
- }
49
- }), J = Symbol.for("vuetify:v-treeview"), be = L({
50
- loading: Boolean,
51
- onToggleExpand: ce(),
52
- toggleIcon: A,
53
- ...de({
54
- slim: !0
55
- })
56
- }, "VTreeviewItem"), K = j()({
57
- name: "VTreeviewItem",
58
- props: be(),
59
- setup(e, w) {
60
- let {
61
- attrs: l,
62
- slots: c,
63
- emit: k
64
- } = w;
65
- const I = se(e, l), a = _(), s = P(() => {
66
- var d, p;
67
- return ((d = a.value) == null ? void 0 : d.root.activatable.value) && ((p = a.value) == null ? void 0 : p.isGroupActivator);
68
- }), f = P(() => {
69
- var d;
70
- return !e.disabled && e.link !== !1 && (e.link || I.isClickable.value || e.value != null && !!((d = a.value) != null && d.list) || s.value);
71
- });
72
- function o(d) {
73
- var p, y;
74
- f.value && s.value && ((y = a.value) == null || y.activate(!((p = a.value) != null && p.isActivated), d));
75
- }
76
- const b = W(J, {
77
- visibleIds: _()
78
- }).visibleIds;
79
- return F(() => {
80
- var y, r;
81
- const d = D(M.filterProps(e), ["onClick"]), p = c.prepend || e.toggleIcon;
82
- return m(M, T({
83
- ref: a
84
- }, d, {
85
- active: (y = a.value) == null ? void 0 : y.isActivated,
86
- class: ["v-treeview-item", {
87
- "v-treeview-item--activatable-group-activator": s.value,
88
- "v-treeview-item--filtered": b.value && !b.value.has((r = a.value) == null ? void 0 : r.id)
89
- }, e.class],
90
- ripple: !1,
91
- onClick: e.onClick ?? o
92
- }), {
93
- ...c,
94
- prepend: p ? (u) => {
95
- var i;
96
- return m(G, null, [e.toggleIcon && m(ue, {
97
- start: !1
98
- }, {
99
- default: () => [m(ve, {
100
- density: "compact",
101
- icon: e.toggleIcon,
102
- loading: e.loading,
103
- variant: "text",
104
- onClick: e.onToggleExpand
105
- }, {
106
- loader() {
107
- return m(fe, {
108
- indeterminate: "disable-shrink",
109
- size: "20",
110
- width: "2"
111
- }, null);
112
- }
113
- })]
114
- }), (i = c.prepend) == null ? void 0 : i.call(c, u)]);
115
- } : void 0
116
- });
117
- }), {};
118
- }
119
- }), Q = L({
120
- loadChildren: Function,
121
- loadingIcon: {
122
- type: String,
123
- default: "$loading"
124
- },
125
- items: Array,
126
- openOnClick: {
127
- type: Boolean,
128
- default: void 0
129
- },
130
- indeterminateIcon: {
131
- type: A,
132
- default: "$checkboxIndeterminate"
133
- },
134
- falseIcon: A,
135
- trueIcon: A,
136
- returnObject: Boolean,
137
- selectable: Boolean,
138
- selectedColor: String,
139
- selectStrategy: [String, Function, Object]
140
- }, "VTreeviewChildren"), N = j()({
141
- name: "VTreeviewChildren",
142
- props: Q(),
143
- setup(e, w) {
144
- let {
145
- slots: l
146
- } = w;
147
- const c = Y(/* @__PURE__ */ new Set()), k = P(() => e.openOnClick != null ? e.openOnClick : e.selectable);
148
- async function I(s) {
149
- var f, o;
150
- try {
151
- if (!((f = e.items) != null && f.length) || !e.loadChildren) return;
152
- ((o = s == null ? void 0 : s.children) == null ? void 0 : o.length) === 0 && (c.add(s.value), await e.loadChildren(s.raw));
153
- } finally {
154
- c.delete(s.value);
155
- }
156
- }
157
- function a(s, f) {
158
- e.selectable && s(!f);
159
- }
160
- return () => {
161
- var s, f;
162
- return ((s = l.default) == null ? void 0 : s.call(l)) ?? ((f = e.items) == null ? void 0 : f.map((o) => {
163
- var i;
164
- const {
165
- children: b,
166
- props: d
167
- } = o, p = c.has(o.value), y = {
168
- prepend: (t) => {
169
- var n;
170
- return m(G, null, [e.selectable && (!b || b && !["leaf", "single-leaf"].includes(e.selectStrategy)) && m("div", null, [m(he, {
171
- key: o.value,
172
- modelValue: t.isSelected,
173
- loading: p,
174
- color: e.selectedColor,
175
- indeterminate: t.isIndeterminate,
176
- indeterminateIcon: e.indeterminateIcon,
177
- falseIcon: e.falseIcon,
178
- trueIcon: e.trueIcon,
179
- onClick: H(() => a(t.select, t.isSelected), ["stop"]),
180
- onKeydown: (v) => {
181
- ["Enter", "Space"].includes(v.key) && (v.stopPropagation(), a(t.select, t.isSelected));
182
- }
183
- }, null)]), (n = l.prepend) == null ? void 0 : n.call(l, {
184
- ...t,
185
- item: o.raw,
186
- internalItem: o
187
- })]);
188
- },
189
- append: l.append ? (t) => {
190
- var n;
191
- return (n = l.append) == null ? void 0 : n.call(l, {
192
- ...t,
193
- item: o.raw,
194
- internalItem: o
195
- });
196
- } : void 0,
197
- title: l.title ? (t) => {
198
- var n;
199
- return (n = l.title) == null ? void 0 : n.call(l, {
200
- ...t,
201
- item: o.raw,
202
- internalItem: o
203
- });
204
- } : void 0
205
- }, r = z.filterProps(d), u = N.filterProps(e);
206
- return b ? m(z, T(r, {
207
- value: e.returnObject ? o.raw : r == null ? void 0 : r.value
208
- }), {
209
- activator: (t) => {
210
- let {
211
- props: n
212
- } = t;
213
- const v = {
214
- ...d,
215
- ...n,
216
- value: d == null ? void 0 : d.value,
217
- onToggleExpand: [() => I(o), n.onClick],
218
- onClick: k.value ? [() => I(o), n.onClick] : void 0
219
- };
220
- return m(K, T(v, {
221
- value: e.returnObject ? O(o.raw) : d.value,
222
- loading: p
223
- }), y);
224
- },
225
- default: () => m(N, T(u, {
226
- items: b,
227
- returnObject: e.returnObject
228
- }), l)
229
- }) : ((i = l.item) == null ? void 0 : i.call(l, {
230
- props: d,
231
- item: o.raw,
232
- internalItem: o
233
- })) ?? m(K, T(d, {
234
- value: e.returnObject ? O(o.raw) : d.value
235
- }), y);
236
- }));
237
- };
238
- }
239
- });
240
- function X(e) {
241
- let w = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
242
- for (const l of e)
243
- w.push(l), l.children && X(l.children, w);
244
- return w;
245
- }
246
- const ye = L({
247
- openAll: Boolean,
248
- search: String,
249
- ...ge({
250
- filterKeys: ["title"]
251
- }),
252
- ...Q(),
253
- ...D(me({
254
- collapseIcon: "$treeviewCollapse",
255
- expandIcon: "$treeviewExpand",
256
- slim: !0
257
- }), ["itemType", "nav", "openStrategy"]),
258
- modelValue: {
259
- type: Array,
260
- default: () => []
261
- }
262
- }, "VTreeview"), Ve = j()({
263
- name: "VTreeview",
264
- props: ye(),
265
- emits: {
266
- "update:opened": (e) => !0,
267
- "update:activated": (e) => !0,
268
- "update:selected": (e) => !0,
269
- "update:modelValue": (e) => !0,
270
- "click:open": (e) => !0,
271
- "click:select": (e) => !0
272
- },
273
- setup(e, w) {
274
- let {
275
- slots: l
276
- } = w;
277
- const {
278
- items: c
279
- } = Ie(e), k = V(e, "activeColor"), I = V(e, "baseColor"), a = V(e, "color"), s = E(e, "activated"), f = E(e, "modelValue"), o = E(e, "selected", e.modelValue), b = P({
280
- get: () => o.value,
281
- set(v) {
282
- o.value = v, f.value = v;
283
- }
284
- }), d = _(), p = P(() => e.openAll ? n(c.value) : e.opened), y = P(() => X(c.value)), r = V(e, "search"), {
285
- filteredItems: u
286
- } = we(e, y, r), i = P(() => {
287
- var C;
288
- if (!r.value) return null;
289
- const v = (C = d.value) == null ? void 0 : C.getPath;
290
- return v ? new Set(u.value.flatMap((g) => {
291
- const h = e.returnObject ? g.raw : g.props.value;
292
- return [...v(h), ...t(h)].map(O);
293
- })) : null;
294
- });
295
- function t(v) {
296
- var h, x;
297
- const C = [], g = (((h = d.value) == null ? void 0 : h.children.get(v)) ?? []).slice();
298
- for (; g.length; ) {
299
- const S = g.shift();
300
- S && (C.push(S), g.push(...(((x = d.value) == null ? void 0 : x.children.get(S)) ?? []).slice()));
301
- }
302
- return C;
303
- }
304
- function n(v) {
305
- let C = [];
306
- for (const g of v)
307
- g.children && (C.push(e.returnObject ? O(g.raw) : g.value), g.children && (C = C.concat(n(g.children))));
308
- return C;
309
- }
310
- return Z(J, {
311
- visibleIds: i
312
- }), pe({
313
- VTreeviewGroup: {
314
- activeColor: k,
315
- baseColor: I,
316
- color: a,
317
- collapseIcon: V(e, "collapseIcon"),
318
- expandIcon: V(e, "expandIcon")
319
- },
320
- VTreeviewItem: {
321
- activeClass: V(e, "activeClass"),
322
- activeColor: k,
323
- baseColor: I,
324
- color: a,
325
- density: V(e, "density"),
326
- disabled: V(e, "disabled"),
327
- lines: V(e, "lines"),
328
- variant: V(e, "variant")
329
- }
330
- }), F(() => {
331
- const v = q.filterProps(e), C = N.filterProps(e);
332
- return m(q, T({
333
- ref: d
334
- }, v, {
335
- class: ["v-treeview", e.class],
336
- "open-strategy": "multiple",
337
- style: e.style,
338
- opened: p.value,
339
- activated: s.value,
340
- "onUpdate:activated": (g) => s.value = g,
341
- selected: b.value,
342
- "onUpdate:selected": (g) => b.value = g
343
- }), {
344
- default: () => [m(N, T(C, {
345
- returnObject: e.returnObject,
346
- items: c.value
347
- }), l)]
348
- });
349
- }), {};
350
- }
351
- }), Pe = ["href", "onClick"], Te = ["href"], _e = /* @__PURE__ */ ee({
352
- __name: "x-navigation-tree",
353
- props: {
354
- clickAction: { type: Function },
355
- currentPage: {}
356
- },
357
- setup(e) {
358
- const w = W("cristal"), l = w.getContainer().get("DocumentService"), c = w.getContainer().get("NavigationTreeSourceProvider").get(), k = _([]), I = _(new Array()), a = _(new Array());
359
- var s = !1;
360
- const f = e;
361
- te(async () => {
362
- for (const r of await c.getChildNodes(""))
363
- k.value.push({
364
- id: r.id,
365
- title: r.label,
366
- href: r.url,
367
- children: r.has_children ? [] : void 0,
368
- _location: r.location
369
- });
370
- await o(), l.registerDocumentChangeListener("delete", p), l.registerDocumentChangeListener("update", y);
371
- }), ne(() => f.currentPage, o);
372
- async function o() {
373
- var r;
374
- if (f.currentPage && !s) {
375
- s = !0;
376
- const u = c.getParentNodesId(f.currentPage);
377
- let i, t = k.value;
378
- for (i = 0; i < u.length - 1; i++)
379
- if (t)
380
- for (const n of t)
381
- n.id == u[i] && (((r = n.children) == null ? void 0 : r.length) == 0 && await b(n), a.value.includes(n.id) || a.value.push(n.id), t = n.children);
382
- if (t)
383
- for (const n of t)
384
- n.id == u[i] && (I.value = [n.id], f.clickAction && f.clickAction({
385
- id: n.id,
386
- label: n.title,
387
- location: n._location,
388
- url: n.href,
389
- has_children: n.children !== void 0
390
- }));
391
- s = !1;
392
- }
393
- }
394
- async function b(r) {
395
- var t;
396
- const u = r, i = await c.getChildNodes(u.id);
397
- for (const n of i)
398
- (t = u.children) == null || t.push({
399
- id: n.id,
400
- title: n.label,
401
- href: n.url,
402
- children: n.has_children ? [] : void 0,
403
- _location: n.location
404
- });
405
- i.length == 0 && (u.children = void 0);
406
- }
407
- function d() {
408
- I.value.length > 1 && I.value.pop();
409
- }
410
- async function p(r) {
411
- const u = c.getParentNodesId(r);
412
- let i, t = k.value, n = !1;
413
- e: for (; t && !n; ) {
414
- for (const v of t.keys())
415
- if (t[v].id == u[0])
416
- if (u.length == 1) {
417
- t.splice(v, 1), i && t.length == 0 && (i.children = void 0);
418
- return;
419
- } else {
420
- i = t[v], t = i.children, u.shift();
421
- continue e;
422
- }
423
- n = !0;
424
- }
425
- }
426
- async function y(r) {
427
- const u = c.getParentNodesId(r);
428
- let i, t = k.value, n = !1, v = !0;
429
- e: for (; t && !n; ) {
430
- for (const h of t.keys())
431
- if (t[h].id == u[0])
432
- if (u.length == 1) {
433
- const x = await c.getChildNodes(
434
- i || ""
435
- );
436
- for (const S of x)
437
- if (S.id == t[h].id) {
438
- t[h].title = S.label;
439
- return;
440
- }
441
- } else {
442
- i = t[h].id, t[h].children || (t[h].children = []), t = t[h].children, u.shift(), v = !1;
443
- continue e;
444
- }
445
- n = !0;
446
- }
447
- if (t.length == 0 && !v)
448
- return;
449
- const C = await c.getChildNodes(
450
- i || ""
451
- ), g = c.getParentNodesId(f.currentPage);
452
- e: for (const h of C) {
453
- for (const x of t.keys())
454
- if (h.id == t[x].id)
455
- continue e;
456
- t.push({
457
- id: h.id,
458
- title: h.label,
459
- href: h.url,
460
- children: h.has_children ? [] : void 0,
461
- _location: h.location
462
- }), g.length > 0 && g[g.length - 1] === h.id && (I.value = [h.id]);
463
- }
464
- }
465
- return (r, u) => (B(), ie(le(Ve), {
466
- opened: a.value,
467
- "onUpdate:opened": u[0] || (u[0] = (i) => a.value = i),
468
- density: "compact",
469
- activated: I.value,
470
- items: k.value,
471
- "load-children": b,
472
- activatable: "",
473
- "active-strategy": "independent",
474
- "item-value": "id",
475
- "onUpdate:activated": d
476
- }, {
477
- title: ae(({ item: i }) => [
478
- f.clickAction ? (B(), R("a", {
479
- key: 0,
480
- href: i.href,
481
- onClick: H((t) => {
482
- I.value = [i.id], r.clickAction({
483
- id: i.id,
484
- label: i.title,
485
- location: i._location,
486
- url: i.href,
487
- has_children: i.children !== void 0
488
- });
489
- }, ["prevent"])
490
- }, $(i.title), 9, Pe)) : (B(), R("a", {
491
- key: 1,
492
- href: i.href
493
- }, $(i.title), 9, Te))
494
- ]),
495
- _: 1
496
- }, 8, ["opened", "activated", "items"]));
497
- }
498
- }), Oe = /* @__PURE__ */ Ce(_e, [["__scopeId", "data-v-ce8e574b"]]);
499
- export {
500
- Oe as default
501
- };
502
- //# sourceMappingURL=x-navigation-tree-BW05Yivz.js.map