@viur/shop-components 0.0.1-dev.47 → 0.0.1-dev.49
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/dist/CategoryView-C82ANveM.mjs +60 -0
- package/dist/ItemCard-CJb5ufYO.mjs +64 -0
- package/dist/ItemView-BqdaEKGW.mjs +1848 -0
- package/dist/ItemView.css +1 -0
- package/dist/main-DAewB9nF.mjs +3212 -0
- package/dist/main.css +1 -0
- package/dist/viur-shop-components.es.js +8 -30452
- package/dist/viur-shop-components.umd.js +417 -6530
- package/package.json +15 -2
- package/dist/style.css +0 -1
|
@@ -0,0 +1,3212 @@
|
|
|
1
|
+
var nt = Object.defineProperty;
|
|
2
|
+
var at = (e, n, t) => n in e ? nt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var Oe = (e, n, t) => at(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { defineComponent as D, inject as C, reactive as w, openBlock as m, createElementBlock as h, normalizeClass as ye, createElementVNode as i, renderSlot as Ze, pushScopeId as M, popScopeId as z, Fragment as E, createCommentVNode as k, toDisplayString as B, onMounted as R, ref as F, readonly as st, getCurrentScope as lt, onScopeDispose as rt, unref as q, computed as S, watchEffect as ce, renderList as U, watch as ae, withDirectives as J, vModelText as le, getCurrentInstance as ot, resolveComponent as se, createBlock as T, vShow as ve, withModifiers as de, createTextVNode as O, shallowRef as G, provide as ie, onBeforeMount as ee, useCssVars as it, Transition as ut, withCtx as dt, createVNode as ct, Teleport as Je, resolveDynamicComponent as mt, mergeProps as ft } from "vue";
|
|
5
|
+
import { defineStore as $e } from "pinia";
|
|
6
|
+
import Ce from "@viur/ckeditor5-build-classic";
|
|
7
|
+
import { Request as gt } from "@viur/vue-utils";
|
|
8
|
+
import { ViURShopClient as ht } from "@viur/viur-shop-client";
|
|
9
|
+
import { useRoute as bt, createRouter as vt, createWebHashHistory as pt } from "vue-router";
|
|
10
|
+
const yt = D({
|
|
11
|
+
props: {
|
|
12
|
+
isDragging: Boolean,
|
|
13
|
+
draggingLineBottom: Boolean,
|
|
14
|
+
draggingLineTop: Boolean
|
|
15
|
+
},
|
|
16
|
+
components: {},
|
|
17
|
+
emits: ["change", "delete", "handleDragStart", "handleDragEnd", "handleDragOver", "handleDrop"],
|
|
18
|
+
setup(e, n) {
|
|
19
|
+
const t = C("boneState");
|
|
20
|
+
return {
|
|
21
|
+
state: w({
|
|
22
|
+
isDraggable: !1
|
|
23
|
+
}),
|
|
24
|
+
boneState: t
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}), I = (e, n) => {
|
|
28
|
+
const t = e.__vccOpts || e;
|
|
29
|
+
for (const [l, s] of n)
|
|
30
|
+
t[l] = s;
|
|
31
|
+
return t;
|
|
32
|
+
}, Qe = (e) => (M("data-v-141aaf9b"), e = e(), z(), e), $t = ["draggable"], St = ["disabled"], _t = /* @__PURE__ */ Qe(() => /* @__PURE__ */ i("sl-icon", {
|
|
33
|
+
slot: "prefix",
|
|
34
|
+
name: "grip-vertical"
|
|
35
|
+
}, null, -1)), kt = [
|
|
36
|
+
_t
|
|
37
|
+
], wt = { class: "value" }, Et = ["disabled", "title"], At = /* @__PURE__ */ Qe(() => /* @__PURE__ */ i("sl-icon", {
|
|
38
|
+
slot: "prefix",
|
|
39
|
+
name: "x-lg"
|
|
40
|
+
}, null, -1)), It = [
|
|
41
|
+
At
|
|
42
|
+
];
|
|
43
|
+
function Ot(e, n, t, l, s, o) {
|
|
44
|
+
return m(), h("div", {
|
|
45
|
+
class: ye(["value-line", {
|
|
46
|
+
"is-dragging": e.isDragging,
|
|
47
|
+
"dragging-line-bottom": e.draggingLineBottom,
|
|
48
|
+
"dragging-line-top": e.draggingLineTop
|
|
49
|
+
}]),
|
|
50
|
+
draggable: e.state.isDraggable,
|
|
51
|
+
onDragover: n[2] || (n[2] = (a) => e.$emit("handleDragOver", a)),
|
|
52
|
+
onDrop: n[3] || (n[3] = (a) => e.$emit("handleDrop", a)),
|
|
53
|
+
onDragstart: n[4] || (n[4] = (a) => e.$emit("handleDragStart", a)),
|
|
54
|
+
onDragend: n[5] || (n[5] = (a) => e.$emit("handleDragEnd"))
|
|
55
|
+
}, [
|
|
56
|
+
i("sl-button", {
|
|
57
|
+
disabled: e.boneState.readonly,
|
|
58
|
+
class: "drag-button",
|
|
59
|
+
onMousedown: n[0] || (n[0] = (a) => e.state.isDraggable = !0)
|
|
60
|
+
}, kt, 40, St),
|
|
61
|
+
i("div", wt, [
|
|
62
|
+
Ze(e.$slots, "default", {}, void 0, !0)
|
|
63
|
+
]),
|
|
64
|
+
i("sl-button", {
|
|
65
|
+
variant: "danger",
|
|
66
|
+
disabled: e.boneState.readonly,
|
|
67
|
+
outline: "",
|
|
68
|
+
title: e.$t("bone.del"),
|
|
69
|
+
class: "delete-btn",
|
|
70
|
+
onClick: n[1] || (n[1] = (a) => e.$emit("delete"))
|
|
71
|
+
}, It, 8, Et)
|
|
72
|
+
], 42, $t);
|
|
73
|
+
}
|
|
74
|
+
const Ct = /* @__PURE__ */ I(yt, [["render", Ot], ["__scopeId", "data-v-141aaf9b"]]), jt = D({
|
|
75
|
+
props: {
|
|
76
|
+
name: String,
|
|
77
|
+
value: Object,
|
|
78
|
+
index: Number,
|
|
79
|
+
lang: String,
|
|
80
|
+
readonly: Boolean,
|
|
81
|
+
params: Object
|
|
82
|
+
},
|
|
83
|
+
components: {},
|
|
84
|
+
emits: ["change", "handleClick"],
|
|
85
|
+
setup(e, n) {
|
|
86
|
+
const t = C("boneState");
|
|
87
|
+
return {
|
|
88
|
+
state: w({
|
|
89
|
+
debug: !1
|
|
90
|
+
}),
|
|
91
|
+
boneState: t
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}), Bt = { class: "bone-name" }, Dt = { key: 0 }, Vt = { class: "bone" };
|
|
95
|
+
function Nt(e, n, t, l, s, o) {
|
|
96
|
+
return m(), h(E, null, [
|
|
97
|
+
i("label", Bt, [
|
|
98
|
+
Ze(e.$slots, "default", {}, void 0, !0),
|
|
99
|
+
k("", !0)
|
|
100
|
+
]),
|
|
101
|
+
e.state.debug ? (m(), h("div", Dt, [
|
|
102
|
+
i("div", Vt, B(e.name), 1),
|
|
103
|
+
i("pre", null, " " + B(e.boneState) + `
|
|
104
|
+
`, 1)
|
|
105
|
+
])) : k("", !0)
|
|
106
|
+
], 64);
|
|
107
|
+
}
|
|
108
|
+
const Rt = /* @__PURE__ */ I(jt, [["render", Nt], ["__scopeId", "data-v-b7149172"]]), Lt = D({
|
|
109
|
+
inheritAttrs: !1,
|
|
110
|
+
props: {
|
|
111
|
+
name: String,
|
|
112
|
+
value: [Object, String, Number, Boolean, Array],
|
|
113
|
+
index: Number,
|
|
114
|
+
lang: String
|
|
115
|
+
},
|
|
116
|
+
components: {},
|
|
117
|
+
emits: ["change"],
|
|
118
|
+
setup(e, n) {
|
|
119
|
+
const t = C("boneState"), l = w({});
|
|
120
|
+
function s(o) {
|
|
121
|
+
n.emit("change", e.name, o.target.value, e.lang, e.index);
|
|
122
|
+
}
|
|
123
|
+
return R(() => {
|
|
124
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
125
|
+
}), {
|
|
126
|
+
state: l,
|
|
127
|
+
boneState: t,
|
|
128
|
+
changeEvent: s
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}), Ut = ["disabled", "value"], Tt = ["disabled", "value"];
|
|
132
|
+
function Pt(e, n, t, l, s, o) {
|
|
133
|
+
var a, u;
|
|
134
|
+
return e.boneState.bonestructure.type === "raw.json" ? (m(), h("sl-textarea", {
|
|
135
|
+
key: 0,
|
|
136
|
+
disabled: (a = e.boneState) == null ? void 0 : a.readonly,
|
|
137
|
+
value: JSON.stringify(e.value),
|
|
138
|
+
onInput: n[0] || (n[0] = (...r) => e.changeEvent && e.changeEvent(...r))
|
|
139
|
+
}, null, 40, Ut)) : (m(), h("sl-textarea", {
|
|
140
|
+
key: 1,
|
|
141
|
+
disabled: (u = e.boneState) == null ? void 0 : u.readonly,
|
|
142
|
+
value: e.value,
|
|
143
|
+
onInput: n[1] || (n[1] = (...r) => e.changeEvent && e.changeEvent(...r))
|
|
144
|
+
}, null, 40, Tt));
|
|
145
|
+
}
|
|
146
|
+
const pe = /* @__PURE__ */ I(Lt, [["render", Pt], ["__scopeId", "data-v-0ebe5f0b"]]), Mt = D({
|
|
147
|
+
inheritAttrs: !1,
|
|
148
|
+
props: {
|
|
149
|
+
name: String,
|
|
150
|
+
value: [Object, String, Number, Boolean, Array],
|
|
151
|
+
index: Number,
|
|
152
|
+
lang: String,
|
|
153
|
+
readonly: Boolean,
|
|
154
|
+
params: Object
|
|
155
|
+
},
|
|
156
|
+
components: {},
|
|
157
|
+
emits: ["change"],
|
|
158
|
+
setup(e, n) {
|
|
159
|
+
const t = w({});
|
|
160
|
+
function l(s) {
|
|
161
|
+
n.emit("change", e.name, s.target.value, e.lang, e.index);
|
|
162
|
+
}
|
|
163
|
+
return R(() => {
|
|
164
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
165
|
+
}), {
|
|
166
|
+
state: t,
|
|
167
|
+
changeEvent: l
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}), zt = ["value"];
|
|
171
|
+
function Wt(e, n, t, l, s, o) {
|
|
172
|
+
return m(), h("sl-input", {
|
|
173
|
+
disabled: "",
|
|
174
|
+
value: e.value,
|
|
175
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
176
|
+
}, null, 40, zt);
|
|
177
|
+
}
|
|
178
|
+
const je = /* @__PURE__ */ I(Mt, [["render", Wt], ["__scopeId", "data-v-b45a1311"]]);
|
|
179
|
+
function qt(e) {
|
|
180
|
+
return lt() ? (rt(e), !0) : !1;
|
|
181
|
+
}
|
|
182
|
+
function Ft(e) {
|
|
183
|
+
return typeof e == "function" ? e() : q(e);
|
|
184
|
+
}
|
|
185
|
+
const Kt = typeof window < "u" && typeof document < "u";
|
|
186
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
187
|
+
function me(e, n, t = {}) {
|
|
188
|
+
const {
|
|
189
|
+
immediate: l = !0
|
|
190
|
+
} = t, s = F(!1);
|
|
191
|
+
let o = null;
|
|
192
|
+
function a() {
|
|
193
|
+
o && (clearTimeout(o), o = null);
|
|
194
|
+
}
|
|
195
|
+
function u() {
|
|
196
|
+
s.value = !1, a();
|
|
197
|
+
}
|
|
198
|
+
function r(...c) {
|
|
199
|
+
a(), s.value = !0, o = setTimeout(() => {
|
|
200
|
+
s.value = !1, o = null, e(...c);
|
|
201
|
+
}, Ft(n));
|
|
202
|
+
}
|
|
203
|
+
return l && (s.value = !0, Kt && r()), qt(u), {
|
|
204
|
+
isPending: st(s),
|
|
205
|
+
start: r,
|
|
206
|
+
stop: u
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
class Ht {
|
|
210
|
+
static objectEmpty(n) {
|
|
211
|
+
return Object.keys(n).length === 0 && n.constructor === Object;
|
|
212
|
+
}
|
|
213
|
+
static getDescr(n, t) {
|
|
214
|
+
try {
|
|
215
|
+
return n.values.filter((l) => l[0] === t)[0][1];
|
|
216
|
+
} catch {
|
|
217
|
+
return "-";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
static unescape(n) {
|
|
221
|
+
return n || (n = ""), String(n).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/(/g, "(").replace(/)/g, ")").replace(/=/g, "=").replace(/'/g, "'").replace(/(/g, "(").replace(/)/g, ")").replace(/=/g, "=");
|
|
222
|
+
}
|
|
223
|
+
static formatString(n, t) {
|
|
224
|
+
function l(a) {
|
|
225
|
+
let u = [], r = [], c = /\$\((.*?)\)/g;
|
|
226
|
+
for (; r; ) {
|
|
227
|
+
if (r = c.exec(a), !r) {
|
|
228
|
+
r = !1;
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
u.push(r[1]);
|
|
232
|
+
}
|
|
233
|
+
return u;
|
|
234
|
+
}
|
|
235
|
+
let s = l(n), o = [];
|
|
236
|
+
Array.isArray(t) || (t = [t]);
|
|
237
|
+
for (let a of t) {
|
|
238
|
+
let u = n;
|
|
239
|
+
for (let r of s) {
|
|
240
|
+
let c = r.split("."), d = a;
|
|
241
|
+
for (let f of c)
|
|
242
|
+
d && d !== "-" && f in d && d[f] ? d = d[f] : d = "-";
|
|
243
|
+
d = this.unescape(d), u = u.replace("$(" + r + ")", d);
|
|
244
|
+
}
|
|
245
|
+
o.push(u);
|
|
246
|
+
}
|
|
247
|
+
return o.join(", ");
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
const Gt = D({
|
|
251
|
+
inheritAttrs: !1,
|
|
252
|
+
props: {
|
|
253
|
+
name: String,
|
|
254
|
+
value: [Object, String, Number, Boolean, Array],
|
|
255
|
+
index: Number,
|
|
256
|
+
lang: String,
|
|
257
|
+
autofocus: Boolean
|
|
258
|
+
},
|
|
259
|
+
components: {},
|
|
260
|
+
emits: ["change"],
|
|
261
|
+
setup(e, n) {
|
|
262
|
+
const t = C("boneState"), l = w({
|
|
263
|
+
value: S(() => e.value)
|
|
264
|
+
}), s = F(null);
|
|
265
|
+
function o(a) {
|
|
266
|
+
n.emit("change", e.name, a.target.value, e.lang, e.index);
|
|
267
|
+
}
|
|
268
|
+
return ce(() => {
|
|
269
|
+
if (e.autofocus && s.value && s.value !== null && s !== null) {
|
|
270
|
+
const { start: a } = me(() => {
|
|
271
|
+
s.value.focus();
|
|
272
|
+
}, 600);
|
|
273
|
+
a();
|
|
274
|
+
}
|
|
275
|
+
}), R(() => {
|
|
276
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
277
|
+
}), {
|
|
278
|
+
state: l,
|
|
279
|
+
Utils: Ht,
|
|
280
|
+
boneState: t,
|
|
281
|
+
changeEvent: o,
|
|
282
|
+
stringBone: s
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}), Zt = ["disabled", "value", "required"];
|
|
286
|
+
function Jt(e, n, t, l, s, o) {
|
|
287
|
+
return m(), h("sl-input", {
|
|
288
|
+
ref: "stringBone",
|
|
289
|
+
disabled: e.boneState.readonly,
|
|
290
|
+
value: e.Utils.unescape(e.value),
|
|
291
|
+
required: e.boneState.bonestructure.required,
|
|
292
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)),
|
|
293
|
+
onKeyup: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
294
|
+
}, null, 40, Zt);
|
|
295
|
+
}
|
|
296
|
+
const Be = /* @__PURE__ */ I(Gt, [["render", Jt], ["__scopeId", "data-v-1ccbacc0"]]), Qt = D({
|
|
297
|
+
inheritAttrs: !1,
|
|
298
|
+
props: {
|
|
299
|
+
name: String,
|
|
300
|
+
value: [Object, String, Number, Boolean, Array],
|
|
301
|
+
index: Number,
|
|
302
|
+
lang: String,
|
|
303
|
+
autofocus: Boolean
|
|
304
|
+
},
|
|
305
|
+
components: {},
|
|
306
|
+
emits: ["change"],
|
|
307
|
+
setup(e, n) {
|
|
308
|
+
const t = C("boneState"), l = w({}), s = F(null);
|
|
309
|
+
function o(a) {
|
|
310
|
+
n.emit("change", e.name, a.target.value, e.lang, e.index);
|
|
311
|
+
}
|
|
312
|
+
return ce(() => {
|
|
313
|
+
if (e.autofocus && s.value && s.value !== null && s !== null) {
|
|
314
|
+
const { start: a } = me(() => {
|
|
315
|
+
s.value.focus();
|
|
316
|
+
}, 600);
|
|
317
|
+
a();
|
|
318
|
+
}
|
|
319
|
+
}), R(() => {
|
|
320
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
321
|
+
}), {
|
|
322
|
+
state: l,
|
|
323
|
+
boneState: t,
|
|
324
|
+
changeEvent: o,
|
|
325
|
+
emailBone: s
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}), Yt = ["disabled", "value"];
|
|
329
|
+
function Xt(e, n, t, l, s, o) {
|
|
330
|
+
return m(), h("sl-input", {
|
|
331
|
+
ref: "emailBone",
|
|
332
|
+
disabled: e.boneState.readonly,
|
|
333
|
+
type: "email",
|
|
334
|
+
value: e.value,
|
|
335
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
336
|
+
}, null, 40, Yt);
|
|
337
|
+
}
|
|
338
|
+
const De = /* @__PURE__ */ I(Qt, [["render", Xt], ["__scopeId", "data-v-4328e024"]]), xt = D({
|
|
339
|
+
inheritAttrs: !1,
|
|
340
|
+
props: {
|
|
341
|
+
name: String,
|
|
342
|
+
value: [Object, String, Number, Boolean, Array],
|
|
343
|
+
index: Number,
|
|
344
|
+
lang: String
|
|
345
|
+
},
|
|
346
|
+
components: {},
|
|
347
|
+
emits: ["change"],
|
|
348
|
+
setup(e, n) {
|
|
349
|
+
const t = C("boneState"), l = w({
|
|
350
|
+
value: S(() => {
|
|
351
|
+
var a;
|
|
352
|
+
let o = e.value;
|
|
353
|
+
return t.bonestructure.time ? o = (a = e.value) == null ? void 0 : a.split("+")[0] : e.value && (o = new Date(e.value).toISOString().substr(0, 10)), o;
|
|
354
|
+
}),
|
|
355
|
+
typeString: S(() => {
|
|
356
|
+
let o = "datetime-local";
|
|
357
|
+
return t.bonestructure.time || (o = "date"), o;
|
|
358
|
+
})
|
|
359
|
+
});
|
|
360
|
+
function s(o) {
|
|
361
|
+
n.emit("change", e.name, o.target.value, e.lang, e.index);
|
|
362
|
+
}
|
|
363
|
+
return R(() => {
|
|
364
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
365
|
+
}), {
|
|
366
|
+
state: l,
|
|
367
|
+
boneState: t,
|
|
368
|
+
changeEvent: s
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
}), en = ["disabled", "type", "value"];
|
|
372
|
+
function tn(e, n, t, l, s, o) {
|
|
373
|
+
return m(), h("sl-input", {
|
|
374
|
+
disabled: e.boneState.readonly,
|
|
375
|
+
type: e.state.typeString,
|
|
376
|
+
value: e.state.value,
|
|
377
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
378
|
+
}, null, 40, en);
|
|
379
|
+
}
|
|
380
|
+
const Ve = /* @__PURE__ */ I(xt, [["render", tn], ["__scopeId", "data-v-f1b8af8c"]]), nn = D({
|
|
381
|
+
inheritAttrs: !1,
|
|
382
|
+
props: {
|
|
383
|
+
name: String,
|
|
384
|
+
value: null,
|
|
385
|
+
index: Number,
|
|
386
|
+
lang: String
|
|
387
|
+
},
|
|
388
|
+
components: {},
|
|
389
|
+
emits: ["change"],
|
|
390
|
+
setup(e, n) {
|
|
391
|
+
const t = C("boneState"), l = w({
|
|
392
|
+
value: S(() => {
|
|
393
|
+
let a = e.value;
|
|
394
|
+
return Array.isArray(e.value) ? (t.bonestructure.values instanceof Array ? a = a.filter((u) => t.bonestructure.values.map((r) => r[0].toString()).includes(u)) : a = a.filter(
|
|
395
|
+
(u) => Object.keys(t.bonestructure.values).map((r) => r.toString()).includes(u)
|
|
396
|
+
), a.map((u) => u.toString())) : e.value ? e.value.toString() : "";
|
|
397
|
+
})
|
|
398
|
+
});
|
|
399
|
+
function s() {
|
|
400
|
+
if (Array.isArray(t.bonestructure.values))
|
|
401
|
+
return t.bonestructure.values;
|
|
402
|
+
{
|
|
403
|
+
let a = [];
|
|
404
|
+
for (const [u, r] of Object.entries(t.bonestructure.values))
|
|
405
|
+
a.push([u, r]);
|
|
406
|
+
return a;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function o(a) {
|
|
410
|
+
n.emit("change", e.name, a.target.value, e.lang, e.index), W;
|
|
411
|
+
}
|
|
412
|
+
return R(() => {
|
|
413
|
+
n.emit("change", e.name, l.value, e.lang, e.index);
|
|
414
|
+
}), {
|
|
415
|
+
state: l,
|
|
416
|
+
boneState: t,
|
|
417
|
+
changeEvent: o,
|
|
418
|
+
convertObjToList: s
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
}), an = ["disabled", "value", "multiple"], sn = ["value"];
|
|
422
|
+
function ln(e, n, t, l, s, o) {
|
|
423
|
+
return m(), h("sl-select", {
|
|
424
|
+
disabled: e.boneState.readonly,
|
|
425
|
+
value: e.state.value,
|
|
426
|
+
hoist: "",
|
|
427
|
+
multiple: e.boneState.bonestructure.multiple,
|
|
428
|
+
"max-options-visible": "0",
|
|
429
|
+
clearable: "",
|
|
430
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
431
|
+
}, [
|
|
432
|
+
(m(!0), h(E, null, U(e.convertObjToList(), (a) => (m(), h("sl-option", {
|
|
433
|
+
key: a[0],
|
|
434
|
+
value: a[0]
|
|
435
|
+
}, B(a[1]), 9, sn))), 128))
|
|
436
|
+
], 40, an);
|
|
437
|
+
}
|
|
438
|
+
const Ne = /* @__PURE__ */ I(nn, [["render", ln], ["__scopeId", "data-v-5a38b97f"]]), rn = D({
|
|
439
|
+
inheritAttrs: !1,
|
|
440
|
+
props: {
|
|
441
|
+
name: String,
|
|
442
|
+
value: [Object, String, Number, Boolean, Array],
|
|
443
|
+
index: Number,
|
|
444
|
+
lang: String
|
|
445
|
+
},
|
|
446
|
+
components: {},
|
|
447
|
+
emits: ["change"],
|
|
448
|
+
setup(e, n) {
|
|
449
|
+
const t = C("boneState"), l = w({
|
|
450
|
+
value: S(() => ![!1, null, void 0, ""].includes(e.value))
|
|
451
|
+
});
|
|
452
|
+
function s(o) {
|
|
453
|
+
n.emit("change", e.name, o.target.checked, e.lang, e.index);
|
|
454
|
+
}
|
|
455
|
+
return R(() => {
|
|
456
|
+
let o = e.value;
|
|
457
|
+
o || (o = !1), n.emit("change", e.name, o, e.lang, e.index);
|
|
458
|
+
}), {
|
|
459
|
+
state: l,
|
|
460
|
+
boneState: t,
|
|
461
|
+
changeEvent: s
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
}), on = ["disabled", "checked"];
|
|
465
|
+
function un(e, n, t, l, s, o) {
|
|
466
|
+
return m(), h("sl-switch", {
|
|
467
|
+
disabled: e.boneState.readonly,
|
|
468
|
+
checked: e.state.value,
|
|
469
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
470
|
+
}, null, 40, on);
|
|
471
|
+
}
|
|
472
|
+
const Re = /* @__PURE__ */ I(rn, [["render", un], ["__scopeId", "data-v-363598c8"]]), dn = D({
|
|
473
|
+
inheritAttrs: !1,
|
|
474
|
+
props: {
|
|
475
|
+
name: String,
|
|
476
|
+
value: [Object, String, Number, Boolean, Array],
|
|
477
|
+
index: Number,
|
|
478
|
+
lang: String,
|
|
479
|
+
autofocus: Boolean
|
|
480
|
+
},
|
|
481
|
+
components: {},
|
|
482
|
+
emits: ["change"],
|
|
483
|
+
setup(e, n) {
|
|
484
|
+
const t = C("boneState"), l = w({
|
|
485
|
+
value1: "",
|
|
486
|
+
value2: null,
|
|
487
|
+
equal: !1,
|
|
488
|
+
passwordInfo: [],
|
|
489
|
+
requiredPasswordInfo: []
|
|
490
|
+
}), s = F(null);
|
|
491
|
+
function o(u) {
|
|
492
|
+
l.value1 === l.value2 ? l.equal = !0 : l.equal = !1, a(l.value1), l.requiredPasswordInfo.length === 0 && l.passwordInfo.length - l.requiredPasswordInfo.length <= t.bonestructure.test_threshold ? n.emit("change", e.name, l.value1, e.lang, e.index, !0) : n.emit("change", e.name, l.value1, e.lang, e.index, !1);
|
|
493
|
+
}
|
|
494
|
+
R(() => {
|
|
495
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
496
|
+
});
|
|
497
|
+
function a(u) {
|
|
498
|
+
l.passwordInfo = [], l.requiredPasswordInfo = [];
|
|
499
|
+
for (const r of t.bonestructure.tests)
|
|
500
|
+
new RegExp(r[0]).test(u) || (r[2] ? l.requiredPasswordInfo.push(r[1]) : l.passwordInfo.push(r[1]));
|
|
501
|
+
l.equal || l.requiredPasswordInfo.push("Die eingegebenen Passwörter stimmen nicht überein."), l.value1 || l.requiredPasswordInfo.push("Das eingegebene Passwort ist leer.");
|
|
502
|
+
}
|
|
503
|
+
return ce(() => {
|
|
504
|
+
if (e.autofocus && s.value && s.value !== null && s !== null) {
|
|
505
|
+
const { start: u } = me(() => {
|
|
506
|
+
s.value.focus();
|
|
507
|
+
}, 600);
|
|
508
|
+
u();
|
|
509
|
+
}
|
|
510
|
+
}), ae(
|
|
511
|
+
() => e.value,
|
|
512
|
+
(u, r) => {
|
|
513
|
+
l.value1 = u;
|
|
514
|
+
}
|
|
515
|
+
), {
|
|
516
|
+
state: l,
|
|
517
|
+
boneState: t,
|
|
518
|
+
changeEvent: o,
|
|
519
|
+
passwordBone: s
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
}), cn = ["disabled"], mn = ["name"], fn = ["name"], gn = { class: "errors" };
|
|
523
|
+
function hn(e, n, t, l, s, o) {
|
|
524
|
+
return m(), h(E, null, [
|
|
525
|
+
J(i("sl-input", {
|
|
526
|
+
ref: "passwordBone",
|
|
527
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => e.state.value1 = a),
|
|
528
|
+
disabled: e.boneState.readonly,
|
|
529
|
+
class: ye({ "has-check": !e.boneState.readonly }),
|
|
530
|
+
type: "password",
|
|
531
|
+
clearable: "",
|
|
532
|
+
"password-toggle": "true",
|
|
533
|
+
onSlChange: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a)),
|
|
534
|
+
onSlClear: n[2] || (n[2] = (a) => e.state.value1 = ""),
|
|
535
|
+
onKeyup: n[3] || (n[3] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
536
|
+
}, [
|
|
537
|
+
i("sl-icon", {
|
|
538
|
+
slot: "suffix",
|
|
539
|
+
name: e.state.equal && e.state.value1.length ? "check" : "x"
|
|
540
|
+
}, null, 8, mn)
|
|
541
|
+
], 42, cn), [
|
|
542
|
+
[le, e.state.value1]
|
|
543
|
+
]),
|
|
544
|
+
e.boneState.readonly ? k("", !0) : J((m(), h("sl-input", {
|
|
545
|
+
key: 0,
|
|
546
|
+
"onUpdate:modelValue": n[4] || (n[4] = (a) => e.state.value2 = a),
|
|
547
|
+
class: "password-check",
|
|
548
|
+
type: "password",
|
|
549
|
+
clearable: "",
|
|
550
|
+
"password-toggle": "true",
|
|
551
|
+
onSlChange: n[5] || (n[5] = (...a) => e.changeEvent && e.changeEvent(...a)),
|
|
552
|
+
onSlClear: n[6] || (n[6] = (a) => e.state.value2 = ""),
|
|
553
|
+
onKeyup: n[7] || (n[7] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
554
|
+
}, [
|
|
555
|
+
i("sl-icon", {
|
|
556
|
+
slot: "suffix",
|
|
557
|
+
name: e.state.equal && e.state.value1.length ? "check" : "x"
|
|
558
|
+
}, null, 8, fn)
|
|
559
|
+
], 544)), [
|
|
560
|
+
[le, e.state.value2]
|
|
561
|
+
]),
|
|
562
|
+
i("ul", gn, [
|
|
563
|
+
(m(!0), h(E, null, U(e.state.passwordInfo, (a, u) => (m(), h("li", { key: u }, B(a), 1))), 128)),
|
|
564
|
+
(m(!0), h(E, null, U(e.state.requiredPasswordInfo, (a, u) => (m(), h("li", {
|
|
565
|
+
key: u,
|
|
566
|
+
class: "requiredInfo"
|
|
567
|
+
}, B(a), 1))), 128))
|
|
568
|
+
])
|
|
569
|
+
], 64);
|
|
570
|
+
}
|
|
571
|
+
const Le = /* @__PURE__ */ I(dn, [["render", hn], ["__scopeId", "data-v-0ccf18c0"]]), bn = D({
|
|
572
|
+
props: {
|
|
573
|
+
name: String,
|
|
574
|
+
value: null,
|
|
575
|
+
index: Number,
|
|
576
|
+
lang: String,
|
|
577
|
+
readonly: Boolean,
|
|
578
|
+
params: Object
|
|
579
|
+
},
|
|
580
|
+
emits: ["change"],
|
|
581
|
+
setup(e, n) {
|
|
582
|
+
const t = C("boneState"), l = w({
|
|
583
|
+
value: S(() => e.value),
|
|
584
|
+
structure: S(() => a(t.bonestructure.using)),
|
|
585
|
+
globalRegistration: !1,
|
|
586
|
+
formGroups: S(() => {
|
|
587
|
+
var c, d;
|
|
588
|
+
let u = { default: { name: "Allgemein", bones: [], groupVisible: !1, groupOpen: !0 } };
|
|
589
|
+
for (const [f, p] of Object.entries(l.structure)) {
|
|
590
|
+
let v = "default", _ = l.structure[f], g = (c = l.value) == null ? void 0 : c[f];
|
|
591
|
+
(d = p == null ? void 0 : p.params) != null && d.category && (v = p.params.category.toLowerCase()), Object.keys(u).includes(v) ? u[v].bones.push({
|
|
592
|
+
boneName: f,
|
|
593
|
+
boneStructure: _,
|
|
594
|
+
boneValue: g
|
|
595
|
+
}) : u[v] = {
|
|
596
|
+
name: p.params.category,
|
|
597
|
+
bones: [
|
|
598
|
+
{
|
|
599
|
+
boneName: f,
|
|
600
|
+
boneStructure: _,
|
|
601
|
+
boneValue: g
|
|
602
|
+
}
|
|
603
|
+
]
|
|
604
|
+
}, _.visible === !0 && (u[v].groupVisible = !0);
|
|
605
|
+
}
|
|
606
|
+
let r = {};
|
|
607
|
+
return Object.keys(u).sort().forEach(function(f) {
|
|
608
|
+
r[f] = u[f];
|
|
609
|
+
}), r;
|
|
610
|
+
})
|
|
611
|
+
});
|
|
612
|
+
function s(u) {
|
|
613
|
+
n.emit("change", u);
|
|
614
|
+
}
|
|
615
|
+
R(() => {
|
|
616
|
+
ot().appContext.components.Bone ? l.globalRegistration = !0 : l.globalRegistration = !1, n.emit("change", e.name, e.value, e.lang, e.index);
|
|
617
|
+
});
|
|
618
|
+
function o(u) {
|
|
619
|
+
console.log(u);
|
|
620
|
+
}
|
|
621
|
+
function a(u) {
|
|
622
|
+
if (Array.isArray(u)) {
|
|
623
|
+
let r = {};
|
|
624
|
+
for (const c in u)
|
|
625
|
+
r[u[c][0]] = u[c][1];
|
|
626
|
+
return r;
|
|
627
|
+
} else
|
|
628
|
+
return u;
|
|
629
|
+
}
|
|
630
|
+
return {
|
|
631
|
+
state: l,
|
|
632
|
+
boneState: t,
|
|
633
|
+
getBoneWidget: x,
|
|
634
|
+
structureToDict: a,
|
|
635
|
+
changeEvent: s,
|
|
636
|
+
updateValue: o
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
}), vn = {
|
|
640
|
+
key: 0,
|
|
641
|
+
open: "",
|
|
642
|
+
variant: "danger"
|
|
643
|
+
}, pn = {
|
|
644
|
+
key: 1,
|
|
645
|
+
class: "form"
|
|
646
|
+
}, yn = ["summary", "open"];
|
|
647
|
+
function $n(e, n, t, l, s, o) {
|
|
648
|
+
const a = se("bone");
|
|
649
|
+
return e.state.globalRegistration ? (m(), h("div", pn, [
|
|
650
|
+
(m(!0), h(E, null, U(e.state.formGroups, (u, r) => J((m(), h("sl-details", {
|
|
651
|
+
key: r,
|
|
652
|
+
summary: u.name,
|
|
653
|
+
open: u.groupOpen
|
|
654
|
+
}, [
|
|
655
|
+
(m(!0), h(E, null, U(u.bones, (c) => J((m(), T(a, {
|
|
656
|
+
key: c.name,
|
|
657
|
+
is: e.getBoneWidget(e.state.structure[c.boneName].type),
|
|
658
|
+
name: c.boneName,
|
|
659
|
+
structure: e.state.structure,
|
|
660
|
+
skel: e.state.value,
|
|
661
|
+
errors: e.boneState.errors,
|
|
662
|
+
readonly: e.boneState.bonestructure.readonly ? !0 : void 0,
|
|
663
|
+
onChangeInternal: e.changeEvent
|
|
664
|
+
}, null, 8, ["is", "name", "structure", "skel", "errors", "readonly", "onChangeInternal"])), [
|
|
665
|
+
[ve, e.state.structure[c.boneName].visible]
|
|
666
|
+
])), 128))
|
|
667
|
+
], 8, yn)), [
|
|
668
|
+
[ve, u.groupVisible]
|
|
669
|
+
])), 128))
|
|
670
|
+
])) : (m(), h("sl-alert", vn, " In Order to use this Bone register the bone component globally in your main file "));
|
|
671
|
+
}
|
|
672
|
+
const Ye = /* @__PURE__ */ I(bn, [["render", $n], ["__scopeId", "data-v-e6fcfbca"]]), Sn = D({
|
|
673
|
+
inheritAttrs: !1,
|
|
674
|
+
props: {
|
|
675
|
+
name: String,
|
|
676
|
+
value: null,
|
|
677
|
+
index: Number,
|
|
678
|
+
lang: String
|
|
679
|
+
},
|
|
680
|
+
components: { Wrapper_nested: Ye },
|
|
681
|
+
emits: ["change"],
|
|
682
|
+
setup(e, n) {
|
|
683
|
+
const t = C("boneState"), l = w({
|
|
684
|
+
value: {},
|
|
685
|
+
index: S(() => e.index),
|
|
686
|
+
lang: S(() => e.lang)
|
|
687
|
+
});
|
|
688
|
+
function s(o) {
|
|
689
|
+
var u;
|
|
690
|
+
(u = l.value) != null && u[o.name] || (l.value ? l.value[o.name] = null : l.value = { [o.name]: null });
|
|
691
|
+
let a = l.value[o.name];
|
|
692
|
+
o.lang ? (a === null && (a = {}), Object.keys(a).includes(o.lang) && o.index !== null ? a[o.lang][o.index] = o.value : a[o.lang] = o.value) : o.index !== null ? (a === null && (a = []), a[o.index] = o.value) : a = o.value, l.value[o.name] = a, n.emit("change", e.name, l.value, e.lang, e.index, !0);
|
|
693
|
+
}
|
|
694
|
+
return R(() => {
|
|
695
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
696
|
+
}), {
|
|
697
|
+
state: l,
|
|
698
|
+
boneState: t,
|
|
699
|
+
changeEvent: s
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
function _n(e, n, t, l, s, o) {
|
|
704
|
+
const a = se("Wrapper_nested");
|
|
705
|
+
return m(), T(a, {
|
|
706
|
+
value: e.value,
|
|
707
|
+
name: e.name,
|
|
708
|
+
index: e.state.index,
|
|
709
|
+
disabled: e.boneState.bonestructure.readonly,
|
|
710
|
+
onChange: e.changeEvent
|
|
711
|
+
}, null, 8, ["value", "name", "index", "disabled", "onChange"]);
|
|
712
|
+
}
|
|
713
|
+
const Ue = /* @__PURE__ */ I(Sn, [["render", _n], ["__scopeId", "data-v-84a761ce"]]), kn = D({
|
|
714
|
+
inheritAttrs: !1,
|
|
715
|
+
props: {
|
|
716
|
+
name: String,
|
|
717
|
+
value: [Object, String, Number, Boolean, Array],
|
|
718
|
+
index: Number,
|
|
719
|
+
lang: String
|
|
720
|
+
},
|
|
721
|
+
components: {},
|
|
722
|
+
emits: ["change"],
|
|
723
|
+
setup(e, n) {
|
|
724
|
+
const t = C("boneState"), l = w({});
|
|
725
|
+
function s(o) {
|
|
726
|
+
n.emit("change", e.name, o.target.value, e.lang, e.index);
|
|
727
|
+
}
|
|
728
|
+
return R(() => {
|
|
729
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
730
|
+
}), {
|
|
731
|
+
state: l,
|
|
732
|
+
boneState: t,
|
|
733
|
+
changeEvent: s
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
}), wn = ["disabled", "value"];
|
|
737
|
+
function En(e, n, t, l, s, o) {
|
|
738
|
+
return m(), h("sl-color-picker", {
|
|
739
|
+
disabled: e.boneState.readonly,
|
|
740
|
+
value: e.value,
|
|
741
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
742
|
+
}, null, 40, wn);
|
|
743
|
+
}
|
|
744
|
+
const Te = /* @__PURE__ */ I(kn, [["render", En], ["__scopeId", "data-v-534b9149"]]), An = D({
|
|
745
|
+
inheritAttrs: !1,
|
|
746
|
+
emits: { change: null },
|
|
747
|
+
props: {
|
|
748
|
+
name: String,
|
|
749
|
+
value: [Object, String, Number, Boolean, Array],
|
|
750
|
+
index: Number,
|
|
751
|
+
lang: String,
|
|
752
|
+
autofocus: Boolean
|
|
753
|
+
},
|
|
754
|
+
components: {},
|
|
755
|
+
setup(e, n) {
|
|
756
|
+
const t = C("boneState"), l = w({
|
|
757
|
+
minAmount: S(() => t.bonestructure.minAmount),
|
|
758
|
+
maxAmount: S(() => t.bonestructure.maxAmount),
|
|
759
|
+
precision: S(() => {
|
|
760
|
+
if (t.bonestructure.precision > 1)
|
|
761
|
+
return parseFloat(`0.${"0".repeat(t.bonestructure.precision - 1)}1`);
|
|
762
|
+
})
|
|
763
|
+
}), s = F(null);
|
|
764
|
+
function o(a) {
|
|
765
|
+
n.emit("change", e.name, a.target.value, e.lang, e.index);
|
|
766
|
+
}
|
|
767
|
+
return ce(() => {
|
|
768
|
+
if (e.autofocus && s.value && s.value !== null && s !== null) {
|
|
769
|
+
const { start: a } = me(() => {
|
|
770
|
+
s.value.focus();
|
|
771
|
+
}, 600);
|
|
772
|
+
a();
|
|
773
|
+
}
|
|
774
|
+
}), R(() => {
|
|
775
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
776
|
+
}), {
|
|
777
|
+
state: l,
|
|
778
|
+
boneState: t,
|
|
779
|
+
changeEvent: o,
|
|
780
|
+
numericBone: s
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
}), In = ["disabled", "value", "min", "max", "step"], On = { class: "info" }, Cn = { key: 0 }, jn = { key: 1 }, Bn = { key: 2 };
|
|
784
|
+
function Dn(e, n, t, l, s, o) {
|
|
785
|
+
return m(), h(E, null, [
|
|
786
|
+
i("sl-input", {
|
|
787
|
+
ref: "numericBone",
|
|
788
|
+
type: "number",
|
|
789
|
+
disabled: e.boneState.readonly,
|
|
790
|
+
value: e.value,
|
|
791
|
+
min: e.state.minAmount,
|
|
792
|
+
max: e.state.maxAmount,
|
|
793
|
+
step: e.state.precision,
|
|
794
|
+
onSlChange: n[0] || (n[0] = (...a) => e.changeEvent && e.changeEvent(...a)),
|
|
795
|
+
onKeyup: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a))
|
|
796
|
+
}, null, 40, In),
|
|
797
|
+
i("ul", On, [
|
|
798
|
+
e.state.minAmount !== -9223372036854776e3 && e.state.minAmount ? (m(), h("li", Cn, B(e.$t("bones.numeric.min", { val: e.state.minAmount })), 1)) : k("", !0),
|
|
799
|
+
e.state.maxAmount !== 9223372036854776e3 && e.state.maxAmount ? (m(), h("li", jn, B(e.$t("bones.numeric.max", { val: e.state.maxAmount })), 1)) : k("", !0),
|
|
800
|
+
e.state.precision ? (m(), h("li", Bn, B(e.$t("bones.numeric.precision", { val: e.boneState.bonestructure.precision })), 1)) : k("", !0)
|
|
801
|
+
])
|
|
802
|
+
], 64);
|
|
803
|
+
}
|
|
804
|
+
const Pe = /* @__PURE__ */ I(An, [["render", Dn], ["__scopeId", "data-v-03d5b399"]]);
|
|
805
|
+
var N = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
806
|
+
class ue extends Error {
|
|
807
|
+
constructor(n, t, l, s) {
|
|
808
|
+
super(l || t), arguments.length >= 4 && s && Object.assign(this, s), this.statusText = t, this.statusCode = n, this.response = s;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
let be = null;
|
|
812
|
+
function X() {
|
|
813
|
+
return be || (be = $e("requestStore", () => {
|
|
814
|
+
const e = w({ sKeys: /* @__PURE__ */ new Set() });
|
|
815
|
+
function n() {
|
|
816
|
+
e.sKeys = /* @__PURE__ */ new Set();
|
|
817
|
+
}
|
|
818
|
+
return {
|
|
819
|
+
state: e,
|
|
820
|
+
$reset: n
|
|
821
|
+
};
|
|
822
|
+
})), be();
|
|
823
|
+
}
|
|
824
|
+
class j {
|
|
825
|
+
static resetState() {
|
|
826
|
+
X().$reset(), X().$dispose();
|
|
827
|
+
}
|
|
828
|
+
static buildUrl(n) {
|
|
829
|
+
return n && !(n.startsWith("http://") || n.startsWith("https://") || n.startsWith("//")) && (n = (N.VITE_API_URL ? N.VITE_API_URL : window.location.origin) + n), n;
|
|
830
|
+
}
|
|
831
|
+
static post(n, { dataObj: t = null, callback: l = null, failedCallback: s = null, abortController: o = null, headers: a = null, mode: u = null } = {}) {
|
|
832
|
+
function r() {
|
|
833
|
+
if (t instanceof FormData)
|
|
834
|
+
return t;
|
|
835
|
+
const d = new FormData();
|
|
836
|
+
for (const f in t)
|
|
837
|
+
if (Array.isArray(t[f]))
|
|
838
|
+
for (let p of t[f])
|
|
839
|
+
d.append(f, p);
|
|
840
|
+
else
|
|
841
|
+
d.append(f, t[f]);
|
|
842
|
+
return d;
|
|
843
|
+
}
|
|
844
|
+
let c = re.post(j.buildUrl(n), r(), null, a, o, u);
|
|
845
|
+
return c.then(function(d) {
|
|
846
|
+
l && l(d.data);
|
|
847
|
+
}).catch(function(d) {
|
|
848
|
+
s && s(d);
|
|
849
|
+
}), c;
|
|
850
|
+
}
|
|
851
|
+
static async getBatchSkeys(n = 30, t = N.VITE_DEFAULT_RENDERER || "json") {
|
|
852
|
+
await j.get(`/${t}/skey`, {
|
|
853
|
+
dataObj: { amount: n }
|
|
854
|
+
}).then(async (l) => {
|
|
855
|
+
let s = await l.json();
|
|
856
|
+
Array.isArray(s) || (s = [s]), X().state.sKeys = new Set(s);
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
static async securePost(n, {
|
|
860
|
+
dataObj: t = null,
|
|
861
|
+
callback: l = null,
|
|
862
|
+
failedCallback: s = null,
|
|
863
|
+
abortController: o = null,
|
|
864
|
+
renderer: a = N.VITE_DEFAULT_RENDERER || "json",
|
|
865
|
+
headers: u = null,
|
|
866
|
+
mode: r = null,
|
|
867
|
+
amount: c = 30
|
|
868
|
+
} = {}) {
|
|
869
|
+
let d = null;
|
|
870
|
+
X().state.sKeys.size === 0 && await j.getBatchSkeys(c);
|
|
871
|
+
const f = [...X().state.sKeys][0];
|
|
872
|
+
return t instanceof FormData ? (t.append("skey", f), X().state.sKeys.delete(f)) : (t || (t = {}), t.skey = f, X().state.sKeys.delete(f)), d = j.post(n, {
|
|
873
|
+
dataObj: t,
|
|
874
|
+
callback: l,
|
|
875
|
+
abortController: o,
|
|
876
|
+
headers: u,
|
|
877
|
+
mode: r
|
|
878
|
+
}), d;
|
|
879
|
+
}
|
|
880
|
+
static get(n, {
|
|
881
|
+
dataObj: t = null,
|
|
882
|
+
callback: l = null,
|
|
883
|
+
failedCallback: s = null,
|
|
884
|
+
cached: o = !1,
|
|
885
|
+
clearCache: a = !1,
|
|
886
|
+
abortController: u = null,
|
|
887
|
+
headers: r = null,
|
|
888
|
+
mode: c = null,
|
|
889
|
+
// milli sec min Std Tage
|
|
890
|
+
cacheTime: d = 1e3 * 60 * 60 * 24 * 1
|
|
891
|
+
} = {}) {
|
|
892
|
+
let f = re.get(j.buildUrl(n), t, a, r, u, c);
|
|
893
|
+
return f.then(function(p) {
|
|
894
|
+
l && l(p.data);
|
|
895
|
+
}).catch(function(p) {
|
|
896
|
+
s && s(p);
|
|
897
|
+
}), f;
|
|
898
|
+
}
|
|
899
|
+
static list(n, {
|
|
900
|
+
dataObj: t = null,
|
|
901
|
+
callback: l = null,
|
|
902
|
+
failedCallback: s = null,
|
|
903
|
+
group: o = null,
|
|
904
|
+
abortController: a = null,
|
|
905
|
+
renderer: u = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json"
|
|
906
|
+
} = {}) {
|
|
907
|
+
let r = `/${u}/${n}/list`;
|
|
908
|
+
return o && (r += `/${o}`), j.get(r, {
|
|
909
|
+
dataObj: t,
|
|
910
|
+
callback: l,
|
|
911
|
+
failedCallback: s,
|
|
912
|
+
abortController: a
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
static getStructure(n, {
|
|
916
|
+
dataObj: t = null,
|
|
917
|
+
callback: l = null,
|
|
918
|
+
failedCallback: s = null,
|
|
919
|
+
group: o = null,
|
|
920
|
+
abortController: a = null,
|
|
921
|
+
renderer: u = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json"
|
|
922
|
+
} = {}) {
|
|
923
|
+
n = n.replace(/\//g, ".");
|
|
924
|
+
let r = `/${u}/getStructure/${n}`;
|
|
925
|
+
return o && (r += `/${o}`), j.get(r, {
|
|
926
|
+
dataObj: t,
|
|
927
|
+
callback: l,
|
|
928
|
+
failedCallback: s,
|
|
929
|
+
abortController: a
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
static view(n, t, {
|
|
933
|
+
dataObj: l = null,
|
|
934
|
+
callback: s = null,
|
|
935
|
+
failedCallback: o = null,
|
|
936
|
+
group: a = null,
|
|
937
|
+
abortController: u = null,
|
|
938
|
+
renderer: r = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json"
|
|
939
|
+
} = {}) {
|
|
940
|
+
let c = `/${r}/${n}/view/${t}`;
|
|
941
|
+
return a && (c = `/${r}/${n}/view/${a}/${t}`), j.get(c, {
|
|
942
|
+
dataObj: l,
|
|
943
|
+
callback: s,
|
|
944
|
+
failedCallback: o,
|
|
945
|
+
abortController: u
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
static add(n, {
|
|
949
|
+
dataObj: t = null,
|
|
950
|
+
callback: l = null,
|
|
951
|
+
failedCallback: s = null,
|
|
952
|
+
group: o = null,
|
|
953
|
+
abortController: a = null,
|
|
954
|
+
renderer: u = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json"
|
|
955
|
+
} = {}) {
|
|
956
|
+
let r = `/${u}/${n}/add`;
|
|
957
|
+
return o && (r = `/${u}/${n}/add/${o}`), j.securePost(r, {
|
|
958
|
+
dataObj: t,
|
|
959
|
+
callback: l,
|
|
960
|
+
failedCallback: s,
|
|
961
|
+
abortController: a
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
static edit(n, t, {
|
|
965
|
+
dataObj: l = null,
|
|
966
|
+
callback: s = null,
|
|
967
|
+
failedCallback: o = null,
|
|
968
|
+
group: a = null,
|
|
969
|
+
abortController: u = null,
|
|
970
|
+
renderer: r = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json"
|
|
971
|
+
} = {}) {
|
|
972
|
+
let c = `/${r}/${n}/edit/${t}`;
|
|
973
|
+
return a && (c = `/${r}/${n}/edit/${a}/${t}`), j.securePost(c, {
|
|
974
|
+
dataObj: l,
|
|
975
|
+
callback: s,
|
|
976
|
+
failedCallback: o,
|
|
977
|
+
abortController: u
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
static delete(n, t, {
|
|
981
|
+
dataObj: l = null,
|
|
982
|
+
callback: s = null,
|
|
983
|
+
failedCallback: o = null,
|
|
984
|
+
group: a = null,
|
|
985
|
+
abortController: u = null,
|
|
986
|
+
renderer: r = (N == null ? void 0 : N.VITE_DEFAULT_RENDERER) || "json"
|
|
987
|
+
} = {}) {
|
|
988
|
+
let c = `/${r}/${n}/delete/${t}`;
|
|
989
|
+
return a && (c = `/${r}/${n}/delete/${a}/${t}`), j.securePost(c, {
|
|
990
|
+
dataObj: l,
|
|
991
|
+
callback: s,
|
|
992
|
+
failedCallback: o,
|
|
993
|
+
abortController: u,
|
|
994
|
+
amount: 1
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
static downloadUrlFor(n, t = !1) {
|
|
998
|
+
return n && "dest" in n ? t && "thumbnail" in n.dest ? j.buildUrl(n.dest.thumbnail) : "downloadUrl" in n.dest ? j.buildUrl(n.dest.downloadUrl) : j.buildUrl(null) : j.buildUrl(n);
|
|
999
|
+
}
|
|
1000
|
+
static uploadFile(n, t = void 0) {
|
|
1001
|
+
const l = {
|
|
1002
|
+
fileName: n.name,
|
|
1003
|
+
mimeType: n.type || "application/octet-stream",
|
|
1004
|
+
size: n.size.toString(),
|
|
1005
|
+
node: t
|
|
1006
|
+
};
|
|
1007
|
+
return new Promise((s, o) => {
|
|
1008
|
+
j.securePost("/vi/file/getUploadURL", { dataObj: l }).then(async (a) => {
|
|
1009
|
+
let u = await a.json();
|
|
1010
|
+
fetch(u.values.uploadUrl, {
|
|
1011
|
+
body: n,
|
|
1012
|
+
method: "POST",
|
|
1013
|
+
mode: "no-cors"
|
|
1014
|
+
}).then(async (r) => {
|
|
1015
|
+
const c = {
|
|
1016
|
+
key: u.values.uploadKey,
|
|
1017
|
+
skelType: "leaf"
|
|
1018
|
+
};
|
|
1019
|
+
j.securePost("/vi/file/add", { dataObj: c }).then(async (d) => {
|
|
1020
|
+
let f = await d.json();
|
|
1021
|
+
f.action === "addSuccess" ? s(f.values) : o(f);
|
|
1022
|
+
}).catch((d) => {
|
|
1023
|
+
o(d);
|
|
1024
|
+
});
|
|
1025
|
+
}).catch((r) => {
|
|
1026
|
+
o(r);
|
|
1027
|
+
});
|
|
1028
|
+
}).catch((a) => {
|
|
1029
|
+
o(a);
|
|
1030
|
+
});
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
class re {
|
|
1035
|
+
constructor() {
|
|
1036
|
+
Oe(this, "withCredentials", !0);
|
|
1037
|
+
}
|
|
1038
|
+
static buildOptions(n, t = null, l = null, s = null, o = null) {
|
|
1039
|
+
let a = { method: n };
|
|
1040
|
+
return a.credentials = "include", a.headers = {
|
|
1041
|
+
Accept: "application/json, text/plain, */*"
|
|
1042
|
+
}, l && (a.headers = { ...a.headers, ...l }), t && (a.body = t), s && (a.signal = s.signal), o && (a.mode = o), a;
|
|
1043
|
+
}
|
|
1044
|
+
static get(n, t = null, l = null, s = null, o = null, a = null) {
|
|
1045
|
+
function u(r, c) {
|
|
1046
|
+
let d = new URL(r);
|
|
1047
|
+
if (c && Object.keys(c).length > 0) {
|
|
1048
|
+
const f = new URLSearchParams();
|
|
1049
|
+
for (const [p, v] of Object.entries(c))
|
|
1050
|
+
if (Array.isArray(v))
|
|
1051
|
+
for (const _ of v)
|
|
1052
|
+
f.append(p, _);
|
|
1053
|
+
else
|
|
1054
|
+
f.append(p, v);
|
|
1055
|
+
d.search = f.toString();
|
|
1056
|
+
}
|
|
1057
|
+
return d.toString();
|
|
1058
|
+
}
|
|
1059
|
+
return fetch(u(n, t), re.buildOptions("GET", null, s, o, a)).then(async (r) => {
|
|
1060
|
+
if (r.ok)
|
|
1061
|
+
return r;
|
|
1062
|
+
{
|
|
1063
|
+
const c = `${r.status} ${r.statusText}: ${r.headers ? r.headers.get("x-error-descr") : ""}`;
|
|
1064
|
+
return Promise.reject(new ue(r.status, r.statusText, c, r));
|
|
1065
|
+
}
|
|
1066
|
+
}).catch((r) => {
|
|
1067
|
+
if (r instanceof TypeError) {
|
|
1068
|
+
const d = `503 ${r.message}: ${r.headers ? r.headers.get("x-error-descr") : ""}`;
|
|
1069
|
+
return Promise.reject(new ue(503, r.message, d, r));
|
|
1070
|
+
}
|
|
1071
|
+
if (r instanceof DOMException && r.name == "AbortError") {
|
|
1072
|
+
const d = `${r.code} ${r.name}: ${r.headers ? r.headers.get("x-error-descr") : ""}`;
|
|
1073
|
+
return Promise.reject(new ue(r.code, r.name, d, { url: n }));
|
|
1074
|
+
}
|
|
1075
|
+
const c = `${r.statusCode} ${r.statusText}: ${r.headers ? r.headers.get("x-error-descr") : ""}`;
|
|
1076
|
+
return Promise.reject(new ue(r.statusCode, r.statusText, c, r.response));
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
static post(n, t = null, l = null, s = null, o = null, a = null) {
|
|
1080
|
+
return fetch(n, re.buildOptions("POST", t, s, o, a));
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
var Vn = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
1084
|
+
const Nn = D({
|
|
1085
|
+
inheritAttrs: !1,
|
|
1086
|
+
props: {
|
|
1087
|
+
name: String,
|
|
1088
|
+
value: [Object, String, Number, Boolean, Array],
|
|
1089
|
+
index: Number,
|
|
1090
|
+
lang: String
|
|
1091
|
+
},
|
|
1092
|
+
components: { Wrapper_nested: Ye },
|
|
1093
|
+
emits: ["change"],
|
|
1094
|
+
setup(e, n) {
|
|
1095
|
+
const t = C("boneState"), l = C("formatString"), s = w({
|
|
1096
|
+
format: S(() => t == null ? void 0 : t.bonestructure.format),
|
|
1097
|
+
skellistdata: null,
|
|
1098
|
+
selection: null
|
|
1099
|
+
});
|
|
1100
|
+
function o(r) {
|
|
1101
|
+
let c = "";
|
|
1102
|
+
return t.bonestructure.type === "relational.tree.leaf.file" ? c = "skelType=leaf&" : t.bonestructure.type === "relational.tree.node.file" && (c = "skelType=node&"), j.get(
|
|
1103
|
+
`/${Vn.VITE_DEFAULT_RENDERER || "vi"}/${t.bonestructure.module}/list?${c}limit=99`
|
|
1104
|
+
).then(async (d) => {
|
|
1105
|
+
var p;
|
|
1106
|
+
const f = await d.json();
|
|
1107
|
+
s.skellistdata = {};
|
|
1108
|
+
for (let v of f.skellist)
|
|
1109
|
+
s.skellistdata[v.key] = v;
|
|
1110
|
+
return (p = f.skellist) == null ? void 0 : p.map((v) => ({ text: l(t.bonestructure.format, { dest: v }), value: v.key, data: v }));
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
function a(r) {
|
|
1114
|
+
s.selection = { dest: s.skellistdata[r.detail.item.value] }, n.emit("change", e.name, s.selection, e.lang, e.index);
|
|
1115
|
+
}
|
|
1116
|
+
function u(r) {
|
|
1117
|
+
var d;
|
|
1118
|
+
s.selection || (s.selection = {}), (d = s.selection.rel) != null && d[r.name] || (s.selection.rel ? s.selection.rel[r.name] = null : s.selection.rel = { [r.name]: null });
|
|
1119
|
+
let c = s.selection.rel[r.name];
|
|
1120
|
+
r.lang ? (c === null && (c = {}), Object.keys(c).includes(r.lang) && r.index !== null ? c[r.lang][r.index] = r.value : c[r.lang] = r.value) : r.index !== null ? (c === null && (c = []), c[r.index] = r.value) : c = r.value, Object.keys(s.selection).includes("rel") && s.selection.rel ? s.selection.rel[r.name] = c : s.selection.rel = { [r.name]: c }, Object.keys(s.selection).includes("dest") && n.emit("change", e.name, s.selection, e.lang, e.index);
|
|
1121
|
+
}
|
|
1122
|
+
return R(() => {
|
|
1123
|
+
s.selection = e.value, n.emit("change", e.name, e.value, e.lang, e.index);
|
|
1124
|
+
}), {
|
|
1125
|
+
state: s,
|
|
1126
|
+
boneState: t,
|
|
1127
|
+
formatString: l,
|
|
1128
|
+
changeEvent: a,
|
|
1129
|
+
changeEventNested: u,
|
|
1130
|
+
getList: o
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
}), Rn = (e) => (M("data-v-61dd72e0"), e = e(), z(), e), Ln = { class: "record" }, Un = { class: "single-entry" }, Tn = ["value"], Pn = ["disabled", "source"], Mn = ["title"], zn = /* @__PURE__ */ Rn(() => /* @__PURE__ */ i("sl-icon", {
|
|
1134
|
+
slot: "prefix",
|
|
1135
|
+
name: "x-lg"
|
|
1136
|
+
}, null, -1)), Wn = [
|
|
1137
|
+
zn
|
|
1138
|
+
];
|
|
1139
|
+
function qn(e, n, t, l, s, o) {
|
|
1140
|
+
var u, r;
|
|
1141
|
+
const a = se("Wrapper_nested");
|
|
1142
|
+
return m(), h("div", Ln, [
|
|
1143
|
+
i("div", Un, [
|
|
1144
|
+
e.state.selection ? (m(), h("sl-input", {
|
|
1145
|
+
key: 0,
|
|
1146
|
+
disabled: !0,
|
|
1147
|
+
value: e.value ? e.formatString(e.state.format, e.state.selection) : ""
|
|
1148
|
+
}, null, 8, Tn)) : (m(), h("sl-combobox", {
|
|
1149
|
+
key: 1,
|
|
1150
|
+
disabled: e.boneState.readonly,
|
|
1151
|
+
source: e.getList,
|
|
1152
|
+
hoist: "",
|
|
1153
|
+
onSlItemSelect: n[0] || (n[0] = (...c) => e.changeEvent && e.changeEvent(...c))
|
|
1154
|
+
}, null, 40, Pn)),
|
|
1155
|
+
!e.boneState.multiple && !e.boneState.isEmpty ? (m(), h("sl-button", {
|
|
1156
|
+
key: 2,
|
|
1157
|
+
variant: "danger",
|
|
1158
|
+
outline: "",
|
|
1159
|
+
title: e.$t("bone.del"),
|
|
1160
|
+
class: "delete-btn square-btn",
|
|
1161
|
+
onClick: n[1] || (n[1] = () => {
|
|
1162
|
+
e.$emit("change", e.name, "", e.lang, e.index), e.state.selection = null;
|
|
1163
|
+
})
|
|
1164
|
+
}, Wn, 8, Mn)) : k("", !0)
|
|
1165
|
+
]),
|
|
1166
|
+
(u = e.boneState) != null && u.bonestructure.using ? (m(), T(a, {
|
|
1167
|
+
key: 0,
|
|
1168
|
+
value: (r = e.value) == null ? void 0 : r.rel,
|
|
1169
|
+
name: e.name,
|
|
1170
|
+
index: e.index,
|
|
1171
|
+
disabled: e.boneState.bonestructure.readonly,
|
|
1172
|
+
onChange: e.changeEventNested
|
|
1173
|
+
}, null, 8, ["value", "name", "index", "disabled", "onChange"])) : k("", !0)
|
|
1174
|
+
]);
|
|
1175
|
+
}
|
|
1176
|
+
const Me = /* @__PURE__ */ I(Nn, [["render", qn], ["__scopeId", "data-v-61dd72e0"]]), Fn = D({
|
|
1177
|
+
inheritAttrs: !1,
|
|
1178
|
+
props: {
|
|
1179
|
+
name: String,
|
|
1180
|
+
value: [Object, String, Number, Boolean, Array],
|
|
1181
|
+
index: Number,
|
|
1182
|
+
lang: String,
|
|
1183
|
+
readonly: Boolean,
|
|
1184
|
+
params: Object
|
|
1185
|
+
},
|
|
1186
|
+
components: {},
|
|
1187
|
+
emits: ["change"],
|
|
1188
|
+
setup(e, n) {
|
|
1189
|
+
const t = C("boneState"), l = w({});
|
|
1190
|
+
function s(o, a) {
|
|
1191
|
+
n.emit("change", e.name, o, e.lang, e.index);
|
|
1192
|
+
}
|
|
1193
|
+
return R(() => {
|
|
1194
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
1195
|
+
}), {
|
|
1196
|
+
state: l,
|
|
1197
|
+
boneState: t,
|
|
1198
|
+
changeEvent: s
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
}), Kn = { class: "box" };
|
|
1202
|
+
function Hn(e, n, t, l, s, o) {
|
|
1203
|
+
return m(), h("div", Kn, B(e.value), 1);
|
|
1204
|
+
}
|
|
1205
|
+
const Gn = /* @__PURE__ */ I(Fn, [["render", Hn], ["__scopeId", "data-v-343aca69"]]);
|
|
1206
|
+
var ze = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
1207
|
+
const Zn = D({
|
|
1208
|
+
inheritAttrs: !1,
|
|
1209
|
+
props: {
|
|
1210
|
+
name: String,
|
|
1211
|
+
value: [Object, String, Number, Boolean, Array],
|
|
1212
|
+
index: Number,
|
|
1213
|
+
lang: String
|
|
1214
|
+
},
|
|
1215
|
+
components: {},
|
|
1216
|
+
emits: ["change"],
|
|
1217
|
+
setup(e, n) {
|
|
1218
|
+
const t = C("boneState"), l = F(), s = w({
|
|
1219
|
+
loading: !1,
|
|
1220
|
+
droparea: !1,
|
|
1221
|
+
previewopen: !1
|
|
1222
|
+
});
|
|
1223
|
+
R(() => {
|
|
1224
|
+
n.emit("change", e.name, e.value, e.lang, e.index);
|
|
1225
|
+
});
|
|
1226
|
+
function o() {
|
|
1227
|
+
console.log(j.downloadUrlFor(e.value)), window.open(j.downloadUrlFor(e.value));
|
|
1228
|
+
}
|
|
1229
|
+
function a() {
|
|
1230
|
+
return j.downloadUrlFor(e.value, !1);
|
|
1231
|
+
}
|
|
1232
|
+
function u(d) {
|
|
1233
|
+
const f = {
|
|
1234
|
+
fileName: d.name,
|
|
1235
|
+
mimeType: d.type || "application/octet-stream",
|
|
1236
|
+
size: d.size.toString()
|
|
1237
|
+
};
|
|
1238
|
+
return new Promise((p, v) => {
|
|
1239
|
+
j.securePost(`/${ze.VITE_DEFAULT_RENDERER || "vi"}/file/getUploadURL`, { dataObj: f }).then(async (_) => {
|
|
1240
|
+
let g = await _.json();
|
|
1241
|
+
fetch(g.values.uploadUrl, {
|
|
1242
|
+
body: d,
|
|
1243
|
+
method: "POST",
|
|
1244
|
+
mode: "no-cors"
|
|
1245
|
+
}).then(async (b) => {
|
|
1246
|
+
const y = {
|
|
1247
|
+
key: g.values.uploadKey,
|
|
1248
|
+
node: void 0,
|
|
1249
|
+
skelType: "leaf"
|
|
1250
|
+
};
|
|
1251
|
+
j.securePost(`/${ze.VITE_DEFAULT_RENDERER || "vi"}/file/add`, { dataObj: y }).then(async ($) => {
|
|
1252
|
+
let A = await $.json();
|
|
1253
|
+
A.action === "addSuccess" ? p(A.values) : v(A);
|
|
1254
|
+
}).catch(($) => {
|
|
1255
|
+
v($);
|
|
1256
|
+
});
|
|
1257
|
+
}).catch((b) => {
|
|
1258
|
+
v(b);
|
|
1259
|
+
});
|
|
1260
|
+
}).catch((_) => {
|
|
1261
|
+
v(_);
|
|
1262
|
+
});
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
async function r(d) {
|
|
1266
|
+
s.loading = !0;
|
|
1267
|
+
for (let f of d.target.files) {
|
|
1268
|
+
let p = await u(f);
|
|
1269
|
+
l.value.value = null, n.emit("change", e.name, { dest: p, rel: null }, e.lang, e.index);
|
|
1270
|
+
}
|
|
1271
|
+
s.loading = !1;
|
|
1272
|
+
}
|
|
1273
|
+
async function c(d) {
|
|
1274
|
+
s.loading = !0, s.droparea = !1;
|
|
1275
|
+
for (let f of d.dataTransfer.files) {
|
|
1276
|
+
let p = await u(f);
|
|
1277
|
+
l.value.value = null, n.emit("change", e.name, { dest: p, rel: null }, e.lang, e.index);
|
|
1278
|
+
break;
|
|
1279
|
+
}
|
|
1280
|
+
s.loading = !1;
|
|
1281
|
+
}
|
|
1282
|
+
return {
|
|
1283
|
+
state: s,
|
|
1284
|
+
boneState: t,
|
|
1285
|
+
downloadFile: o,
|
|
1286
|
+
createBackgroundImage: a,
|
|
1287
|
+
handleUpload: r,
|
|
1288
|
+
uploadinput: l,
|
|
1289
|
+
handleDrop: c
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
}), fe = (e) => (M("data-v-91086308"), e = e(), z(), e), Jn = {
|
|
1293
|
+
key: 0,
|
|
1294
|
+
class: "loader"
|
|
1295
|
+
}, Qn = /* @__PURE__ */ fe(() => /* @__PURE__ */ i("sl-spinner", { slot: "suffix" }, null, -1)), Yn = [
|
|
1296
|
+
Qn
|
|
1297
|
+
], Xn = {
|
|
1298
|
+
key: 1,
|
|
1299
|
+
class: "droparea"
|
|
1300
|
+
}, xn = ["title"], ea = /* @__PURE__ */ fe(() => /* @__PURE__ */ i("sl-icon", { name: "upload" }, null, -1)), ta = [
|
|
1301
|
+
ea
|
|
1302
|
+
], na = ["multiple"], aa = ["title"], sa = /* @__PURE__ */ fe(() => /* @__PURE__ */ i("sl-icon", {
|
|
1303
|
+
slot: "prefix",
|
|
1304
|
+
name: "download"
|
|
1305
|
+
}, null, -1)), la = [
|
|
1306
|
+
sa
|
|
1307
|
+
], ra = { class: "box" }, oa = ["src"], ia = ["label", "open"], ua = ["src"], da = {
|
|
1308
|
+
key: 1,
|
|
1309
|
+
class: "preview"
|
|
1310
|
+
}, ca = {
|
|
1311
|
+
key: 0,
|
|
1312
|
+
name: "file-earmark"
|
|
1313
|
+
}, ma = { key: 2 }, fa = ["title"], ga = /* @__PURE__ */ fe(() => /* @__PURE__ */ i("sl-icon", { name: "x-lg" }, null, -1)), ha = [
|
|
1314
|
+
ga
|
|
1315
|
+
];
|
|
1316
|
+
function ba(e, n, t, l, s, o) {
|
|
1317
|
+
var a, u, r, c, d, f, p, v, _, g;
|
|
1318
|
+
return m(), h("div", {
|
|
1319
|
+
class: "file-wrapper",
|
|
1320
|
+
onDragover: n[5] || (n[5] = de((b) => e.state.droparea = !0, ["prevent"])),
|
|
1321
|
+
onDragleave: n[6] || (n[6] = (b) => e.state.droparea = !1),
|
|
1322
|
+
onDrop: n[7] || (n[7] = de((...b) => e.handleDrop && e.handleDrop(...b), ["prevent"]))
|
|
1323
|
+
}, [
|
|
1324
|
+
e.state.loading ? (m(), h("div", Jn, Yn)) : k("", !0),
|
|
1325
|
+
e.state.droparea ? (m(), h("div", Xn, " Dateien hier hinziehen ")) : k("", !0),
|
|
1326
|
+
!e.boneState.readonly && (!e.value || e.state.loading) ? (m(), h("sl-button", {
|
|
1327
|
+
key: 2,
|
|
1328
|
+
title: e.$t("bone.upload"),
|
|
1329
|
+
outline: "",
|
|
1330
|
+
class: "upload-btn",
|
|
1331
|
+
onClick: n[0] || (n[0] = (b) => e.uploadinput.click())
|
|
1332
|
+
}, ta, 8, xn)) : k("", !0),
|
|
1333
|
+
i("input", {
|
|
1334
|
+
ref: "uploadinput",
|
|
1335
|
+
hidden: "",
|
|
1336
|
+
type: "file",
|
|
1337
|
+
multiple: e.boneState.multiple,
|
|
1338
|
+
onChange: n[1] || (n[1] = (...b) => e.handleUpload && e.handleUpload(...b))
|
|
1339
|
+
}, null, 40, na),
|
|
1340
|
+
e.value ? (m(), h("sl-button", {
|
|
1341
|
+
key: 3,
|
|
1342
|
+
title: e.$t("bone.download"),
|
|
1343
|
+
onClick: n[2] || (n[2] = (...b) => e.downloadFile && e.downloadFile(...b))
|
|
1344
|
+
}, la, 8, aa)) : k("", !0),
|
|
1345
|
+
i("div", ra, [
|
|
1346
|
+
(u = (a = e.value) == null ? void 0 : a.dest) != null && u.mimetype.includes("image") ? (m(), h("div", {
|
|
1347
|
+
key: 0,
|
|
1348
|
+
class: "preview has-preview",
|
|
1349
|
+
onClick: n[3] || (n[3] = (b) => e.state.previewopen = !e.state.previewopen)
|
|
1350
|
+
}, [
|
|
1351
|
+
i("img", {
|
|
1352
|
+
class: "preview-img",
|
|
1353
|
+
src: e.createBackgroundImage(),
|
|
1354
|
+
alt: ""
|
|
1355
|
+
}, null, 8, oa),
|
|
1356
|
+
i("sl-dialog", {
|
|
1357
|
+
label: decodeURIComponent((c = (r = e.value) == null ? void 0 : r.dest) == null ? void 0 : c.name),
|
|
1358
|
+
class: "preview-overlay",
|
|
1359
|
+
open: e.state.previewopen
|
|
1360
|
+
}, [
|
|
1361
|
+
i("img", {
|
|
1362
|
+
src: e.createBackgroundImage(),
|
|
1363
|
+
alt: ""
|
|
1364
|
+
}, null, 8, ua)
|
|
1365
|
+
], 8, ia)
|
|
1366
|
+
])) : (m(), h("div", da, [
|
|
1367
|
+
(f = (d = e.value) == null ? void 0 : d.dest) != null && f.name ? (m(), h("sl-icon", ca)) : k("", !0)
|
|
1368
|
+
])),
|
|
1369
|
+
(v = (p = e.value) == null ? void 0 : p.dest) != null && v.name ? (m(), h("div", ma, B(decodeURIComponent((g = (_ = e.value) == null ? void 0 : _.dest) == null ? void 0 : g.name)), 1)) : k("", !0)
|
|
1370
|
+
]),
|
|
1371
|
+
e.boneState.multiple ? k("", !0) : (m(), h("sl-button", {
|
|
1372
|
+
key: 4,
|
|
1373
|
+
variant: "danger",
|
|
1374
|
+
outline: "",
|
|
1375
|
+
title: e.$t("bone.del"),
|
|
1376
|
+
class: "delete-btn",
|
|
1377
|
+
onClick: n[4] || (n[4] = (b) => e.$emit("change", e.name, "", e.lang, e.index))
|
|
1378
|
+
}, ha, 8, fa))
|
|
1379
|
+
], 32);
|
|
1380
|
+
}
|
|
1381
|
+
const We = /* @__PURE__ */ I(Zn, [["render", ba], ["__scopeId", "data-v-91086308"]]), va = D({
|
|
1382
|
+
inheritAttrs: !1,
|
|
1383
|
+
props: {
|
|
1384
|
+
name: String,
|
|
1385
|
+
value: [Object, String, Number, Boolean, Array],
|
|
1386
|
+
index: Number,
|
|
1387
|
+
lang: String
|
|
1388
|
+
},
|
|
1389
|
+
components: {},
|
|
1390
|
+
emits: ["change"],
|
|
1391
|
+
setup(e, n) {
|
|
1392
|
+
const t = C("boneState"), l = w({
|
|
1393
|
+
value: "",
|
|
1394
|
+
editorConfig: {},
|
|
1395
|
+
editor: S(() => Ce)
|
|
1396
|
+
});
|
|
1397
|
+
function s(u) {
|
|
1398
|
+
n.emit("change", e.name, l.value, e.lang, e.index);
|
|
1399
|
+
}
|
|
1400
|
+
function o(u) {
|
|
1401
|
+
l.value = u.target.value, n.emit("change", e.name, l.value, e.lang, e.index);
|
|
1402
|
+
}
|
|
1403
|
+
R(() => {
|
|
1404
|
+
e.value !== null && (l.value = e.value), n.emit("change", e.name, e.value, e.lang, e.index);
|
|
1405
|
+
});
|
|
1406
|
+
function a(u) {
|
|
1407
|
+
u.editing.view.change((r) => {
|
|
1408
|
+
r.setStyle("min-height", "250px", u.editing.view.document.getRoot());
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
return ae(
|
|
1412
|
+
() => e.value,
|
|
1413
|
+
(u, r) => {
|
|
1414
|
+
l.value = u;
|
|
1415
|
+
}
|
|
1416
|
+
), {
|
|
1417
|
+
state: l,
|
|
1418
|
+
ClassicEditor: Ce,
|
|
1419
|
+
boneState: t,
|
|
1420
|
+
changeEvent: s,
|
|
1421
|
+
onReady: a,
|
|
1422
|
+
changeEventTextarea: o
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
}), pa = ["disabled", "value"];
|
|
1426
|
+
function ya(e, n, t, l, s, o) {
|
|
1427
|
+
var u, r, c, d;
|
|
1428
|
+
const a = se("ckeditor");
|
|
1429
|
+
return e.state.editor ? (m(), h(E, { key: 0 }, [
|
|
1430
|
+
(u = e.boneState.bonestructure) != null && u.valid_html || (r = e.boneState.bonestructure) != null && r.validHtml ? (m(), T(a, {
|
|
1431
|
+
key: 0,
|
|
1432
|
+
modelValue: e.state.value,
|
|
1433
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => e.state.value = f),
|
|
1434
|
+
editor: e.state.editor,
|
|
1435
|
+
config: e.state.editorConfig,
|
|
1436
|
+
disabled: (c = e.boneState) == null ? void 0 : c.readonly,
|
|
1437
|
+
onReady: e.onReady,
|
|
1438
|
+
onInput: e.changeEvent
|
|
1439
|
+
}, null, 8, ["modelValue", "editor", "config", "disabled", "onReady", "onInput"])) : (m(), h("sl-textarea", {
|
|
1440
|
+
key: 1,
|
|
1441
|
+
disabled: (d = e.boneState) == null ? void 0 : d.readonly,
|
|
1442
|
+
value: e.value,
|
|
1443
|
+
onInput: n[1] || (n[1] = (...f) => e.changeEventTextarea && e.changeEventTextarea(...f))
|
|
1444
|
+
}, null, 40, pa))
|
|
1445
|
+
], 64)) : k("", !0);
|
|
1446
|
+
}
|
|
1447
|
+
const qe = /* @__PURE__ */ I(va, [["render", ya]]), $a = D({
|
|
1448
|
+
inheritAttrs: !1,
|
|
1449
|
+
props: {
|
|
1450
|
+
name: String,
|
|
1451
|
+
value: [Object, String, Number, Boolean, Array],
|
|
1452
|
+
index: Number,
|
|
1453
|
+
lang: String
|
|
1454
|
+
},
|
|
1455
|
+
components: {},
|
|
1456
|
+
emits: ["change"],
|
|
1457
|
+
setup(e, n) {
|
|
1458
|
+
const t = C("boneState"), l = w({
|
|
1459
|
+
valueLat: null,
|
|
1460
|
+
valueLng: null
|
|
1461
|
+
});
|
|
1462
|
+
function s() {
|
|
1463
|
+
n.emit("change", e.name, [l.valueLat, l.valueLng], e.lang, e.index);
|
|
1464
|
+
}
|
|
1465
|
+
return R(() => {
|
|
1466
|
+
try {
|
|
1467
|
+
l.valueLat = e.value[0], l.valueLng = e.value[1];
|
|
1468
|
+
} catch {
|
|
1469
|
+
}
|
|
1470
|
+
n.emit("change", e.name, [l.valueLat, l.valueLng], e.lang, e.index);
|
|
1471
|
+
}), {
|
|
1472
|
+
state: l,
|
|
1473
|
+
boneState: t,
|
|
1474
|
+
changeEvent: s
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
}), Sa = ["name", "min", "max", "disabled"], _a = ["name", "min", "max", "disabled"];
|
|
1478
|
+
function ka(e, n, t, l, s, o) {
|
|
1479
|
+
return m(), h(E, null, [
|
|
1480
|
+
J(i("sl-input", {
|
|
1481
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => e.state.valueLat = a),
|
|
1482
|
+
index: "lat",
|
|
1483
|
+
type: "number",
|
|
1484
|
+
name: e.name,
|
|
1485
|
+
min: e.boneState.bonestructure.boundslat[0],
|
|
1486
|
+
max: e.boneState.bonestructure.boundslat[1],
|
|
1487
|
+
disabled: e.boneState.readonly,
|
|
1488
|
+
"value-as-number": "",
|
|
1489
|
+
step: "0.000001",
|
|
1490
|
+
onSlChange: n[1] || (n[1] = (...a) => e.changeEvent && e.changeEvent(...a)),
|
|
1491
|
+
placeholder: "Lat"
|
|
1492
|
+
}, null, 40, Sa), [
|
|
1493
|
+
[le, e.state.valueLat]
|
|
1494
|
+
]),
|
|
1495
|
+
J(i("sl-input", {
|
|
1496
|
+
"onUpdate:modelValue": n[2] || (n[2] = (a) => e.state.valueLng = a),
|
|
1497
|
+
index: "lng",
|
|
1498
|
+
type: "number",
|
|
1499
|
+
name: e.name,
|
|
1500
|
+
min: e.boneState.bonestructure.boundslat[0],
|
|
1501
|
+
max: e.boneState.bonestructure.boundslat[1],
|
|
1502
|
+
disabled: e.boneState.readonly,
|
|
1503
|
+
"value-as-number": "",
|
|
1504
|
+
step: "0.000001",
|
|
1505
|
+
onSlChange: n[3] || (n[3] = (...a) => e.changeEvent && e.changeEvent(...a)),
|
|
1506
|
+
placeholder: "Long"
|
|
1507
|
+
}, null, 40, _a), [
|
|
1508
|
+
[le, e.state.valueLng]
|
|
1509
|
+
])
|
|
1510
|
+
], 64);
|
|
1511
|
+
}
|
|
1512
|
+
const Fe = /* @__PURE__ */ I($a, [["render", ka], ["__scopeId", "data-v-7bc31020"]]), wa = D({
|
|
1513
|
+
props: {
|
|
1514
|
+
name: String,
|
|
1515
|
+
value: Object,
|
|
1516
|
+
index: Number,
|
|
1517
|
+
lang: String,
|
|
1518
|
+
readonly: Boolean,
|
|
1519
|
+
params: Object
|
|
1520
|
+
},
|
|
1521
|
+
components: {},
|
|
1522
|
+
emits: ["change"],
|
|
1523
|
+
setup(e, n) {
|
|
1524
|
+
const t = C("boneState"), l = w({
|
|
1525
|
+
counter: 0,
|
|
1526
|
+
debounce: null
|
|
1527
|
+
}), s = C("addMultipleEntry"), o = C("removeMultipleEntries");
|
|
1528
|
+
function a() {
|
|
1529
|
+
l.counter += 1;
|
|
1530
|
+
let r = 200;
|
|
1531
|
+
l.counter > 1 && (r = 500), l.debounce && clearTimeout(l.debounce), l.debounce = setTimeout(() => {
|
|
1532
|
+
for (let c = l.counter; c--; )
|
|
1533
|
+
s(e.lang);
|
|
1534
|
+
l.counter = 0;
|
|
1535
|
+
}, r);
|
|
1536
|
+
}
|
|
1537
|
+
function u() {
|
|
1538
|
+
let r = 200;
|
|
1539
|
+
l.debounce && clearTimeout(l.debounce), l.debounce = setTimeout(() => {
|
|
1540
|
+
o(e.lang);
|
|
1541
|
+
}, r);
|
|
1542
|
+
}
|
|
1543
|
+
return R(() => {
|
|
1544
|
+
(!e.value || e.value.length === 0) && n.emit("change", e.name, [], e.lang);
|
|
1545
|
+
}), {
|
|
1546
|
+
state: l,
|
|
1547
|
+
boneState: t,
|
|
1548
|
+
handleAdd: a,
|
|
1549
|
+
handleRemove: u,
|
|
1550
|
+
removeMultipleEntries: o
|
|
1551
|
+
};
|
|
1552
|
+
}
|
|
1553
|
+
}), Xe = (e) => (M("data-v-63e75dee"), e = e(), z(), e), Ea = { class: "actionbar" }, Aa = ["title"], Ia = /* @__PURE__ */ Xe(() => /* @__PURE__ */ i("sl-icon", {
|
|
1554
|
+
slot: "prefix",
|
|
1555
|
+
name: "x-lg"
|
|
1556
|
+
}, null, -1)), Oa = [
|
|
1557
|
+
Ia
|
|
1558
|
+
], Ca = ["title"], ja = /* @__PURE__ */ Xe(() => /* @__PURE__ */ i("sl-icon", {
|
|
1559
|
+
slot: "prefix",
|
|
1560
|
+
name: "plus-lg"
|
|
1561
|
+
}, null, -1));
|
|
1562
|
+
function Ba(e, n, t, l, s, o) {
|
|
1563
|
+
return m(), h("div", Ea, [
|
|
1564
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1565
|
+
key: 0,
|
|
1566
|
+
variant: "danger",
|
|
1567
|
+
title: e.$t("bone.del"),
|
|
1568
|
+
outline: "",
|
|
1569
|
+
class: "delete-btn",
|
|
1570
|
+
onClick: n[0] || (n[0] = (a) => e.handleRemove(e.lang))
|
|
1571
|
+
}, Oa, 8, Aa)) : k("", !0),
|
|
1572
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1573
|
+
key: 1,
|
|
1574
|
+
variant: "success",
|
|
1575
|
+
title: e.$t("bone.add"),
|
|
1576
|
+
outline: "",
|
|
1577
|
+
class: "add-btn",
|
|
1578
|
+
onClick: n[1] || (n[1] = (a) => e.handleAdd(e.lang))
|
|
1579
|
+
}, [
|
|
1580
|
+
ja,
|
|
1581
|
+
O(" " + B(e.$t("bone.add")) + " ", 1),
|
|
1582
|
+
e.state.counter > 1 ? (m(), h(E, { key: 0 }, [
|
|
1583
|
+
O("(" + B(e.state.counter) + ")", 1)
|
|
1584
|
+
], 64)) : k("", !0)
|
|
1585
|
+
], 8, Ca)) : k("", !0)
|
|
1586
|
+
]);
|
|
1587
|
+
}
|
|
1588
|
+
const Da = /* @__PURE__ */ I(wa, [["render", Ba], ["__scopeId", "data-v-63e75dee"]]);
|
|
1589
|
+
var Va = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
1590
|
+
const Na = D({
|
|
1591
|
+
props: {
|
|
1592
|
+
name: String,
|
|
1593
|
+
value: Object,
|
|
1594
|
+
index: Number,
|
|
1595
|
+
lang: String,
|
|
1596
|
+
readonly: Boolean,
|
|
1597
|
+
params: Object
|
|
1598
|
+
},
|
|
1599
|
+
components: {},
|
|
1600
|
+
emits: ["change"],
|
|
1601
|
+
setup(e, n) {
|
|
1602
|
+
const t = C("boneState"), l = C("addMultipleEntry"), s = C("formatString"), o = null, a = w({
|
|
1603
|
+
skels: {},
|
|
1604
|
+
hasUsing: S(() => t == null ? void 0 : t.bonestructure.using)
|
|
1605
|
+
});
|
|
1606
|
+
function u(r) {
|
|
1607
|
+
let c = "";
|
|
1608
|
+
return t.bonestructure.type === "relational.tree.leaf.file" ? c = "skelType=leaf&" : t.bonestructure.type === "relational.tree.node.file" && (c = "skelType=node&"), j.get(
|
|
1609
|
+
`/${Va.VITE_DEFAULT_RENDERER || "vi"}/${t.bonestructure.module}/list?${c}limit=99`
|
|
1610
|
+
).then(async (d) => {
|
|
1611
|
+
var p;
|
|
1612
|
+
const f = await d.json();
|
|
1613
|
+
return a.skels = f.skellist.reduce((v, _) => (v[_.key] = _, v), {}), (p = f.skellist) == null ? void 0 : p.map((v) => ({ text: s(t.bonestructure.format, { dest: v }), value: v.key, data: v }));
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
return R(() => {
|
|
1617
|
+
(!e.value || e.value.length === 0) && n.emit("change", e.name, [], e.lang);
|
|
1618
|
+
}), {
|
|
1619
|
+
state: a,
|
|
1620
|
+
boneState: t,
|
|
1621
|
+
addMultipleEntry: l,
|
|
1622
|
+
removeMultipleEntries: o,
|
|
1623
|
+
getList: u
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
}), xe = (e) => (M("data-v-eeea51c6"), e = e(), z(), e), Ra = { class: "actionbar" }, La = ["title"], Ua = /* @__PURE__ */ xe(() => /* @__PURE__ */ i("sl-icon", {
|
|
1627
|
+
slot: "prefix",
|
|
1628
|
+
name: "x-lg"
|
|
1629
|
+
}, null, -1)), Ta = [
|
|
1630
|
+
Ua
|
|
1631
|
+
], Pa = ["source"], Ma = ["title"], za = /* @__PURE__ */ xe(() => /* @__PURE__ */ i("sl-icon", {
|
|
1632
|
+
slot: "prefix",
|
|
1633
|
+
name: "plus-lg"
|
|
1634
|
+
}, null, -1));
|
|
1635
|
+
function Wa(e, n, t, l, s, o) {
|
|
1636
|
+
return m(), h("div", Ra, [
|
|
1637
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1638
|
+
key: 0,
|
|
1639
|
+
variant: "danger",
|
|
1640
|
+
title: e.$t("bone.del"),
|
|
1641
|
+
outline: "",
|
|
1642
|
+
class: "delete-btn",
|
|
1643
|
+
onClick: n[0] || (n[0] = (a) => e.openSelector())
|
|
1644
|
+
}, Ta, 8, La)) : k("", !0),
|
|
1645
|
+
i("sl-combobox", {
|
|
1646
|
+
source: e.getList,
|
|
1647
|
+
hoist: "",
|
|
1648
|
+
onSlItemSelect: n[1] || (n[1] = (a) => {
|
|
1649
|
+
var u;
|
|
1650
|
+
return e.addMultipleEntry(e.lang, {
|
|
1651
|
+
dest: (u = e.state.skels) == null ? void 0 : u[a.detail.item.value],
|
|
1652
|
+
rel: e.state.hasUsing ? void 0 : null
|
|
1653
|
+
});
|
|
1654
|
+
})
|
|
1655
|
+
}, null, 40, Pa),
|
|
1656
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1657
|
+
key: 1,
|
|
1658
|
+
variant: "success",
|
|
1659
|
+
title: e.$t("bone.add"),
|
|
1660
|
+
outline: "",
|
|
1661
|
+
class: "add-btn",
|
|
1662
|
+
onClick: n[2] || (n[2] = (a) => e.addMultipleEntry(e.lang))
|
|
1663
|
+
}, [
|
|
1664
|
+
za,
|
|
1665
|
+
O(" " + B(e.$t("bone.list")), 1)
|
|
1666
|
+
], 8, Ma)) : k("", !0)
|
|
1667
|
+
]);
|
|
1668
|
+
}
|
|
1669
|
+
const qa = /* @__PURE__ */ I(Na, [["render", Wa], ["__scopeId", "data-v-eeea51c6"]]);
|
|
1670
|
+
var Ke = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
|
|
1671
|
+
const Fa = D({
|
|
1672
|
+
props: {
|
|
1673
|
+
name: String,
|
|
1674
|
+
value: Object,
|
|
1675
|
+
index: Number,
|
|
1676
|
+
lang: String,
|
|
1677
|
+
readonly: Boolean,
|
|
1678
|
+
params: Object
|
|
1679
|
+
},
|
|
1680
|
+
components: {},
|
|
1681
|
+
emits: ["change"],
|
|
1682
|
+
setup(e, n) {
|
|
1683
|
+
const t = C("boneState"), l = C("addMultipleEntry");
|
|
1684
|
+
C("formatString");
|
|
1685
|
+
const s = null, o = F(), a = w({
|
|
1686
|
+
skels: {},
|
|
1687
|
+
uploadinput: null,
|
|
1688
|
+
loading: !1,
|
|
1689
|
+
droparea: !1,
|
|
1690
|
+
hasUsing: S(() => t == null ? void 0 : t.bonestructure.using)
|
|
1691
|
+
});
|
|
1692
|
+
function u(d) {
|
|
1693
|
+
const f = {
|
|
1694
|
+
fileName: d.name,
|
|
1695
|
+
mimeType: d.type || "application/octet-stream",
|
|
1696
|
+
size: d.size.toString()
|
|
1697
|
+
};
|
|
1698
|
+
return new Promise((p, v) => {
|
|
1699
|
+
j.securePost(`/${Ke.VITE_DEFAULT_RENDERER || "vi"}/file/getUploadURL`, { dataObj: f }).then(async (_) => {
|
|
1700
|
+
let g = await _.json();
|
|
1701
|
+
fetch(g.values.uploadUrl, {
|
|
1702
|
+
body: d,
|
|
1703
|
+
method: "POST",
|
|
1704
|
+
mode: "no-cors"
|
|
1705
|
+
}).then(async (b) => {
|
|
1706
|
+
const y = {
|
|
1707
|
+
key: g.values.uploadKey,
|
|
1708
|
+
node: void 0,
|
|
1709
|
+
skelType: "leaf"
|
|
1710
|
+
};
|
|
1711
|
+
j.securePost(`/${Ke.VITE_DEFAULT_RENDERER || "vi"}/file/add`, { dataObj: y }).then(async ($) => {
|
|
1712
|
+
let A = await $.json();
|
|
1713
|
+
A.action === "addSuccess" ? p(A.values) : v(A);
|
|
1714
|
+
}).catch(($) => {
|
|
1715
|
+
v($);
|
|
1716
|
+
});
|
|
1717
|
+
}).catch((b) => {
|
|
1718
|
+
v(b);
|
|
1719
|
+
});
|
|
1720
|
+
}).catch((_) => {
|
|
1721
|
+
v(_);
|
|
1722
|
+
});
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
async function r(d) {
|
|
1726
|
+
a.loading = !0;
|
|
1727
|
+
for (let f of d.target.files) {
|
|
1728
|
+
let p = await u(f);
|
|
1729
|
+
o.value.value = null;
|
|
1730
|
+
let v = null;
|
|
1731
|
+
a.hasUsing && (v = void 0), l(e.lang, { dest: p, rel: v });
|
|
1732
|
+
}
|
|
1733
|
+
a.loading = !1;
|
|
1734
|
+
}
|
|
1735
|
+
async function c(d) {
|
|
1736
|
+
a.loading = !0, a.droparea = !1;
|
|
1737
|
+
for (let f of d.dataTransfer.files) {
|
|
1738
|
+
let p = await u(f);
|
|
1739
|
+
o.value.value = null;
|
|
1740
|
+
let v = null;
|
|
1741
|
+
a.hasUsing && (v = void 0), l(e.lang, { dest: p, rel: v });
|
|
1742
|
+
}
|
|
1743
|
+
a.loading = !1;
|
|
1744
|
+
}
|
|
1745
|
+
return R(() => {
|
|
1746
|
+
(!e.value || e.value.length === 0) && n.emit("change", e.name, [], e.lang);
|
|
1747
|
+
}), {
|
|
1748
|
+
state: a,
|
|
1749
|
+
boneState: t,
|
|
1750
|
+
addMultipleEntry: l,
|
|
1751
|
+
removeMultipleEntries: s,
|
|
1752
|
+
uploadFile: u,
|
|
1753
|
+
uploadinput: o,
|
|
1754
|
+
handleUpload: r,
|
|
1755
|
+
handleDrop: c
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
}), Se = (e) => (M("data-v-9bac9f8a"), e = e(), z(), e), Ka = ["title"], Ha = /* @__PURE__ */ Se(() => /* @__PURE__ */ i("sl-icon", {
|
|
1759
|
+
slot: "prefix",
|
|
1760
|
+
name: "x-lg"
|
|
1761
|
+
}, null, -1)), Ga = [
|
|
1762
|
+
Ha
|
|
1763
|
+
], Za = {
|
|
1764
|
+
key: 1,
|
|
1765
|
+
class: "droparea"
|
|
1766
|
+
}, Ja = ["multiple"], Qa = ["title"], Ya = /* @__PURE__ */ Se(() => /* @__PURE__ */ i("sl-icon", {
|
|
1767
|
+
slot: "prefix",
|
|
1768
|
+
name: "plus-lg"
|
|
1769
|
+
}, null, -1)), Xa = [
|
|
1770
|
+
Ya
|
|
1771
|
+
], xa = ["title"], es = /* @__PURE__ */ Se(() => /* @__PURE__ */ i("sl-icon", { name: "upload" }, null, -1)), ts = {
|
|
1772
|
+
key: 0,
|
|
1773
|
+
slot: "suffix"
|
|
1774
|
+
};
|
|
1775
|
+
function ns(e, n, t, l, s, o) {
|
|
1776
|
+
return m(), h("div", {
|
|
1777
|
+
class: "actionbar",
|
|
1778
|
+
onDragover: n[4] || (n[4] = de((a) => e.state.droparea = !0, ["prevent"])),
|
|
1779
|
+
onDragleave: n[5] || (n[5] = (a) => e.state.droparea = !1),
|
|
1780
|
+
onDrop: n[6] || (n[6] = de((...a) => e.handleDrop && e.handleDrop(...a), ["prevent"]))
|
|
1781
|
+
}, [
|
|
1782
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1783
|
+
key: 0,
|
|
1784
|
+
variant: "danger",
|
|
1785
|
+
title: e.$t("bone.del"),
|
|
1786
|
+
outline: "",
|
|
1787
|
+
class: "delete-btn",
|
|
1788
|
+
onClick: n[0] || (n[0] = (a) => e.openSelector())
|
|
1789
|
+
}, Ga, 8, Ka)) : k("", !0),
|
|
1790
|
+
e.state.droparea ? (m(), h("div", Za, " Dateien hier hinziehen ")) : k("", !0),
|
|
1791
|
+
i("input", {
|
|
1792
|
+
ref: "uploadinput",
|
|
1793
|
+
hidden: "",
|
|
1794
|
+
type: "file",
|
|
1795
|
+
multiple: e.boneState.multiple,
|
|
1796
|
+
onChange: n[1] || (n[1] = (...a) => e.handleUpload && e.handleUpload(...a))
|
|
1797
|
+
}, null, 40, Ja),
|
|
1798
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1799
|
+
key: 2,
|
|
1800
|
+
outline: "",
|
|
1801
|
+
title: e.$t("bone.list"),
|
|
1802
|
+
class: "add-btn",
|
|
1803
|
+
onClick: n[2] || (n[2] = (a) => e.addMultipleEntry(e.lang))
|
|
1804
|
+
}, Xa, 8, Qa)) : k("", !0),
|
|
1805
|
+
e.boneState.multiple && !e.readonly ? (m(), h("sl-button", {
|
|
1806
|
+
key: 3,
|
|
1807
|
+
variant: "success",
|
|
1808
|
+
outline: "",
|
|
1809
|
+
title: e.$t("bone.upload"),
|
|
1810
|
+
class: "upload-btn",
|
|
1811
|
+
onClick: n[3] || (n[3] = (a) => e.uploadinput.click())
|
|
1812
|
+
}, [
|
|
1813
|
+
es,
|
|
1814
|
+
O(" " + B(e.$t("bone.upload")) + " ", 1),
|
|
1815
|
+
e.state.loading ? (m(), h("sl-spinner", ts)) : k("", !0)
|
|
1816
|
+
], 8, xa)) : k("", !0)
|
|
1817
|
+
], 32);
|
|
1818
|
+
}
|
|
1819
|
+
const as = /* @__PURE__ */ I(Fa, [["render", ns], ["__scopeId", "data-v-9bac9f8a"]]), _e = $e("boneStore", () => {
|
|
1820
|
+
const e = w({
|
|
1821
|
+
additionalBones: G({}),
|
|
1822
|
+
defaultBones: G({
|
|
1823
|
+
rawBone: pe,
|
|
1824
|
+
keyBone: je,
|
|
1825
|
+
stringBone: Be,
|
|
1826
|
+
emailBone: De,
|
|
1827
|
+
dateBone: Ve,
|
|
1828
|
+
booleanBone: Re,
|
|
1829
|
+
selectBone: Ne,
|
|
1830
|
+
passwordBone: Le,
|
|
1831
|
+
recordBone: Ue,
|
|
1832
|
+
numericBone: Pe,
|
|
1833
|
+
colorBone: Te,
|
|
1834
|
+
relationalBone: Me,
|
|
1835
|
+
jsonBone: Gn,
|
|
1836
|
+
fileBone: We,
|
|
1837
|
+
textBone: qe,
|
|
1838
|
+
spatialBone: Fe
|
|
1839
|
+
}),
|
|
1840
|
+
actionbars: G({
|
|
1841
|
+
"relational.tree.leaf.file.file": as,
|
|
1842
|
+
"relational.": qa
|
|
1843
|
+
}),
|
|
1844
|
+
multibones: G(["select", "select."])
|
|
1845
|
+
});
|
|
1846
|
+
function n(a, u) {
|
|
1847
|
+
e.additionalBones[a] = u;
|
|
1848
|
+
}
|
|
1849
|
+
function t() {
|
|
1850
|
+
let a = e.defaultBones;
|
|
1851
|
+
for (const [u, r] of Object.entries(e.additionalBones))
|
|
1852
|
+
a.add(r);
|
|
1853
|
+
return a;
|
|
1854
|
+
}
|
|
1855
|
+
function l(a) {
|
|
1856
|
+
if (Object.keys(e.additionalBones).includes(a))
|
|
1857
|
+
return e.additionalBones[a];
|
|
1858
|
+
{
|
|
1859
|
+
let u = a.split("."), r = Object.entries(e.additionalBones).filter(
|
|
1860
|
+
(c) => c[0].startsWith(u[0] + ".")
|
|
1861
|
+
);
|
|
1862
|
+
if (r.length > 0) {
|
|
1863
|
+
r.sort((c, d) => d.length - c.length);
|
|
1864
|
+
for (let c of r)
|
|
1865
|
+
if (a.startsWith(c[0]))
|
|
1866
|
+
return e.additionalBones[c[0]];
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
return a === "date" ? Ve : a === "key" ? je : a === "str.email" ? De : a === "str" || a.startsWith("str.") ? Be : a === "select" || a.startsWith("select.") ? Ne : a === "bool" ? Re : a === "password" ? Le : a === "record" ? Ue : a === "numeric" || a.startsWith("numeric.") ? Pe : a === "relational.tree.leaf.file.file" ? We : a === "relational" || a.startsWith("relational.") ? Me : a === "color" ? Te : a === "text" ? qe : a === "spatial" ? Fe : pe;
|
|
1870
|
+
}
|
|
1871
|
+
function s(a, u) {
|
|
1872
|
+
e.actionbars[a] = u;
|
|
1873
|
+
}
|
|
1874
|
+
function o(a) {
|
|
1875
|
+
if (Object.keys(e.actionbars).includes(a))
|
|
1876
|
+
return e.actionbars[a];
|
|
1877
|
+
{
|
|
1878
|
+
let u = a.split("."), r = Object.entries(e.actionbars).filter(
|
|
1879
|
+
(c) => c[0].startsWith(u[0] + ".")
|
|
1880
|
+
);
|
|
1881
|
+
if (r.length > 0) {
|
|
1882
|
+
r.sort((c, d) => d.length - c.length);
|
|
1883
|
+
for (let c of r)
|
|
1884
|
+
if (a.startsWith(c[0]))
|
|
1885
|
+
return e.actionbars[c[0]];
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
return Da;
|
|
1889
|
+
}
|
|
1890
|
+
return {
|
|
1891
|
+
state: e,
|
|
1892
|
+
addBoneWidget: n,
|
|
1893
|
+
getBoneWidget: l,
|
|
1894
|
+
importWidgets: t,
|
|
1895
|
+
addBoneActionbar: s,
|
|
1896
|
+
getBoneActionbar: o
|
|
1897
|
+
};
|
|
1898
|
+
});
|
|
1899
|
+
function ss(e) {
|
|
1900
|
+
return _e().getBoneActionbar(e);
|
|
1901
|
+
}
|
|
1902
|
+
function x(e) {
|
|
1903
|
+
return _e().getBoneWidget(e);
|
|
1904
|
+
}
|
|
1905
|
+
function ls(e) {
|
|
1906
|
+
const n = _e();
|
|
1907
|
+
if (n.state.multibones.includes(e))
|
|
1908
|
+
return !0;
|
|
1909
|
+
{
|
|
1910
|
+
let t = e.split("."), l = Object.entries(n.state.multibones).filter(
|
|
1911
|
+
(s) => s[1].startsWith(t[0] + ".")
|
|
1912
|
+
);
|
|
1913
|
+
if (l.length > 0) {
|
|
1914
|
+
l.sort((s, o) => o.length - s.length);
|
|
1915
|
+
for (let s of l)
|
|
1916
|
+
if (e.startsWith(s[1]))
|
|
1917
|
+
return !0;
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1920
|
+
return !1;
|
|
1921
|
+
}
|
|
1922
|
+
D({
|
|
1923
|
+
inheritAttrs: !1,
|
|
1924
|
+
emits: ["change", "change-internal", "handleClick"],
|
|
1925
|
+
components: {
|
|
1926
|
+
wrapperMultiple: Ct,
|
|
1927
|
+
BoneLabel: Rt
|
|
1928
|
+
},
|
|
1929
|
+
props: {
|
|
1930
|
+
is: {
|
|
1931
|
+
type: Object,
|
|
1932
|
+
default: pe
|
|
1933
|
+
},
|
|
1934
|
+
name: {
|
|
1935
|
+
type: String,
|
|
1936
|
+
required: !0
|
|
1937
|
+
},
|
|
1938
|
+
languages: Array,
|
|
1939
|
+
multiple: Boolean,
|
|
1940
|
+
readonly: Boolean,
|
|
1941
|
+
required: Boolean,
|
|
1942
|
+
params: Object,
|
|
1943
|
+
value: [Object, String, Number, Boolean, Array],
|
|
1944
|
+
structure: {
|
|
1945
|
+
type: Object,
|
|
1946
|
+
required: !0
|
|
1947
|
+
},
|
|
1948
|
+
skel: {
|
|
1949
|
+
type: null,
|
|
1950
|
+
required: !0
|
|
1951
|
+
},
|
|
1952
|
+
errors: Object,
|
|
1953
|
+
showLabelInfo: { type: Boolean, required: !1, default: !1 },
|
|
1954
|
+
autofocus: { type: Boolean, required: !1, default: !1 }
|
|
1955
|
+
},
|
|
1956
|
+
setup(e, n) {
|
|
1957
|
+
const t = w({
|
|
1958
|
+
bonestructure: S(() => {
|
|
1959
|
+
var g;
|
|
1960
|
+
return (g = e.structure) == null ? void 0 : g[e.name];
|
|
1961
|
+
}),
|
|
1962
|
+
bonevalue: null,
|
|
1963
|
+
dragStartIndex: {
|
|
1964
|
+
lang: null,
|
|
1965
|
+
index: Number
|
|
1966
|
+
},
|
|
1967
|
+
dropIndex: {
|
|
1968
|
+
lang: null,
|
|
1969
|
+
index: Number
|
|
1970
|
+
},
|
|
1971
|
+
draggingLineBottom: {
|
|
1972
|
+
lang: String,
|
|
1973
|
+
index: Number
|
|
1974
|
+
},
|
|
1975
|
+
draggingLineTop: {
|
|
1976
|
+
lang: String,
|
|
1977
|
+
index: Number
|
|
1978
|
+
},
|
|
1979
|
+
isDragging: {
|
|
1980
|
+
lang: String,
|
|
1981
|
+
index: Number
|
|
1982
|
+
},
|
|
1983
|
+
multilanguage: S(() => {
|
|
1984
|
+
var g;
|
|
1985
|
+
return ((g = t.languages) == null ? void 0 : g.length) && t.languages.length > 0;
|
|
1986
|
+
}),
|
|
1987
|
+
languages: S(() => e.languages ? e.languages : t.bonestructure && Object.keys(t.bonestructure).includes("languages") ? t.bonestructure.languages : []),
|
|
1988
|
+
readonly: S(() => e.readonly ? e.readonly : t.bonestructure && Object.keys(t.bonestructure).includes("readonly") ? t.bonestructure.readonly : !1),
|
|
1989
|
+
required: S(() => e.required ? e.required : t.bonestructure && Object.keys(t.bonestructure).includes("required") ? t.bonestructure.required : !1),
|
|
1990
|
+
hasTooltip: S(() => !!(t.bonestructure && Object.keys(t.bonestructure.params).includes("tooltip"))),
|
|
1991
|
+
multiple: S(() => e.multiple ? e.multiple : t.bonestructure && Object.keys(t.bonestructure).includes("multiple") ? t.bonestructure.multiple : !1),
|
|
1992
|
+
params: S(() => e.params ? e.params : t.bonestructure && Object.keys(t.bonestructure).includes("params") ? t.bonestructure.params : {}),
|
|
1993
|
+
actionbar: S(() => {
|
|
1994
|
+
var g;
|
|
1995
|
+
return ss((g = t.bonestructure) == null ? void 0 : g.type);
|
|
1996
|
+
}),
|
|
1997
|
+
isEmpty: S(() => {
|
|
1998
|
+
function g(b) {
|
|
1999
|
+
for (const [y, $] of Object.entries(b))
|
|
2000
|
+
if ($ !== null) {
|
|
2001
|
+
if (Array.isArray($) && $.length > 0)
|
|
2002
|
+
return !1;
|
|
2003
|
+
if (!Array.isArray($))
|
|
2004
|
+
return !1;
|
|
2005
|
+
}
|
|
2006
|
+
return !0;
|
|
2007
|
+
}
|
|
2008
|
+
return t.readonly ? !1 : !t.bonevalue || Array.isArray(t.bonevalue) && t.bonevalue.length === 0 ? !0 : t.bonevalue === Object(t.bonevalue) && !Array.isArray(t.bonevalue) ? g(t.bonevalue) : !1;
|
|
2009
|
+
}),
|
|
2010
|
+
errors: [],
|
|
2011
|
+
errorMessages: S(() => {
|
|
2012
|
+
let g = [];
|
|
2013
|
+
for (let b of e.errors)
|
|
2014
|
+
b.fieldPath[0] === e.name && (b.severity > 2 || t.required && (b.severity === 2 || b.severity === 0)) && g.push(b.errorMessage);
|
|
2015
|
+
return g;
|
|
2016
|
+
})
|
|
2017
|
+
});
|
|
2018
|
+
ie("boneState", t);
|
|
2019
|
+
function l(g, b, y) {
|
|
2020
|
+
a(b, g, "isDragging"), a(b, g, "dragStartIndex");
|
|
2021
|
+
}
|
|
2022
|
+
function s(g, b, y) {
|
|
2023
|
+
y.preventDefault();
|
|
2024
|
+
const $ = y.clientY - y.target.getBoundingClientRect().top, A = y.target.closest(".value-line");
|
|
2025
|
+
$ < A.offsetHeight / 2 ? (a(b, g, "draggingLineTop"), u("draggingLineBottom"), t.dropIndex.index = g) : (a(b, g, "draggingLineBottom"), u("draggingLineTop"), t.dropIndex.index = g + 1);
|
|
2026
|
+
let L = b ? t.bonevalue[b] : t.bonevalue;
|
|
2027
|
+
t.dropIndex.index > L.length - 1 && (t.dropIndex.index -= 1);
|
|
2028
|
+
}
|
|
2029
|
+
function o(g, b, y) {
|
|
2030
|
+
let $ = null;
|
|
2031
|
+
t.dragStartIndex.index !== t.dropIndex.index && (b ? ($ = t.bonevalue[b].splice(t.dragStartIndex.index, 1)[0], t.bonevalue[b].splice(t.dropIndex.index, 0, $)) : ($ = t.bonevalue.splice(t.dragStartIndex.index, 1)[0], t.bonevalue.splice(t.dropIndex.index, 0, $)), console.dir(t.bonevalue[0]), n.emit("change", {
|
|
2032
|
+
name: e.name,
|
|
2033
|
+
value: c(),
|
|
2034
|
+
lang: b,
|
|
2035
|
+
index: g
|
|
2036
|
+
})), u("draggingLineBottom", "draggingLineTop", "isDragging", "dragStartIndex", "dropIndex");
|
|
2037
|
+
}
|
|
2038
|
+
function a(g, b, y) {
|
|
2039
|
+
t[y].lang = g || null, t[y].index = b;
|
|
2040
|
+
}
|
|
2041
|
+
function u(...g) {
|
|
2042
|
+
g.forEach((b) => {
|
|
2043
|
+
t[b] = {
|
|
2044
|
+
lang: null,
|
|
2045
|
+
index: Number
|
|
2046
|
+
};
|
|
2047
|
+
});
|
|
2048
|
+
}
|
|
2049
|
+
function r(g, b, y = null, $ = null, A) {
|
|
2050
|
+
if (b === void 0 || (y ? (t.bonevalue || (t.bonevalue = {}), Object.keys(t.bonevalue).includes(y) && $ !== null ? t.bonevalue[y][$] = b : t.bonevalue[y] = b) : $ !== null ? t.bonevalue[$] = b : A === !1 || (t.bonevalue = b), t.readonly)) return !1;
|
|
2051
|
+
let L = {
|
|
2052
|
+
name: g,
|
|
2053
|
+
value: c(),
|
|
2054
|
+
lang: y,
|
|
2055
|
+
index: $
|
|
2056
|
+
}, V = {
|
|
2057
|
+
name: g,
|
|
2058
|
+
value: b,
|
|
2059
|
+
lang: y,
|
|
2060
|
+
index: $
|
|
2061
|
+
};
|
|
2062
|
+
A != null && (L.pwMatch = A, V.pwMatch = A), n.emit("change", L), n.emit("change-internal", V);
|
|
2063
|
+
}
|
|
2064
|
+
function c() {
|
|
2065
|
+
function g(y, $ = null) {
|
|
2066
|
+
let A = [];
|
|
2067
|
+
if (Array.isArray(y))
|
|
2068
|
+
if (t.bonestructure.type == "spatial" && y.length === 2 && !Array.isArray(y[0]))
|
|
2069
|
+
A.push({ [$ + ".lat"]: y[0] }), A.push({ [$ + ".lng"]: y[1] });
|
|
2070
|
+
else if (Object.values(y).filter((L) => L === Object(L)).length > 0)
|
|
2071
|
+
for (const [L, V] of y.entries())
|
|
2072
|
+
V.rel !== null ? A.push(g(V, $ + "." + L)) : A.push(g(V, $));
|
|
2073
|
+
else
|
|
2074
|
+
for (const [L, V] of y.entries())
|
|
2075
|
+
A.push(g(V, $));
|
|
2076
|
+
else if (y === Object(y))
|
|
2077
|
+
for (const [L, V] of Object.entries(y))
|
|
2078
|
+
$ ? $.endsWith(".dest") || $.endsWith(".rel") ? $.endsWith(".dest") && L === "key" ? (/\.[0-9]*\.dest$/.test($) ? A.push(g(V, $.replace(/\.[0-9]*\.dest/, ""))) : A.push(g(V, $.replace(/\.dest/, ""))), A.push(g(V, $.replace(/\.dest/, "") + "." + L))) : $.endsWith(".rel") && A.push(g(V, $.replace(/\.rel/, "") + "." + L)) : A.push(g(V, $ + "." + L)) : A.push(g(V, L));
|
|
2079
|
+
else
|
|
2080
|
+
y == null && (y = ""), $ !== null && A.push({ [$]: y });
|
|
2081
|
+
return A;
|
|
2082
|
+
}
|
|
2083
|
+
let b = g(t.bonevalue, e.name);
|
|
2084
|
+
return b = b.flat(10), b;
|
|
2085
|
+
}
|
|
2086
|
+
function d(g = null, b = "") {
|
|
2087
|
+
g ? Object.keys(t.bonevalue).includes(g) ? t.bonevalue[g].push(b) : t.bonevalue[g] = [b] : t.bonevalue ? t.bonevalue.push(b) : t.bonevalue = [b];
|
|
2088
|
+
}
|
|
2089
|
+
ie("addMultipleEntry", d);
|
|
2090
|
+
function f(g, b = null) {
|
|
2091
|
+
var y;
|
|
2092
|
+
b ? (y = t.bonevalue) == null || y[b].splice(g, 1) : t.bonevalue.splice(g, 1), n.emit("change", {
|
|
2093
|
+
name: e.name,
|
|
2094
|
+
value: c(),
|
|
2095
|
+
lang: b,
|
|
2096
|
+
index: g
|
|
2097
|
+
}), n.emit("change-internal", {
|
|
2098
|
+
name: e.name,
|
|
2099
|
+
value: c(),
|
|
2100
|
+
lang: b,
|
|
2101
|
+
index: g
|
|
2102
|
+
});
|
|
2103
|
+
}
|
|
2104
|
+
function p(g = null) {
|
|
2105
|
+
var b;
|
|
2106
|
+
g ? (b = t.bonevalue) == null || b[g].splice(0) : t.bonevalue.splice(0), n.emit("change", {
|
|
2107
|
+
name: e.name,
|
|
2108
|
+
value: c(),
|
|
2109
|
+
lang: g
|
|
2110
|
+
}), n.emit("change-internal", {
|
|
2111
|
+
name: e.name,
|
|
2112
|
+
value: c(),
|
|
2113
|
+
lang: g
|
|
2114
|
+
});
|
|
2115
|
+
}
|
|
2116
|
+
ie("removeMultipleEntries", p);
|
|
2117
|
+
function v(g = null, b = "") {
|
|
2118
|
+
d(g, b);
|
|
2119
|
+
}
|
|
2120
|
+
function _(g, b) {
|
|
2121
|
+
function y(V) {
|
|
2122
|
+
let Z = [], H = [], ne = /\$\((.*?)\)/g;
|
|
2123
|
+
for (; H; ) {
|
|
2124
|
+
if (H = ne.exec(V), !H) {
|
|
2125
|
+
H = !1;
|
|
2126
|
+
continue;
|
|
2127
|
+
}
|
|
2128
|
+
Z.push(H[1]);
|
|
2129
|
+
}
|
|
2130
|
+
return Z;
|
|
2131
|
+
}
|
|
2132
|
+
function $(V, Z) {
|
|
2133
|
+
let H = V.split("."), ne = V.split("."), P = Z;
|
|
2134
|
+
for (let Y of H)
|
|
2135
|
+
if (ne.shift(), P && P !== "-" && Object.keys(P).includes(Y) && P[Y])
|
|
2136
|
+
if (Array.isArray(P[Y])) {
|
|
2137
|
+
let Ie = [];
|
|
2138
|
+
for (let tt of P[Y])
|
|
2139
|
+
Ie.push($(ne.join("."), tt));
|
|
2140
|
+
P = Ie.join(", ");
|
|
2141
|
+
} else
|
|
2142
|
+
P = P[Y];
|
|
2143
|
+
else (!P || typeof P[Y] == "object" && !P[Y]) && (P = "-");
|
|
2144
|
+
return P;
|
|
2145
|
+
}
|
|
2146
|
+
let A = y(g), L = [];
|
|
2147
|
+
Array.isArray(b) || (b = [b]);
|
|
2148
|
+
for (let V of b) {
|
|
2149
|
+
let Z = g;
|
|
2150
|
+
for (let H of A) {
|
|
2151
|
+
let ne = $(H, V);
|
|
2152
|
+
Z = Z.replace("$(" + H + ")", ne);
|
|
2153
|
+
}
|
|
2154
|
+
L.push(Z);
|
|
2155
|
+
}
|
|
2156
|
+
return L.join(", ");
|
|
2157
|
+
}
|
|
2158
|
+
return ie("formatString", _), ee(() => {
|
|
2159
|
+
var g;
|
|
2160
|
+
e.value ? t.bonevalue = e.value : t.bonevalue = (g = e.skel) == null ? void 0 : g[e.name];
|
|
2161
|
+
}), ae(
|
|
2162
|
+
() => e.skel,
|
|
2163
|
+
(g, b) => {
|
|
2164
|
+
var y;
|
|
2165
|
+
t.bonevalue = (y = e.skel) == null ? void 0 : y[e.name];
|
|
2166
|
+
}
|
|
2167
|
+
), ae(
|
|
2168
|
+
() => {
|
|
2169
|
+
var g;
|
|
2170
|
+
return (g = e.errors) == null ? void 0 : g[e.name];
|
|
2171
|
+
},
|
|
2172
|
+
(g, b) => {
|
|
2173
|
+
t.errors = e.errors;
|
|
2174
|
+
}
|
|
2175
|
+
), {
|
|
2176
|
+
state: t,
|
|
2177
|
+
updateValue: r,
|
|
2178
|
+
addMultipleEntry: d,
|
|
2179
|
+
removeMultipleEntry: f,
|
|
2180
|
+
removeMultipleEntries: p,
|
|
2181
|
+
BoneHasMultipleHandling: ls,
|
|
2182
|
+
multipleBonePressEnter: v,
|
|
2183
|
+
handleDragStart: l,
|
|
2184
|
+
handleDragOver: s,
|
|
2185
|
+
handleDrop: o,
|
|
2186
|
+
setStateProperties: a,
|
|
2187
|
+
resetStateProperties: u
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
});
|
|
2191
|
+
const ke = {
|
|
2192
|
+
props: {
|
|
2193
|
+
size: {
|
|
2194
|
+
type: String,
|
|
2195
|
+
default: "2"
|
|
2196
|
+
},
|
|
2197
|
+
active: {
|
|
2198
|
+
type: Boolean,
|
|
2199
|
+
default: !0
|
|
2200
|
+
},
|
|
2201
|
+
logo: {
|
|
2202
|
+
default: "logo-cube.svg",
|
|
2203
|
+
type: String
|
|
2204
|
+
},
|
|
2205
|
+
color: {
|
|
2206
|
+
default: "var(--sl-color-primary-500)",
|
|
2207
|
+
type: String
|
|
2208
|
+
}
|
|
2209
|
+
},
|
|
2210
|
+
setup(e, n) {
|
|
2211
|
+
const t = w({
|
|
2212
|
+
trackWidth: S(() => `${e.size / 30}rem`),
|
|
2213
|
+
outerSize: S(() => `calc(${e.size}rem + ${t.trackWidth})`),
|
|
2214
|
+
spinnerSize: S(() => `${e.size}rem`),
|
|
2215
|
+
logoSize: S(() => `calc(${e.size}rem - ${t.trackWidth} * 10)`),
|
|
2216
|
+
shadow: S(() => `0px 0px ${e.size / 6}rem 0 color-mix(in hsl, var(--sl-color-neutral-1000), 80% transparent)`)
|
|
2217
|
+
});
|
|
2218
|
+
return { state: t };
|
|
2219
|
+
}
|
|
2220
|
+
}, He = () => {
|
|
2221
|
+
it((e) => ({
|
|
2222
|
+
"93747d92": e.state.outerSize,
|
|
2223
|
+
"284424e5": e.state.shadow,
|
|
2224
|
+
"6485ca5e": e.state.logoSize,
|
|
2225
|
+
"5d833915": e.state.spinnerSize,
|
|
2226
|
+
d5b3feca: e.color,
|
|
2227
|
+
"2050b700": e.state.trackWidth
|
|
2228
|
+
}));
|
|
2229
|
+
}, Ge = ke.setup;
|
|
2230
|
+
ke.setup = Ge ? (e, n) => (He(), Ge(e, n)) : He;
|
|
2231
|
+
const rs = (e) => (M("data-v-46c45785"), e = e(), z(), e), os = {
|
|
2232
|
+
key: 0,
|
|
2233
|
+
class: "loading"
|
|
2234
|
+
}, is = /* @__PURE__ */ rs(() => /* @__PURE__ */ i("sl-spinner", { class: "loader" }, null, -1)), us = { class: "logo" }, ds = ["src"];
|
|
2235
|
+
function cs(e, n, t, l, s, o) {
|
|
2236
|
+
return m(), T(ut, null, {
|
|
2237
|
+
default: dt(() => [
|
|
2238
|
+
t.active ? (m(), h("div", os, [
|
|
2239
|
+
is,
|
|
2240
|
+
i("div", us, [
|
|
2241
|
+
i("sl-icon", { src: t.logo }, null, 8, ds)
|
|
2242
|
+
])
|
|
2243
|
+
])) : k("", !0)
|
|
2244
|
+
]),
|
|
2245
|
+
_: 1
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
const ms = /* @__PURE__ */ I(ke, [["render", cs], ["__scopeId", "data-v-46c45785"]]), oe = $e("cartstore", () => {
|
|
2249
|
+
const e = new ht({
|
|
2250
|
+
host_url: window.location.origin === "http://localhost:8081" ? "http://localhost:8080" : window.location.origin
|
|
2251
|
+
}), n = w({
|
|
2252
|
+
basketRootNode: {},
|
|
2253
|
+
whishlistRootNodes: [],
|
|
2254
|
+
children: {},
|
|
2255
|
+
structure: { address: {}, cart: {} }
|
|
2256
|
+
});
|
|
2257
|
+
async function t() {
|
|
2258
|
+
await s();
|
|
2259
|
+
}
|
|
2260
|
+
async function l(d) {
|
|
2261
|
+
return await e.cart_list({ cart_key: d });
|
|
2262
|
+
}
|
|
2263
|
+
async function s() {
|
|
2264
|
+
(await e.cart_list()).forEach((f) => {
|
|
2265
|
+
f.is_root_node && (f.cart_type === "basket" ? n.basketRootNode = f : n.whishlistRootNodes.push(f));
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
async function o(d, f) {
|
|
2269
|
+
let p = await e.article_add({
|
|
2270
|
+
article_key: d,
|
|
2271
|
+
parent_cart_key: f
|
|
2272
|
+
});
|
|
2273
|
+
console.log("addToCart", p);
|
|
2274
|
+
}
|
|
2275
|
+
async function a(d, f) {
|
|
2276
|
+
let p = await e.article_view({
|
|
2277
|
+
article_key: d,
|
|
2278
|
+
parent_cart_key: f
|
|
2279
|
+
});
|
|
2280
|
+
console.log("getArticleView", p);
|
|
2281
|
+
}
|
|
2282
|
+
async function u(d, f) {
|
|
2283
|
+
let p = await e.article_remove({
|
|
2284
|
+
article_key: d,
|
|
2285
|
+
parent_cart_key: f
|
|
2286
|
+
});
|
|
2287
|
+
console.log("remove Resp", p);
|
|
2288
|
+
}
|
|
2289
|
+
async function r(d, f, p) {
|
|
2290
|
+
let v = await e.article_update({
|
|
2291
|
+
article_key: d,
|
|
2292
|
+
parent_cart_key: f,
|
|
2293
|
+
quantity: p,
|
|
2294
|
+
quantity_mode: "replace"
|
|
2295
|
+
});
|
|
2296
|
+
console.log("update Resp", v);
|
|
2297
|
+
}
|
|
2298
|
+
async function c() {
|
|
2299
|
+
let d = await e.address_structure();
|
|
2300
|
+
n.structure.address = d.addSkel, console.log("adress add", n.structure.address);
|
|
2301
|
+
}
|
|
2302
|
+
return {
|
|
2303
|
+
state: n,
|
|
2304
|
+
addToCart: o,
|
|
2305
|
+
getArticleView: a,
|
|
2306
|
+
removeItem: u,
|
|
2307
|
+
updateItem: r,
|
|
2308
|
+
init: t,
|
|
2309
|
+
getAdressStructure: c,
|
|
2310
|
+
getChildren: l
|
|
2311
|
+
};
|
|
2312
|
+
}), fs = {
|
|
2313
|
+
__name: "CartNode",
|
|
2314
|
+
props: {
|
|
2315
|
+
node: { type: Object, required: !0 }
|
|
2316
|
+
},
|
|
2317
|
+
setup(e) {
|
|
2318
|
+
return w({}), (n, t) => (m(), h("pre", null, B(e.node.name), 1));
|
|
2319
|
+
}
|
|
2320
|
+
}, ge = (e) => (M("data-v-4b285730"), e = e(), z(), e), gs = {
|
|
2321
|
+
horizontal: "",
|
|
2322
|
+
class: "viur-shop-cart-leaf"
|
|
2323
|
+
}, hs = ["src"], bs = { class: "viur-shop-cart-leaf-headline headline" }, vs = { class: "viur-shop-cart-leaf-artno" }, ps = ["innerHTML"], ys = { class: "viur-shop-cart-leaf-actions" }, $s = /* @__PURE__ */ ge(() => /* @__PURE__ */ i("sl-button", {
|
|
2324
|
+
size: "small",
|
|
2325
|
+
outline: "",
|
|
2326
|
+
class: "viur-shop-cart-leaf-add-to-favourites-btn",
|
|
2327
|
+
variant: "primary",
|
|
2328
|
+
title: "Add to favourites"
|
|
2329
|
+
}, [
|
|
2330
|
+
/* @__PURE__ */ i("sl-icon", {
|
|
2331
|
+
name: "heart",
|
|
2332
|
+
slot: "prefix"
|
|
2333
|
+
})
|
|
2334
|
+
], -1)), Ss = /* @__PURE__ */ ge(() => /* @__PURE__ */ i("sl-icon", {
|
|
2335
|
+
name: "trash",
|
|
2336
|
+
slot: "prefix"
|
|
2337
|
+
}, null, -1)), _s = [
|
|
2338
|
+
Ss
|
|
2339
|
+
], ks = { class: "viur-shop-cart-leaf-quantity" }, ws = { class: "viur-shop-cart-leaf-unitprice" }, Es = /* @__PURE__ */ ge(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-leaf-label" }, "Stückpreis", -1)), As = ["value"], Is = { class: "viur-shop-cart-leaf-price" }, Os = /* @__PURE__ */ ge(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-leaf-label" }, "Gesamtpreis", -1)), Cs = ["value"], js = {
|
|
2340
|
+
__name: "CartLeaf",
|
|
2341
|
+
props: {
|
|
2342
|
+
leaf: { type: Object, required: !0 },
|
|
2343
|
+
node: { type: Object, required: !0 }
|
|
2344
|
+
},
|
|
2345
|
+
emits: ["updateItem", "removeItem"],
|
|
2346
|
+
setup(e, { emit: n }) {
|
|
2347
|
+
const t = e, l = n, s = w({
|
|
2348
|
+
leaf: {}
|
|
2349
|
+
});
|
|
2350
|
+
function o(r) {
|
|
2351
|
+
return r !== void 0 ? gt.downloadUrlFor(r) : "https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80";
|
|
2352
|
+
}
|
|
2353
|
+
function a(r, c, d, f) {
|
|
2354
|
+
l("updateItem", {
|
|
2355
|
+
item: r,
|
|
2356
|
+
articleKey: c,
|
|
2357
|
+
node: d,
|
|
2358
|
+
quantity: f
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
function u(r, c, d) {
|
|
2362
|
+
l("removeItem", { item: r, articleKey: c, node: d });
|
|
2363
|
+
}
|
|
2364
|
+
return ee(() => {
|
|
2365
|
+
s.leaf = t.leaf;
|
|
2366
|
+
}), (r, c) => (m(), h("sl-card", gs, [
|
|
2367
|
+
i("img", {
|
|
2368
|
+
class: "viur-shop-cart-leaf-image",
|
|
2369
|
+
slot: "image",
|
|
2370
|
+
src: o(s.leaf.shop_image ? s.leaf.shop_image : void 0)
|
|
2371
|
+
}, null, 8, hs),
|
|
2372
|
+
i("h4", bs, B(s.leaf.shop_name), 1),
|
|
2373
|
+
i("h5", vs, B(s.leaf.shop_art_no_or_gtin), 1),
|
|
2374
|
+
i("div", {
|
|
2375
|
+
class: "viur-shop-cart-leaf-description",
|
|
2376
|
+
innerHTML: s.leaf.shop_description
|
|
2377
|
+
}, null, 8, ps),
|
|
2378
|
+
i("div", ys, [
|
|
2379
|
+
$s,
|
|
2380
|
+
i("sl-button", {
|
|
2381
|
+
size: "small",
|
|
2382
|
+
outline: "",
|
|
2383
|
+
class: "viur-shop-cart-leaf-delete-btn",
|
|
2384
|
+
variant: "primary",
|
|
2385
|
+
title: "Remove from cart",
|
|
2386
|
+
onClick: c[0] || (c[0] = (d) => u(s.leaf, s.leaf.article.dest.key, e.node))
|
|
2387
|
+
}, _s)
|
|
2388
|
+
]),
|
|
2389
|
+
i("div", ks, [
|
|
2390
|
+
J(i("sl-input", {
|
|
2391
|
+
class: "viur-shop-cart-leaf-value viur-shop-cart-leaf-value--quantity",
|
|
2392
|
+
type: "number",
|
|
2393
|
+
label: "Anzahl",
|
|
2394
|
+
placeholder: "Number",
|
|
2395
|
+
min: "0",
|
|
2396
|
+
"onUpdate:modelValue": c[1] || (c[1] = (d) => s.leaf.quantity = d),
|
|
2397
|
+
onInput: c[2] || (c[2] = (d) => a(
|
|
2398
|
+
s.leaf,
|
|
2399
|
+
s.leaf.article.dest.key,
|
|
2400
|
+
e.node,
|
|
2401
|
+
s.leaf.quantity
|
|
2402
|
+
))
|
|
2403
|
+
}, null, 544), [
|
|
2404
|
+
[le, s.leaf.quantity]
|
|
2405
|
+
])
|
|
2406
|
+
]),
|
|
2407
|
+
i("div", ws, [
|
|
2408
|
+
Es,
|
|
2409
|
+
i("sl-format-number", {
|
|
2410
|
+
class: "viur-shop-cart-leaf-value viur-shop-cart-leaf-value--unitprice",
|
|
2411
|
+
lang: "de",
|
|
2412
|
+
type: "currency",
|
|
2413
|
+
currency: "EUR",
|
|
2414
|
+
value: s.leaf.price.retail
|
|
2415
|
+
}, null, 8, As)
|
|
2416
|
+
]),
|
|
2417
|
+
i("div", Is, [
|
|
2418
|
+
Os,
|
|
2419
|
+
i("sl-format-number", {
|
|
2420
|
+
class: "viur-shop-cart-leaf-value viur-shop-cart-leaf-value--price",
|
|
2421
|
+
lang: "de",
|
|
2422
|
+
type: "currency",
|
|
2423
|
+
currency: "EUR",
|
|
2424
|
+
value: s.leaf.price.retail * s.leaf.quantity
|
|
2425
|
+
}, null, 8, Cs)
|
|
2426
|
+
])
|
|
2427
|
+
]));
|
|
2428
|
+
}
|
|
2429
|
+
}, Bs = /* @__PURE__ */ I(js, [["__scopeId", "data-v-4b285730"]]), K = (e) => (M("data-v-d03d4f46"), e = e(), z(), e), Ds = { key: 0 }, Vs = /* @__PURE__ */ K(() => /* @__PURE__ */ i("p", null, "Möchten Sie den Artikel wirklich aus dem Warenkorb entfernen?", -1)), Ns = {
|
|
2430
|
+
class: "footer-wrap",
|
|
2431
|
+
slot: "footer"
|
|
2432
|
+
}, Rs = { class: "viur-shop-cart-node" }, Ls = /* @__PURE__ */ K(() => /* @__PURE__ */ i("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Zusammenfassung", -1)), Us = /* @__PURE__ */ K(() => /* @__PURE__ */ i("br", null, null, -1)), Ts = /* @__PURE__ */ K(() => /* @__PURE__ */ i("sl-input", {
|
|
2433
|
+
label: "Rabattcode eingeben",
|
|
2434
|
+
class: "viur-shop-cart-sidebar-coupon-input"
|
|
2435
|
+
}, null, -1)), Ps = /* @__PURE__ */ K(() => /* @__PURE__ */ i("br", null, null, -1)), Ms = { class: "viur-shop-cart-sidebar-info-line" }, zs = /* @__PURE__ */ K(() => /* @__PURE__ */ i("span", null, "Zwischensumme", -1)), Ws = /* @__PURE__ */ K(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-sidebar-info-line" }, [
|
|
2436
|
+
/* @__PURE__ */ i("span", null, "Rabatt"),
|
|
2437
|
+
/* @__PURE__ */ O(" 0 € ")
|
|
2438
|
+
], -1)), qs = /* @__PURE__ */ K(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-sidebar-info-line" }, [
|
|
2439
|
+
/* @__PURE__ */ i("span", null, "Versandkosten"),
|
|
2440
|
+
/* @__PURE__ */ O(" 0 € ")
|
|
2441
|
+
], -1)), Fs = { class: "viur-shop-cart-sidebar-info-line total" }, Ks = /* @__PURE__ */ K(() => /* @__PURE__ */ i("span", null, "Gesamt:", -1)), Hs = /* @__PURE__ */ K(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-sidebar-btn-wrap" }, [
|
|
2442
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2443
|
+
variant: "primary",
|
|
2444
|
+
size: "medium"
|
|
2445
|
+
}, " Jetzt Bestellen "),
|
|
2446
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2447
|
+
size: "medium",
|
|
2448
|
+
variant: "info"
|
|
2449
|
+
}, [
|
|
2450
|
+
/* @__PURE__ */ i("sl-icon", {
|
|
2451
|
+
name: "paypal",
|
|
2452
|
+
slot: "prefix"
|
|
2453
|
+
}),
|
|
2454
|
+
/* @__PURE__ */ O(" Paypal ")
|
|
2455
|
+
])
|
|
2456
|
+
], -1)), Gs = /* @__PURE__ */ K(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-mobile-footer" }, [
|
|
2457
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2458
|
+
variant: "primary",
|
|
2459
|
+
size: "medium"
|
|
2460
|
+
}, " Jetzt Bestellen ")
|
|
2461
|
+
], -1)), Zs = {
|
|
2462
|
+
__name: "CartView",
|
|
2463
|
+
props: {
|
|
2464
|
+
mode: { type: String, default: "basket" },
|
|
2465
|
+
cartKey: { type: String, required: !0 },
|
|
2466
|
+
sidebar: { type: Boolean, default: !0 }
|
|
2467
|
+
},
|
|
2468
|
+
setup(e) {
|
|
2469
|
+
const n = e, t = oe(), l = F(null), s = w({
|
|
2470
|
+
itemsIsInit: S(() => !0),
|
|
2471
|
+
images: {},
|
|
2472
|
+
currentItem: {},
|
|
2473
|
+
currentNode: {},
|
|
2474
|
+
nodes: [],
|
|
2475
|
+
leaves: {}
|
|
2476
|
+
});
|
|
2477
|
+
S(() => n.mode === "basket" ? t.state.basket : n.cartKey);
|
|
2478
|
+
async function o() {
|
|
2479
|
+
await t.updateItem(
|
|
2480
|
+
s.currentItem.article.dest.key,
|
|
2481
|
+
s.currentNode.key,
|
|
2482
|
+
0
|
|
2483
|
+
), await c(), l.value.hide();
|
|
2484
|
+
}
|
|
2485
|
+
async function a(f) {
|
|
2486
|
+
console.log("updateItem :", f), f.quantity === 0 ? (l.value.show(), s.currentItem = f.item, s.currentNode = f.node) : (await t.updateItem(f.articleKey, f.node.key, f.quantity), await t.init());
|
|
2487
|
+
}
|
|
2488
|
+
function u(f) {
|
|
2489
|
+
console.log("removeItem :", f), l.value.show(), s.currentItem = f.item, s.currentNode = f.node;
|
|
2490
|
+
}
|
|
2491
|
+
async function r() {
|
|
2492
|
+
s.leaves[s.currentNode.key].forEach((f) => {
|
|
2493
|
+
f.key === s.currentItem.key && (f.quantity = 1);
|
|
2494
|
+
}), s.currentItem = {}, s.currentNode = {};
|
|
2495
|
+
}
|
|
2496
|
+
async function c() {
|
|
2497
|
+
s.nodes = [], s.leaves = {}, await t.init(), await d();
|
|
2498
|
+
}
|
|
2499
|
+
async function d(f = n.cartKey) {
|
|
2500
|
+
console.log("debug getChildren parentKey from comp: ", f);
|
|
2501
|
+
const p = await t.getChildren(f);
|
|
2502
|
+
console.log("getChildren children: ", p), p.forEach(async (v) => {
|
|
2503
|
+
v.skel_type === "node" ? (s.nodes.push(v), await d(v.key)) : (Object.keys(s.leaves).includes(f) || (s.leaves[f] = []), s.leaves[f].push(v));
|
|
2504
|
+
});
|
|
2505
|
+
}
|
|
2506
|
+
return ee(async () => {
|
|
2507
|
+
await t.init(), await d(), n.mode === "basket" && s.nodes.push(t.state.basketRootNode), console.log("state.nodes test", s.nodes), console.log("state.leaves", s.leaves);
|
|
2508
|
+
}), (f, p) => e.cartKey.length ? (m(), h(E, { key: 1 }, [
|
|
2509
|
+
i("sl-dialog", {
|
|
2510
|
+
ref_key: "confirm",
|
|
2511
|
+
ref: l,
|
|
2512
|
+
onSlHide: r
|
|
2513
|
+
}, [
|
|
2514
|
+
Vs,
|
|
2515
|
+
i("div", Ns, [
|
|
2516
|
+
i("sl-button", {
|
|
2517
|
+
variant: "danger",
|
|
2518
|
+
onClick: p[0] || (p[0] = (v) => l.value.hide()),
|
|
2519
|
+
size: "medium"
|
|
2520
|
+
}, " Abbrechen "),
|
|
2521
|
+
i("sl-button", {
|
|
2522
|
+
variant: "success",
|
|
2523
|
+
onClick: o,
|
|
2524
|
+
size: "medium"
|
|
2525
|
+
}, " Aus Warenkorb entfernen ")
|
|
2526
|
+
])
|
|
2527
|
+
], 544),
|
|
2528
|
+
(m(!0), h(E, null, U(s.nodes, (v) => (m(), h("div", Rs, [
|
|
2529
|
+
Object.keys(s.leaves).includes(v.key) ? (m(), h(E, { key: 0 }, [
|
|
2530
|
+
ct(fs, { node: v }, null, 8, ["node"]),
|
|
2531
|
+
(m(!0), h(E, null, U(s.leaves[v.key], (_) => (m(), T(Bs, {
|
|
2532
|
+
key: _.key,
|
|
2533
|
+
leaf: _,
|
|
2534
|
+
node: v,
|
|
2535
|
+
onRemoveItem: u,
|
|
2536
|
+
onUpdateItem: a
|
|
2537
|
+
}, null, 8, ["leaf", "node"]))), 128))
|
|
2538
|
+
], 64)) : k("", !0)
|
|
2539
|
+
]))), 256)),
|
|
2540
|
+
e.sidebar ? (m(), T(Je, {
|
|
2541
|
+
key: 0,
|
|
2542
|
+
to: "#order_sidebar"
|
|
2543
|
+
}, [
|
|
2544
|
+
Ls,
|
|
2545
|
+
Us,
|
|
2546
|
+
Ts,
|
|
2547
|
+
Ps,
|
|
2548
|
+
i("div", Ms, [
|
|
2549
|
+
zs,
|
|
2550
|
+
O(" --> " + B(e.mode === "basket" ? q(t).state.basketRootNode.total : q(t).state.whishlistRootNodes[e.cartKey].total) + " € ", 1)
|
|
2551
|
+
]),
|
|
2552
|
+
Ws,
|
|
2553
|
+
qs,
|
|
2554
|
+
i("div", Fs, [
|
|
2555
|
+
Ks,
|
|
2556
|
+
O(" " + B(e.mode === "basket" ? q(t).state.basketRootNode.total : q(t).state.whishlistRootNodes[e.cartKey].total) + " € ", 1)
|
|
2557
|
+
]),
|
|
2558
|
+
Hs
|
|
2559
|
+
])) : k("", !0),
|
|
2560
|
+
Gs
|
|
2561
|
+
], 64)) : (m(), h("sl-spinner", Ds));
|
|
2562
|
+
}
|
|
2563
|
+
}, we = /* @__PURE__ */ I(Zs, [["__scopeId", "data-v-d03d4f46"]]), Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2564
|
+
__proto__: null,
|
|
2565
|
+
default: we
|
|
2566
|
+
}, Symbol.toStringTag, { value: "Module" })), Q = (e) => (M("data-v-b7b745be"), e = e(), z(), e), Qs = {
|
|
2567
|
+
key: 1,
|
|
2568
|
+
class: "list"
|
|
2569
|
+
}, Ys = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("h2", { class: "viur-shop-cart-headline headline" }, "Bestellung prüfen", -1)), Xs = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("br", null, null, -1)), xs = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-address-wrap" }, [
|
|
2570
|
+
/* @__PURE__ */ i("div", { class: "viur-shop-cart-address" }, [
|
|
2571
|
+
/* @__PURE__ */ i("div", { class: "viur-shop-cart-address-headline" }, [
|
|
2572
|
+
/* @__PURE__ */ O(" Versandadresse "),
|
|
2573
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2574
|
+
outline: "",
|
|
2575
|
+
size: "small"
|
|
2576
|
+
}, [
|
|
2577
|
+
/* @__PURE__ */ i("sl-icon", {
|
|
2578
|
+
name: "pencil",
|
|
2579
|
+
slot: "prefix"
|
|
2580
|
+
})
|
|
2581
|
+
])
|
|
2582
|
+
]),
|
|
2583
|
+
/* @__PURE__ */ O(" Roland Brose"),
|
|
2584
|
+
/* @__PURE__ */ i("br"),
|
|
2585
|
+
/* @__PURE__ */ O(" Speicherstraße 33"),
|
|
2586
|
+
/* @__PURE__ */ i("br"),
|
|
2587
|
+
/* @__PURE__ */ O(" 44147 Dortmund, DE"),
|
|
2588
|
+
/* @__PURE__ */ i("br"),
|
|
2589
|
+
/* @__PURE__ */ i("br"),
|
|
2590
|
+
/* @__PURE__ */ O(" rb@mausbrand.de"),
|
|
2591
|
+
/* @__PURE__ */ i("br"),
|
|
2592
|
+
/* @__PURE__ */ O(" 0231 21 34 68 90 ")
|
|
2593
|
+
]),
|
|
2594
|
+
/* @__PURE__ */ i("div", { class: "viur-shop-cart-address" }, [
|
|
2595
|
+
/* @__PURE__ */ i("div", { class: "viur-shop-cart-address-headline" }, [
|
|
2596
|
+
/* @__PURE__ */ O(" Rechnungsadresse "),
|
|
2597
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2598
|
+
outline: "",
|
|
2599
|
+
size: "small"
|
|
2600
|
+
}, [
|
|
2601
|
+
/* @__PURE__ */ i("sl-icon", {
|
|
2602
|
+
name: "pencil",
|
|
2603
|
+
slot: "prefix"
|
|
2604
|
+
})
|
|
2605
|
+
])
|
|
2606
|
+
]),
|
|
2607
|
+
/* @__PURE__ */ O(" Roland Brose"),
|
|
2608
|
+
/* @__PURE__ */ i("br"),
|
|
2609
|
+
/* @__PURE__ */ O(" Speicherstraße 33"),
|
|
2610
|
+
/* @__PURE__ */ i("br"),
|
|
2611
|
+
/* @__PURE__ */ O(" 44147 Dortmund, DE"),
|
|
2612
|
+
/* @__PURE__ */ i("br"),
|
|
2613
|
+
/* @__PURE__ */ i("br"),
|
|
2614
|
+
/* @__PURE__ */ O(" rb@mausbrand.de"),
|
|
2615
|
+
/* @__PURE__ */ i("br"),
|
|
2616
|
+
/* @__PURE__ */ O(" 0231 21 34 68 90 ")
|
|
2617
|
+
])
|
|
2618
|
+
], -1)), el = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("div", { class: "viur-shop-cart-payment" }, [
|
|
2619
|
+
/* @__PURE__ */ i("div", { class: "viur-shop-cart-payment-method" }, [
|
|
2620
|
+
/* @__PURE__ */ i("span", null, "Zahlungsmethode:"),
|
|
2621
|
+
/* @__PURE__ */ O(" Paypal ")
|
|
2622
|
+
]),
|
|
2623
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2624
|
+
outline: "",
|
|
2625
|
+
size: "small"
|
|
2626
|
+
}, [
|
|
2627
|
+
/* @__PURE__ */ i("sl-icon", {
|
|
2628
|
+
name: "pencil",
|
|
2629
|
+
slot: "prefix"
|
|
2630
|
+
})
|
|
2631
|
+
])
|
|
2632
|
+
], -1)), tl = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("h2", { class: "viur-shop-cart-headline headline" }, "Warenkorb", -1)), nl = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("br", null, null, -1)), al = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("h2", { class: "viur-shop-cart-sidebar-headline headline" }, "Jetzt Bestellen", -1)), sl = /* @__PURE__ */ Q(() => /* @__PURE__ */ i("br", null, null, -1)), ll = { class: "viur-shop-cart-sidebar-btn-wrap" }, rl = ["variant", "disabled"], ol = {
|
|
2633
|
+
__name: "ConfirmView",
|
|
2634
|
+
setup(e) {
|
|
2635
|
+
const n = oe(), t = w({
|
|
2636
|
+
cartIsInit: S(() => !0),
|
|
2637
|
+
itemsIsInit: S(() => {
|
|
2638
|
+
var s;
|
|
2639
|
+
return !!((s = n.state) != null && s.carts[n.state.basket].items);
|
|
2640
|
+
}),
|
|
2641
|
+
images: {},
|
|
2642
|
+
showOrderButton: !1
|
|
2643
|
+
});
|
|
2644
|
+
function l(s) {
|
|
2645
|
+
s.target.checked && (t.showOrderButton = !0), s.target.checked || (t.showOrderButton = !1);
|
|
2646
|
+
}
|
|
2647
|
+
return ee(async () => {
|
|
2648
|
+
await n.init();
|
|
2649
|
+
}), (s, o) => t.cartIsInit ? (m(), h("div", Qs, [
|
|
2650
|
+
Ys,
|
|
2651
|
+
Xs,
|
|
2652
|
+
xs,
|
|
2653
|
+
el,
|
|
2654
|
+
tl,
|
|
2655
|
+
nl,
|
|
2656
|
+
(m(), T(Je, { to: "#order_sidebar" }, [
|
|
2657
|
+
al,
|
|
2658
|
+
sl,
|
|
2659
|
+
i("sl-checkbox", { onSlChange: l }, " Ich akzeptiere die geltenden AGBs und Datenschutzbestimmungen ", 32),
|
|
2660
|
+
i("div", ll, [
|
|
2661
|
+
i("sl-button", {
|
|
2662
|
+
variant: t.showOrderButton ? "info" : "disabled",
|
|
2663
|
+
size: "small",
|
|
2664
|
+
disabled: !t.showOrderButton
|
|
2665
|
+
}, " Zahlungspflichtig bestellen ", 8, rl)
|
|
2666
|
+
])
|
|
2667
|
+
]))
|
|
2668
|
+
])) : (m(), T(ms, { key: 0 }));
|
|
2669
|
+
}
|
|
2670
|
+
}, Ee = /* @__PURE__ */ I(ol, [["__scopeId", "data-v-b7b745be"]]), il = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2671
|
+
__proto__: null,
|
|
2672
|
+
default: Ee
|
|
2673
|
+
}, Symbol.toStringTag, { value: "Module" })), ul = (e) => (M("data-v-0e63188d"), e = e(), z(), e), dl = { class: "bind viur-shop-wrap" }, cl = ["panel", "disabled"], ml = { class: "viur-shop-order-step" }, fl = ["name", "library"], gl = { class: "viur-shop-order-status-text" }, hl = {
|
|
2674
|
+
key: 0,
|
|
2675
|
+
name: "chevron-right",
|
|
2676
|
+
class: "viur-shop-order-tab-check"
|
|
2677
|
+
}, bl = ["name"], vl = ["onClick"], pl = ["onClick"], yl = /* @__PURE__ */ ul(() => /* @__PURE__ */ i("div", { class: "viur-shop-sidebar-wrap" }, [
|
|
2678
|
+
/* @__PURE__ */ i("div", {
|
|
2679
|
+
class: "viur-shop-sidebar",
|
|
2680
|
+
id: "order_sidebar"
|
|
2681
|
+
})
|
|
2682
|
+
], -1)), $l = {
|
|
2683
|
+
__name: "OrderView",
|
|
2684
|
+
props: {
|
|
2685
|
+
tabs: {
|
|
2686
|
+
type: Object,
|
|
2687
|
+
required: !0
|
|
2688
|
+
}
|
|
2689
|
+
},
|
|
2690
|
+
emits: ["tabChange"],
|
|
2691
|
+
setup(e, { emit: n }) {
|
|
2692
|
+
const t = e, l = n, s = w({
|
|
2693
|
+
tabNames: S(() => a(t.tabs)),
|
|
2694
|
+
isFirstTab: (d) => d === 0
|
|
2695
|
+
}), o = F(null);
|
|
2696
|
+
function a(d) {
|
|
2697
|
+
let f = [], p = [];
|
|
2698
|
+
for (const v in d)
|
|
2699
|
+
d[v].position ? f.push([v, d[v].position]) : f.push([v, 0]);
|
|
2700
|
+
return f.sort((v, _) => v[1] - _[1]), f.forEach((v) => {
|
|
2701
|
+
p.push(v[0]);
|
|
2702
|
+
}), p;
|
|
2703
|
+
}
|
|
2704
|
+
function u(d) {
|
|
2705
|
+
l("tabChange", d);
|
|
2706
|
+
}
|
|
2707
|
+
function r(d) {
|
|
2708
|
+
o.value.show(d);
|
|
2709
|
+
}
|
|
2710
|
+
function c(d) {
|
|
2711
|
+
o.value.show(d);
|
|
2712
|
+
}
|
|
2713
|
+
return (d, f) => (m(), h("div", dl, [
|
|
2714
|
+
i("sl-tab-group", {
|
|
2715
|
+
class: "viur-shop-order-tabgroup",
|
|
2716
|
+
noScrollControls: "",
|
|
2717
|
+
onSlTabShow: u,
|
|
2718
|
+
ref_key: "tabGroup",
|
|
2719
|
+
ref: o
|
|
2720
|
+
}, [
|
|
2721
|
+
(m(!0), h(E, null, U(s.tabNames, (p, v) => (m(), h("sl-tab", {
|
|
2722
|
+
class: "viur-shop-order-tab",
|
|
2723
|
+
slot: "nav",
|
|
2724
|
+
panel: p,
|
|
2725
|
+
key: p,
|
|
2726
|
+
disabled: e.tabs[p].disabled
|
|
2727
|
+
}, [
|
|
2728
|
+
i("div", ml, [
|
|
2729
|
+
i("sl-icon", {
|
|
2730
|
+
class: "viur-shop-order-step-icon",
|
|
2731
|
+
name: e.tabs[p].icon.name,
|
|
2732
|
+
library: e.tabs[p].icon.library
|
|
2733
|
+
}, null, 8, fl),
|
|
2734
|
+
i("div", gl, B(v + 1) + ". " + B(e.tabs[p].displayName), 1)
|
|
2735
|
+
]),
|
|
2736
|
+
v < s.tabNames.length - 1 ? (m(), h("sl-icon", hl)) : k("", !0)
|
|
2737
|
+
], 8, cl))), 128)),
|
|
2738
|
+
(m(!0), h(E, null, U(s.tabNames, (p, v) => (m(), h("sl-tab-panel", {
|
|
2739
|
+
class: "viur-shop-order-tab-panel",
|
|
2740
|
+
name: p,
|
|
2741
|
+
key: p
|
|
2742
|
+
}, [
|
|
2743
|
+
(m(), T(mt(e.tabs[p].component), ft({ ref_for: !0 }, e.tabs[p].props ? e.tabs[p].props : ""), null, 16)),
|
|
2744
|
+
v !== s.tabNames.length - 1 ? (m(), h("div", {
|
|
2745
|
+
key: 0,
|
|
2746
|
+
class: ye(["viur-shop-form-footer", { "flex-end": s.isFirstTab(v) }])
|
|
2747
|
+
}, [
|
|
2748
|
+
J(i("sl-button", {
|
|
2749
|
+
type: "submit",
|
|
2750
|
+
onClick: (_) => r(s.tabNames[v - 1])
|
|
2751
|
+
}, " Zurück ", 8, vl), [
|
|
2752
|
+
[ve, v !== 0]
|
|
2753
|
+
]),
|
|
2754
|
+
i("sl-button", {
|
|
2755
|
+
type: "submit",
|
|
2756
|
+
variant: "primary",
|
|
2757
|
+
onClick: (_) => c(s.tabNames[v + 1])
|
|
2758
|
+
}, " Weiter ", 8, pl)
|
|
2759
|
+
], 2)) : k("", !0)
|
|
2760
|
+
], 8, bl))), 128))
|
|
2761
|
+
], 544),
|
|
2762
|
+
yl
|
|
2763
|
+
]));
|
|
2764
|
+
}
|
|
2765
|
+
}, Sl = /* @__PURE__ */ I($l, [["__scopeId", "data-v-0e63188d"]]), _l = {}, he = (e) => (M("data-v-36ccc280"), e = e(), z(), e), kl = { class: "bind" }, wl = /* @__PURE__ */ he(() => /* @__PURE__ */ i("h1", { class: "headline" }, "Vielen Dank für Ihre Bestellung", -1)), El = /* @__PURE__ */ he(() => /* @__PURE__ */ i("br", null, null, -1)), Al = /* @__PURE__ */ he(() => /* @__PURE__ */ i("p", { class: "paragraph" }, [
|
|
2766
|
+
/* @__PURE__ */ i("strong", null, "Ihre Bestellnummer:"),
|
|
2767
|
+
/* @__PURE__ */ O(" 123345670 ")
|
|
2768
|
+
], -1)), Il = /* @__PURE__ */ he(() => /* @__PURE__ */ i("p", { class: "paragraph" }, [
|
|
2769
|
+
/* @__PURE__ */ O(" Wir haben Ihre Bestellung erhalten und werden diese schenllstmöglich bearbeiten."),
|
|
2770
|
+
/* @__PURE__ */ i("br"),
|
|
2771
|
+
/* @__PURE__ */ O(" Sie erhalten in wenigen Minuten eine Bestätigung per E-Mail. "),
|
|
2772
|
+
/* @__PURE__ */ i("div", { class: "btn-wrap" }, [
|
|
2773
|
+
/* @__PURE__ */ i("sl-button", { size: "medium" }, " Zur Startseite "),
|
|
2774
|
+
/* @__PURE__ */ i("sl-button", {
|
|
2775
|
+
variant: "primary",
|
|
2776
|
+
size: "medium"
|
|
2777
|
+
}, " Weiter Einkaufen ")
|
|
2778
|
+
])
|
|
2779
|
+
], -1)), Ol = [
|
|
2780
|
+
wl,
|
|
2781
|
+
El,
|
|
2782
|
+
Al,
|
|
2783
|
+
Il
|
|
2784
|
+
];
|
|
2785
|
+
function Cl(e, n) {
|
|
2786
|
+
return m(), h("div", kl, Ol);
|
|
2787
|
+
}
|
|
2788
|
+
const jl = /* @__PURE__ */ I(_l, [["render", Cl], ["__scopeId", "data-v-36ccc280"]]), Ae = (e) => (M("data-v-b68a2bfa"), e = e(), z(), e), Bl = /* @__PURE__ */ Ae(() => /* @__PURE__ */ i("h2", { class: "viur-shop-form-headline headline" }, "Nutzterdaten", -1)), Dl = /* @__PURE__ */ Ae(() => /* @__PURE__ */ i("h2", { class: "viur-shop-form-headline headline" }, "Lieferadresse", -1)), Vl = { key: 0 }, Nl = /* @__PURE__ */ Ae(() => /* @__PURE__ */ i("h2", { class: "viur-shop-form-headline headline" }, "Rechnungsadresse", -1)), Rl = {
|
|
2789
|
+
__name: "UserInformation",
|
|
2790
|
+
props: {
|
|
2791
|
+
mode: { type: String, default: "form" },
|
|
2792
|
+
conditions: { type: Function }
|
|
2793
|
+
},
|
|
2794
|
+
setup(e) {
|
|
2795
|
+
const n = oe(), t = w({
|
|
2796
|
+
formValues: {},
|
|
2797
|
+
requiredFieldsFilled: S(() => {
|
|
2798
|
+
if (t.isCustomAdress)
|
|
2799
|
+
return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("billing.city") && Object.keys(t.formValues).includes("billing.street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname");
|
|
2800
|
+
if (!t.isCustomAdress)
|
|
2801
|
+
return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname");
|
|
2802
|
+
}),
|
|
2803
|
+
isCustomAdress: !1,
|
|
2804
|
+
addSkel: null,
|
|
2805
|
+
errors: {}
|
|
2806
|
+
});
|
|
2807
|
+
function l(a) {
|
|
2808
|
+
a.target.checked && (t.isCustomAdress = !1), a.target.checked || (t.isCustomAdress = !0);
|
|
2809
|
+
}
|
|
2810
|
+
function s(a, u) {
|
|
2811
|
+
for (const [r, c] of Object.entries(u.value[0]))
|
|
2812
|
+
t.formValues[r] = c;
|
|
2813
|
+
}
|
|
2814
|
+
function o(a) {
|
|
2815
|
+
let u = {};
|
|
2816
|
+
return Array.isArray(a) ? (a.forEach((r) => {
|
|
2817
|
+
let c = r[0], d = r[1];
|
|
2818
|
+
u[c] = d;
|
|
2819
|
+
}), console.log("output", u), u) : a;
|
|
2820
|
+
}
|
|
2821
|
+
return ae(t.formValues, (a) => {
|
|
2822
|
+
Object.entries(a).forEach(([u, r]) => {
|
|
2823
|
+
r === "" && delete t.formValues[u];
|
|
2824
|
+
});
|
|
2825
|
+
}), ee(async () => {
|
|
2826
|
+
await n.getAdressStructure(), t.addSkel = o(n.state.structure.address);
|
|
2827
|
+
}), (a, u) => {
|
|
2828
|
+
const r = se("bone");
|
|
2829
|
+
return m(), h(E, null, [
|
|
2830
|
+
i("div", null, [
|
|
2831
|
+
O(" test "),
|
|
2832
|
+
Bl,
|
|
2833
|
+
(m(!0), h(E, null, U(t.addSkel, (c, d) => (m(), h(E, { key: d }, [
|
|
2834
|
+
O(B(d) + " ", 1),
|
|
2835
|
+
c.visible && c.params.group === "Customer Info" ? (m(), T(r, {
|
|
2836
|
+
key: 0,
|
|
2837
|
+
is: q(x)(c.type),
|
|
2838
|
+
name: d,
|
|
2839
|
+
structure: o(t.addSkel),
|
|
2840
|
+
errors: t.errors[d] ? t.errors[d] : [],
|
|
2841
|
+
skel: t.formValues,
|
|
2842
|
+
onChange: (f) => s(d, f),
|
|
2843
|
+
class: "viur-shop-form-grid-w-2"
|
|
2844
|
+
}, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : k("", !0)
|
|
2845
|
+
], 64))), 128))
|
|
2846
|
+
]),
|
|
2847
|
+
i("div", null, [
|
|
2848
|
+
Dl,
|
|
2849
|
+
(m(!0), h(E, null, U(t.addSkel, (c, d) => (m(), h(E, { key: d }, [
|
|
2850
|
+
c.visible && c.params.group === "Customer Address" ? (m(), T(r, {
|
|
2851
|
+
key: 0,
|
|
2852
|
+
is: q(x)(c.type),
|
|
2853
|
+
name: d,
|
|
2854
|
+
structure: o(t.addSkel),
|
|
2855
|
+
errors: t.errors[d] ? t.errors[d] : [],
|
|
2856
|
+
skel: t.formValues,
|
|
2857
|
+
onChange: (f) => s(d, f)
|
|
2858
|
+
}, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : k("", !0)
|
|
2859
|
+
], 64))), 128))
|
|
2860
|
+
]),
|
|
2861
|
+
t.isCustomAdress ? (m(), h("div", Vl, [
|
|
2862
|
+
Nl,
|
|
2863
|
+
(m(!0), h(E, null, U(t.addSkel, (c, d) => (m(), h(E, { key: d }, [
|
|
2864
|
+
c.visible && c.params.group === "Customer Address" ? (m(), T(r, {
|
|
2865
|
+
key: 0,
|
|
2866
|
+
is: q(x)(c.type),
|
|
2867
|
+
name: d,
|
|
2868
|
+
structure: o(t.addSkel),
|
|
2869
|
+
errors: t.errors[d] ? t.errors[d] : [],
|
|
2870
|
+
skel: t.formValues,
|
|
2871
|
+
onChange: (f) => s(d, f)
|
|
2872
|
+
}, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : k("", !0)
|
|
2873
|
+
], 64))), 128))
|
|
2874
|
+
])) : k("", !0),
|
|
2875
|
+
i("sl-checkbox", {
|
|
2876
|
+
onSlChange: l,
|
|
2877
|
+
checked: ""
|
|
2878
|
+
}, " Rechnungsadresse wie Lieferadresse ", 32)
|
|
2879
|
+
], 64);
|
|
2880
|
+
};
|
|
2881
|
+
}
|
|
2882
|
+
}, Ll = /* @__PURE__ */ I(Rl, [["__scopeId", "data-v-b68a2bfa"]]), te = (e) => (M("data-v-a4accf28"), e = e(), z(), e), Ul = /* @__PURE__ */ te(() => /* @__PURE__ */ i("h2", { class: "viur-shop-form-headline headline" }, "Nutzterdaten", -1)), Tl = /* @__PURE__ */ te(() => /* @__PURE__ */ i("h2", { class: "viur-shop-form-headline headline" }, "Lieferadresse", -1)), Pl = ["onSlChange", "onSlClear", "label"], Ml = ["value"], zl = { key: 0 }, Wl = /* @__PURE__ */ te(() => /* @__PURE__ */ i("h2", { class: "viur-shop-form-headline headline" }, "Rechnungsadresse", -1)), ql = /* @__PURE__ */ te(() => /* @__PURE__ */ i("sl-icon", {
|
|
2883
|
+
name: "x-lg",
|
|
2884
|
+
slot: "prefix"
|
|
2885
|
+
}, null, -1)), Fl = [
|
|
2886
|
+
ql
|
|
2887
|
+
], Kl = /* @__PURE__ */ te(() => /* @__PURE__ */ i("sl-icon", {
|
|
2888
|
+
name: "plus-lg",
|
|
2889
|
+
slot: "prefix"
|
|
2890
|
+
}, null, -1)), Hl = /* @__PURE__ */ te(() => /* @__PURE__ */ i("sl-icon", {
|
|
2891
|
+
slot: "icon",
|
|
2892
|
+
name: "exclamation-triangle"
|
|
2893
|
+
}, null, -1)), Gl = /* @__PURE__ */ te(() => /* @__PURE__ */ i("br", null, null, -1)), Zl = {
|
|
2894
|
+
__name: "UserInfoMulti",
|
|
2895
|
+
props: {
|
|
2896
|
+
mode: { type: String, default: "form" }
|
|
2897
|
+
},
|
|
2898
|
+
setup(e) {
|
|
2899
|
+
const n = oe(), t = w({
|
|
2900
|
+
formValues: {},
|
|
2901
|
+
requiredFieldsFilled: S(() => {
|
|
2902
|
+
if (t.isCustomAdress)
|
|
2903
|
+
return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("billing.city") && Object.keys(t.formValues).includes("billing.street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname");
|
|
2904
|
+
if (!t.isCustomAdress)
|
|
2905
|
+
return Object.keys(t.formValues).includes("city") && Object.keys(t.formValues).includes("street") && Object.keys(t.formValues).includes("email") && Object.keys(t.formValues).includes("firstname") && Object.keys(t.formValues).includes("lastname");
|
|
2906
|
+
}),
|
|
2907
|
+
isCustomAdress: !1,
|
|
2908
|
+
shippingAdressAmount: 1,
|
|
2909
|
+
maxShippingAdress: S(
|
|
2910
|
+
() => Object.keys(n.state.carts).length + 2
|
|
2911
|
+
),
|
|
2912
|
+
amountAlert: { title: "", msg: "" },
|
|
2913
|
+
items: null,
|
|
2914
|
+
addSkel: null,
|
|
2915
|
+
errors: {},
|
|
2916
|
+
selectedItem: {},
|
|
2917
|
+
isInit: S(() => !!n.state.carts[n.state.basket])
|
|
2918
|
+
}), l = F(null), s = F(null);
|
|
2919
|
+
function o(p) {
|
|
2920
|
+
p.target.checked && (t.isCustomAdress = !1), p.target.checked || (t.isCustomAdress = !0);
|
|
2921
|
+
}
|
|
2922
|
+
function a() {
|
|
2923
|
+
if (t.shippingAdressAmount === t.maxShippingAdress) {
|
|
2924
|
+
t.amountAlert.title = "Zu viele Lieferadressen", t.amountAlert.msg = `Sie können nur maximal: "${t.maxShippingAdress}" Lieferadressen verwenden.`, s.value.show();
|
|
2925
|
+
return;
|
|
2926
|
+
}
|
|
2927
|
+
t.shippingAdressAmount += 1;
|
|
2928
|
+
}
|
|
2929
|
+
function u(p, v) {
|
|
2930
|
+
for (const [_, g] of Object.entries(v.value[0]))
|
|
2931
|
+
t.formValues[_] = g;
|
|
2932
|
+
}
|
|
2933
|
+
function r() {
|
|
2934
|
+
if (t.shippingAdressAmount === 1) {
|
|
2935
|
+
t.amountAlert.title = "Zu wenig Lieferadressen", t.amountAlert.msg = "Mindestens eine Lieferadresse muss angegeben werden.", s.value.show();
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
t.shippingAdressAmount -= 1;
|
|
2939
|
+
}
|
|
2940
|
+
function c(p, v) {
|
|
2941
|
+
if (console.log(p.target.value), !p.target.value.length) {
|
|
2942
|
+
d();
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
t.selectedItem[v] = p.target.value, t.isItemSelected = !0;
|
|
2946
|
+
}
|
|
2947
|
+
function d(p, v) {
|
|
2948
|
+
console.log("clearing..."), delete t.selectedItem[v], t.isItemSelected = !1;
|
|
2949
|
+
}
|
|
2950
|
+
function f(p) {
|
|
2951
|
+
let v = {};
|
|
2952
|
+
return Array.isArray(p) ? (p.forEach((_) => {
|
|
2953
|
+
let g = _[0], b = _[1];
|
|
2954
|
+
v[g] = b;
|
|
2955
|
+
}), v) : p;
|
|
2956
|
+
}
|
|
2957
|
+
return ae(t.formValues, (p) => {
|
|
2958
|
+
Object.entries(p).forEach(([v, _]) => {
|
|
2959
|
+
_ === "" && delete t.formValues[v];
|
|
2960
|
+
});
|
|
2961
|
+
}), ee(async () => {
|
|
2962
|
+
await n.getAdressStructure(), t.addSkel = f(n.state.structure.address);
|
|
2963
|
+
}), (p, v) => {
|
|
2964
|
+
const _ = se("bone");
|
|
2965
|
+
return m(), h(E, null, [
|
|
2966
|
+
i("div", null, [
|
|
2967
|
+
Ul,
|
|
2968
|
+
(m(!0), h(E, null, U(t.addSkel, (g, b) => (m(), h(E, { key: b }, [
|
|
2969
|
+
g.visible && g.params.group === "Customer Info" ? (m(), T(_, {
|
|
2970
|
+
key: 0,
|
|
2971
|
+
is: q(x)(g.type),
|
|
2972
|
+
name: b,
|
|
2973
|
+
structure: f(t.addSkel),
|
|
2974
|
+
errors: t.errors[b] ? t.errors[b] : [],
|
|
2975
|
+
skel: t.formValues,
|
|
2976
|
+
onChange: (y) => u(b, y),
|
|
2977
|
+
class: "viur-shop-form-grid-w-2"
|
|
2978
|
+
}, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : k("", !0)
|
|
2979
|
+
], 64))), 128))
|
|
2980
|
+
]),
|
|
2981
|
+
Tl,
|
|
2982
|
+
(m(!0), h(E, null, U(t.shippingAdressAmount, (g) => (m(), h("div", { key: g }, [
|
|
2983
|
+
i("sl-select", {
|
|
2984
|
+
clearable: "",
|
|
2985
|
+
ref_for: !0,
|
|
2986
|
+
ref_key: "itemSelection",
|
|
2987
|
+
ref: l,
|
|
2988
|
+
onSlChange: (b) => c(b, g),
|
|
2989
|
+
onSlClear: (b) => d(b, g),
|
|
2990
|
+
label: t.selectedItem[g] ? q(n).state.carts[t.selectedItem[g]].info.name : "Warenkorb für Adresse wählen.",
|
|
2991
|
+
class: "grid-w-4"
|
|
2992
|
+
}, [
|
|
2993
|
+
(m(!0), h(E, null, U(q(n).state.carts, (b, y) => (m(), h("sl-option", { value: y }, B(b.info.name), 9, Ml))), 256))
|
|
2994
|
+
], 40, Pl),
|
|
2995
|
+
(m(!0), h(E, null, U(t.addSkel, (b, y) => (m(), h(E, { key: y }, [
|
|
2996
|
+
b.visible && b.params.group === "Customer Address" ? (m(), T(_, {
|
|
2997
|
+
key: 0,
|
|
2998
|
+
is: q(x)(b.type),
|
|
2999
|
+
name: y,
|
|
3000
|
+
structure: f(t.addSkel),
|
|
3001
|
+
errors: t.errors[y] ? t.errors[y] : [],
|
|
3002
|
+
skel: t.formValues,
|
|
3003
|
+
onChange: ($) => u(y, $)
|
|
3004
|
+
}, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : k("", !0)
|
|
3005
|
+
], 64))), 128))
|
|
3006
|
+
]))), 128)),
|
|
3007
|
+
t.isCustomAdress ? (m(), h("div", zl, [
|
|
3008
|
+
Wl,
|
|
3009
|
+
(m(!0), h(E, null, U(t.addSkel, (g, b) => (m(), h(E, { key: b }, [
|
|
3010
|
+
g.visible && g.params.group === "Customer Address" ? (m(), T(_, {
|
|
3011
|
+
key: 0,
|
|
3012
|
+
is: q(x)(g.type),
|
|
3013
|
+
name: b,
|
|
3014
|
+
structure: f(t.addSkel),
|
|
3015
|
+
errors: t.errors[b] ? t.errors[b] : [],
|
|
3016
|
+
skel: t.formValues,
|
|
3017
|
+
onChange: (y) => u(b, y)
|
|
3018
|
+
}, null, 8, ["is", "name", "structure", "errors", "skel", "onChange"])) : k("", !0)
|
|
3019
|
+
], 64))), 128))
|
|
3020
|
+
])) : k("", !0),
|
|
3021
|
+
i("div", { class: "viur-shop-form-btn-wrap" }, [
|
|
3022
|
+
i("sl-button", {
|
|
3023
|
+
size: "medium",
|
|
3024
|
+
onClick: r,
|
|
3025
|
+
title: "Lieferadresse entfernen"
|
|
3026
|
+
}, Fl),
|
|
3027
|
+
i("sl-button", {
|
|
3028
|
+
size: "medium",
|
|
3029
|
+
variant: "primary",
|
|
3030
|
+
onClick: a
|
|
3031
|
+
}, [
|
|
3032
|
+
Kl,
|
|
3033
|
+
O(" Lieferadresse hinzufügen ")
|
|
3034
|
+
])
|
|
3035
|
+
]),
|
|
3036
|
+
i("sl-alert", {
|
|
3037
|
+
variant: "warning",
|
|
3038
|
+
duration: "2000",
|
|
3039
|
+
ref_key: "shippingWarning",
|
|
3040
|
+
ref: s,
|
|
3041
|
+
closable: ""
|
|
3042
|
+
}, [
|
|
3043
|
+
Hl,
|
|
3044
|
+
i("strong", null, B(t.amountAlert.title), 1),
|
|
3045
|
+
Gl,
|
|
3046
|
+
O(" " + B(t.amountAlert.msg), 1)
|
|
3047
|
+
], 512),
|
|
3048
|
+
i("sl-checkbox", {
|
|
3049
|
+
onSlChange: o,
|
|
3050
|
+
checked: ""
|
|
3051
|
+
}, " Rechnungsadresse wie Lieferadresse ", 32)
|
|
3052
|
+
], 64);
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3055
|
+
}, Jl = /* @__PURE__ */ I(Zl, [["__scopeId", "data-v-a4accf28"]]), et = {
|
|
3056
|
+
__name: "ExampleUsage",
|
|
3057
|
+
setup(e) {
|
|
3058
|
+
const n = oe(), t = S(
|
|
3059
|
+
() => n.state.basketRootNode.key ? n.state.basketRootNode.key : ""
|
|
3060
|
+
), l = w({
|
|
3061
|
+
rootNode: {},
|
|
3062
|
+
tabs: {
|
|
3063
|
+
cart: {
|
|
3064
|
+
component: G(we),
|
|
3065
|
+
props: {
|
|
3066
|
+
sidebar: !0,
|
|
3067
|
+
mode: "basket",
|
|
3068
|
+
cartKey: t
|
|
3069
|
+
},
|
|
3070
|
+
// cartKey (on initial call has to be a root node) is a required prop, make sure that cartStore.init() is called before cart is mounted
|
|
3071
|
+
displayName: "Warenkorb",
|
|
3072
|
+
icon: { name: "cart", library: "hsk" },
|
|
3073
|
+
position: 2,
|
|
3074
|
+
disabled: !1,
|
|
3075
|
+
atShow: null,
|
|
3076
|
+
atHide: null
|
|
3077
|
+
},
|
|
3078
|
+
confirm: {
|
|
3079
|
+
component: G(Ee),
|
|
3080
|
+
props: {},
|
|
3081
|
+
displayName: "Bestellung prüfen",
|
|
3082
|
+
icon: { name: "order-check", library: "hsk" },
|
|
3083
|
+
position: 5,
|
|
3084
|
+
disabled: !1,
|
|
3085
|
+
atShow: null,
|
|
3086
|
+
atHide: null
|
|
3087
|
+
},
|
|
3088
|
+
// order: {
|
|
3089
|
+
// component: shallowRef(CategoryView),
|
|
3090
|
+
// props: {
|
|
3091
|
+
// listHandler: ListRequest("categorystore", {
|
|
3092
|
+
// module: "variante",
|
|
3093
|
+
// params: { type: "dk", limit: 99 },
|
|
3094
|
+
// }),
|
|
3095
|
+
// },
|
|
3096
|
+
// displayName: "Artikel Bestellen",
|
|
3097
|
+
// icon: { name: "cart-add", library: "hsk" },
|
|
3098
|
+
// position: 1,
|
|
3099
|
+
// disabled: false,
|
|
3100
|
+
// atShow: null,
|
|
3101
|
+
// atHide: null,
|
|
3102
|
+
// },
|
|
3103
|
+
orderComplete: {
|
|
3104
|
+
component: G(jl),
|
|
3105
|
+
props: {},
|
|
3106
|
+
displayName: "Bestellung Abgeschlossen",
|
|
3107
|
+
icon: { name: "order-confirmed", library: "hsk" },
|
|
3108
|
+
position: 6,
|
|
3109
|
+
disabled: !0,
|
|
3110
|
+
atShow: null,
|
|
3111
|
+
atHide: null
|
|
3112
|
+
},
|
|
3113
|
+
userInfo: {
|
|
3114
|
+
component: G(Ll),
|
|
3115
|
+
props: {},
|
|
3116
|
+
displayName: "Daten Eingeben",
|
|
3117
|
+
icon: { name: "user", library: "hsk" },
|
|
3118
|
+
position: 3,
|
|
3119
|
+
disabled: !1,
|
|
3120
|
+
atShow: null,
|
|
3121
|
+
atHide: null
|
|
3122
|
+
},
|
|
3123
|
+
userInfoMulti: {
|
|
3124
|
+
component: G(Jl),
|
|
3125
|
+
props: {},
|
|
3126
|
+
displayName: "Daten Eingeben (Multi)",
|
|
3127
|
+
icon: { name: "user", library: "hsk" },
|
|
3128
|
+
position: 4,
|
|
3129
|
+
disabled: !1,
|
|
3130
|
+
atShow: null,
|
|
3131
|
+
atHide: null
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
});
|
|
3135
|
+
function s(o) {
|
|
3136
|
+
(o == null ? void 0 : o.detail.name) === "confirm" && (l.tabs.orderComplete.disabled = !1);
|
|
3137
|
+
}
|
|
3138
|
+
return ee(async () => {
|
|
3139
|
+
await n.init(), await n.getAdressStructure(), console.log("debug init exampleusage :", n.state.basketRootNode);
|
|
3140
|
+
}), (o, a) => (m(), T(Sl, {
|
|
3141
|
+
tabs: l.tabs,
|
|
3142
|
+
onTabChange: s
|
|
3143
|
+
}, null, 8, ["tabs"]));
|
|
3144
|
+
}
|
|
3145
|
+
}, Ql = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3146
|
+
__proto__: null,
|
|
3147
|
+
default: et
|
|
3148
|
+
}, Symbol.toStringTag, { value: "Module" })), Yl = D({
|
|
3149
|
+
props: {},
|
|
3150
|
+
components: {},
|
|
3151
|
+
setup(e, n) {
|
|
3152
|
+
const t = bt();
|
|
3153
|
+
return { state: w({}), route: t };
|
|
3154
|
+
}
|
|
3155
|
+
}), Xl = { class: "home" };
|
|
3156
|
+
function xl(e, n, t, l, s, o) {
|
|
3157
|
+
return m(), h("div", Xl, "View " + B(e.route.path) + " is missing.", 1);
|
|
3158
|
+
}
|
|
3159
|
+
const er = /* @__PURE__ */ I(Yl, [["render", xl]]), tr = [
|
|
3160
|
+
{
|
|
3161
|
+
path: "/:pathMatch(.*)*",
|
|
3162
|
+
name: "view_missing",
|
|
3163
|
+
component: er
|
|
3164
|
+
},
|
|
3165
|
+
{
|
|
3166
|
+
path: "/shop/category/:identifier",
|
|
3167
|
+
name: "CategoryView",
|
|
3168
|
+
component: () => import("./CategoryView-C82ANveM.mjs")
|
|
3169
|
+
},
|
|
3170
|
+
{
|
|
3171
|
+
path: "/shop/item/:item",
|
|
3172
|
+
name: "itemView",
|
|
3173
|
+
component: () => import("./ItemView-BqdaEKGW.mjs")
|
|
3174
|
+
},
|
|
3175
|
+
{
|
|
3176
|
+
path: "/shop/cart/view",
|
|
3177
|
+
name: "CartView",
|
|
3178
|
+
component: () => Promise.resolve().then(() => Js)
|
|
3179
|
+
},
|
|
3180
|
+
{
|
|
3181
|
+
path: "/shop/order/",
|
|
3182
|
+
name: "OrderView",
|
|
3183
|
+
component: () => Promise.resolve().then(() => Ql)
|
|
3184
|
+
},
|
|
3185
|
+
{
|
|
3186
|
+
path: "/shop/order/confirm",
|
|
3187
|
+
name: "ConfirmView",
|
|
3188
|
+
component: () => Promise.resolve().then(() => il)
|
|
3189
|
+
}
|
|
3190
|
+
];
|
|
3191
|
+
function ur(e, n = !1) {
|
|
3192
|
+
let t = [];
|
|
3193
|
+
return n ? t = e : t = e.concat(tr), vt({
|
|
3194
|
+
// @ts-ignore
|
|
3195
|
+
history: pt("/"),
|
|
3196
|
+
routes: t
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
const dr = {
|
|
3200
|
+
install(e) {
|
|
3201
|
+
e.component("CartView", we), e.component("ExampleUsage", et), e.component("ConfirmView", Ee);
|
|
3202
|
+
}
|
|
3203
|
+
};
|
|
3204
|
+
export {
|
|
3205
|
+
we as C,
|
|
3206
|
+
dr as V,
|
|
3207
|
+
I as _,
|
|
3208
|
+
et as a,
|
|
3209
|
+
Ee as b,
|
|
3210
|
+
ur as c,
|
|
3211
|
+
oe as u
|
|
3212
|
+
};
|