@xwiki/cristal-dsvuetify 0.12.0 → 0.14.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 (71) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/{index-DCILSBLH.js → index-C4ioHAez.js} +4114 -4063
  3. package/dist/index-C4ioHAez.js.map +1 -0
  4. package/dist/index.es.js +6 -4
  5. package/dist/index.umd.js +10 -8
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/vue/form/x-checkbox.vue.d.ts +11 -0
  8. package/dist/vue/form/x-file-input.vue.d.ts +6 -6
  9. package/dist/vue/form/x-form.vue.d.ts +2 -1
  10. package/dist/vue/form/x-text-field.vue.d.ts +9 -1
  11. package/dist/vue/x-alert.vue.d.ts +2 -1
  12. package/dist/vue/x-avatar.vue.d.ts +2 -19
  13. package/dist/vue/x-btn.vue.d.ts +2 -1
  14. package/dist/vue/x-dialog.vue.d.ts +8 -8
  15. package/dist/vue/x-load.vue.d.ts +1 -1
  16. package/dist/vue/x-menu-item.vue.d.ts +6 -6
  17. package/dist/vue/x-menu-label.vue.d.ts +2 -1
  18. package/dist/vue/x-menu.vue.d.ts +2 -1
  19. package/dist/vue/x-navigation-tree.vue.d.ts +3 -5
  20. package/dist/vue/x-tab-group.vue.d.ts +4 -3
  21. package/dist/vue/x-tab-panel.vue.d.ts +2 -1
  22. package/dist/vue/x-tab.vue.d.ts +2 -1
  23. package/dist/x-alert-CTAhsN6L.js +46 -0
  24. package/dist/x-alert-CTAhsN6L.js.map +1 -0
  25. package/dist/x-avatar-Ds9aYRI9.js +28 -0
  26. package/dist/x-avatar-Ds9aYRI9.js.map +1 -0
  27. package/dist/x-breadcrumb-C2iUd4Sf.js.map +1 -1
  28. package/dist/{x-btn-DNlhiqjD.js → x-btn-BsiSIiiO.js} +9 -7
  29. package/dist/{x-btn-DNlhiqjD.js.map → x-btn-BsiSIiiO.js.map} +1 -1
  30. package/dist/x-card-CRM9KUby.js.map +1 -1
  31. package/dist/x-checkbox-CJ3_IJ-Y.js +28 -0
  32. package/dist/x-checkbox-CJ3_IJ-Y.js.map +1 -0
  33. package/dist/x-dialog-C4gz0mOu.js +48 -0
  34. package/dist/x-dialog-C4gz0mOu.js.map +1 -0
  35. package/dist/{x-file-input-BtGTZtfq.js → x-file-input-CMM5DWJc.js} +11 -9
  36. package/dist/{x-file-input-BtGTZtfq.js.map → x-file-input-CMM5DWJc.js.map} +1 -1
  37. package/dist/{x-form-pSj3365X.js → x-form-BLg386BG.js} +2 -2
  38. package/dist/{x-form-pSj3365X.js.map → x-form-BLg386BG.js.map} +1 -1
  39. package/dist/x-img-BYgs_O1F.js.map +1 -1
  40. package/dist/x-navigation-tree-BW05Yivz.js +502 -0
  41. package/dist/x-navigation-tree-BW05Yivz.js.map +1 -0
  42. package/dist/{x-tab-group-ngNByee3.js → x-tab-group-Bp7V46k9.js} +5 -5
  43. package/dist/{x-tab-group-ngNByee3.js.map → x-tab-group-Bp7V46k9.js.map} +1 -1
  44. package/dist/x-text-field-BxSiyeFc.js +38 -0
  45. package/dist/x-text-field-BxSiyeFc.js.map +1 -0
  46. package/langs/translation-de.json +4 -0
  47. package/langs/translation-fr.json +4 -1
  48. package/package.json +18 -11
  49. package/src/components/vuetifyDesignSystemLoader.ts +7 -0
  50. package/src/vue/css/style.css +17 -4
  51. package/src/vue/form/x-checkbox.vue +35 -0
  52. package/src/vue/form/x-file-input.vue +2 -2
  53. package/src/vue/form/x-text-field.vue +8 -1
  54. package/src/vue/x-alert.vue +10 -0
  55. package/src/vue/x-avatar.vue +9 -9
  56. package/src/vue/x-dialog.vue +10 -3
  57. package/src/vue/x-navigation-tree.vue +109 -68
  58. package/src/vue/x-tab-group.vue +2 -2
  59. package/src/vue/x-tab-panel.vue +0 -2
  60. package/tsconfig.json +14 -8
  61. package/dist/index-DCILSBLH.js.map +0 -1
  62. package/dist/x-alert-C3nY6ghP.js +0 -42
  63. package/dist/x-alert-C3nY6ghP.js.map +0 -1
  64. package/dist/x-avatar-But_Z7ic.js +0 -20
  65. package/dist/x-avatar-But_Z7ic.js.map +0 -1
  66. package/dist/x-dialog-Ce8KWptm.js +0 -38
  67. package/dist/x-dialog-Ce8KWptm.js.map +0 -1
  68. package/dist/x-navigation-tree-W6QDS4uh.js +0 -499
  69. package/dist/x-navigation-tree-W6QDS4uh.js.map +0 -1
  70. package/dist/x-text-field-CAVD3OjY.js +0 -29
  71. package/dist/x-text-field-CAVD3OjY.js.map +0 -1
