@xwiki/cristal-dsvuetify 0.13.0 → 0.15.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.
- package/CHANGELOG.md +30 -0
- package/dist/{index-UP1o6s9t.js → index-BAakw3UY.js} +6415 -6339
- package/dist/index-BAakw3UY.js.map +1 -0
- package/dist/index.es.js +9 -6
- package/dist/index.umd.js +13 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/translations-k4crOAds.js +24 -0
- package/dist/{translations-BNEIsfPR.js.map → translations-k4crOAds.js.map} +1 -1
- package/dist/vue/form/x-checkbox.vue.d.ts +11 -0
- package/dist/vue/form/x-file-input.vue.d.ts +6 -6
- package/dist/vue/form/x-form.vue.d.ts +2 -1
- package/dist/vue/form/x-navigation-tree-select.vue.d.ts +12 -0
- package/dist/vue/form/x-text-field.vue.d.ts +9 -1
- package/dist/vue/x-alert.vue.d.ts +2 -1
- package/dist/vue/x-avatar.vue.d.ts +2 -19
- package/dist/vue/x-btn.vue.d.ts +2 -1
- package/dist/vue/x-dialog.vue.d.ts +7 -8
- package/dist/vue/x-load.vue.d.ts +1 -1
- package/dist/vue/x-menu-item.vue.d.ts +6 -6
- package/dist/vue/x-menu-label.vue.d.ts +2 -1
- package/dist/vue/x-menu.vue.d.ts +2 -1
- package/dist/vue/x-navigation-tree.vue.d.ts +2 -10
- package/dist/vue/x-tab-group.vue.d.ts +4 -3
- package/dist/vue/x-tab-panel.vue.d.ts +2 -1
- package/dist/vue/x-tab.vue.d.ts +2 -1
- package/dist/x-alert-CRdF8zFB.js +46 -0
- package/dist/x-alert-CRdF8zFB.js.map +1 -0
- package/dist/x-avatar-Ds9aYRI9.js +28 -0
- package/dist/x-avatar-Ds9aYRI9.js.map +1 -0
- package/dist/{x-btn-DNlhiqjD.js → x-btn-DwTcXGgx.js} +8 -6
- package/dist/{x-btn-DNlhiqjD.js.map → x-btn-DwTcXGgx.js.map} +1 -1
- package/dist/x-checkbox-Fro597Ax.js +28 -0
- package/dist/x-checkbox-Fro597Ax.js.map +1 -0
- package/dist/x-dialog-DCEnccuq.js +48 -0
- package/dist/x-dialog-DCEnccuq.js.map +1 -0
- package/dist/x-file-input-CvH0AC3G.js +39 -0
- package/dist/{x-file-input-BsaodA0p.js.map → x-file-input-CvH0AC3G.js.map} +1 -1
- package/dist/x-form-DCHdDC6W.js +25 -0
- package/dist/x-form-DCHdDC6W.js.map +1 -0
- package/dist/x-navigation-tree-D_fUW-gW.js +520 -0
- package/dist/x-navigation-tree-D_fUW-gW.js.map +1 -0
- package/dist/x-navigation-tree-select-DaiYF3ux.js +95 -0
- package/dist/x-navigation-tree-select-DaiYF3ux.js.map +1 -0
- package/dist/{x-tab-group-ngNByee3.js → x-tab-group-Bp7V46k9.js} +5 -5
- package/dist/{x-tab-group-ngNByee3.js.map → x-tab-group-Bp7V46k9.js.map} +1 -1
- package/dist/x-text-field-2Sv6HUGW.js +43 -0
- package/dist/x-text-field-2Sv6HUGW.js.map +1 -0
- package/langs/translation-de.json +3 -1
- package/langs/translation-en.json +3 -1
- package/langs/translation-fr.json +6 -1
- package/package.json +15 -13
- package/src/components/vuetifyDesignSystemLoader.ts +12 -1
- package/src/translations.ts +4 -0
- package/src/vue/css/style.css +6 -0
- package/src/vue/form/x-checkbox.vue +35 -0
- package/src/vue/form/x-file-input.vue +2 -2
- package/src/vue/form/x-form.vue +8 -4
- package/src/vue/form/x-navigation-tree-select.vue +120 -0
- package/src/vue/form/x-text-field.vue +5 -0
- package/src/vue/x-alert.vue +8 -0
- package/src/vue/x-avatar.vue +9 -9
- package/src/vue/x-dialog.vue +1 -7
- package/src/vue/x-navigation-tree.vue +47 -24
- package/src/vue/x-tab-group.vue +2 -2
- package/src/vue/x-tab-panel.vue +0 -2
- package/dist/index-UP1o6s9t.js.map +0 -1
- package/dist/translations-BNEIsfPR.js +0 -10
- package/dist/x-alert-Bmt4mXHQ.js +0 -45
- package/dist/x-alert-Bmt4mXHQ.js.map +0 -1
- package/dist/x-avatar-But_Z7ic.js +0 -20
- package/dist/x-avatar-But_Z7ic.js.map +0 -1
- package/dist/x-dialog-C-dMkFJk.js +0 -49
- package/dist/x-dialog-C-dMkFJk.js.map +0 -1
- package/dist/x-file-input-BsaodA0p.js +0 -36
- package/dist/x-form-iQFXj1PW.js +0 -32
- package/dist/x-form-iQFXj1PW.js.map +0 -1
- package/dist/x-navigation-tree-DN2Qz7Sm.js +0 -501
- package/dist/x-navigation-tree-DN2Qz7Sm.js.map +0 -1
- package/dist/x-text-field-CTsLZhLE.js +0 -31
- package/dist/x-text-field-CTsLZhLE.js.map +0 -1
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
import { ref as T, computed as P, createVNode as h, mergeProps as _, Fragment as G, inject as W, reactive as Y, withModifiers as H, toRaw as A, toRef as b, provide as Z, defineComponent as ee, onBeforeMount as te, watch as ne, openBlock as B, createBlock as ae, unref as ie, withCtx as le, createElementBlock as $, toDisplayString as R } from "vue";
|
|
2
|
-
import { p as L, o as D, m as oe, g as N, u as F, c as U, d as ce, E as re, I as S, 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-UP1o6s9t.js";
|
|
3
|
-
import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
const Ce = L({
|
|
5
|
-
...D(oe({
|
|
6
|
-
collapseIcon: "$treeviewCollapse",
|
|
7
|
-
expandIcon: "$treeviewExpand"
|
|
8
|
-
}), ["subgroup"])
|
|
9
|
-
}, "VTreeviewGroup"), z = N()({
|
|
10
|
-
name: "VTreeviewGroup",
|
|
11
|
-
props: Ce(),
|
|
12
|
-
setup(e, g) {
|
|
13
|
-
let {
|
|
14
|
-
slots: i
|
|
15
|
-
} = g;
|
|
16
|
-
const s = T(), w = P(() => {
|
|
17
|
-
var c;
|
|
18
|
-
return (c = s.value) != null && c.isOpen ? e.collapseIcon : e.expandIcon;
|
|
19
|
-
}), y = P(() => {
|
|
20
|
-
var c;
|
|
21
|
-
return {
|
|
22
|
-
VTreeviewItem: {
|
|
23
|
-
prependIcon: void 0,
|
|
24
|
-
appendIcon: void 0,
|
|
25
|
-
active: (c = s.value) == null ? void 0 : c.isOpen,
|
|
26
|
-
toggleIcon: w.value
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
return F(() => {
|
|
31
|
-
const c = U.filterProps(e);
|
|
32
|
-
return h(U, _(c, {
|
|
33
|
-
ref: s,
|
|
34
|
-
class: ["v-treeview-group", e.class],
|
|
35
|
-
subgroup: !0
|
|
36
|
-
}), {
|
|
37
|
-
...i,
|
|
38
|
-
activator: i.activator ? (u) => h(G, null, [h(ce, {
|
|
39
|
-
defaults: y.value
|
|
40
|
-
}, {
|
|
41
|
-
default: () => {
|
|
42
|
-
var f;
|
|
43
|
-
return [(f = i.activator) == null ? void 0 : f.call(i, u)];
|
|
44
|
-
}
|
|
45
|
-
})]) : void 0
|
|
46
|
-
});
|
|
47
|
-
}), {};
|
|
48
|
-
}
|
|
49
|
-
}), J = Symbol.for("vuetify:v-treeview"), ye = L({
|
|
50
|
-
loading: Boolean,
|
|
51
|
-
onToggleExpand: re(),
|
|
52
|
-
toggleIcon: S,
|
|
53
|
-
...de({
|
|
54
|
-
slim: !0
|
|
55
|
-
})
|
|
56
|
-
}, "VTreeviewItem"), K = N()({
|
|
57
|
-
name: "VTreeviewItem",
|
|
58
|
-
props: ye(),
|
|
59
|
-
setup(e, g) {
|
|
60
|
-
let {
|
|
61
|
-
attrs: i,
|
|
62
|
-
slots: s,
|
|
63
|
-
emit: w
|
|
64
|
-
} = g;
|
|
65
|
-
const y = se(e, i), c = T(), u = P(() => {
|
|
66
|
-
var r, m;
|
|
67
|
-
return ((r = c.value) == null ? void 0 : r.root.activatable.value) && ((m = c.value) == null ? void 0 : m.isGroupActivator);
|
|
68
|
-
}), f = P(() => {
|
|
69
|
-
var r;
|
|
70
|
-
return !e.disabled && e.link !== !1 && (e.link || y.isClickable.value || e.value != null && !!((r = c.value) != null && r.list) || u.value);
|
|
71
|
-
});
|
|
72
|
-
function l(r) {
|
|
73
|
-
var m, k;
|
|
74
|
-
f.value && u.value && ((k = c.value) == null || k.activate(!((m = c.value) != null && m.isActivated), r));
|
|
75
|
-
}
|
|
76
|
-
const p = W(J, {
|
|
77
|
-
visibleIds: T()
|
|
78
|
-
}).visibleIds;
|
|
79
|
-
return F(() => {
|
|
80
|
-
var k, C;
|
|
81
|
-
const r = D(M.filterProps(e), ["onClick"]), m = s.prepend || e.toggleIcon;
|
|
82
|
-
return h(M, _({
|
|
83
|
-
ref: c
|
|
84
|
-
}, r, {
|
|
85
|
-
active: (k = c.value) == null ? void 0 : k.isActivated,
|
|
86
|
-
class: ["v-treeview-item", {
|
|
87
|
-
"v-treeview-item--activatable-group-activator": u.value,
|
|
88
|
-
"v-treeview-item--filtered": p.value && !p.value.has((C = c.value) == null ? void 0 : C.id)
|
|
89
|
-
}, e.class],
|
|
90
|
-
ripple: !1,
|
|
91
|
-
onClick: e.onClick ?? l
|
|
92
|
-
}), {
|
|
93
|
-
...s,
|
|
94
|
-
prepend: m ? (v) => {
|
|
95
|
-
var d;
|
|
96
|
-
return h(G, null, [e.toggleIcon && h(ue, {
|
|
97
|
-
start: !1
|
|
98
|
-
}, {
|
|
99
|
-
default: () => [h(ve, {
|
|
100
|
-
density: "compact",
|
|
101
|
-
icon: e.toggleIcon,
|
|
102
|
-
loading: e.loading,
|
|
103
|
-
variant: "text",
|
|
104
|
-
onClick: e.onToggleExpand
|
|
105
|
-
}, {
|
|
106
|
-
loader() {
|
|
107
|
-
return h(fe, {
|
|
108
|
-
indeterminate: "disable-shrink",
|
|
109
|
-
size: "20",
|
|
110
|
-
width: "2"
|
|
111
|
-
}, null);
|
|
112
|
-
}
|
|
113
|
-
})]
|
|
114
|
-
}), (d = s.prepend) == null ? void 0 : d.call(s, v)]);
|
|
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: S,
|
|
132
|
-
default: "$checkboxIndeterminate"
|
|
133
|
-
},
|
|
134
|
-
falseIcon: S,
|
|
135
|
-
trueIcon: S,
|
|
136
|
-
returnObject: Boolean,
|
|
137
|
-
selectable: Boolean,
|
|
138
|
-
selectedColor: String,
|
|
139
|
-
selectStrategy: [String, Function, Object]
|
|
140
|
-
}, "VTreeviewChildren"), O = N()({
|
|
141
|
-
name: "VTreeviewChildren",
|
|
142
|
-
props: Q(),
|
|
143
|
-
setup(e, g) {
|
|
144
|
-
let {
|
|
145
|
-
slots: i
|
|
146
|
-
} = g;
|
|
147
|
-
const s = Y(/* @__PURE__ */ new Set()), w = P(() => e.openOnClick != null ? e.openOnClick : e.selectable);
|
|
148
|
-
async function y(u) {
|
|
149
|
-
var f, l;
|
|
150
|
-
try {
|
|
151
|
-
if (!((f = e.items) != null && f.length) || !e.loadChildren) return;
|
|
152
|
-
((l = u == null ? void 0 : u.children) == null ? void 0 : l.length) === 0 && (s.add(u.value), await e.loadChildren(u.raw));
|
|
153
|
-
} finally {
|
|
154
|
-
s.delete(u.value);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
function c(u, f) {
|
|
158
|
-
e.selectable && u(!f);
|
|
159
|
-
}
|
|
160
|
-
return () => {
|
|
161
|
-
var u, f;
|
|
162
|
-
return ((u = i.default) == null ? void 0 : u.call(i)) ?? ((f = e.items) == null ? void 0 : f.map((l) => {
|
|
163
|
-
var d;
|
|
164
|
-
const {
|
|
165
|
-
children: p,
|
|
166
|
-
props: r
|
|
167
|
-
} = l, m = s.has(l.value), k = {
|
|
168
|
-
prepend: (t) => {
|
|
169
|
-
var n;
|
|
170
|
-
return h(G, null, [e.selectable && (!p || p && !["leaf", "single-leaf"].includes(e.selectStrategy)) && h("div", null, [h(he, {
|
|
171
|
-
key: l.value,
|
|
172
|
-
modelValue: t.isSelected,
|
|
173
|
-
loading: m,
|
|
174
|
-
color: e.selectedColor,
|
|
175
|
-
indeterminate: t.isIndeterminate,
|
|
176
|
-
indeterminateIcon: e.indeterminateIcon,
|
|
177
|
-
falseIcon: e.falseIcon,
|
|
178
|
-
trueIcon: e.trueIcon,
|
|
179
|
-
onClick: H(() => c(t.select, t.isSelected), ["stop"]),
|
|
180
|
-
onKeydown: (a) => {
|
|
181
|
-
["Enter", "Space"].includes(a.key) && (a.stopPropagation(), c(t.select, t.isSelected));
|
|
182
|
-
}
|
|
183
|
-
}, null)]), (n = i.prepend) == null ? void 0 : n.call(i, {
|
|
184
|
-
...t,
|
|
185
|
-
item: l.raw,
|
|
186
|
-
internalItem: l
|
|
187
|
-
})]);
|
|
188
|
-
},
|
|
189
|
-
append: i.append ? (t) => {
|
|
190
|
-
var n;
|
|
191
|
-
return (n = i.append) == null ? void 0 : n.call(i, {
|
|
192
|
-
...t,
|
|
193
|
-
item: l.raw,
|
|
194
|
-
internalItem: l
|
|
195
|
-
});
|
|
196
|
-
} : void 0,
|
|
197
|
-
title: i.title ? (t) => {
|
|
198
|
-
var n;
|
|
199
|
-
return (n = i.title) == null ? void 0 : n.call(i, {
|
|
200
|
-
...t,
|
|
201
|
-
item: l.raw,
|
|
202
|
-
internalItem: l
|
|
203
|
-
});
|
|
204
|
-
} : void 0
|
|
205
|
-
}, C = z.filterProps(r), v = O.filterProps(e);
|
|
206
|
-
return p ? h(z, _(C, {
|
|
207
|
-
value: e.returnObject ? l.raw : C == null ? void 0 : C.value
|
|
208
|
-
}), {
|
|
209
|
-
activator: (t) => {
|
|
210
|
-
let {
|
|
211
|
-
props: n
|
|
212
|
-
} = t;
|
|
213
|
-
const a = {
|
|
214
|
-
...r,
|
|
215
|
-
...n,
|
|
216
|
-
value: r == null ? void 0 : r.value,
|
|
217
|
-
onToggleExpand: [() => y(l), n.onClick],
|
|
218
|
-
onClick: w.value ? [() => y(l), n.onClick] : void 0
|
|
219
|
-
};
|
|
220
|
-
return h(K, _(a, {
|
|
221
|
-
value: e.returnObject ? A(l.raw) : r.value,
|
|
222
|
-
loading: m
|
|
223
|
-
}), k);
|
|
224
|
-
},
|
|
225
|
-
default: () => h(O, _(v, {
|
|
226
|
-
items: p,
|
|
227
|
-
returnObject: e.returnObject
|
|
228
|
-
}), i)
|
|
229
|
-
}) : ((d = i.item) == null ? void 0 : d.call(i, {
|
|
230
|
-
props: r,
|
|
231
|
-
item: l.raw,
|
|
232
|
-
internalItem: l
|
|
233
|
-
})) ?? h(K, _(r, {
|
|
234
|
-
value: e.returnObject ? A(l.raw) : r.value
|
|
235
|
-
}), k);
|
|
236
|
-
}));
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
function X(e) {
|
|
241
|
-
let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
242
|
-
for (const i of e)
|
|
243
|
-
g.push(i), i.children && X(i.children, g);
|
|
244
|
-
return g;
|
|
245
|
-
}
|
|
246
|
-
const be = 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 = N()({
|
|
263
|
-
name: "VTreeview",
|
|
264
|
-
props: be(),
|
|
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, g) {
|
|
274
|
-
let {
|
|
275
|
-
slots: i
|
|
276
|
-
} = g;
|
|
277
|
-
const {
|
|
278
|
-
items: s
|
|
279
|
-
} = Ie(e), w = b(e, "activeColor"), y = b(e, "baseColor"), c = b(e, "color"), u = E(e, "activated"), f = E(e, "modelValue"), l = E(e, "selected", e.modelValue), p = P({
|
|
280
|
-
get: () => l.value,
|
|
281
|
-
set(a) {
|
|
282
|
-
l.value = a, f.value = a;
|
|
283
|
-
}
|
|
284
|
-
}), r = T(), m = P(() => e.openAll ? n(s.value) : e.opened), k = P(() => X(s.value)), C = b(e, "search"), {
|
|
285
|
-
filteredItems: v
|
|
286
|
-
} = we(e, k, C), d = P(() => {
|
|
287
|
-
var I;
|
|
288
|
-
if (!C.value) return null;
|
|
289
|
-
const a = (I = r.value) == null ? void 0 : I.getPath;
|
|
290
|
-
return a ? new Set(v.value.flatMap((o) => {
|
|
291
|
-
const V = e.returnObject ? o.raw : o.props.value;
|
|
292
|
-
return [...a(V), ...t(V)].map(A);
|
|
293
|
-
})) : null;
|
|
294
|
-
});
|
|
295
|
-
function t(a) {
|
|
296
|
-
var V, x;
|
|
297
|
-
const I = [], o = (((V = r.value) == null ? void 0 : V.children.get(a)) ?? []).slice();
|
|
298
|
-
for (; o.length; ) {
|
|
299
|
-
const j = o.shift();
|
|
300
|
-
j && (I.push(j), o.push(...(((x = r.value) == null ? void 0 : x.children.get(j)) ?? []).slice()));
|
|
301
|
-
}
|
|
302
|
-
return I;
|
|
303
|
-
}
|
|
304
|
-
function n(a) {
|
|
305
|
-
let I = [];
|
|
306
|
-
for (const o of a)
|
|
307
|
-
o.children && (I.push(e.returnObject ? A(o.raw) : o.value), o.children && (I = I.concat(n(o.children))));
|
|
308
|
-
return I;
|
|
309
|
-
}
|
|
310
|
-
return Z(J, {
|
|
311
|
-
visibleIds: d
|
|
312
|
-
}), pe({
|
|
313
|
-
VTreeviewGroup: {
|
|
314
|
-
activeColor: w,
|
|
315
|
-
baseColor: y,
|
|
316
|
-
color: c,
|
|
317
|
-
collapseIcon: b(e, "collapseIcon"),
|
|
318
|
-
expandIcon: b(e, "expandIcon")
|
|
319
|
-
},
|
|
320
|
-
VTreeviewItem: {
|
|
321
|
-
activeClass: b(e, "activeClass"),
|
|
322
|
-
activeColor: w,
|
|
323
|
-
baseColor: y,
|
|
324
|
-
color: c,
|
|
325
|
-
density: b(e, "density"),
|
|
326
|
-
disabled: b(e, "disabled"),
|
|
327
|
-
lines: b(e, "lines"),
|
|
328
|
-
variant: b(e, "variant")
|
|
329
|
-
}
|
|
330
|
-
}), F(() => {
|
|
331
|
-
const a = q.filterProps(e), I = O.filterProps(e);
|
|
332
|
-
return h(q, _({
|
|
333
|
-
ref: r
|
|
334
|
-
}, a, {
|
|
335
|
-
class: ["v-treeview", e.class],
|
|
336
|
-
"open-strategy": "multiple",
|
|
337
|
-
style: e.style,
|
|
338
|
-
opened: m.value,
|
|
339
|
-
activated: u.value,
|
|
340
|
-
"onUpdate:activated": (o) => u.value = o,
|
|
341
|
-
selected: p.value,
|
|
342
|
-
"onUpdate:selected": (o) => p.value = o
|
|
343
|
-
}), {
|
|
344
|
-
default: () => [h(O, _(I, {
|
|
345
|
-
returnObject: e.returnObject,
|
|
346
|
-
items: s.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 g = W("cristal"), i = g.getContainer().get("DocumentService"), s = g.getContainer().get("NavigationTreeSourceProvider").get(), w = T([]), y = T(void 0), c = T(new Array()), u = T(new Array());
|
|
359
|
-
var f = !1;
|
|
360
|
-
const l = e;
|
|
361
|
-
te(async () => {
|
|
362
|
-
for (const v of await s.getChildNodes(""))
|
|
363
|
-
w.value.push({
|
|
364
|
-
id: v.id,
|
|
365
|
-
title: v.label,
|
|
366
|
-
href: v.url,
|
|
367
|
-
children: v.has_children ? [] : void 0,
|
|
368
|
-
_location: v.location
|
|
369
|
-
});
|
|
370
|
-
await p(), i.registerDocumentChangeListener("delete", k), i.registerDocumentChangeListener("update", C);
|
|
371
|
-
}), ne(() => l.currentPage, p);
|
|
372
|
-
async function p() {
|
|
373
|
-
var v;
|
|
374
|
-
if (l.currentPage && !f) {
|
|
375
|
-
f = !0;
|
|
376
|
-
const d = s.getParentNodesId(l.currentPage);
|
|
377
|
-
let t, n = w.value;
|
|
378
|
-
for (t = 0; t < d.length - 1; t++)
|
|
379
|
-
if (n)
|
|
380
|
-
for (const a of n)
|
|
381
|
-
a.id == d[t] && (((v = a.children) == null ? void 0 : v.length) == 0 && await r(a), u.value.includes(a.id) || u.value.push(a.id), n = a.children);
|
|
382
|
-
if (n)
|
|
383
|
-
for (const a of n)
|
|
384
|
-
a.id == d[t] && (c.value = [a.id], l.clickAction && l.clickAction({
|
|
385
|
-
id: a.id,
|
|
386
|
-
label: a.title,
|
|
387
|
-
location: a._location,
|
|
388
|
-
url: a.href,
|
|
389
|
-
has_children: a.children !== void 0
|
|
390
|
-
}));
|
|
391
|
-
f = !1;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
async function r(v) {
|
|
395
|
-
var n;
|
|
396
|
-
const d = v, t = await s.getChildNodes(d.id);
|
|
397
|
-
for (const a of t)
|
|
398
|
-
(n = d.children) == null || n.push({
|
|
399
|
-
id: a.id,
|
|
400
|
-
title: a.label,
|
|
401
|
-
href: a.url,
|
|
402
|
-
children: a.has_children ? [] : void 0,
|
|
403
|
-
_location: a.location
|
|
404
|
-
});
|
|
405
|
-
t.length == 0 && (d.children = void 0);
|
|
406
|
-
}
|
|
407
|
-
function m() {
|
|
408
|
-
c.value.length > 1 && c.value.pop();
|
|
409
|
-
}
|
|
410
|
-
async function k(v) {
|
|
411
|
-
const d = s.getParentNodesId(v);
|
|
412
|
-
let t = w.value;
|
|
413
|
-
for (; t; )
|
|
414
|
-
for (const n of t.keys())
|
|
415
|
-
if (t[n].id == d[0])
|
|
416
|
-
if (d.length == 1) {
|
|
417
|
-
t.splice(n, 1);
|
|
418
|
-
return;
|
|
419
|
-
} else {
|
|
420
|
-
t = t[n].children, d.shift();
|
|
421
|
-
break;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
async function C(v) {
|
|
425
|
-
const d = s.getParentNodesId(v);
|
|
426
|
-
let t, n = w.value, a = !1;
|
|
427
|
-
e: for (; n && !a; ) {
|
|
428
|
-
for (const o of n.keys())
|
|
429
|
-
if (n[o].id == d[0])
|
|
430
|
-
if (d.length == 1) {
|
|
431
|
-
const V = await s.getChildNodes(
|
|
432
|
-
t || ""
|
|
433
|
-
);
|
|
434
|
-
for (const x of V)
|
|
435
|
-
if (x.id == n[o].id) {
|
|
436
|
-
n[o].title = x.label;
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
} else {
|
|
440
|
-
t = n[o].id, n[o].children || (n[o].children = []), n = n[o].children, d.shift();
|
|
441
|
-
continue e;
|
|
442
|
-
}
|
|
443
|
-
a = !0;
|
|
444
|
-
}
|
|
445
|
-
const I = await s.getChildNodes(
|
|
446
|
-
t || ""
|
|
447
|
-
);
|
|
448
|
-
e: for (const o of I) {
|
|
449
|
-
for (const V of n.keys())
|
|
450
|
-
if (o.id == n[V].id)
|
|
451
|
-
continue e;
|
|
452
|
-
n.push({
|
|
453
|
-
id: o.id,
|
|
454
|
-
title: o.label,
|
|
455
|
-
href: o.url,
|
|
456
|
-
children: o.has_children ? [] : void 0,
|
|
457
|
-
_location: o.location
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return (v, d) => (B(), ae(ie(Ve), {
|
|
462
|
-
ref_key: "tree",
|
|
463
|
-
ref: y,
|
|
464
|
-
opened: u.value,
|
|
465
|
-
"onUpdate:opened": d[0] || (d[0] = (t) => u.value = t),
|
|
466
|
-
density: "compact",
|
|
467
|
-
activated: c.value,
|
|
468
|
-
items: w.value,
|
|
469
|
-
"load-children": r,
|
|
470
|
-
activatable: "",
|
|
471
|
-
"active-strategy": "independent",
|
|
472
|
-
"item-value": "id",
|
|
473
|
-
"open-strategy": "multiple",
|
|
474
|
-
"onUpdate:activated": m
|
|
475
|
-
}, {
|
|
476
|
-
title: le(({ item: t }) => [
|
|
477
|
-
l.clickAction ? (B(), $("a", {
|
|
478
|
-
key: 0,
|
|
479
|
-
href: t.href,
|
|
480
|
-
onClick: H((n) => {
|
|
481
|
-
c.value = [t.id], v.clickAction({
|
|
482
|
-
id: t.id,
|
|
483
|
-
label: t.title,
|
|
484
|
-
location: t._location,
|
|
485
|
-
url: t.href,
|
|
486
|
-
has_children: t.children !== void 0
|
|
487
|
-
});
|
|
488
|
-
}, ["prevent"])
|
|
489
|
-
}, R(t.title), 9, Pe)) : (B(), $("a", {
|
|
490
|
-
key: 1,
|
|
491
|
-
href: t.href
|
|
492
|
-
}, R(t.title), 9, Te))
|
|
493
|
-
]),
|
|
494
|
-
_: 1
|
|
495
|
-
}, 8, ["opened", "activated", "items"]));
|
|
496
|
-
}
|
|
497
|
-
}), Oe = /* @__PURE__ */ ke(_e, [["__scopeId", "data-v-ec2189a9"]]);
|
|
498
|
-
export {
|
|
499
|
-
Oe as default
|
|
500
|
-
};
|
|
501
|
-
//# sourceMappingURL=x-navigation-tree-DN2Qz7Sm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"x-navigation-tree-DN2Qz7Sm.js","sources":["../../../node_modules/.pnpm/vuetify@3.7.5_typescript@5.6.3_vite-plugin-vuetify@2.0.4_vue@3.5.13_typescript@5.6.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeviewGroup.mjs","../../../node_modules/.pnpm/vuetify@3.7.5_typescript@5.6.3_vite-plugin-vuetify@2.0.4_vue@3.5.13_typescript@5.6.3_/node_modules/vuetify/lib/labs/VTreeview/shared.mjs","../../../node_modules/.pnpm/vuetify@3.7.5_typescript@5.6.3_vite-plugin-vuetify@2.0.4_vue@3.5.13_typescript@5.6.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeviewItem.mjs","../../../node_modules/.pnpm/vuetify@3.7.5_typescript@5.6.3_vite-plugin-vuetify@2.0.4_vue@3.5.13_typescript@5.6.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeviewChildren.mjs","../../../node_modules/.pnpm/vuetify@3.7.5_typescript@5.6.3_vite-plugin-vuetify@2.0.4_vue@3.5.13_typescript@5.6.3_/node_modules/vuetify/lib/labs/VTreeview/VTreeview.mjs","../src/vue/x-navigation-tree.vue"],"sourcesContent":["import { mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from \"vue\";\n// Components\nimport { VDefaultsProvider } from \"../../components/VDefaultsProvider/index.mjs\";\nimport { makeVListGroupProps, VListGroup } from \"../../components/VList/VListGroup.mjs\"; // Utilities\nimport { computed, ref } from 'vue';\nimport { genericComponent, omit, propsFactory, useRender } from \"../../util/index.mjs\"; // 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.mjs.map","// Types\n\nexport const VTreeviewSymbol = Symbol.for('vuetify:v-treeview');\n//# sourceMappingURL=shared.mjs.map","import { mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from \"vue\";\n// Styles\nimport \"./VTreeviewItem.css\";\n\n// Components\nimport { VBtn } from \"../../components/VBtn/index.mjs\";\nimport { VListItemAction } from \"../../components/VList/index.mjs\";\nimport { makeVListItemProps, VListItem } from \"../../components/VList/VListItem.mjs\";\nimport { VProgressCircular } from \"../../components/VProgressCircular/index.mjs\"; // Composables\nimport { IconValue } from \"../../composables/icons.mjs\";\nimport { useLink } from \"../../composables/router.mjs\"; // Utilities\nimport { computed, inject, ref } from 'vue';\nimport { EventProp, genericComponent, omit, propsFactory, useRender } from \"../../util/index.mjs\"; // Types\nimport { VTreeviewSymbol } from \"./shared.mjs\";\nexport const makeVTreeviewItemProps = propsFactory({\n loading: Boolean,\n onToggleExpand: EventProp(),\n toggleIcon: IconValue,\n ...makeVListItemProps({\n slim: true\n })\n}, 'VTreeviewItem');\nexport const VTreeviewItem = genericComponent()({\n name: 'VTreeviewItem',\n props: makeVTreeviewItemProps(),\n setup(props, _ref) {\n let {\n attrs,\n slots,\n emit\n } = _ref;\n const link = useLink(props, attrs);\n const vListItemRef = ref();\n const isActivatableGroupActivator = computed(() => vListItemRef.value?.root.activatable.value && vListItemRef.value?.isGroupActivator);\n const isClickable = computed(() => !props.disabled && props.link !== false && (props.link || link.isClickable.value || props.value != null && !!vListItemRef.value?.list || isActivatableGroupActivator.value));\n function activateGroupActivator(e) {\n if (isClickable.value && isActivatableGroupActivator.value) {\n vListItemRef.value?.activate(!vListItemRef.value?.isActivated, e);\n }\n }\n const visibleIds = inject(VTreeviewSymbol, {\n visibleIds: ref()\n }).visibleIds;\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': visibleIds.value && !visibleIds.value.has(vListItemRef.value?.id)\n }, props.class],\n \"ripple\": false,\n \"onClick\": props.onClick ?? activateGroupActivator\n }), {\n ...slots,\n prepend: hasPrepend ? slotProps => {\n return _createVNode(_Fragment, null, [props.toggleIcon && _createVNode(VListItemAction, {\n \"start\": false\n }, {\n default: () => [_createVNode(VBtn, {\n \"density\": \"compact\",\n \"icon\": props.toggleIcon,\n \"loading\": props.loading,\n \"variant\": \"text\",\n \"onClick\": props.onToggleExpand\n }, {\n loader() {\n return _createVNode(VProgressCircular, {\n \"indeterminate\": \"disable-shrink\",\n \"size\": \"20\",\n \"width\": \"2\"\n }, null);\n }\n })]\n }), slots.prepend?.(slotProps)]);\n } : undefined\n });\n });\n return {};\n }\n});\n//# sourceMappingURL=VTreeviewItem.mjs.map","import { mergeProps as _mergeProps, resolveDirective as _resolveDirective, createVNode as _createVNode, Fragment as _Fragment } from \"vue\";\n// Components\nimport { VTreeviewGroup } from \"./VTreeviewGroup.mjs\";\nimport { VTreeviewItem } from \"./VTreeviewItem.mjs\";\nimport { VCheckboxBtn } from \"../../components/VCheckbox/index.mjs\"; // Composables\nimport { IconValue } from \"../../composables/icons.mjs\"; // Utilities\nimport { computed, reactive, toRaw, withModifiers } from 'vue';\nimport { genericComponent, propsFactory } from \"../../util/index.mjs\"; // Types\nexport const makeVTreeviewChildrenProps = propsFactory({\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}, '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.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 \"loading\": loading,\n \"color\": props.selectedColor,\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 };\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 ? toRaw(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.mjs.map","import { createVNode as _createVNode, mergeProps as _mergeProps, resolveDirective as _resolveDirective } from \"vue\";\n// Components\nimport { makeVTreeviewChildrenProps, VTreeviewChildren } from \"./VTreeviewChildren.mjs\";\nimport { makeVListProps, useListItems, VList } from \"../../components/VList/VList.mjs\"; // Composables\nimport { provideDefaults } from \"../../composables/defaults.mjs\";\nimport { makeFilterProps, useFilter } from \"../../composables/filter.mjs\";\nimport { useProxiedModel } from \"../../composables/proxiedModel.mjs\"; // Utilities\nimport { computed, provide, ref, toRaw, toRef } from 'vue';\nimport { genericComponent, omit, propsFactory, useRender } from \"../../util/index.mjs\"; // Types\nimport { VTreeviewSymbol } from \"./shared.mjs\";\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 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', 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 \"returnObject\": props.returnObject,\n \"items\": items.value\n }), slots)]\n });\n });\n return {};\n }\n});\n//# sourceMappingURL=VTreeview.mjs.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 { inject, onBeforeMount, ref, watch } from \"vue\";\nimport { VTreeview } from \"vuetify/labs/VTreeview\";\nimport type { CristalApp, PageData } from \"@xwiki/cristal-api\";\nimport type { DocumentService } from \"@xwiki/cristal-document-api\";\nimport type { SpaceReference } from \"@xwiki/cristal-model-api\";\nimport type {\n NavigationTreeNode,\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};\n\ntype OnClickAction = (node: NavigationTreeNode) => void;\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([]);\nconst tree: Ref<VTreeview | undefined> = ref(undefined);\n\nconst activatedNodes: Ref<Array<string>> = ref(new Array<string>());\nconst expandedNodes: Ref<Array<string>> = ref(new Array<string>());\nvar isExpanding: boolean = false;\n\nconst props = defineProps<{\n clickAction?: OnClickAction;\n currentPage?: PageData;\n}>();\n\nonBeforeMount(async () => {\n for (const node of await treeSource.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 });\n }\n await expandTree();\n\n documentService.registerDocumentChangeListener(\"delete\", onDocumentDelete);\n documentService.registerDocumentChangeListener(\"update\", onDocumentUpdate);\n});\n\nwatch(() => props.currentPage, 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.currentPage && !isExpanding) {\n isExpanding = true;\n const newExpandedNodes = treeSource.getParentNodesId(props.currentPage);\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.includes(node.id)) {\n expandedNodes.value.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 });\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 treeSource.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 });\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: PageData) {\n const parents = treeSource.getParentNodesId(page);\n let currentItems: TreeItem[] | undefined = rootNodes.value;\n while (currentItems) {\n for (const i of currentItems.keys()) {\n if (currentItems[i].id == parents[0]) {\n if (parents.length == 1) {\n currentItems.splice(i, 1);\n return;\n } else {\n currentItems = currentItems[i].children;\n parents.shift();\n break;\n }\n }\n }\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: PageData) {\n const parents = treeSource.getParentNodesId(page);\n let currentParent: string | undefined = undefined;\n let currentItems: TreeItem[] | undefined = rootNodes.value;\n let notFound = false;\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 treeSource.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 currentItems[i].children = [];\n }\n currentItems = currentItems[i].children;\n parents.shift();\n continue currentItemsLoop;\n }\n }\n }\n notFound = true;\n }\n\n // New page\n const newItems = await treeSource.getChildNodes(\n currentParent ? currentParent : \"\",\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 });\n }\n}\n</script>\n\n<template>\n <v-treeview\n ref=\"tree\"\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 open-strategy=\"multiple\"\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 });\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":["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","EventProp","IconValue","makeVListItemProps","VTreeviewItem","attrs","emit","link","useLink","vListItemRef","isActivatableGroupActivator","_b","isClickable","activateGroupActivator","e","visibleIds","inject","listItemProps","VListItem","hasPrepend","VListItemAction","VBtn","VProgressCircular","makeVTreeviewChildrenProps","VTreeviewChildren","isLoading","reactive","isClickOnOpen","checkChildren","item","selectItem","select","isSelected","children","itemProps","loading","slotsWithItem","VCheckboxBtn","withModifiers","treeviewGroupProps","treeviewChildrenProps","_ref2","activatorProps","toRaw","flatten","items","flat","makeVTreeviewProps","makeFilterProps","makeVListProps","VTreeview","val","value","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","tree","activatedNodes","expandedNodes","isExpanding","__props","onBeforeMount","node","expandTree","onDocumentDelete","onDocumentUpdate","watch","newExpandedNodes","currentNodes","lazyLoadChildren","treeItem","childNodes","clearSelection","page","parents","currentItems","currentParent","notFound","currentItemsLoop","newItems","newItem","newItemsLoop"],"mappings":";;;AAMO,MAAMA,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,GAAyB;AAAA,EAChC,MAAMM,GAAOC,GAAM;AACjB,QAAI;AAAA,MACF,OAAAC;AAAA,IACN,IAAQD;AACJ,UAAME,IAAgBC,EAAK,GACrBC,IAAaC,EAAS,MAAA;;AAAM,cAAAC,IAAAJ,EAAc,UAAd,QAAAI,EAAqB,SAASP,EAAM,eAAeA,EAAM;AAAA,KAAU,GAC/FQ,IAAoBF,EAAS,MAAO;;AAAA;AAAA,QACxC,eAAe;AAAA,UACb,aAAa;AAAA,UACb,YAAY;AAAA,UACZ,SAAQC,IAAAJ,EAAc,UAAd,gBAAAI,EAAqB;AAAA,UAC7B,YAAYF,EAAW;AAAA,QAC/B;AAAA,MACA;AAAA,KAAM;AACF,WAAAI,EAAU,MAAM;AACd,YAAMC,IAAiBC,EAAW,YAAYX,CAAK;AACnD,aAAOY,EAAaD,GAAYE,EAAYH,GAAgB;AAAA,QAC1D,KAAOP;AAAA,QACP,OAAS,CAAC,oBAAoBH,EAAM,KAAK;AAAA,QACzC,UAAY;AAAA,MACpB,CAAO,GAAG;AAAA,QACF,GAAGE;AAAA,QACH,WAAWA,EAAM,YAAY,CAAAY,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,IAEf6B,IAAAA,EAAa7B,CAAC,EAAE,UAC/B4B,EAAQ,MAAM;AACL,uBAAAI;AAAA,YAAA;AAIJ,QAAAD,IAAA;AAAA,MAAA;AAIP,YAAAE,IAAW,MAAMzB,EAAW;AAAA,QAChCsB,KAAgC;AAAA,MAClC;AACc,MAAAK,EAAA,YAAWD,KAAWD,GAAU;AACjC,mBAAAjC,KAAK6B,EAAc;AAC5B,cAAIK,EAAQ,MAAML,EAAc7B,CAAC,EAAE;AACxB,qBAAAmC;AAGb,QAAAN,EAAc,KAAK;AAAA,UACjB,IAAIK,EAAQ;AAAA,UACZ,OAAOA,EAAQ;AAAA,UACf,MAAMA,EAAQ;AAAA,UACd,UAAUA,EAAQ,eAAe,CAAA,IAAK;AAAA,UACtC,WAAWA,EAAQ;AAAA,QAAA,CACpB;AAAA,MAAA;AAAA,IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,3,4]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineComponent as n, computed as s, openBlock as l, createBlock as m, unref as p } from "vue";
|
|
2
|
-
import { t as f } from "./translations-BNEIsfPR.js";
|
|
3
|
-
import { useI18n as i } from "vue-i18n";
|
|
4
|
-
import { a as c } from "./index-UP1o6s9t.js";
|
|
5
|
-
const x = /* @__PURE__ */ n({
|
|
6
|
-
__name: "x-text-field",
|
|
7
|
-
props: {
|
|
8
|
-
name: {},
|
|
9
|
-
label: {},
|
|
10
|
-
required: { type: Boolean },
|
|
11
|
-
autofocus: { type: Boolean }
|
|
12
|
-
},
|
|
13
|
-
setup(o) {
|
|
14
|
-
const { t: r } = i({
|
|
15
|
-
messages: f
|
|
16
|
-
}), u = o, a = s(() => {
|
|
17
|
-
const e = [];
|
|
18
|
-
return u.required && e.push((t) => t ? !0 : r("vuetify.text.input.mandatory")), e;
|
|
19
|
-
});
|
|
20
|
-
return (e, t) => (l(), m(p(c), {
|
|
21
|
-
label: e.label,
|
|
22
|
-
name: e.name,
|
|
23
|
-
autofocus: e.autofocus,
|
|
24
|
-
rules: a.value
|
|
25
|
-
}, null, 8, ["label", "name", "autofocus", "rules"]));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
export {
|
|
29
|
-
x as default
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=x-text-field-CTsLZhLE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"x-text-field-CTsLZhLE.js","sources":["../src/vue/form/x-text-field.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport messages from \"../../translations\";\nimport { computed } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VTextField } from \"vuetify/components/VTextField\";\nimport type { TextFieldProps } from \"@xwiki/cristal-dsapi\";\n\nconst { t } = useI18n({\n messages,\n});\nconst props = defineProps<TextFieldProps>();\n\nconst rules = computed(() => {\n const rulesList = [];\n if (props.required) {\n rulesList.push((value: unknown) => {\n if (value) {\n return true;\n } else {\n return t(\"vuetify.text.input.mandatory\");\n }\n });\n }\n return rulesList;\n});\n</script>\n\n<template>\n <v-text-field\n :label=\"label\"\n :name=\"name\"\n :autofocus=\"autofocus\"\n :rules=\"rules\"\n ></v-text-field>\n</template>\n\n<style scoped></style>\n"],"names":["t","useI18n","messages","props","__props","rules","computed","rulesList","value"],"mappings":";;;;;;;;;;;;;AAOM,UAAA,EAAE,GAAAA,EAAE,IAAIC,EAAQ;AAAA,MACpBC,UAAAA;AAAAA,IAAA,CACD,GACKC,IAAQC,GAERC,IAAQC,EAAS,MAAM;AAC3B,YAAMC,IAAY,CAAC;AACnB,aAAIJ,EAAM,YACEI,EAAA,KAAK,CAACC,MACVA,IACK,KAEAR,EAAE,8BAA8B,CAE1C,GAEIO;AAAA,IAAA,CACR;;;;;;;;;"}
|