@@ -1,42 +0,0 @@
1
- import { defineComponent as p, resolveComponent as o, openBlock as l, createBlock as n, withCtx as a, createElementBlock as c, Fragment as i, renderList as m, createTextVNode as d, toDisplayString as u, renderSlot as _ } from "vue";
2
- const y = /* @__PURE__ */ p({
3
- __name: "x-alert",
4
- props: {
5
- title: {},
6
- type: {},
7
- description: {},
8
- actions: {},
9
- closable: { type: Boolean }
10
- },
11
- setup(b) {
12
- return (e, f) => {
13
- const r = o("x-btn"), s = o("v-alert");
14
- return l(), n(s, {
15
- closable: e.closable,
16
- title: e.title,
17
- type: e.type,
18
- text: e.description
19
- }, {
20
- default: a(() => [
21
- (l(!0), c(i, null, m(e.actions, (t) => (l(), n(r, {
22
- key: t.name,
23
- size: "small",
24
- variant: "text",
25
- onClick: t.callback
26
- }, {
27
- default: a(() => [
28
- d(u(t.name), 1)
29
- ]),
30
- _: 2
31
- }, 1032, ["onClick"]))), 128)),
32
- _(e.$slots, "default")
33
- ]),
34
- _: 3
35
- }, 8, ["closable", "title", "type", "text"]);
36
- };
37
- }
38
- });
39
- export {
40
- y as default
41
- };
42
- //# sourceMappingURL=x-alert-C3nY6ghP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-alert-C3nY6ghP.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,20 +0,0 @@
1
- import { resolveComponent as r, openBlock as a, createBlock as o } from "vue";
2
- import { _ as n } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- const i = {
4
- props: {
5
- image: { type: String, required: !0 },
6
- size: { type: String, required: !0 }
7
- }
8
- };
9
- function s(c, _, e, m, p, u) {
10
- const t = r("v-avatar");
11
- return a(), o(t, {
12
- image: e.image,
13
- size: e.size
14
- }, null, 8, ["image", "size"]);
15
- }
16
- const g = /* @__PURE__ */ n(i, [["render", s]]);
17
- export {
18
- g as default
19
- };
20
- //# sourceMappingURL=x-avatar-But_Z7ic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-avatar-But_Z7ic.js","sources":["../src/vue/x-avatar.vue"],"sourcesContent":["<!--\nSee the LICENSE file distributed with this work for additional\ninformation regarding copyright ownership.\n\nThis is free software; you can redistribute it and/or modify it\nunder the terms of the GNU Lesser General Public License as\npublished by the Free Software Foundation; either version 2.1 of\nthe License, or (at your option) any later version.\n\nThis software is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nLesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public\nLicense along with this software; if not, write to the Free\nSoftware Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n02110-1301 USA, or see the FSF site: http://www.fsf.org.\n-->\n<template>\n <v-avatar :image=\"image\" :size=\"size\"></v-avatar>\n</template>\n<script lang=\"ts\">\nexport default {\n props: {\n image: { type: String, required: true },\n size: { type: String, required: true },\n },\n};\n</script>\n"],"names":["_sfc_main","_resolveComponent","_openBlock","_createBlock","_component_v_avatar","$props"],"mappings":";;AAuBA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ,UAAU,GAAK;AAAA,IACtC,MAAM,EAAE,MAAM,QAAQ,UAAU,GAAK;AAAA,EACvC;AACF;;YAREC,EAAiD,UAAA;SAAjBC,EAAI,GAAAC,EAAAC,GAAA;AAAA,IAAA,OAAAC,EAAA;AAAA;;;;"}
@@ -1,38 +0,0 @@
1
- import { defineComponent as i, resolveComponent as o, openBlock as s, createBlock as _, withCtx as e, createElementVNode as p, normalizeProps as m, guardReactiveProps as u, renderSlot as a, createVNode as n } from "vue";
2
- const w = /* @__PURE__ */ i({
3
- __name: "x-dialog",
4
- props: {
5
- title: {},
6
- width: {}
7
- },
8
- setup(v) {
9
- return (t, f) => {
10
- const r = o("v-card-text"), l = o("v-card"), d = o("v-dialog");
11
- return s(), _(d, { width: t.width }, {
12
- activator: e(({ props: c }) => [
13
- p("span", m(u(c)), [
14
- a(t.$slots, "activator")
15
- ], 16)
16
- ]),
17
- default: e(() => [
18
- n(l, { title: t.title }, {
19
- default: e(() => [
20
- n(r, null, {
21
- default: e(() => [
22
- a(t.$slots, "default")
23
- ]),
24
- _: 3
25
- })
26
- ]),
27
- _: 3
28
- }, 8, ["title"])
29
- ]),
30
- _: 3
31
- }, 8, ["width"]);
32
- };
33
- }
34
- });
35
- export {
36
- w as default
37
- };
38
- //# sourceMappingURL=x-dialog-Ce8KWptm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"x-dialog-Ce8KWptm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,499 +0,0 @@
1
- import { ref as P, computed as V, createVNode as g, mergeProps as T, Fragment as G, inject as W, reactive as Y, withModifiers as H, toRaw as S, toRef as y, provide as Z, defineComponent as ee, onBeforeMount as te, watch as ne, openBlock as j, createBlock as ae, unref as ie, withCtx as le, createElementBlock as $, toDisplayString as R } from "vue";
2
- import { p as O, o as D, m as oe, g as L, u as E, c as U, d as re, E as ce, I as x, 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 B, t as we, v as pe, w as q } from "./index-DCILSBLH.js";
3
- import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const Ce = O({
5
- ...D(oe({
6
- collapseIcon: "$treeviewCollapse",
7
- expandIcon: "$treeviewExpand"
8
- }), ["subgroup"])
9
- }, "VTreeviewGroup"), z = L()({
10
- name: "VTreeviewGroup",
11
- props: Ce(),
12
- setup(e, I) {
13
- let {
14
- slots: i
15
- } = I;
16
- const u = P(), p = V(() => {
17
- var o;
18
- return (o = u.value) != null && o.isOpen ? e.collapseIcon : e.expandIcon;
19
- }), b = V(() => {
20
- var o;
21
- return {
22
- VTreeviewItem: {
23
- prependIcon: void 0,
24
- appendIcon: void 0,
25
- active: (o = u.value) == null ? void 0 : o.isOpen,
26
- toggleIcon: p.value
27
- }
28
- };
29
- });
30
- return E(() => {
31
- const o = U.filterProps(e);
32
- return g(U, T(o, {
33
- ref: u,
34
- class: ["v-treeview-group", e.class],
35
- subgroup: !0
36
- }), {
37
- ...i,
38
- activator: i.activator ? (v) => g(G, null, [g(re, {
39
- defaults: b.value
40
- }, {
41
- default: () => {
42
- var f;
43
- return [(f = i.activator) == null ? void 0 : f.call(i, v)];
44
- }
45
- })]) : void 0
46
- });
47
- }), {};
48
- }
49
- }), J = Symbol.for("vuetify:v-treeview"), be = O({
50
- loading: Boolean,
51
- onToggleExpand: ce(),
52
- toggleIcon: x,
53
- ...de({
54
- slim: !0
55
- })
56
- }, "VTreeviewItem"), K = L()({
57
- name: "VTreeviewItem",
58
- props: be(),
59
- setup(e, I) {
60
- let {
61
- attrs: i,
62
- slots: u,
63
- emit: p
64
- } = I;
65
- const b = se(e, i), o = P(), v = V(() => {
66
- var s, w;
67
- return ((s = o.value) == null ? void 0 : s.root.activatable.value) && ((w = o.value) == null ? void 0 : w.isGroupActivator);
68
- }), f = V(() => {
69
- var s;
70
- return !e.disabled && e.link !== !1 && (e.link || b.isClickable.value || e.value != null && !!((s = o.value) != null && s.list) || v.value);
71
- });
72
- function d(s) {
73
- var w, C, l, r;
74
- !f.value || !v.value && ((w = o.value) != null && w.isGroupActivator) || (C = o.value) != null && C.root.activatable.value && ((r = o.value) == null || r.activate(!((l = o.value) != null && l.isActivated), s));
75
- }
76
- const k = W(J, {
77
- visibleIds: P()
78
- }).visibleIds;
79
- return E(() => {
80
- var C, l;
81
- const s = D(M.filterProps(e), ["onClick"]), w = u.prepend || e.toggleIcon;
82
- return g(M, T({
83
- ref: o
84
- }, s, {
85
- active: (C = o.value) == null ? void 0 : C.isActivated,
86
- class: ["v-treeview-item", {
87
- "v-treeview-item--activatable-group-activator": v.value,
88
- "v-treeview-item--filtered": k.value && !k.value.has((l = o.value) == null ? void 0 : l.id)
89
- }, e.class],
90
- ripple: !1,
91
- onClick: e.onClick ?? d
92
- }), {
93
- ...u,
94
- prepend: w ? (r) => {
95
- var t;
96
- return g(G, null, [e.toggleIcon && g(ue, {
97
- start: !1
98
- }, {
99
- default: () => [g(ve, {
100
- density: "compact",
101
- icon: e.toggleIcon,
102
- loading: e.loading,
103
- variant: "text",
104
- onClick: e.onToggleExpand
105
- }, {
106
- loader() {
107
- return g(fe, {
108
- indeterminate: "disable-shrink",
109
- size: "20",
110
- width: "2"
111
- }, null);
112
- }
113
- })]
114
- }), (t = u.prepend) == null ? void 0 : t.call(u, r)]);
115
- } : void 0
116
- });
117
- }), {};
118
- }
119
- }), Q = O({
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: x,
132
- default: "$checkboxIndeterminate"
133
- },
134
- falseIcon: x,
135
- trueIcon: x,
136
- returnObject: Boolean,
137
- selectable: Boolean,
138
- selectedColor: String,
139
- selectStrategy: [String, Function, Object]
140
- }, "VTreeviewChildren"), A = L()({
141
- name: "VTreeviewChildren",
142
- props: Q(),
143
- setup(e, I) {
144
- let {
145
- slots: i
146
- } = I;
147
- const u = Y(/* @__PURE__ */ new Set()), p = V(() => e.openOnClick != null ? e.openOnClick : e.selectable);
148
- async function b(v) {
149
- var f, d;
150
- try {
151
- if (!((f = e.items) != null && f.length) || !e.loadChildren) return;
152
- ((d = v == null ? void 0 : v.children) == null ? void 0 : d.length) === 0 && (u.add(v.value), await e.loadChildren(v.raw));
153
- } finally {
154
- u.delete(v.value);
155
- }
156
- }
157
- function o(v, f) {
158
- e.selectable && v(!f);
159
- }
160
- return () => {
161
- var v, f;
162
- return ((v = i.default) == null ? void 0 : v.call(i)) ?? ((f = e.items) == null ? void 0 : f.map((d) => {
163
- var t;
164
- const {
165
- children: k,
166
- props: s
167
- } = d, w = u.has(d.value), C = {
168
- prepend: (n) => {
169
- var a;
170
- return g(G, null, [e.selectable && (!k || k && !["leaf", "single-leaf"].includes(e.selectStrategy)) && g("div", null, [g(he, {
171
- key: d.value,
172
- modelValue: n.isSelected,
173
- loading: w,
174
- color: e.selectedColor,
175
- indeterminate: n.isIndeterminate,
176
- indeterminateIcon: e.indeterminateIcon,
177
- falseIcon: e.falseIcon,
178
- trueIcon: e.trueIcon,
179
- onClick: H(() => o(n.select, n.isSelected), ["stop"]),
180
- onKeydown: (c) => {
181
- ["Enter", "Space"].includes(c.key) && (c.stopPropagation(), o(n.select, n.isSelected));
182
- }
183
- }, null)]), (a = i.prepend) == null ? void 0 : a.call(i, {
184
- ...n,
185
- item: d.raw,
186
- internalItem: d
187
- })]);
188
- },
189
- append: i.append ? (n) => {
190
- var a;
191
- return (a = i.append) == null ? void 0 : a.call(i, {
192
- ...n,
193
- item: d.raw,
194
- internalItem: d
195
- });
196
- } : void 0,
197
- title: i.title ? (n) => {
198
- var a;
199
- return (a = i.title) == null ? void 0 : a.call(i, {
200
- ...n,
201
- item: d.raw,
202
- internalItem: d
203
- });
204
- } : void 0
205
- }, l = z.filterProps(s), r = A.filterProps(e);
206
- return k ? g(z, T(l, {
207
- value: e.returnObject ? d.raw : l == null ? void 0 : l.value
208
- }), {
209
- activator: (n) => {
210
- let {
211
- props: a
212
- } = n;
213
- const c = {
214
- ...s,
215
- ...a,
216
- value: s == null ? void 0 : s.value,
217
- onToggleExpand: [() => b(d), a.onClick],
218
- onClick: p.value ? [() => b(d), a.onClick] : void 0
219
- };
220
- return g(K, T(c, {
221
- value: e.returnObject ? S(d.raw) : s.value,
222
- loading: w
223
- }), C);
224
- },
225
- default: () => g(A, T(r, {
226
- items: k,
227
- returnObject: e.returnObject
228
- }), i)
229
- }) : ((t = i.item) == null ? void 0 : t.call(i, {
230
- props: s,
231
- item: d.raw,
232
- internalItem: d
233
- })) ?? g(K, T(s, {
234
- value: e.returnObject ? S(d.raw) : s.value
235
- }), C);
236
- }));
237
- };
238
- }
239
- });
240
- function X(e) {
241
- let I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
242
- for (const i of e)
243
- I.push(i), i.children && X(i.children, I);
244
- return I;
245
- }
246
- const ye = O({
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 = L()({
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, I) {
274
- let {
275
- slots: i
276
- } = I;
277
- const {
278
- items: u
279
- } = Ie(e), p = y(e, "activeColor"), b = y(e, "baseColor"), o = y(e, "color"), v = B(e, "activated"), f = B(e, "modelValue"), d = B(e, "selected", e.modelValue), k = V({
280
- get: () => d.value,
281
- set(c) {
282
- d.value = c, f.value = c;
283
- }
284
- }), s = P(), w = V(() => e.openAll ? a(u.value) : e.opened), C = V(() => X(u.value)), l = y(e, "search"), {
285
- filteredItems: r
286
- } = we(e, C, l), t = V(() => {
287
- var m;
288
- if (!l.value) return null;
289
- const c = (m = s.value) == null ? void 0 : m.getPath;
290
- return c ? new Set(r.value.flatMap((h) => {
291
- const _ = e.returnObject ? h.raw : h.props.value;
292
- return [...c(_), ...n(_)].map(S);
293
- })) : null;
294
- });
295
- function n(c) {
296
- var _, F;
297
- const m = [], h = (((_ = s.value) == null ? void 0 : _.children.get(c)) ?? []).slice();
298
- for (; h.length; ) {
299
- const N = h.shift();
300
- N && (m.push(N), h.push(...(((F = s.value) == null ? void 0 : F.children.get(N)) ?? []).slice()));
301
- }
302
- return m;
303
- }
304
- function a(c) {
305
- let m = [];
306
- for (const h of c)
307
- h.children && (m.push(e.returnObject ? S(h.raw) : h.value), h.children && (m = m.concat(a(h.children))));
308
- return m;
309
- }
310
- return Z(J, {
311
- visibleIds: t
312
- }), pe({
313
- VTreeviewGroup: {
314
- activeColor: p,
315
- baseColor: b,
316
- color: o,
317
- collapseIcon: y(e, "collapseIcon"),
318
- expandIcon: y(e, "expandIcon")
319
- },
320
- VTreeviewItem: {
321
- activeClass: y(e, "activeClass"),
322
- activeColor: p,
323
- baseColor: b,
324
- color: o,
325
- density: y(e, "density"),
326
- disabled: y(e, "disabled"),
327
- lines: y(e, "lines"),
328
- variant: y(e, "variant")
329
- }
330
- }), E(() => {
331
- const c = q.filterProps(e), m = A.filterProps(e);
332
- return g(q, T({
333
- ref: s
334
- }, c, {
335
- class: ["v-treeview", e.class],
336
- "open-strategy": "multiple",
337
- style: e.style,
338
- opened: w.value,
339
- activated: v.value,
340
- "onUpdate:activated": (h) => v.value = h,
341
- selected: k.value,
342
- "onUpdate:selected": (h) => k.value = h
343
- }), {
344
- default: () => [g(A, T(m, {
345
- returnObject: e.returnObject,
346
- items: u.value
347
- }), i)]
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 I = W("cristal"), i = I.getContainer().get("DocumentService"), u = I.getContainer().get("NavigationTreeSourceProvider").get(), p = P([]), b = P(void 0), o = P(new Array()), v = P(new Array()), f = e;
359
- te(async () => {
360
- for (const l of await u.getChildNodes(""))
361
- p.value.push({
362
- id: l.id,
363
- title: l.label,
364
- href: l.url,
365
- children: l.has_children ? [] : void 0,
366
- _location: l.location
367
- });
368
- f.currentPage !== void 0 && await d(), i.registerDocumentChangeListener("delete", w), i.registerDocumentChangeListener("update", C);
369
- }), ne(
370
- () => f.currentPage,
371
- async () => {
372
- f.currentPage && await d();
373
- }
374
- );
375
- async function d() {
376
- var n;
377
- const l = u.getParentNodesId(f.currentPage);
378
- let r, t = p.value;
379
- for (r = 0; r < l.length - 1; r++)
380
- if (t)
381
- for (const a of t)
382
- a.id == l[r] && (((n = a.children) == null ? void 0 : n.length) == 0 && await k(a), v.value.includes(a.id) || v.value.push(a.id), t = a.children);
383
- if (t)
384
- for (const a of t)
385
- a.id == l[r] && (o.value = [a.id], f.clickAction && f.clickAction({
386
- id: a.id,
387
- label: a.title,
388
- location: a._location,
389
- url: a.href,
390
- has_children: a.children !== void 0
391
- }));
392
- }
393
- async function k(l) {
394
- var n;
395
- const r = l, t = await u.getChildNodes(r.id);
396
- for (const a of t)
397
- (n = r.children) == null || n.push({
398
- id: a.id,
399
- title: a.label,
400
- href: a.url,
401
- children: a.has_children ? [] : void 0,
402
- _location: a.location
403
- });
404
- t.length == 0 && (r.children = void 0);
405
- }
406
- function s() {
407
- o.value.length > 1 && o.value.pop();
408
- }
409
- async function w(l) {
410
- const r = u.getParentNodesId(l);
411
- let t = p.value;
412
- for (; t; )
413
- for (const n of t.keys())
414
- if (t[n].id == r[0])
415
- if (r.length == 1) {
416
- t.splice(n, 1);
417
- return;
418
- } else {
419
- t = t[n].children, r.shift();
420
- break;
421
- }
422
- }
423
- async function C(l) {
424
- const r = u.getParentNodesId(l);
425
- let t, n = p.value;
426
- for (; n; ) {
427
- for (const c of n.keys())
428
- if (n[c].id == r[0])
429
- if (r.length == 1) {
430
- const m = await u.getChildNodes(
431
- t || ""
432
- );
433
- for (const h of m)
434
- if (h.id == n[c].id) {
435
- n[c].title = h.label;
436
- return;
437
- }
438
- } else {
439
- t = n[c].id, n = n[c].children, r.shift();
440
- break;
441
- }
442
- const a = await u.getChildNodes(
443
- t || ""
444
- );
445
- e: for (const c of a) {
446
- for (const m of n.keys())
447
- if (c.id == n[m].id)
448
- continue e;
449
- n.push({
450
- id: c.id,
451
- title: c.label,
452
- href: c.url,
453
- children: c.has_children ? [] : void 0,
454
- _location: c.location
455
- });
456
- }
457
- }
458
- }
459
- return (l, r) => (j(), ae(ie(Ve), {
460
- ref_key: "tree",
461
- ref: b,
462
- opened: v.value,
463
- "onUpdate:opened": r[0] || (r[0] = (t) => v.value = t),
464
- density: "compact",
465
- activated: o.value,
466
- items: p.value,
467
- "load-children": k,
468
- activatable: "",
469
- "active-strategy": "independent",
470
- "item-value": "id",
471
- "open-strategy": "multiple",
472
- "onUpdate:activated": s
473
- }, {
474
- title: le(({ item: t }) => [
475
- f.clickAction ? (j(), $("a", {
476
- key: 0,
477
- href: t.href,
478
- onClick: H((n) => {
479
- o.value = [t.id], l.clickAction({
480
- id: t.id,
481
- label: t.title,
482
- location: t._location,
483
- url: t.href,
484
- has_children: t.children !== void 0
485
- });
486
- }, ["prevent"])
487
- }, R(t.title), 9, Pe)) : (j(), $("a", {
488
- key: 1,
489
- href: t.href
490
- }, R(t.title), 9, Te))
491
- ]),
492
- _: 1
493
- }, 8, ["opened", "activated", "items"]));
494
- }
495
- }), Oe = /* @__PURE__ */ ke(_e, [["__scopeId", "data-v-cf1d31bb"]]);
496
- export {
497
- Oe as default
498
- };
499
- //# sourceMappingURL=x-navigation-tree-W6QDS4uh.js.map