@jsonschema-editor/vue 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/index.d.ts +389 -0
- package/dist/jsonschema-editor-vue.js +4039 -0
- package/dist/style.css +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,4039 @@
|
|
|
1
|
+
var hn = Object.defineProperty;
|
|
2
|
+
var pn = (e, t, n) => t in e ? hn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var De = (e, t, n) => pn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { StringSchema as te, globalJsonSchemaAttributeRegistry as Ae, ObjectSchema as X, NumberSchema as be, IntegerSchema as $e, BooleanSchema as yt, ArraySchema as Z, CompositionSchema as le, RefSchema as ve, NullSchema as yn, parseDefRef as gn, DEFS_SEGMENT as ie, buildDefRef as Ge, documentFromJSON as bn } from "@jsonschema-editor/json-schema";
|
|
5
|
+
import { SchemaDocument as ka, buildDefRef as xa, documentFromJSON as ja, parseDefRef as _a } from "@jsonschema-editor/json-schema";
|
|
6
|
+
import { scopeToPath as Bt, globalUiSchemaAttributeRegistry as Ie, buildPropertyScope as $n, Category as Ne, Step as Be, Control as de, Group as ue, VerticalLayout as We, HorizontalLayout as Qe, Label as ke, Categorization as et, Stepper as tt } from "@jsonschema-editor/ui-schema";
|
|
7
|
+
import { computed as p, toRaw as Ft, defineComponent as D, openBlock as u, createElementBlock as h, createElementVNode as $, Fragment as N, renderSlot as se, createTextVNode as I, toDisplayString as R, createCommentVNode as P, toRef as Q, useModel as H, createBlock as C, unref as y, withCtx as x, createVNode as w, mergeModels as Y, renderList as F, normalizeClass as re, inject as ce, ref as L, watch as fe, resolveDynamicComponent as St, withModifiers as ye, resolveComponent as Mt, normalizeStyle as Vt, withKeys as Sn, onBeforeUnmount as zt, Teleport as Vn, withDirectives as Ue, vShow as Oe, nextTick as Jt, shallowRef as It, provide as wn, isRef as it } from "vue";
|
|
8
|
+
import { resolveSchemaAtScope as En, resolveCompositionAtScope as Ht, UiSchema as He } from "@jsonschema-editor/ui-schema/bridge";
|
|
9
|
+
class Yt {
|
|
10
|
+
constructor() {
|
|
11
|
+
De(this, "registrations", []);
|
|
12
|
+
De(this, "defaultComponent", null);
|
|
13
|
+
}
|
|
14
|
+
register(t) {
|
|
15
|
+
return this.registrations.push(t), this;
|
|
16
|
+
}
|
|
17
|
+
registerName(t, n, l = 0, r) {
|
|
18
|
+
return this.register({ id: r, matcher: { name: t, priority: l }, component: n });
|
|
19
|
+
}
|
|
20
|
+
registerNames(t, n, l = 0, r) {
|
|
21
|
+
return this.register({ id: r, matcher: { names: t, priority: l }, component: n });
|
|
22
|
+
}
|
|
23
|
+
registerValueType(t, n, l = 0, r) {
|
|
24
|
+
return this.register({ id: r, matcher: { valueType: t, priority: l }, component: n });
|
|
25
|
+
}
|
|
26
|
+
registerMatch(t, n, l = 0, r) {
|
|
27
|
+
return this.register({ id: r, matcher: { match: t, priority: l }, component: n });
|
|
28
|
+
}
|
|
29
|
+
setDefault(t) {
|
|
30
|
+
return this.defaultComponent = t, this;
|
|
31
|
+
}
|
|
32
|
+
unregister(t) {
|
|
33
|
+
const n = this.registrations.length;
|
|
34
|
+
return this.registrations = this.registrations.filter((l) => l.id !== t), this.registrations.length < n;
|
|
35
|
+
}
|
|
36
|
+
resolve(t) {
|
|
37
|
+
const n = [...this.registrations].sort(
|
|
38
|
+
(l, r) => (r.matcher.priority ?? 0) - (l.matcher.priority ?? 0)
|
|
39
|
+
);
|
|
40
|
+
for (const l of n)
|
|
41
|
+
if (this.matches(l.matcher, t))
|
|
42
|
+
return l.component;
|
|
43
|
+
return this.defaultComponent;
|
|
44
|
+
}
|
|
45
|
+
matches(t, n) {
|
|
46
|
+
return t.name !== void 0 && n.attributeName !== t.name || t.names !== void 0 && !t.names.includes(n.attributeName) || t.valueType !== void 0 && we(n.value) !== t.valueType ? !1 : t.match !== void 0 ? t.match(n) : t.name !== void 0 || t.names !== void 0 || t.valueType !== void 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function we(e) {
|
|
50
|
+
return typeof e == "string" ? "string" : typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : Array.isArray(e) ? "array" : "unknown";
|
|
51
|
+
}
|
|
52
|
+
class nt {
|
|
53
|
+
constructor() {
|
|
54
|
+
De(this, "registrations", []);
|
|
55
|
+
De(this, "defaultComponent", null);
|
|
56
|
+
}
|
|
57
|
+
register(t) {
|
|
58
|
+
return this.registrations.push(t), this;
|
|
59
|
+
}
|
|
60
|
+
registerInstanceOf(t, n, l) {
|
|
61
|
+
return this.register({
|
|
62
|
+
id: l == null ? void 0 : l.id,
|
|
63
|
+
matcher: { instanceOf: t, priority: l == null ? void 0 : l.priority },
|
|
64
|
+
component: n
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
registerKind(t, n, l = 0, r) {
|
|
68
|
+
return this.register({ id: r, matcher: { kind: t, priority: l }, component: n });
|
|
69
|
+
}
|
|
70
|
+
registerElementKind(t, n, l = 0, r) {
|
|
71
|
+
return this.register({ id: r, matcher: { elementKind: t, priority: l }, component: n });
|
|
72
|
+
}
|
|
73
|
+
registerMatch(t, n, l = 0, r) {
|
|
74
|
+
return this.register({ id: r, matcher: { match: t, priority: l }, component: n });
|
|
75
|
+
}
|
|
76
|
+
setDefault(t) {
|
|
77
|
+
return this.defaultComponent = t, this;
|
|
78
|
+
}
|
|
79
|
+
unregister(t) {
|
|
80
|
+
const n = this.registrations.length;
|
|
81
|
+
return this.registrations = this.registrations.filter((l) => l.id !== t), this.registrations.length < n;
|
|
82
|
+
}
|
|
83
|
+
list() {
|
|
84
|
+
return this.registrations;
|
|
85
|
+
}
|
|
86
|
+
resolve(t, n) {
|
|
87
|
+
const l = [...this.registrations].sort(
|
|
88
|
+
(r, o) => (o.matcher.priority ?? 0) - (r.matcher.priority ?? 0)
|
|
89
|
+
);
|
|
90
|
+
for (const r of l)
|
|
91
|
+
if (this.matches(r.matcher, t, n))
|
|
92
|
+
return r.component;
|
|
93
|
+
return this.defaultComponent;
|
|
94
|
+
}
|
|
95
|
+
matches(t, n, l) {
|
|
96
|
+
return t.instanceOf !== void 0 && !(n instanceof t.instanceOf) || t.kind !== void 0 && n.kind !== t.kind || t.elementKind !== void 0 && n.elementKind !== t.elementKind ? !1 : t.match !== void 0 ? t.match(n, l) : t.instanceOf !== void 0 || t.kind !== void 0 || t.elementKind !== void 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const wt = new nt(), Et = new nt(), kt = new nt(), xt = new nt(), jt = new Yt(), _t = new Yt(), kn = Symbol("schemaFormTypeRegistry"), xn = Symbol("schemaEditorTypeRegistry"), jn = Symbol("uiFormTypeRegistry"), _n = Symbol("uiEditorTypeRegistry"), Cn = Symbol("schemaAttributeControlRegistry"), Tn = Symbol("uiAttributeControlRegistry"), Rn = Symbol("jsonSchemaAttributeRegistry"), Pn = Symbol("uiSchemaAttributeRegistry");
|
|
100
|
+
function Fe(e, t, n, l) {
|
|
101
|
+
const r = p(() => l.value ?? e.value), o = p(
|
|
102
|
+
() => {
|
|
103
|
+
var s;
|
|
104
|
+
return (n == null ? void 0 : n.value) ?? ((s = r.value) == null ? void 0 : s.title) ?? t.split("/").pop() ?? "Feld";
|
|
105
|
+
}
|
|
106
|
+
), a = p(() => {
|
|
107
|
+
var s;
|
|
108
|
+
return (s = r.value) == null ? void 0 : s.description;
|
|
109
|
+
});
|
|
110
|
+
return { resolvedSchema: r, displayLabel: o, description: a };
|
|
111
|
+
}
|
|
112
|
+
function Pe(e, t, n, l) {
|
|
113
|
+
const r = p(() => Bt(n)), o = p(() => {
|
|
114
|
+
const s = l != null && l.value ? (d) => l.value.resolveRef(d) : void 0;
|
|
115
|
+
return En(e.value, n, s);
|
|
116
|
+
}), a = p({
|
|
117
|
+
get: () => {
|
|
118
|
+
let s = t.value;
|
|
119
|
+
for (const d of r.value) {
|
|
120
|
+
if (s == null || typeof s != "object")
|
|
121
|
+
return;
|
|
122
|
+
s = s[d];
|
|
123
|
+
}
|
|
124
|
+
return s;
|
|
125
|
+
},
|
|
126
|
+
set: (s) => {
|
|
127
|
+
const d = structuredClone(Ft(t.value));
|
|
128
|
+
let i = d;
|
|
129
|
+
for (let c = 0; c < r.value.length - 1; c++) {
|
|
130
|
+
const m = r.value[c];
|
|
131
|
+
(i[m] === void 0 || typeof i[m] != "object" || i[m] === null) && (i[m] = {}), i = i[m];
|
|
132
|
+
}
|
|
133
|
+
i[r.value[r.value.length - 1]] = s, t.value = d;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return { path: r, fieldSchema: o, value: a };
|
|
137
|
+
}
|
|
138
|
+
function ca(e) {
|
|
139
|
+
return e.elementKind === "Control";
|
|
140
|
+
}
|
|
141
|
+
function ma(e) {
|
|
142
|
+
return e.elementKind === "VerticalLayout";
|
|
143
|
+
}
|
|
144
|
+
function fa(e) {
|
|
145
|
+
return e.elementKind === "HorizontalLayout";
|
|
146
|
+
}
|
|
147
|
+
function va(e) {
|
|
148
|
+
return e.elementKind === "Group";
|
|
149
|
+
}
|
|
150
|
+
function ha(e) {
|
|
151
|
+
return e.elementKind === "Label";
|
|
152
|
+
}
|
|
153
|
+
const Dn = ["id", "checked", "disabled"], lt = /* @__PURE__ */ D({
|
|
154
|
+
__name: "JseCheckbox",
|
|
155
|
+
props: {
|
|
156
|
+
modelValue: { type: Boolean },
|
|
157
|
+
disabled: { type: Boolean },
|
|
158
|
+
id: {}
|
|
159
|
+
},
|
|
160
|
+
emits: ["update:modelValue"],
|
|
161
|
+
setup(e) {
|
|
162
|
+
return (t, n) => (u(), h("input", {
|
|
163
|
+
id: e.id,
|
|
164
|
+
class: "jse-checkbox",
|
|
165
|
+
type: "checkbox",
|
|
166
|
+
checked: e.modelValue,
|
|
167
|
+
disabled: e.disabled,
|
|
168
|
+
onChange: n[0] || (n[0] = (l) => t.$emit("update:modelValue", l.target.checked))
|
|
169
|
+
}, null, 40, Dn));
|
|
170
|
+
}
|
|
171
|
+
}), An = { class: "jse-field" }, In = { class: "jse-field__label" }, Un = {
|
|
172
|
+
key: 2,
|
|
173
|
+
class: "jse-field__hint"
|
|
174
|
+
}, Me = /* @__PURE__ */ D({
|
|
175
|
+
__name: "JseSchemaFormField",
|
|
176
|
+
props: {
|
|
177
|
+
label: {},
|
|
178
|
+
description: {},
|
|
179
|
+
boolean: { type: Boolean }
|
|
180
|
+
},
|
|
181
|
+
setup(e) {
|
|
182
|
+
return (t, n) => (u(), h("div", An, [
|
|
183
|
+
$("label", In, [
|
|
184
|
+
e.boolean ? (u(), h(N, { key: 0 }, [
|
|
185
|
+
se(t.$slots, "default"),
|
|
186
|
+
I(" " + R(e.label), 1)
|
|
187
|
+
], 64)) : (u(), h(N, { key: 1 }, [
|
|
188
|
+
I(R(e.label), 1)
|
|
189
|
+
], 64)),
|
|
190
|
+
e.description ? (u(), h("span", Un, R(e.description), 1)) : P("", !0)
|
|
191
|
+
]),
|
|
192
|
+
e.boolean ? P("", !0) : se(t.$slots, "default", { key: 0 })
|
|
193
|
+
]));
|
|
194
|
+
}
|
|
195
|
+
}), ut = /* @__PURE__ */ D({
|
|
196
|
+
__name: "BooleanFormField",
|
|
197
|
+
props: /* @__PURE__ */ Y({
|
|
198
|
+
schema: {},
|
|
199
|
+
scope: {},
|
|
200
|
+
label: {},
|
|
201
|
+
readonly: { type: Boolean }
|
|
202
|
+
}, {
|
|
203
|
+
modelValue: { required: !0 },
|
|
204
|
+
modelModifiers: {}
|
|
205
|
+
}),
|
|
206
|
+
emits: ["update:modelValue"],
|
|
207
|
+
setup(e) {
|
|
208
|
+
const t = e, n = Q(t, "schema"), l = Q(t, "label"), r = H(e, "modelValue"), { fieldSchema: o, value: a } = Pe(n, r, t.scope), { displayLabel: s, description: d } = Fe(
|
|
209
|
+
n,
|
|
210
|
+
t.scope,
|
|
211
|
+
l,
|
|
212
|
+
o
|
|
213
|
+
);
|
|
214
|
+
return (i, c) => (u(), C(Me, {
|
|
215
|
+
boolean: "",
|
|
216
|
+
label: y(s),
|
|
217
|
+
description: y(d)
|
|
218
|
+
}, {
|
|
219
|
+
default: x(() => [
|
|
220
|
+
w(lt, {
|
|
221
|
+
"model-value": y(a),
|
|
222
|
+
disabled: e.readonly,
|
|
223
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => a.value = m)
|
|
224
|
+
}, null, 8, ["model-value", "disabled"])
|
|
225
|
+
]),
|
|
226
|
+
_: 1
|
|
227
|
+
}, 8, ["label", "description"]));
|
|
228
|
+
}
|
|
229
|
+
}), On = ["value", "type", "disabled", "placeholder"], Se = /* @__PURE__ */ D({
|
|
230
|
+
__name: "JseInput",
|
|
231
|
+
props: {
|
|
232
|
+
modelValue: {},
|
|
233
|
+
type: {},
|
|
234
|
+
disabled: { type: Boolean },
|
|
235
|
+
placeholder: {}
|
|
236
|
+
},
|
|
237
|
+
emits: ["update:modelValue"],
|
|
238
|
+
setup(e) {
|
|
239
|
+
return (t, n) => (u(), h("input", {
|
|
240
|
+
class: "jse-input",
|
|
241
|
+
value: e.modelValue,
|
|
242
|
+
type: e.type ?? "text",
|
|
243
|
+
disabled: e.disabled,
|
|
244
|
+
placeholder: e.placeholder,
|
|
245
|
+
onInput: n[0] || (n[0] = (l) => t.$emit("update:modelValue", l.target.value))
|
|
246
|
+
}, null, 40, On));
|
|
247
|
+
}
|
|
248
|
+
}), Kn = ["value", "disabled"], ze = /* @__PURE__ */ D({
|
|
249
|
+
__name: "JseSelect",
|
|
250
|
+
props: {
|
|
251
|
+
modelValue: {},
|
|
252
|
+
disabled: { type: Boolean }
|
|
253
|
+
},
|
|
254
|
+
emits: ["update:modelValue"],
|
|
255
|
+
setup(e, { emit: t }) {
|
|
256
|
+
const n = t;
|
|
257
|
+
function l(o) {
|
|
258
|
+
return o !== "" && !Number.isNaN(Number(o)) && /^\d+$/.test(o) ? Number(o) : o;
|
|
259
|
+
}
|
|
260
|
+
function r(o) {
|
|
261
|
+
const a = o.target;
|
|
262
|
+
n("update:modelValue", l(a.value));
|
|
263
|
+
}
|
|
264
|
+
return (o, a) => (u(), h("select", {
|
|
265
|
+
class: "jse-select",
|
|
266
|
+
value: e.modelValue,
|
|
267
|
+
disabled: e.disabled,
|
|
268
|
+
onChange: a[0] || (a[0] = (s) => r(s))
|
|
269
|
+
}, [
|
|
270
|
+
se(o.$slots, "default")
|
|
271
|
+
], 40, Kn));
|
|
272
|
+
}
|
|
273
|
+
}), Ln = ["value"], Ce = /* @__PURE__ */ D({
|
|
274
|
+
__name: "DefaultFormField",
|
|
275
|
+
props: /* @__PURE__ */ Y({
|
|
276
|
+
schema: {},
|
|
277
|
+
scope: {},
|
|
278
|
+
label: {},
|
|
279
|
+
readonly: { type: Boolean }
|
|
280
|
+
}, {
|
|
281
|
+
modelValue: { required: !0 },
|
|
282
|
+
modelModifiers: {}
|
|
283
|
+
}),
|
|
284
|
+
emits: ["update:modelValue"],
|
|
285
|
+
setup(e) {
|
|
286
|
+
const t = e, n = Q(t, "schema"), l = Q(t, "label"), r = H(e, "modelValue"), { fieldSchema: o, value: a } = Pe(n, r, t.scope), { resolvedSchema: s, displayLabel: d, description: i } = Fe(
|
|
287
|
+
n,
|
|
288
|
+
t.scope,
|
|
289
|
+
l,
|
|
290
|
+
o
|
|
291
|
+
), c = p(() => {
|
|
292
|
+
var V;
|
|
293
|
+
switch ((V = s.value) == null ? void 0 : V.kind) {
|
|
294
|
+
case "integer":
|
|
295
|
+
case "number":
|
|
296
|
+
return "number";
|
|
297
|
+
case "boolean":
|
|
298
|
+
return "checkbox";
|
|
299
|
+
default:
|
|
300
|
+
return "text";
|
|
301
|
+
}
|
|
302
|
+
}), m = p(() => {
|
|
303
|
+
var V;
|
|
304
|
+
return ((V = s.value) == null ? void 0 : V.enumValues) ?? [];
|
|
305
|
+
}), _ = p(() => c.value === "checkbox");
|
|
306
|
+
return (V, j) => (u(), C(Me, {
|
|
307
|
+
boolean: _.value,
|
|
308
|
+
label: y(d),
|
|
309
|
+
description: y(i)
|
|
310
|
+
}, {
|
|
311
|
+
default: x(() => [
|
|
312
|
+
m.value.length ? (u(), C(ze, {
|
|
313
|
+
key: 0,
|
|
314
|
+
"model-value": y(a),
|
|
315
|
+
class: "jse-field__input",
|
|
316
|
+
disabled: e.readonly,
|
|
317
|
+
"onUpdate:modelValue": j[0] || (j[0] = (E) => a.value = E)
|
|
318
|
+
}, {
|
|
319
|
+
default: x(() => [
|
|
320
|
+
(u(!0), h(N, null, F(m.value, (E) => (u(), h("option", {
|
|
321
|
+
key: String(E),
|
|
322
|
+
value: E
|
|
323
|
+
}, R(E), 9, Ln))), 128))
|
|
324
|
+
]),
|
|
325
|
+
_: 1
|
|
326
|
+
}, 8, ["model-value", "disabled"])) : _.value ? (u(), C(lt, {
|
|
327
|
+
key: 1,
|
|
328
|
+
"model-value": y(a),
|
|
329
|
+
class: "jse-field__checkbox",
|
|
330
|
+
disabled: e.readonly,
|
|
331
|
+
"onUpdate:modelValue": j[1] || (j[1] = (E) => a.value = E)
|
|
332
|
+
}, null, 8, ["model-value", "disabled"])) : (u(), C(Se, {
|
|
333
|
+
key: 2,
|
|
334
|
+
"model-value": y(a),
|
|
335
|
+
class: "jse-field__input",
|
|
336
|
+
type: c.value,
|
|
337
|
+
disabled: e.readonly,
|
|
338
|
+
"onUpdate:modelValue": j[2] || (j[2] = (E) => a.value = E)
|
|
339
|
+
}, null, 8, ["model-value", "type", "disabled"]))
|
|
340
|
+
]),
|
|
341
|
+
_: 1
|
|
342
|
+
}, 8, ["boolean", "label", "description"]));
|
|
343
|
+
}
|
|
344
|
+
}), Nn = ["value"], Bn = /* @__PURE__ */ D({
|
|
345
|
+
__name: "EnumFormField",
|
|
346
|
+
props: /* @__PURE__ */ Y({
|
|
347
|
+
schema: {},
|
|
348
|
+
scope: {},
|
|
349
|
+
label: {},
|
|
350
|
+
readonly: { type: Boolean }
|
|
351
|
+
}, {
|
|
352
|
+
modelValue: { required: !0 },
|
|
353
|
+
modelModifiers: {}
|
|
354
|
+
}),
|
|
355
|
+
emits: ["update:modelValue"],
|
|
356
|
+
setup(e) {
|
|
357
|
+
const t = e, n = Q(t, "schema"), l = Q(t, "label"), r = H(e, "modelValue"), { fieldSchema: o, value: a } = Pe(n, r, t.scope), { resolvedSchema: s, displayLabel: d, description: i } = Fe(
|
|
358
|
+
n,
|
|
359
|
+
t.scope,
|
|
360
|
+
l,
|
|
361
|
+
o
|
|
362
|
+
), c = p(() => {
|
|
363
|
+
var m;
|
|
364
|
+
return ((m = s.value) == null ? void 0 : m.enumValues) ?? [];
|
|
365
|
+
});
|
|
366
|
+
return (m, _) => (u(), C(Me, {
|
|
367
|
+
label: y(d),
|
|
368
|
+
description: y(i)
|
|
369
|
+
}, {
|
|
370
|
+
default: x(() => [
|
|
371
|
+
w(ze, {
|
|
372
|
+
"model-value": y(a),
|
|
373
|
+
class: "jse-field__input",
|
|
374
|
+
disabled: e.readonly,
|
|
375
|
+
"onUpdate:modelValue": _[0] || (_[0] = (V) => a.value = V)
|
|
376
|
+
}, {
|
|
377
|
+
default: x(() => [
|
|
378
|
+
(u(!0), h(N, null, F(c.value, (V) => (u(), h("option", {
|
|
379
|
+
key: String(V),
|
|
380
|
+
value: V
|
|
381
|
+
}, R(V), 9, Nn))), 128))
|
|
382
|
+
]),
|
|
383
|
+
_: 1
|
|
384
|
+
}, 8, ["model-value", "disabled"])
|
|
385
|
+
]),
|
|
386
|
+
_: 1
|
|
387
|
+
}, 8, ["label", "description"]));
|
|
388
|
+
}
|
|
389
|
+
}), je = /* @__PURE__ */ D({
|
|
390
|
+
__name: "NumberFormField",
|
|
391
|
+
props: /* @__PURE__ */ Y({
|
|
392
|
+
schema: {},
|
|
393
|
+
scope: {},
|
|
394
|
+
label: {},
|
|
395
|
+
readonly: { type: Boolean }
|
|
396
|
+
}, {
|
|
397
|
+
modelValue: { required: !0 },
|
|
398
|
+
modelModifiers: {}
|
|
399
|
+
}),
|
|
400
|
+
emits: ["update:modelValue"],
|
|
401
|
+
setup(e) {
|
|
402
|
+
const t = e, n = Q(t, "schema"), l = Q(t, "label"), r = H(e, "modelValue"), { fieldSchema: o, value: a } = Pe(n, r, t.scope), { displayLabel: s, description: d } = Fe(
|
|
403
|
+
n,
|
|
404
|
+
t.scope,
|
|
405
|
+
l,
|
|
406
|
+
o
|
|
407
|
+
);
|
|
408
|
+
return (i, c) => (u(), C(Me, {
|
|
409
|
+
label: y(s),
|
|
410
|
+
description: y(d)
|
|
411
|
+
}, {
|
|
412
|
+
default: x(() => [
|
|
413
|
+
w(Se, {
|
|
414
|
+
"model-value": y(a),
|
|
415
|
+
class: "jse-field__input",
|
|
416
|
+
type: "number",
|
|
417
|
+
disabled: e.readonly,
|
|
418
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => a.value = m)
|
|
419
|
+
}, null, 8, ["model-value", "disabled"])
|
|
420
|
+
]),
|
|
421
|
+
_: 1
|
|
422
|
+
}, 8, ["label", "description"]));
|
|
423
|
+
}
|
|
424
|
+
}), dt = /* @__PURE__ */ D({
|
|
425
|
+
__name: "StringFormField",
|
|
426
|
+
props: /* @__PURE__ */ Y({
|
|
427
|
+
schema: {},
|
|
428
|
+
scope: {},
|
|
429
|
+
label: {},
|
|
430
|
+
readonly: { type: Boolean }
|
|
431
|
+
}, {
|
|
432
|
+
modelValue: { required: !0 },
|
|
433
|
+
modelModifiers: {}
|
|
434
|
+
}),
|
|
435
|
+
emits: ["update:modelValue"],
|
|
436
|
+
setup(e) {
|
|
437
|
+
const t = e, n = Q(t, "schema"), l = Q(t, "label"), r = H(e, "modelValue"), { fieldSchema: o, value: a } = Pe(n, r, t.scope), { resolvedSchema: s, displayLabel: d, description: i } = Fe(
|
|
438
|
+
n,
|
|
439
|
+
t.scope,
|
|
440
|
+
l,
|
|
441
|
+
o
|
|
442
|
+
), c = p(() => {
|
|
443
|
+
const m = s.value;
|
|
444
|
+
return m instanceof te ? m.format === "date" ? "date" : m.format === "date-time" ? "datetime-local" : "text" : "text";
|
|
445
|
+
});
|
|
446
|
+
return (m, _) => (u(), C(Me, {
|
|
447
|
+
label: y(d),
|
|
448
|
+
description: y(i)
|
|
449
|
+
}, {
|
|
450
|
+
default: x(() => [
|
|
451
|
+
w(Se, {
|
|
452
|
+
"model-value": y(a),
|
|
453
|
+
class: "jse-field__input",
|
|
454
|
+
type: c.value,
|
|
455
|
+
disabled: e.readonly,
|
|
456
|
+
"onUpdate:modelValue": _[0] || (_[0] = (V) => a.value = V)
|
|
457
|
+
}, null, 8, ["model-value", "type", "disabled"])
|
|
458
|
+
]),
|
|
459
|
+
_: 1
|
|
460
|
+
}, 8, ["label", "description"]));
|
|
461
|
+
}
|
|
462
|
+
}), Fn = ["for"], Mn = { class: "jse-label__text" }, zn = {
|
|
463
|
+
key: 0,
|
|
464
|
+
class: "jse-label__hint"
|
|
465
|
+
}, Le = /* @__PURE__ */ D({
|
|
466
|
+
__name: "JseLabel",
|
|
467
|
+
props: {
|
|
468
|
+
forId: {},
|
|
469
|
+
hint: {}
|
|
470
|
+
},
|
|
471
|
+
setup(e) {
|
|
472
|
+
return (t, n) => (u(), h("label", {
|
|
473
|
+
class: "jse-label",
|
|
474
|
+
for: e.forId
|
|
475
|
+
}, [
|
|
476
|
+
$("span", Mn, [
|
|
477
|
+
se(t.$slots, "default")
|
|
478
|
+
]),
|
|
479
|
+
e.hint ? (u(), h("span", zn, R(e.hint), 1)) : P("", !0)
|
|
480
|
+
], 8, Fn));
|
|
481
|
+
}
|
|
482
|
+
}), me = /* @__PURE__ */ D({
|
|
483
|
+
__name: "JseFormField",
|
|
484
|
+
props: {
|
|
485
|
+
label: {},
|
|
486
|
+
boolean: { type: Boolean }
|
|
487
|
+
},
|
|
488
|
+
setup(e) {
|
|
489
|
+
return (t, n) => (u(), h("div", {
|
|
490
|
+
class: re(["jse-attribute-control", { "jse-attribute-control--boolean": e.boolean }])
|
|
491
|
+
}, [
|
|
492
|
+
e.boolean ? (u(), h(N, { key: 0 }, [
|
|
493
|
+
se(t.$slots, "default"),
|
|
494
|
+
se(t.$slots, "label", {}, () => [
|
|
495
|
+
e.label ? (u(), C(Le, { key: 0 }, {
|
|
496
|
+
default: x(() => [
|
|
497
|
+
I(R(e.label), 1)
|
|
498
|
+
]),
|
|
499
|
+
_: 1
|
|
500
|
+
})) : P("", !0)
|
|
501
|
+
])
|
|
502
|
+
], 64)) : (u(), h(N, { key: 1 }, [
|
|
503
|
+
se(t.$slots, "label", {}, () => [
|
|
504
|
+
e.label ? (u(), C(Le, { key: 0 }, {
|
|
505
|
+
default: x(() => [
|
|
506
|
+
I(R(e.label), 1)
|
|
507
|
+
]),
|
|
508
|
+
_: 1
|
|
509
|
+
})) : P("", !0)
|
|
510
|
+
]),
|
|
511
|
+
se(t.$slots, "default")
|
|
512
|
+
], 64))
|
|
513
|
+
], 2));
|
|
514
|
+
}
|
|
515
|
+
}), Gt = /* @__PURE__ */ D({
|
|
516
|
+
__name: "BooleanAttributeControl",
|
|
517
|
+
props: /* @__PURE__ */ Y({
|
|
518
|
+
label: {},
|
|
519
|
+
readonly: { type: Boolean }
|
|
520
|
+
}, {
|
|
521
|
+
modelValue: { type: Boolean, default: !1 },
|
|
522
|
+
modelModifiers: {}
|
|
523
|
+
}),
|
|
524
|
+
emits: ["update:modelValue"],
|
|
525
|
+
setup(e) {
|
|
526
|
+
const t = H(e, "modelValue");
|
|
527
|
+
return (n, l) => (u(), C(me, {
|
|
528
|
+
label: e.label,
|
|
529
|
+
boolean: ""
|
|
530
|
+
}, {
|
|
531
|
+
default: x(() => [
|
|
532
|
+
w(lt, {
|
|
533
|
+
modelValue: t.value,
|
|
534
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r),
|
|
535
|
+
disabled: e.readonly
|
|
536
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
537
|
+
]),
|
|
538
|
+
_: 1
|
|
539
|
+
}, 8, ["label"]));
|
|
540
|
+
}
|
|
541
|
+
}), Jn = ["value", "rows", "disabled", "placeholder"], gt = /* @__PURE__ */ D({
|
|
542
|
+
__name: "JseTextarea",
|
|
543
|
+
props: {
|
|
544
|
+
modelValue: {},
|
|
545
|
+
rows: {},
|
|
546
|
+
disabled: { type: Boolean },
|
|
547
|
+
placeholder: {}
|
|
548
|
+
},
|
|
549
|
+
emits: ["update:modelValue"],
|
|
550
|
+
setup(e) {
|
|
551
|
+
return (t, n) => (u(), h("textarea", {
|
|
552
|
+
class: "jse-textarea",
|
|
553
|
+
value: e.modelValue,
|
|
554
|
+
rows: e.rows ?? 3,
|
|
555
|
+
disabled: e.disabled,
|
|
556
|
+
placeholder: e.placeholder,
|
|
557
|
+
spellcheck: "false",
|
|
558
|
+
onInput: n[0] || (n[0] = (l) => t.$emit("update:modelValue", l.target.value))
|
|
559
|
+
}, null, 40, Jn));
|
|
560
|
+
}
|
|
561
|
+
}), bt = /* @__PURE__ */ D({
|
|
562
|
+
__name: "JsonAttributeControl",
|
|
563
|
+
props: /* @__PURE__ */ Y({
|
|
564
|
+
label: {},
|
|
565
|
+
readonly: { type: Boolean }
|
|
566
|
+
}, {
|
|
567
|
+
modelValue: { default: "" },
|
|
568
|
+
modelModifiers: {}
|
|
569
|
+
}),
|
|
570
|
+
emits: ["update:modelValue"],
|
|
571
|
+
setup(e) {
|
|
572
|
+
const t = H(e, "modelValue");
|
|
573
|
+
return (n, l) => (u(), C(me, { label: e.label }, {
|
|
574
|
+
default: x(() => [
|
|
575
|
+
w(gt, {
|
|
576
|
+
modelValue: t.value,
|
|
577
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r),
|
|
578
|
+
disabled: e.readonly,
|
|
579
|
+
rows: 3
|
|
580
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
581
|
+
]),
|
|
582
|
+
_: 1
|
|
583
|
+
}, 8, ["label"]));
|
|
584
|
+
}
|
|
585
|
+
}), $t = /* @__PURE__ */ D({
|
|
586
|
+
__name: "NumberAttributeControl",
|
|
587
|
+
props: /* @__PURE__ */ Y({
|
|
588
|
+
label: {},
|
|
589
|
+
readonly: { type: Boolean }
|
|
590
|
+
}, {
|
|
591
|
+
modelValue: {},
|
|
592
|
+
modelModifiers: {}
|
|
593
|
+
}),
|
|
594
|
+
emits: ["update:modelValue"],
|
|
595
|
+
setup(e) {
|
|
596
|
+
const t = H(e, "modelValue");
|
|
597
|
+
return (n, l) => (u(), C(me, { label: e.label }, {
|
|
598
|
+
default: x(() => [
|
|
599
|
+
w(Se, {
|
|
600
|
+
"model-value": t.value ?? "",
|
|
601
|
+
type: "number",
|
|
602
|
+
disabled: e.readonly,
|
|
603
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r === "" ? void 0 : Number(r))
|
|
604
|
+
}, null, 8, ["model-value", "disabled"])
|
|
605
|
+
]),
|
|
606
|
+
_: 1
|
|
607
|
+
}, 8, ["label"]));
|
|
608
|
+
}
|
|
609
|
+
}), ge = /* @__PURE__ */ D({
|
|
610
|
+
__name: "StringAttributeControl",
|
|
611
|
+
props: /* @__PURE__ */ Y({
|
|
612
|
+
label: {},
|
|
613
|
+
readonly: { type: Boolean }
|
|
614
|
+
}, {
|
|
615
|
+
modelValue: { default: "" },
|
|
616
|
+
modelModifiers: {}
|
|
617
|
+
}),
|
|
618
|
+
emits: ["update:modelValue"],
|
|
619
|
+
setup(e) {
|
|
620
|
+
const t = H(e, "modelValue");
|
|
621
|
+
return (n, l) => (u(), C(me, { label: e.label }, {
|
|
622
|
+
default: x(() => [
|
|
623
|
+
w(Se, {
|
|
624
|
+
modelValue: t.value,
|
|
625
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r),
|
|
626
|
+
disabled: e.readonly
|
|
627
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
628
|
+
]),
|
|
629
|
+
_: 1
|
|
630
|
+
}, 8, ["label"]));
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
function Hn() {
|
|
634
|
+
return ce(kn, wt);
|
|
635
|
+
}
|
|
636
|
+
function pa() {
|
|
637
|
+
return ce(xn, Et);
|
|
638
|
+
}
|
|
639
|
+
function Yn() {
|
|
640
|
+
return ce(jn, kt);
|
|
641
|
+
}
|
|
642
|
+
function ya() {
|
|
643
|
+
return ce(_n, xt);
|
|
644
|
+
}
|
|
645
|
+
function Gn() {
|
|
646
|
+
return ce(Cn, jt);
|
|
647
|
+
}
|
|
648
|
+
function qn() {
|
|
649
|
+
return ce(Tn, _t);
|
|
650
|
+
}
|
|
651
|
+
function ga() {
|
|
652
|
+
return ce(Rn, Ae);
|
|
653
|
+
}
|
|
654
|
+
function ba() {
|
|
655
|
+
return ce(Pn, Ie);
|
|
656
|
+
}
|
|
657
|
+
function Xn(e, t) {
|
|
658
|
+
let n = e;
|
|
659
|
+
for (const l of t) {
|
|
660
|
+
if (n == null || typeof n != "object")
|
|
661
|
+
return;
|
|
662
|
+
n = n[l];
|
|
663
|
+
}
|
|
664
|
+
return n;
|
|
665
|
+
}
|
|
666
|
+
function Zn(e, t, n) {
|
|
667
|
+
const l = structuredClone(Ft(e));
|
|
668
|
+
let r = l;
|
|
669
|
+
for (let o = 0; o < t.length - 1; o++) {
|
|
670
|
+
const a = t[o], s = r[a];
|
|
671
|
+
(s === void 0 || typeof s != "object" || s === null) && (r[a] = {}), r = r[a];
|
|
672
|
+
}
|
|
673
|
+
return r[t[t.length - 1]] = n, l;
|
|
674
|
+
}
|
|
675
|
+
function Ye(e) {
|
|
676
|
+
if (e.kind === "object") {
|
|
677
|
+
const t = e, n = {};
|
|
678
|
+
for (const [l, r] of t.properties)
|
|
679
|
+
n[l] = qt(r);
|
|
680
|
+
return n;
|
|
681
|
+
}
|
|
682
|
+
return {};
|
|
683
|
+
}
|
|
684
|
+
function qt(e) {
|
|
685
|
+
if (e.defaultValue !== void 0) return e.defaultValue;
|
|
686
|
+
if (e.constValue !== void 0) return e.constValue;
|
|
687
|
+
switch (e.kind) {
|
|
688
|
+
case "string":
|
|
689
|
+
return "";
|
|
690
|
+
case "number":
|
|
691
|
+
case "integer":
|
|
692
|
+
return 0;
|
|
693
|
+
case "boolean":
|
|
694
|
+
return !1;
|
|
695
|
+
case "array":
|
|
696
|
+
return [];
|
|
697
|
+
case "object": {
|
|
698
|
+
const t = e, n = {};
|
|
699
|
+
for (const [l, r] of t.properties)
|
|
700
|
+
n[l] = qt(r);
|
|
701
|
+
return n;
|
|
702
|
+
}
|
|
703
|
+
case "composition": {
|
|
704
|
+
const t = e, n = {};
|
|
705
|
+
for (const r of t.allOf)
|
|
706
|
+
r.kind === "object" && Object.assign(n, Ye(r));
|
|
707
|
+
const l = t.oneOf[0] ?? t.anyOf[0];
|
|
708
|
+
return (l == null ? void 0 : l.kind) === "object" && Object.assign(n, Ye(l)), Object.keys(n).length > 0 ? n : Ye(t.branches[0] ?? e);
|
|
709
|
+
}
|
|
710
|
+
default:
|
|
711
|
+
return null;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
const Wn = {
|
|
715
|
+
key: 0,
|
|
716
|
+
class: "jse-group jse-oneof-field"
|
|
717
|
+
}, Qn = { key: 0 }, el = {
|
|
718
|
+
key: 1,
|
|
719
|
+
class: "jse-field"
|
|
720
|
+
}, tl = ["value"], nl = /* @__PURE__ */ D({
|
|
721
|
+
__name: "OneOfFormField",
|
|
722
|
+
props: /* @__PURE__ */ Y({
|
|
723
|
+
schema: {},
|
|
724
|
+
document: {},
|
|
725
|
+
scope: {},
|
|
726
|
+
label: {},
|
|
727
|
+
readonly: { type: Boolean }
|
|
728
|
+
}, {
|
|
729
|
+
modelValue: { required: !0 },
|
|
730
|
+
modelModifiers: {}
|
|
731
|
+
}),
|
|
732
|
+
emits: ["update:modelValue"],
|
|
733
|
+
setup(e) {
|
|
734
|
+
const t = e, n = H(e, "modelValue"), l = p(() => {
|
|
735
|
+
var f;
|
|
736
|
+
return ((f = t.document) == null ? void 0 : f.root) ?? t.schema;
|
|
737
|
+
}), r = p(() => Bt(t.scope)), o = p(() => Ht(l.value, t.scope)), a = p(() => {
|
|
738
|
+
const f = o.value;
|
|
739
|
+
return f ? f.oneOf.length > 0 ? f.oneOf : f.anyOf : [];
|
|
740
|
+
}), s = p(
|
|
741
|
+
() => a.value.map((f, b) => (t.document ? t.document.resolveNode(f) : f).title ?? f.title ?? `Option ${b + 1}`)
|
|
742
|
+
), d = L(0);
|
|
743
|
+
function i(f) {
|
|
744
|
+
const b = t.document ? t.document.resolveNode(f) : f;
|
|
745
|
+
return b instanceof X ? [...b.properties.keys()] : [];
|
|
746
|
+
}
|
|
747
|
+
function c(f) {
|
|
748
|
+
const b = a.value[f];
|
|
749
|
+
return t.document ? t.document.resolveNode(b) : b;
|
|
750
|
+
}
|
|
751
|
+
function m(f) {
|
|
752
|
+
const b = Xn(f, r.value);
|
|
753
|
+
return b && typeof b == "object" && !Array.isArray(b) ? b : {};
|
|
754
|
+
}
|
|
755
|
+
function _(f) {
|
|
756
|
+
for (let v = 0; v < a.value.length; v++) {
|
|
757
|
+
const B = c(v);
|
|
758
|
+
if (!(B instanceof X)) continue;
|
|
759
|
+
const U = [...B.properties.entries()].filter(
|
|
760
|
+
([, O]) => O.constValue !== void 0
|
|
761
|
+
);
|
|
762
|
+
if (U.length > 0 && U.every(([O, q]) => f[O] === q.constValue))
|
|
763
|
+
return v;
|
|
764
|
+
}
|
|
765
|
+
const b = a.value.map(i);
|
|
766
|
+
for (let v = 0; v < a.value.length; v++)
|
|
767
|
+
if (b[v].filter(
|
|
768
|
+
(U) => b.filter((O, q) => q !== v).every((O) => !O.includes(U))
|
|
769
|
+
).some((U) => U in f)) return v;
|
|
770
|
+
for (let v = 0; v < a.value.length; v++)
|
|
771
|
+
if (i(a.value[v]).some((B) => B in f))
|
|
772
|
+
return v;
|
|
773
|
+
return 0;
|
|
774
|
+
}
|
|
775
|
+
fe(
|
|
776
|
+
() => n.value,
|
|
777
|
+
(f) => {
|
|
778
|
+
d.value = _(m(f));
|
|
779
|
+
},
|
|
780
|
+
{ immediate: !0, deep: !0 }
|
|
781
|
+
);
|
|
782
|
+
const V = p(() => {
|
|
783
|
+
const f = a.value[d.value];
|
|
784
|
+
if (f)
|
|
785
|
+
return t.document ? t.document.resolveNode(f) : f;
|
|
786
|
+
}), j = p(() => {
|
|
787
|
+
const f = V.value;
|
|
788
|
+
return f instanceof X ? [...f.properties.entries()] : [];
|
|
789
|
+
});
|
|
790
|
+
function E(f) {
|
|
791
|
+
if (r.value.length === 0) {
|
|
792
|
+
n.value = f;
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
n.value = Zn(n.value, r.value, f);
|
|
796
|
+
}
|
|
797
|
+
function z(f) {
|
|
798
|
+
const b = Number(f);
|
|
799
|
+
if (Number.isNaN(b) || b < 0 || b >= a.value.length) return;
|
|
800
|
+
d.value = b;
|
|
801
|
+
const v = m(n.value), B = new Set(a.value.flatMap(i)), U = {};
|
|
802
|
+
for (const [q, S] of Object.entries(v))
|
|
803
|
+
B.has(q) || (U[q] = S);
|
|
804
|
+
const O = Ye(c(b));
|
|
805
|
+
E(
|
|
806
|
+
typeof O == "object" && O !== null && !Array.isArray(O) ? { ...U, ...O } : U
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
return (f, b) => o.value && V.value ? (u(), h("fieldset", Wn, [
|
|
810
|
+
e.label ? (u(), h("legend", Qn, R(e.label), 1)) : P("", !0),
|
|
811
|
+
a.value.length > 1 ? (u(), h("div", el, [
|
|
812
|
+
w(Le, null, {
|
|
813
|
+
default: x(() => [...b[1] || (b[1] = [
|
|
814
|
+
I("Typ", -1)
|
|
815
|
+
])]),
|
|
816
|
+
_: 1
|
|
817
|
+
}),
|
|
818
|
+
w(ze, {
|
|
819
|
+
"model-value": d.value,
|
|
820
|
+
class: "jse-field__input",
|
|
821
|
+
disabled: e.readonly,
|
|
822
|
+
"onUpdate:modelValue": z
|
|
823
|
+
}, {
|
|
824
|
+
default: x(() => [
|
|
825
|
+
(u(!0), h(N, null, F(s.value, (v, B) => (u(), h("option", {
|
|
826
|
+
key: B,
|
|
827
|
+
value: B
|
|
828
|
+
}, R(v), 9, tl))), 128))
|
|
829
|
+
]),
|
|
830
|
+
_: 1
|
|
831
|
+
}, 8, ["model-value", "disabled"])
|
|
832
|
+
])) : P("", !0),
|
|
833
|
+
(u(!0), h(N, null, F(j.value, ([v, B]) => (u(), C(Ct, {
|
|
834
|
+
key: `${d.value}-${v}`,
|
|
835
|
+
modelValue: n.value,
|
|
836
|
+
"onUpdate:modelValue": b[0] || (b[0] = (U) => n.value = U),
|
|
837
|
+
schema: V.value,
|
|
838
|
+
document: e.document,
|
|
839
|
+
scope: y($n)("#", v),
|
|
840
|
+
label: B.title ?? v,
|
|
841
|
+
readonly: e.readonly
|
|
842
|
+
}, null, 8, ["modelValue", "schema", "document", "scope", "label", "readonly"]))), 128))
|
|
843
|
+
])) : P("", !0);
|
|
844
|
+
}
|
|
845
|
+
}), Ct = /* @__PURE__ */ D({
|
|
846
|
+
__name: "SchemaFormFieldResolver",
|
|
847
|
+
props: /* @__PURE__ */ Y({
|
|
848
|
+
schema: {},
|
|
849
|
+
document: {},
|
|
850
|
+
scope: {},
|
|
851
|
+
label: {},
|
|
852
|
+
readonly: { type: Boolean }
|
|
853
|
+
}, {
|
|
854
|
+
modelValue: { required: !0 },
|
|
855
|
+
modelModifiers: {}
|
|
856
|
+
}),
|
|
857
|
+
emits: ["update:modelValue"],
|
|
858
|
+
setup(e) {
|
|
859
|
+
const t = e, n = Q(t, "schema"), l = Q(t, "document"), r = H(e, "modelValue"), o = Hn(), { fieldSchema: a } = Pe(n, r, t.scope, l), s = p(() => Ht(t.schema, t.scope)), d = p(() => {
|
|
860
|
+
if (s.value) return nl;
|
|
861
|
+
const i = a.value ?? t.schema;
|
|
862
|
+
return o.resolve(i) ?? Ce;
|
|
863
|
+
});
|
|
864
|
+
return (i, c) => (u(), C(St(d.value), {
|
|
865
|
+
modelValue: r.value,
|
|
866
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => r.value = m),
|
|
867
|
+
schema: e.schema,
|
|
868
|
+
document: e.document,
|
|
869
|
+
scope: e.scope,
|
|
870
|
+
label: e.label,
|
|
871
|
+
readonly: e.readonly
|
|
872
|
+
}, null, 8, ["modelValue", "schema", "document", "scope", "label", "readonly"]));
|
|
873
|
+
}
|
|
874
|
+
}), Te = /* @__PURE__ */ D({
|
|
875
|
+
__name: "ControlUiElement",
|
|
876
|
+
props: /* @__PURE__ */ Y({
|
|
877
|
+
element: {},
|
|
878
|
+
schema: {},
|
|
879
|
+
document: {},
|
|
880
|
+
readonly: { type: Boolean }
|
|
881
|
+
}, {
|
|
882
|
+
modelValue: { required: !0 },
|
|
883
|
+
modelModifiers: {}
|
|
884
|
+
}),
|
|
885
|
+
emits: ["update:modelValue"],
|
|
886
|
+
setup(e) {
|
|
887
|
+
const t = H(e, "modelValue");
|
|
888
|
+
return (n, l) => (u(), C(Ct, {
|
|
889
|
+
modelValue: t.value,
|
|
890
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r),
|
|
891
|
+
schema: e.schema,
|
|
892
|
+
document: e.document,
|
|
893
|
+
scope: e.element.scope,
|
|
894
|
+
label: e.element.label,
|
|
895
|
+
readonly: e.readonly
|
|
896
|
+
}, null, 8, ["modelValue", "schema", "document", "scope", "label", "readonly"]));
|
|
897
|
+
}
|
|
898
|
+
}), xe = /* @__PURE__ */ D({
|
|
899
|
+
__name: "UiFormElementResolver",
|
|
900
|
+
props: /* @__PURE__ */ Y({
|
|
901
|
+
element: {},
|
|
902
|
+
schema: {},
|
|
903
|
+
document: {},
|
|
904
|
+
readonly: { type: Boolean }
|
|
905
|
+
}, {
|
|
906
|
+
modelValue: { required: !0 },
|
|
907
|
+
modelModifiers: {}
|
|
908
|
+
}),
|
|
909
|
+
emits: ["update:modelValue"],
|
|
910
|
+
setup(e) {
|
|
911
|
+
const t = e, n = H(e, "modelValue"), l = Yn(), r = p(
|
|
912
|
+
() => l.resolve(t.element) ?? Te
|
|
913
|
+
);
|
|
914
|
+
return (o, a) => (u(), C(St(r.value), {
|
|
915
|
+
modelValue: n.value,
|
|
916
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => n.value = s),
|
|
917
|
+
element: e.element,
|
|
918
|
+
schema: e.schema,
|
|
919
|
+
document: e.document,
|
|
920
|
+
readonly: e.readonly
|
|
921
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]));
|
|
922
|
+
}
|
|
923
|
+
}), ll = { class: "jse-group" }, rl = { key: 0 }, ct = /* @__PURE__ */ D({
|
|
924
|
+
__name: "GroupUiElement",
|
|
925
|
+
props: /* @__PURE__ */ Y({
|
|
926
|
+
element: {},
|
|
927
|
+
schema: {},
|
|
928
|
+
document: {},
|
|
929
|
+
readonly: { type: Boolean }
|
|
930
|
+
}, {
|
|
931
|
+
modelValue: { required: !0 },
|
|
932
|
+
modelModifiers: {}
|
|
933
|
+
}),
|
|
934
|
+
emits: ["update:modelValue"],
|
|
935
|
+
setup(e) {
|
|
936
|
+
const t = H(e, "modelValue");
|
|
937
|
+
return (n, l) => (u(), h("fieldset", ll, [
|
|
938
|
+
e.element.label ? (u(), h("legend", rl, R(e.element.label), 1)) : P("", !0),
|
|
939
|
+
(u(!0), h(N, null, F(e.element.elements, (r, o) => (u(), C(xe, {
|
|
940
|
+
key: o,
|
|
941
|
+
modelValue: t.value,
|
|
942
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
|
|
943
|
+
element: r,
|
|
944
|
+
schema: e.schema,
|
|
945
|
+
document: e.document,
|
|
946
|
+
readonly: e.readonly
|
|
947
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]))), 128))
|
|
948
|
+
]));
|
|
949
|
+
}
|
|
950
|
+
}), ol = { class: "jse-label" }, mt = /* @__PURE__ */ D({
|
|
951
|
+
__name: "LabelUiElement",
|
|
952
|
+
props: /* @__PURE__ */ Y({
|
|
953
|
+
element: {},
|
|
954
|
+
schema: {},
|
|
955
|
+
readonly: { type: Boolean }
|
|
956
|
+
}, {
|
|
957
|
+
modelValue: { required: !0 },
|
|
958
|
+
modelModifiers: {}
|
|
959
|
+
}),
|
|
960
|
+
emits: ["update:modelValue"],
|
|
961
|
+
setup(e) {
|
|
962
|
+
return H(e, "modelValue"), (t, n) => (u(), h("p", ol, R(e.element.text), 1));
|
|
963
|
+
}
|
|
964
|
+
}), _e = /* @__PURE__ */ D({
|
|
965
|
+
__name: "LayoutUiElement",
|
|
966
|
+
props: /* @__PURE__ */ Y({
|
|
967
|
+
element: {},
|
|
968
|
+
schema: {},
|
|
969
|
+
document: {},
|
|
970
|
+
readonly: { type: Boolean }
|
|
971
|
+
}, {
|
|
972
|
+
modelValue: { required: !0 },
|
|
973
|
+
modelModifiers: {}
|
|
974
|
+
}),
|
|
975
|
+
emits: ["update:modelValue"],
|
|
976
|
+
setup(e) {
|
|
977
|
+
const t = H(e, "modelValue");
|
|
978
|
+
return (n, l) => (u(), h("div", {
|
|
979
|
+
class: re(
|
|
980
|
+
e.element.elementKind === "HorizontalLayout" ? "jse-layout jse-layout--horizontal" : "jse-layout"
|
|
981
|
+
)
|
|
982
|
+
}, [
|
|
983
|
+
(u(!0), h(N, null, F(e.element.elements, (r, o) => (u(), C(xe, {
|
|
984
|
+
key: o,
|
|
985
|
+
modelValue: t.value,
|
|
986
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
|
|
987
|
+
element: r,
|
|
988
|
+
schema: e.schema,
|
|
989
|
+
document: e.document,
|
|
990
|
+
readonly: e.readonly
|
|
991
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]))), 128))
|
|
992
|
+
], 2));
|
|
993
|
+
}
|
|
994
|
+
}), al = { class: "jse-tabs-wrap" }, sl = {
|
|
995
|
+
class: "jse-tabs",
|
|
996
|
+
role: "tablist"
|
|
997
|
+
}, il = ["aria-selected", "aria-controls", "id", "onClick"], ul = {
|
|
998
|
+
key: 0,
|
|
999
|
+
class: "jse-tabs__description"
|
|
1000
|
+
}, Xt = /* @__PURE__ */ D({
|
|
1001
|
+
__name: "JseTabs",
|
|
1002
|
+
props: {
|
|
1003
|
+
modelValue: {},
|
|
1004
|
+
tabs: {},
|
|
1005
|
+
panelIdPrefix: {}
|
|
1006
|
+
},
|
|
1007
|
+
emits: ["update:modelValue"],
|
|
1008
|
+
setup(e) {
|
|
1009
|
+
const t = e, n = p(() => t.panelIdPrefix ?? "jse-tabpanel"), l = p(
|
|
1010
|
+
() => {
|
|
1011
|
+
var o;
|
|
1012
|
+
return (o = t.tabs.find((a) => a.id === t.modelValue)) == null ? void 0 : o.description;
|
|
1013
|
+
}
|
|
1014
|
+
);
|
|
1015
|
+
function r(o) {
|
|
1016
|
+
return `${n.value}-${o}`;
|
|
1017
|
+
}
|
|
1018
|
+
return (o, a) => (u(), h("div", al, [
|
|
1019
|
+
$("div", sl, [
|
|
1020
|
+
(u(!0), h(N, null, F(e.tabs, (s) => (u(), h("button", {
|
|
1021
|
+
key: s.id,
|
|
1022
|
+
type: "button",
|
|
1023
|
+
role: "tab",
|
|
1024
|
+
class: re(["jse-tabs__tab", { "jse-tabs__tab--active": e.modelValue === s.id }]),
|
|
1025
|
+
"aria-selected": e.modelValue === s.id,
|
|
1026
|
+
"aria-controls": r(s.id),
|
|
1027
|
+
id: `${n.value}-tab-${s.id}`,
|
|
1028
|
+
onClick: (d) => o.$emit("update:modelValue", s.id)
|
|
1029
|
+
}, R(s.label), 11, il))), 128))
|
|
1030
|
+
]),
|
|
1031
|
+
l.value ? (u(), h("p", ul, R(l.value), 1)) : P("", !0)
|
|
1032
|
+
]));
|
|
1033
|
+
}
|
|
1034
|
+
}), dl = { class: "jse-categorization" }, cl = {
|
|
1035
|
+
key: 1,
|
|
1036
|
+
class: "jse-categorization__panel"
|
|
1037
|
+
}, ft = /* @__PURE__ */ D({
|
|
1038
|
+
__name: "CategorizationUiElement",
|
|
1039
|
+
props: /* @__PURE__ */ Y({
|
|
1040
|
+
element: {},
|
|
1041
|
+
schema: {},
|
|
1042
|
+
document: {},
|
|
1043
|
+
readonly: { type: Boolean }
|
|
1044
|
+
}, {
|
|
1045
|
+
modelValue: { required: !0 },
|
|
1046
|
+
modelModifiers: {}
|
|
1047
|
+
}),
|
|
1048
|
+
emits: ["update:modelValue"],
|
|
1049
|
+
setup(e) {
|
|
1050
|
+
const t = e, n = H(e, "modelValue"), l = L("0"), r = p(
|
|
1051
|
+
() => t.element.elements.filter((s) => s instanceof Ne)
|
|
1052
|
+
), o = p(
|
|
1053
|
+
() => r.value.map((s, d) => ({
|
|
1054
|
+
id: String(d),
|
|
1055
|
+
label: s.label ?? `Kategorie ${d + 1}`
|
|
1056
|
+
}))
|
|
1057
|
+
), a = p(
|
|
1058
|
+
() => r.value[Number(l.value)] ?? r.value[0]
|
|
1059
|
+
);
|
|
1060
|
+
return (s, d) => (u(), h("div", dl, [
|
|
1061
|
+
o.value.length > 1 ? (u(), C(Xt, {
|
|
1062
|
+
key: 0,
|
|
1063
|
+
modelValue: l.value,
|
|
1064
|
+
"onUpdate:modelValue": d[0] || (d[0] = (i) => l.value = i),
|
|
1065
|
+
tabs: o.value
|
|
1066
|
+
}, null, 8, ["modelValue", "tabs"])) : P("", !0),
|
|
1067
|
+
a.value ? (u(), h("div", cl, [
|
|
1068
|
+
(u(!0), h(N, null, F(a.value.elements, (i, c) => (u(), C(xe, {
|
|
1069
|
+
key: c,
|
|
1070
|
+
modelValue: n.value,
|
|
1071
|
+
"onUpdate:modelValue": d[1] || (d[1] = (m) => n.value = m),
|
|
1072
|
+
element: i,
|
|
1073
|
+
schema: e.schema,
|
|
1074
|
+
document: e.document,
|
|
1075
|
+
readonly: e.readonly
|
|
1076
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]))), 128))
|
|
1077
|
+
])) : P("", !0)
|
|
1078
|
+
]));
|
|
1079
|
+
}
|
|
1080
|
+
}), ml = { class: "jse-category" }, fl = {
|
|
1081
|
+
key: 0,
|
|
1082
|
+
class: "jse-category__title"
|
|
1083
|
+
}, vt = /* @__PURE__ */ D({
|
|
1084
|
+
__name: "CategoryUiElement",
|
|
1085
|
+
props: /* @__PURE__ */ Y({
|
|
1086
|
+
element: {},
|
|
1087
|
+
schema: {},
|
|
1088
|
+
document: {},
|
|
1089
|
+
readonly: { type: Boolean }
|
|
1090
|
+
}, {
|
|
1091
|
+
modelValue: { required: !0 },
|
|
1092
|
+
modelModifiers: {}
|
|
1093
|
+
}),
|
|
1094
|
+
emits: ["update:modelValue"],
|
|
1095
|
+
setup(e) {
|
|
1096
|
+
const t = H(e, "modelValue");
|
|
1097
|
+
return (n, l) => (u(), h("section", ml, [
|
|
1098
|
+
e.element.label ? (u(), h("h3", fl, R(e.element.label), 1)) : P("", !0),
|
|
1099
|
+
(u(!0), h(N, null, F(e.element.elements, (r, o) => (u(), C(xe, {
|
|
1100
|
+
key: o,
|
|
1101
|
+
modelValue: t.value,
|
|
1102
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
|
|
1103
|
+
element: r,
|
|
1104
|
+
schema: e.schema,
|
|
1105
|
+
document: e.document,
|
|
1106
|
+
readonly: e.readonly
|
|
1107
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]))), 128))
|
|
1108
|
+
]));
|
|
1109
|
+
}
|
|
1110
|
+
}), vl = ["type", "disabled"], J = /* @__PURE__ */ D({
|
|
1111
|
+
__name: "JseButton",
|
|
1112
|
+
props: {
|
|
1113
|
+
type: {},
|
|
1114
|
+
variant: {},
|
|
1115
|
+
disabled: { type: Boolean }
|
|
1116
|
+
},
|
|
1117
|
+
emits: ["click"],
|
|
1118
|
+
setup(e) {
|
|
1119
|
+
return (t, n) => (u(), h("button", {
|
|
1120
|
+
class: re(["jse-btn", { "jse-btn--danger": e.variant === "danger" }]),
|
|
1121
|
+
type: e.type ?? "button",
|
|
1122
|
+
disabled: e.disabled,
|
|
1123
|
+
onClick: n[0] || (n[0] = (l) => t.$emit("click"))
|
|
1124
|
+
}, [
|
|
1125
|
+
se(t.$slots, "default")
|
|
1126
|
+
], 10, vl));
|
|
1127
|
+
}
|
|
1128
|
+
}), hl = { class: "jse-stepper" }, pl = {
|
|
1129
|
+
class: "jse-stepper__steps",
|
|
1130
|
+
role: "list"
|
|
1131
|
+
}, yl = ["aria-current", "onClick"], gl = { class: "jse-stepper__step-number" }, bl = { class: "jse-stepper__step-label" }, $l = {
|
|
1132
|
+
key: 0,
|
|
1133
|
+
class: "jse-stepper__panel"
|
|
1134
|
+
}, Sl = {
|
|
1135
|
+
key: 1,
|
|
1136
|
+
class: "jse-stepper__nav"
|
|
1137
|
+
}, ht = /* @__PURE__ */ D({
|
|
1138
|
+
__name: "StepperUiElement",
|
|
1139
|
+
props: /* @__PURE__ */ Y({
|
|
1140
|
+
element: {},
|
|
1141
|
+
schema: {},
|
|
1142
|
+
document: {},
|
|
1143
|
+
readonly: { type: Boolean }
|
|
1144
|
+
}, {
|
|
1145
|
+
modelValue: { required: !0 },
|
|
1146
|
+
modelModifiers: {}
|
|
1147
|
+
}),
|
|
1148
|
+
emits: ["update:modelValue"],
|
|
1149
|
+
setup(e) {
|
|
1150
|
+
const t = e, n = H(e, "modelValue"), l = L(0), r = p(
|
|
1151
|
+
() => t.element.elements.filter((m) => m instanceof Be)
|
|
1152
|
+
), o = p(
|
|
1153
|
+
() => r.value[l.value] ?? r.value[0]
|
|
1154
|
+
), a = p(() => l.value <= 0), s = p(() => l.value >= r.value.length - 1);
|
|
1155
|
+
function d(m) {
|
|
1156
|
+
m < 0 || m >= r.value.length || (l.value = m);
|
|
1157
|
+
}
|
|
1158
|
+
function i() {
|
|
1159
|
+
d(l.value - 1);
|
|
1160
|
+
}
|
|
1161
|
+
function c() {
|
|
1162
|
+
d(l.value + 1);
|
|
1163
|
+
}
|
|
1164
|
+
return (m, _) => (u(), h("div", hl, [
|
|
1165
|
+
$("ol", pl, [
|
|
1166
|
+
(u(!0), h(N, null, F(r.value, (V, j) => (u(), h("li", {
|
|
1167
|
+
key: j,
|
|
1168
|
+
class: re(["jse-stepper__step-indicator", {
|
|
1169
|
+
"jse-stepper__step-indicator--active": j === l.value,
|
|
1170
|
+
"jse-stepper__step-indicator--done": j < l.value
|
|
1171
|
+
}])
|
|
1172
|
+
}, [
|
|
1173
|
+
$("button", {
|
|
1174
|
+
type: "button",
|
|
1175
|
+
class: "jse-stepper__step-button",
|
|
1176
|
+
"aria-current": j === l.value ? "step" : void 0,
|
|
1177
|
+
onClick: (E) => d(j)
|
|
1178
|
+
}, [
|
|
1179
|
+
$("span", gl, R(j + 1), 1),
|
|
1180
|
+
$("span", bl, R(V.label ?? `Schritt ${j + 1}`), 1)
|
|
1181
|
+
], 8, yl)
|
|
1182
|
+
], 2))), 128))
|
|
1183
|
+
]),
|
|
1184
|
+
o.value ? (u(), h("div", $l, [
|
|
1185
|
+
(u(!0), h(N, null, F(o.value.elements, (V, j) => (u(), C(xe, {
|
|
1186
|
+
key: j,
|
|
1187
|
+
modelValue: n.value,
|
|
1188
|
+
"onUpdate:modelValue": _[0] || (_[0] = (E) => n.value = E),
|
|
1189
|
+
element: V,
|
|
1190
|
+
schema: e.schema,
|
|
1191
|
+
document: e.document,
|
|
1192
|
+
readonly: e.readonly
|
|
1193
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]))), 128))
|
|
1194
|
+
])) : P("", !0),
|
|
1195
|
+
r.value.length > 1 ? (u(), h("div", Sl, [
|
|
1196
|
+
w(J, {
|
|
1197
|
+
type: "button",
|
|
1198
|
+
disabled: a.value || e.readonly,
|
|
1199
|
+
onClick: i
|
|
1200
|
+
}, {
|
|
1201
|
+
default: x(() => [..._[1] || (_[1] = [
|
|
1202
|
+
I(" Zurück ", -1)
|
|
1203
|
+
])]),
|
|
1204
|
+
_: 1
|
|
1205
|
+
}, 8, ["disabled"]),
|
|
1206
|
+
w(J, {
|
|
1207
|
+
type: "button",
|
|
1208
|
+
disabled: s.value || e.readonly,
|
|
1209
|
+
onClick: c
|
|
1210
|
+
}, {
|
|
1211
|
+
default: x(() => [..._[2] || (_[2] = [
|
|
1212
|
+
I(" Weiter ", -1)
|
|
1213
|
+
])]),
|
|
1214
|
+
_: 1
|
|
1215
|
+
}, 8, ["disabled"])
|
|
1216
|
+
])) : P("", !0)
|
|
1217
|
+
]));
|
|
1218
|
+
}
|
|
1219
|
+
}), Vl = { class: "jse-step" }, wl = {
|
|
1220
|
+
key: 0,
|
|
1221
|
+
class: "jse-step__title"
|
|
1222
|
+
}, pt = /* @__PURE__ */ D({
|
|
1223
|
+
__name: "StepUiElement",
|
|
1224
|
+
props: /* @__PURE__ */ Y({
|
|
1225
|
+
element: {},
|
|
1226
|
+
schema: {},
|
|
1227
|
+
document: {},
|
|
1228
|
+
readonly: { type: Boolean }
|
|
1229
|
+
}, {
|
|
1230
|
+
modelValue: { required: !0 },
|
|
1231
|
+
modelModifiers: {}
|
|
1232
|
+
}),
|
|
1233
|
+
emits: ["update:modelValue"],
|
|
1234
|
+
setup(e) {
|
|
1235
|
+
const t = H(e, "modelValue");
|
|
1236
|
+
return (n, l) => (u(), h("section", Vl, [
|
|
1237
|
+
e.element.label ? (u(), h("h3", wl, R(e.element.label), 1)) : P("", !0),
|
|
1238
|
+
(u(!0), h(N, null, F(e.element.elements, (r, o) => (u(), C(xe, {
|
|
1239
|
+
key: o,
|
|
1240
|
+
modelValue: t.value,
|
|
1241
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => t.value = a),
|
|
1242
|
+
element: r,
|
|
1243
|
+
schema: e.schema,
|
|
1244
|
+
document: e.document,
|
|
1245
|
+
readonly: e.readonly
|
|
1246
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]))), 128))
|
|
1247
|
+
]));
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1250
|
+
let Ut = !1;
|
|
1251
|
+
function El() {
|
|
1252
|
+
Ut || (Ut = !0, kl(), xl(), jl(), _l());
|
|
1253
|
+
}
|
|
1254
|
+
function kl() {
|
|
1255
|
+
wt.registerMatch(
|
|
1256
|
+
(e) => {
|
|
1257
|
+
var t;
|
|
1258
|
+
return !!((t = e.enumValues) != null && t.length);
|
|
1259
|
+
},
|
|
1260
|
+
Bn,
|
|
1261
|
+
20,
|
|
1262
|
+
"schema-form-enum"
|
|
1263
|
+
).registerInstanceOf(te, dt, { id: "schema-form-string" }).registerInstanceOf(be, je, { id: "schema-form-number" }).registerInstanceOf($e, je, { id: "schema-form-integer" }).registerInstanceOf(yt, ut, { id: "schema-form-boolean" }).registerKind("string", dt, 0, "schema-form-kind-string").registerKind("number", je, 0, "schema-form-kind-number").registerKind("integer", je, 0, "schema-form-kind-integer").registerKind("boolean", ut, 0, "schema-form-kind-boolean").setDefault(Ce), Et.registerInstanceOf(X, Ce, { id: "schema-editor-object" }).registerInstanceOf(Z, Ce, { id: "schema-editor-array" }).registerInstanceOf(le, Ce, {
|
|
1264
|
+
id: "schema-editor-composition"
|
|
1265
|
+
}).registerInstanceOf(te, dt, { id: "schema-editor-string" }).registerInstanceOf(be, je, { id: "schema-editor-number" }).registerInstanceOf($e, je, { id: "schema-editor-integer" }).registerInstanceOf(yt, ut, { id: "schema-editor-boolean" }).setDefault(Ce);
|
|
1266
|
+
}
|
|
1267
|
+
function xl() {
|
|
1268
|
+
kt.registerInstanceOf(de, Te, { id: "ui-form-control-class", priority: 10 }).registerInstanceOf(ue, ct, { id: "ui-form-group-class", priority: 10 }).registerInstanceOf(We, _e, {
|
|
1269
|
+
id: "ui-form-vertical-class",
|
|
1270
|
+
priority: 10
|
|
1271
|
+
}).registerInstanceOf(Qe, _e, {
|
|
1272
|
+
id: "ui-form-horizontal-class",
|
|
1273
|
+
priority: 10
|
|
1274
|
+
}).registerInstanceOf(ke, mt, { id: "ui-form-label-class", priority: 10 }).registerInstanceOf(et, ft, {
|
|
1275
|
+
id: "ui-form-categorization-class",
|
|
1276
|
+
priority: 10
|
|
1277
|
+
}).registerInstanceOf(Ne, vt, { id: "ui-form-category-class", priority: 10 }).registerInstanceOf(tt, ht, { id: "ui-form-stepper-class", priority: 10 }).registerInstanceOf(Be, pt, { id: "ui-form-step-class", priority: 10 }).registerElementKind("Control", Te, 5, "ui-form-control-kind").registerElementKind("Group", ct, 5, "ui-form-group-kind").registerElementKind("VerticalLayout", _e, 5, "ui-form-vertical-kind").registerElementKind("HorizontalLayout", _e, 5, "ui-form-horizontal-kind").registerElementKind("Label", mt, 5, "ui-form-label-kind").registerElementKind("Categorization", ft, 5, "ui-form-categorization-kind").registerElementKind("Category", vt, 5, "ui-form-category-kind").registerElementKind("Stepper", ht, 5, "ui-form-stepper-kind").registerElementKind("Step", pt, 5, "ui-form-step-kind").setDefault(Te), xt.registerElementKind("Control", Te, 10, "ui-editor-control").registerElementKind("Group", ct, 10, "ui-editor-group").registerElementKind("VerticalLayout", _e, 10, "ui-editor-vertical").registerElementKind("HorizontalLayout", _e, 10, "ui-editor-horizontal").registerElementKind("Label", mt, 10, "ui-editor-label").registerElementKind("Categorization", ft, 10, "ui-editor-categorization").registerElementKind("Category", vt, 10, "ui-editor-category").registerElementKind("Stepper", ht, 10, "ui-editor-stepper").registerElementKind("Step", pt, 10, "ui-editor-step").setDefault(Te);
|
|
1278
|
+
}
|
|
1279
|
+
function jl() {
|
|
1280
|
+
jt.registerNames(
|
|
1281
|
+
["title", "description", "pattern", "format"],
|
|
1282
|
+
ge,
|
|
1283
|
+
10,
|
|
1284
|
+
"schema-attr-string"
|
|
1285
|
+
).registerNames(
|
|
1286
|
+
["minLength", "maxLength", "minimum", "maximum", "minItems", "maxItems"],
|
|
1287
|
+
$t,
|
|
1288
|
+
10,
|
|
1289
|
+
"schema-attr-number"
|
|
1290
|
+
).registerNames(["enum", "examples"], bt, 10, "schema-attr-json").registerMatch(
|
|
1291
|
+
(e) => Ae.isRegistered(e.attributeName) && we(e.value) === "number",
|
|
1292
|
+
$t,
|
|
1293
|
+
8,
|
|
1294
|
+
"schema-custom-number"
|
|
1295
|
+
).registerMatch(
|
|
1296
|
+
(e) => Ae.isRegistered(e.attributeName) && we(e.value) === "boolean",
|
|
1297
|
+
Gt,
|
|
1298
|
+
8,
|
|
1299
|
+
"schema-custom-boolean"
|
|
1300
|
+
).registerMatch(
|
|
1301
|
+
(e) => Ae.isRegistered(e.attributeName) && we(e.value) === "array",
|
|
1302
|
+
bt,
|
|
1303
|
+
8,
|
|
1304
|
+
"schema-custom-array"
|
|
1305
|
+
).registerMatch(
|
|
1306
|
+
(e) => Ae.isRegistered(e.attributeName),
|
|
1307
|
+
ge,
|
|
1308
|
+
1,
|
|
1309
|
+
"schema-custom-string"
|
|
1310
|
+
).setDefault(ge);
|
|
1311
|
+
}
|
|
1312
|
+
function _l() {
|
|
1313
|
+
_t.registerNames(["scope", "label", "text"], ge, 10, "ui-attr-string").registerMatch(
|
|
1314
|
+
(e) => !!Ie.get(e.attributeName) && we(e.value) === "number",
|
|
1315
|
+
$t,
|
|
1316
|
+
8,
|
|
1317
|
+
"ui-custom-number"
|
|
1318
|
+
).registerMatch(
|
|
1319
|
+
(e) => !!Ie.get(e.attributeName) && we(e.value) === "boolean",
|
|
1320
|
+
Gt,
|
|
1321
|
+
8,
|
|
1322
|
+
"ui-custom-boolean"
|
|
1323
|
+
).registerMatch(
|
|
1324
|
+
(e) => !!Ie.get(e.attributeName) && we(e.value) === "array",
|
|
1325
|
+
bt,
|
|
1326
|
+
8,
|
|
1327
|
+
"ui-custom-array"
|
|
1328
|
+
).registerMatch(
|
|
1329
|
+
(e) => !!Ie.get(e.attributeName),
|
|
1330
|
+
ge,
|
|
1331
|
+
1,
|
|
1332
|
+
"ui-custom-string"
|
|
1333
|
+
).setDefault(ge);
|
|
1334
|
+
}
|
|
1335
|
+
El();
|
|
1336
|
+
const Zt = /* @__PURE__ */ D({
|
|
1337
|
+
name: "UiElementRenderer",
|
|
1338
|
+
__name: "UiElementRenderer",
|
|
1339
|
+
props: /* @__PURE__ */ Y({
|
|
1340
|
+
element: {},
|
|
1341
|
+
schema: {},
|
|
1342
|
+
document: {},
|
|
1343
|
+
readonly: { type: Boolean }
|
|
1344
|
+
}, {
|
|
1345
|
+
modelValue: { required: !0 },
|
|
1346
|
+
modelModifiers: {}
|
|
1347
|
+
}),
|
|
1348
|
+
emits: ["update:modelValue"],
|
|
1349
|
+
setup(e) {
|
|
1350
|
+
const t = H(e, "modelValue");
|
|
1351
|
+
return (n, l) => (u(), C(xe, {
|
|
1352
|
+
modelValue: t.value,
|
|
1353
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r),
|
|
1354
|
+
element: e.element,
|
|
1355
|
+
schema: e.schema,
|
|
1356
|
+
document: e.document,
|
|
1357
|
+
readonly: e.readonly
|
|
1358
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"]));
|
|
1359
|
+
}
|
|
1360
|
+
}), Cl = /* @__PURE__ */ D({
|
|
1361
|
+
__name: "JsonSchemaForm",
|
|
1362
|
+
props: /* @__PURE__ */ Y({
|
|
1363
|
+
schema: {},
|
|
1364
|
+
uiSchema: {},
|
|
1365
|
+
readonly: { type: Boolean }
|
|
1366
|
+
}, {
|
|
1367
|
+
modelValue: { required: !0 },
|
|
1368
|
+
modelModifiers: {}
|
|
1369
|
+
}),
|
|
1370
|
+
emits: ["update:modelValue"],
|
|
1371
|
+
setup(e) {
|
|
1372
|
+
const t = e, n = H(e, "modelValue"), l = p(() => t.uiSchema.root);
|
|
1373
|
+
return (r, o) => (u(), h("form", {
|
|
1374
|
+
class: "jse-form",
|
|
1375
|
+
onSubmit: o[1] || (o[1] = ye(() => {
|
|
1376
|
+
}, ["prevent"]))
|
|
1377
|
+
}, [
|
|
1378
|
+
w(Zt, {
|
|
1379
|
+
modelValue: n.value,
|
|
1380
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => n.value = a),
|
|
1381
|
+
element: l.value,
|
|
1382
|
+
schema: e.schema.root,
|
|
1383
|
+
document: e.schema,
|
|
1384
|
+
readonly: e.readonly
|
|
1385
|
+
}, null, 8, ["modelValue", "element", "schema", "document", "readonly"])
|
|
1386
|
+
], 32));
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
function Tl(e) {
|
|
1390
|
+
return e instanceof X || e instanceof le || e instanceof Z;
|
|
1391
|
+
}
|
|
1392
|
+
const Wt = [
|
|
1393
|
+
"string",
|
|
1394
|
+
"number",
|
|
1395
|
+
"integer",
|
|
1396
|
+
"boolean",
|
|
1397
|
+
"null"
|
|
1398
|
+
], Qt = ["date", "date-time"], Rl = {
|
|
1399
|
+
date: "date",
|
|
1400
|
+
"date-time": "date-time"
|
|
1401
|
+
}, en = ["object", "array"], tn = [
|
|
1402
|
+
...Wt,
|
|
1403
|
+
...Qt,
|
|
1404
|
+
...en
|
|
1405
|
+
], Ot = [...tn], Pl = [...tn];
|
|
1406
|
+
function nn(e) {
|
|
1407
|
+
return e === "date" ? "date" : e === "date-time" ? "date-time" : null;
|
|
1408
|
+
}
|
|
1409
|
+
const Dl = /* @__PURE__ */ new Set(["prefixItems", "items"]);
|
|
1410
|
+
function Tt(e) {
|
|
1411
|
+
if (e.length < 2) return null;
|
|
1412
|
+
const t = e[e.length - 1], n = e[e.length - 2];
|
|
1413
|
+
return !Dl.has(n) || !/^\d+$/.test(t) ? null : {
|
|
1414
|
+
arrayPath: e.slice(0, -2),
|
|
1415
|
+
keyword: n,
|
|
1416
|
+
index: Number(t)
|
|
1417
|
+
};
|
|
1418
|
+
}
|
|
1419
|
+
function Ee(e) {
|
|
1420
|
+
return e.length ? e.join(".") : "root";
|
|
1421
|
+
}
|
|
1422
|
+
function Kt(e, t, n) {
|
|
1423
|
+
if (t.length === 0) return e;
|
|
1424
|
+
let l = e, r = 0;
|
|
1425
|
+
for (; r < t.length; ) {
|
|
1426
|
+
if (l instanceof ve && n) {
|
|
1427
|
+
const s = n(l.ref);
|
|
1428
|
+
s && (l = s);
|
|
1429
|
+
}
|
|
1430
|
+
const o = t[r];
|
|
1431
|
+
if (o === "prefixItems") {
|
|
1432
|
+
if (!(l instanceof Z))
|
|
1433
|
+
throw new Error("Ungültiger Pfad: prefixItems");
|
|
1434
|
+
const s = Number(t[r + 1]), d = l.getPrefixItem(s);
|
|
1435
|
+
if (!d) throw new Error(`Ungültiger Pfad: prefixItems[${s}]`);
|
|
1436
|
+
l = d, r += 2;
|
|
1437
|
+
continue;
|
|
1438
|
+
}
|
|
1439
|
+
if (o === "items") {
|
|
1440
|
+
if (!(l instanceof Z))
|
|
1441
|
+
throw new Error("Ungültiger Pfad: items");
|
|
1442
|
+
const s = t[r + 1];
|
|
1443
|
+
if (s !== void 0 && /^\d+$/.test(s) && l.itemsMode === "tuple") {
|
|
1444
|
+
const d = l.getPrefixItem(Number(s));
|
|
1445
|
+
if (!d) throw new Error(`Ungültiger Pfad: items[${s}]`);
|
|
1446
|
+
l = d, r += 2;
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
if (!l.items)
|
|
1450
|
+
throw new Error("Ungültiger Pfad: items");
|
|
1451
|
+
l = l.items, r += 1;
|
|
1452
|
+
continue;
|
|
1453
|
+
}
|
|
1454
|
+
if (o === "allOf" || o === "anyOf" || o === "oneOf") {
|
|
1455
|
+
if (!(l instanceof le))
|
|
1456
|
+
throw new Error(`Ungültiger Pfad: ${o}`);
|
|
1457
|
+
const s = Number(t[r + 1]);
|
|
1458
|
+
l = (o === "allOf" ? l.allOf : o === "anyOf" ? l.anyOf : l.oneOf)[s], r += 2;
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
if (l instanceof le) {
|
|
1462
|
+
const s = l.mergeToObject();
|
|
1463
|
+
s && (l = s);
|
|
1464
|
+
}
|
|
1465
|
+
if (!(l instanceof X))
|
|
1466
|
+
throw new Error(`Ungültiger Pfad: ${o}`);
|
|
1467
|
+
const a = l.getProperty(o);
|
|
1468
|
+
if (!a) throw new Error(`Eigenschaft nicht gefunden: ${o}`);
|
|
1469
|
+
l = a, r += 1;
|
|
1470
|
+
}
|
|
1471
|
+
return l;
|
|
1472
|
+
}
|
|
1473
|
+
function ln(e) {
|
|
1474
|
+
if (e instanceof te) {
|
|
1475
|
+
const t = nn(e.format);
|
|
1476
|
+
if (t) return t;
|
|
1477
|
+
}
|
|
1478
|
+
return e.kind;
|
|
1479
|
+
}
|
|
1480
|
+
function Al(e, t) {
|
|
1481
|
+
const n = [];
|
|
1482
|
+
if (e instanceof X)
|
|
1483
|
+
for (const [l] of e.properties)
|
|
1484
|
+
n.push([...t, l]);
|
|
1485
|
+
if (e instanceof le) {
|
|
1486
|
+
for (let l = 0; l < e.allOf.length; l++)
|
|
1487
|
+
n.push([...t, "allOf", String(l)]);
|
|
1488
|
+
for (let l = 0; l < e.anyOf.length; l++)
|
|
1489
|
+
n.push([...t, "anyOf", String(l)]);
|
|
1490
|
+
for (let l = 0; l < e.oneOf.length; l++)
|
|
1491
|
+
n.push([...t, "oneOf", String(l)]);
|
|
1492
|
+
}
|
|
1493
|
+
if (e instanceof Z)
|
|
1494
|
+
if (e.itemsMode === "tuple") {
|
|
1495
|
+
const l = e.tupleKeyword;
|
|
1496
|
+
for (let r = 0; r < e.prefixItems.length; r++)
|
|
1497
|
+
n.push([...t, l, String(r)]);
|
|
1498
|
+
e.items && l === "prefixItems" && n.push([...t, "items"]);
|
|
1499
|
+
} else e.items && n.push([...t, "items"]);
|
|
1500
|
+
return n;
|
|
1501
|
+
}
|
|
1502
|
+
function rt(e) {
|
|
1503
|
+
switch (e) {
|
|
1504
|
+
case "object":
|
|
1505
|
+
return new X();
|
|
1506
|
+
case "array":
|
|
1507
|
+
return new Z();
|
|
1508
|
+
case "number":
|
|
1509
|
+
return new be();
|
|
1510
|
+
case "integer":
|
|
1511
|
+
return new $e();
|
|
1512
|
+
case "boolean":
|
|
1513
|
+
return new yt();
|
|
1514
|
+
case "null":
|
|
1515
|
+
return new yn();
|
|
1516
|
+
case "composition":
|
|
1517
|
+
return new le();
|
|
1518
|
+
case "date":
|
|
1519
|
+
case "date-time": {
|
|
1520
|
+
const t = new te();
|
|
1521
|
+
return t.format = Rl[e], t;
|
|
1522
|
+
}
|
|
1523
|
+
default:
|
|
1524
|
+
return new te();
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
function pe(e, t, n) {
|
|
1528
|
+
if (t.length === 0) return n.clone();
|
|
1529
|
+
const [l, ...r] = t;
|
|
1530
|
+
if (l === "prefixItems") {
|
|
1531
|
+
if (!(e instanceof Z)) throw new Error("Kein Array");
|
|
1532
|
+
const s = Number(r[0]), d = e.clone(), i = d.getPrefixItem(s);
|
|
1533
|
+
if (!i) throw new Error(`Tuple-Element prefixItems[${s}] fehlt`);
|
|
1534
|
+
const c = r.length > 1 ? pe(i, r.slice(1), n) : n.clone();
|
|
1535
|
+
return d.setPrefixItem(s, c), d;
|
|
1536
|
+
}
|
|
1537
|
+
if (l === "items") {
|
|
1538
|
+
if (!(e instanceof Z)) throw new Error("Kein Array");
|
|
1539
|
+
const s = e.clone();
|
|
1540
|
+
if (r.length > 0 && /^\d+$/.test(r[0]) && s.itemsMode === "tuple") {
|
|
1541
|
+
const d = Number(r[0]), i = s.getPrefixItem(d);
|
|
1542
|
+
if (!i) throw new Error(`Tuple-Element items[${d}] fehlt`);
|
|
1543
|
+
const c = r.length > 1 ? pe(i, r.slice(1), n) : n.clone();
|
|
1544
|
+
return s.setPrefixItem(d, c), s;
|
|
1545
|
+
}
|
|
1546
|
+
return s.setItems(pe(s.items, r, n)), s;
|
|
1547
|
+
}
|
|
1548
|
+
if (l === "allOf" || l === "anyOf" || l === "oneOf") {
|
|
1549
|
+
if (!(e instanceof le)) throw new Error("Keine Komposition");
|
|
1550
|
+
const s = Number(r[0]), d = l, i = e.clone(), c = i.getBranch(d, s);
|
|
1551
|
+
if (!c) throw new Error(`Zweig ${d}[${s}] fehlt`);
|
|
1552
|
+
const m = r.length > 1 ? pe(c, r.slice(1), n) : n.clone();
|
|
1553
|
+
return i.setBranch(d, s, m), i;
|
|
1554
|
+
}
|
|
1555
|
+
if (e instanceof le) {
|
|
1556
|
+
const s = e.mergeToObject();
|
|
1557
|
+
if (s) return pe(s, t, n);
|
|
1558
|
+
}
|
|
1559
|
+
if (!(e instanceof X)) throw new Error("Kein Objekt");
|
|
1560
|
+
const o = e.clone(), a = o.getProperty(l);
|
|
1561
|
+
if (!a) throw new Error(`Eigenschaft ${l} fehlt`);
|
|
1562
|
+
return o.setProperty(
|
|
1563
|
+
l,
|
|
1564
|
+
r.length ? pe(a, r, n) : n.clone(),
|
|
1565
|
+
o.isPropertyRequired(l)
|
|
1566
|
+
), o;
|
|
1567
|
+
}
|
|
1568
|
+
function Rt(e) {
|
|
1569
|
+
let t = e.propertyCount + 1, n = `field${t}`;
|
|
1570
|
+
for (; e.getProperty(n); )
|
|
1571
|
+
t += 1, n = `field${t}`;
|
|
1572
|
+
return n;
|
|
1573
|
+
}
|
|
1574
|
+
function rn(e) {
|
|
1575
|
+
return e.items ? ln(e.items) : void 0;
|
|
1576
|
+
}
|
|
1577
|
+
function ot(e) {
|
|
1578
|
+
return e.length === 1 && e[0] === ie;
|
|
1579
|
+
}
|
|
1580
|
+
function at(e) {
|
|
1581
|
+
return e.length === 2 && e[0] === ie;
|
|
1582
|
+
}
|
|
1583
|
+
function W(e, t) {
|
|
1584
|
+
const n = (l) => e.resolveRef(l);
|
|
1585
|
+
if (t.length >= 2 && t[0] === ie) {
|
|
1586
|
+
const l = t[1], r = e.getDef(l);
|
|
1587
|
+
if (!r) throw new Error(`Definition nicht gefunden: ${l}`);
|
|
1588
|
+
return t.length === 2 ? r : Kt(r, t.slice(2), n);
|
|
1589
|
+
}
|
|
1590
|
+
return Kt(e.root, t, n);
|
|
1591
|
+
}
|
|
1592
|
+
function Re(e, t) {
|
|
1593
|
+
try {
|
|
1594
|
+
return W(e, t);
|
|
1595
|
+
} catch {
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
function Ve(e, t) {
|
|
1600
|
+
return Re(e, t) !== void 0;
|
|
1601
|
+
}
|
|
1602
|
+
function on(e, t) {
|
|
1603
|
+
if (ot(t))
|
|
1604
|
+
return e.listDefNames().map((n) => [ie, n]);
|
|
1605
|
+
try {
|
|
1606
|
+
const n = W(e, t), l = n instanceof ve ? e.resolveNode(n) : n, r = Al(l, t), o = r.filter((a) => Ve(e, a));
|
|
1607
|
+
return o.length < r.length && fetch("http://127.0.0.1:7253/ingest/89292584-bc94-485e-a1bb-b6d2d881ebc7", {
|
|
1608
|
+
method: "POST",
|
|
1609
|
+
headers: { "Content-Type": "application/json", "X-Debug-Session-Id": "76abc3" },
|
|
1610
|
+
body: JSON.stringify({
|
|
1611
|
+
sessionId: "76abc3",
|
|
1612
|
+
hypothesisId: "A",
|
|
1613
|
+
location: "schema-document.ts:listDocumentChildren",
|
|
1614
|
+
message: "filtered invalid child paths",
|
|
1615
|
+
data: {
|
|
1616
|
+
parentPath: t,
|
|
1617
|
+
dropped: r.filter((a) => !o.includes(a))
|
|
1618
|
+
},
|
|
1619
|
+
timestamp: Date.now()
|
|
1620
|
+
})
|
|
1621
|
+
}).catch(() => {
|
|
1622
|
+
}), o;
|
|
1623
|
+
} catch {
|
|
1624
|
+
return [];
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
function ne(e, t, n) {
|
|
1628
|
+
const l = e.clone();
|
|
1629
|
+
if (t.length >= 2 && t[0] === ie) {
|
|
1630
|
+
const r = t[1], o = t.slice(2);
|
|
1631
|
+
if (o.length === 0)
|
|
1632
|
+
l.setDef(r, n.clone());
|
|
1633
|
+
else {
|
|
1634
|
+
const a = l.getDef(r);
|
|
1635
|
+
if (!a) throw new Error(`Definition nicht gefunden: ${r}`);
|
|
1636
|
+
l.setDef(r, pe(a, o, n));
|
|
1637
|
+
}
|
|
1638
|
+
return l;
|
|
1639
|
+
}
|
|
1640
|
+
return t.length === 0 ? (l.root = n.clone(), l) : (l.root = pe(l.root, t, n), l);
|
|
1641
|
+
}
|
|
1642
|
+
function an(e) {
|
|
1643
|
+
let t = e.listDefNames().length + 1, n = `Type${t}`;
|
|
1644
|
+
for (; e.hasDef(n); )
|
|
1645
|
+
t += 1, n = `Type${t}`;
|
|
1646
|
+
return n;
|
|
1647
|
+
}
|
|
1648
|
+
function Il(e, t = "object", n) {
|
|
1649
|
+
const l = (n == null ? void 0 : n.trim()) || an(e);
|
|
1650
|
+
if (!l || e.hasDef(l)) return e;
|
|
1651
|
+
const r = e.clone();
|
|
1652
|
+
return r.setDef(l, rt(t)), r;
|
|
1653
|
+
}
|
|
1654
|
+
function Ul(e, t) {
|
|
1655
|
+
if (!e.hasDef(t)) return e;
|
|
1656
|
+
const n = e.clone();
|
|
1657
|
+
return n.removeDef(t), n;
|
|
1658
|
+
}
|
|
1659
|
+
function Ol(e, t, n) {
|
|
1660
|
+
const l = e.clone();
|
|
1661
|
+
return l.renameDef(t, n.trim()) ? l : e;
|
|
1662
|
+
}
|
|
1663
|
+
function Kl(e, t, n = "string", l) {
|
|
1664
|
+
const r = W(e, t);
|
|
1665
|
+
if (!(r instanceof X)) throw new Error("Kein Objekt");
|
|
1666
|
+
const o = (l == null ? void 0 : l.trim()) || Rt(r);
|
|
1667
|
+
if (!o || r.getProperty(o)) return e;
|
|
1668
|
+
const a = r.clone();
|
|
1669
|
+
return a.setProperty(o, rt(n)), ne(e, t, a);
|
|
1670
|
+
}
|
|
1671
|
+
function Ll(e, t, n, l) {
|
|
1672
|
+
if (!e.hasDef(n)) return e;
|
|
1673
|
+
const r = W(e, t);
|
|
1674
|
+
if (!(r instanceof X)) throw new Error("Kein Objekt");
|
|
1675
|
+
const o = (l == null ? void 0 : l.trim()) || Rt(r);
|
|
1676
|
+
if (!o || r.getProperty(o)) return e;
|
|
1677
|
+
const a = r.clone();
|
|
1678
|
+
return a.setProperty(o, new ve(Ge(n, e.defsKey))), ne(e, t, a);
|
|
1679
|
+
}
|
|
1680
|
+
function Nl(e, t, n) {
|
|
1681
|
+
const l = W(e, t);
|
|
1682
|
+
if (!(l instanceof le)) {
|
|
1683
|
+
const a = new le();
|
|
1684
|
+
a.addBranch(n, l.clone());
|
|
1685
|
+
const s = new X();
|
|
1686
|
+
return s.title = "Variante 2", a.addBranch(n, s), ne(e, t, a);
|
|
1687
|
+
}
|
|
1688
|
+
const r = l.clone(), o = new X();
|
|
1689
|
+
return o.title = `Variante ${r.getChildren().length + 1}`, r.addBranch(n, o), ne(e, t, r);
|
|
1690
|
+
}
|
|
1691
|
+
function Bl(e, t, n, l) {
|
|
1692
|
+
if (!e.hasDef(l)) return e;
|
|
1693
|
+
const r = W(e, t);
|
|
1694
|
+
if (!(r instanceof le)) {
|
|
1695
|
+
const a = new le();
|
|
1696
|
+
return a.addBranch(n, r.clone()), a.addBranch(n, new ve(Ge(l, e.defsKey))), ne(e, t, a);
|
|
1697
|
+
}
|
|
1698
|
+
const o = r.clone();
|
|
1699
|
+
return o.addBranch(n, new ve(Ge(l, e.defsKey))), ne(e, t, o);
|
|
1700
|
+
}
|
|
1701
|
+
function Fl(e, t) {
|
|
1702
|
+
if (t.length === 0) return e;
|
|
1703
|
+
if (at(t))
|
|
1704
|
+
return Ul(e, t[1]);
|
|
1705
|
+
const n = t.slice(0, -1), l = t[t.length - 1], r = Tt(t);
|
|
1706
|
+
if (r) {
|
|
1707
|
+
const s = W(e, r.arrayPath);
|
|
1708
|
+
if (!(s instanceof Z)) return e;
|
|
1709
|
+
const d = s.clone();
|
|
1710
|
+
return d.removePrefixItem(r.index), ne(e, r.arrayPath, d);
|
|
1711
|
+
}
|
|
1712
|
+
if (l === "items") {
|
|
1713
|
+
const s = W(e, n);
|
|
1714
|
+
if (!(s instanceof Z)) return e;
|
|
1715
|
+
const d = s.clone();
|
|
1716
|
+
return d.clearItems(), ne(e, n, d);
|
|
1717
|
+
}
|
|
1718
|
+
if (t.length >= 2 && (t[t.length - 2] === "allOf" || t[t.length - 2] === "anyOf" || t[t.length - 2] === "oneOf") && /^\d+$/.test(l)) {
|
|
1719
|
+
const s = t[t.length - 2], d = t.slice(0, -2), i = W(e, d);
|
|
1720
|
+
if (!(i instanceof le)) return e;
|
|
1721
|
+
const c = i.clone();
|
|
1722
|
+
return c.removeBranch(s, Number(l)), ne(e, d, c);
|
|
1723
|
+
}
|
|
1724
|
+
const a = W(e, n);
|
|
1725
|
+
if (a instanceof X) {
|
|
1726
|
+
const s = a.clone();
|
|
1727
|
+
return s.removeProperty(l), ne(e, n, s);
|
|
1728
|
+
}
|
|
1729
|
+
return e;
|
|
1730
|
+
}
|
|
1731
|
+
function sn(e, t, n) {
|
|
1732
|
+
const l = W(e, t), r = rt(n);
|
|
1733
|
+
return r.title = l.title, r.description = l.description, ne(e, t, r);
|
|
1734
|
+
}
|
|
1735
|
+
function Ml(e, t, n) {
|
|
1736
|
+
if (!e.hasDef(n)) return e;
|
|
1737
|
+
const l = W(e, t), r = new ve(Ge(n, e.defsKey));
|
|
1738
|
+
return r.title = l.title, r.description = l.description, ne(e, t, r);
|
|
1739
|
+
}
|
|
1740
|
+
function un(e, t, n) {
|
|
1741
|
+
const l = W(e, t);
|
|
1742
|
+
if (!(l instanceof Z)) throw new Error("Kein Array");
|
|
1743
|
+
const r = l.clone();
|
|
1744
|
+
return r.setItems(rt(n)), ne(e, t, r);
|
|
1745
|
+
}
|
|
1746
|
+
function zl(e, t, n) {
|
|
1747
|
+
const r = W(e, t).clone();
|
|
1748
|
+
return n(r), ne(e, t, r);
|
|
1749
|
+
}
|
|
1750
|
+
function Jl(e, t, n, l) {
|
|
1751
|
+
const r = l.trim();
|
|
1752
|
+
if (!r || r === n) return e;
|
|
1753
|
+
const o = W(e, t);
|
|
1754
|
+
if (!(o instanceof X)) return e;
|
|
1755
|
+
const a = o.getProperty(n);
|
|
1756
|
+
if (!a || o.getProperty(r)) return e;
|
|
1757
|
+
const s = o.clone();
|
|
1758
|
+
return s.setProperty(r, a.clone(), o.isPropertyRequired(n)), s.removeProperty(n), ne(e, t, s);
|
|
1759
|
+
}
|
|
1760
|
+
function Hl(e, t, n) {
|
|
1761
|
+
if (t.length === 0) return e;
|
|
1762
|
+
const l = t[t.length - 1], r = t.slice(0, -1), o = W(e, r);
|
|
1763
|
+
if (!(o instanceof X)) return e;
|
|
1764
|
+
const a = o.getProperty(l);
|
|
1765
|
+
if (!a) return e;
|
|
1766
|
+
const s = o.clone();
|
|
1767
|
+
return s.setProperty(l, a.clone(), n), ne(e, r, s);
|
|
1768
|
+
}
|
|
1769
|
+
function Pt(e) {
|
|
1770
|
+
if (e instanceof ve) {
|
|
1771
|
+
const t = gn(e.ref);
|
|
1772
|
+
return t ? `$ref → ${t.name}` : "$ref";
|
|
1773
|
+
}
|
|
1774
|
+
if (e instanceof le) {
|
|
1775
|
+
const t = [];
|
|
1776
|
+
return e.allOf.length && t.push("allOf"), e.anyOf.length && t.push("anyOf"), e.oneOf.length && t.push("oneOf"), t.length ? t.join(" + ") : "Komposition";
|
|
1777
|
+
}
|
|
1778
|
+
if (e instanceof te) {
|
|
1779
|
+
const t = nn(e.format);
|
|
1780
|
+
if (t) return t;
|
|
1781
|
+
}
|
|
1782
|
+
return e.kind;
|
|
1783
|
+
}
|
|
1784
|
+
function qe(e, t) {
|
|
1785
|
+
if (at(t)) return t[1];
|
|
1786
|
+
if (t.length === 0) return e.title ?? "Root";
|
|
1787
|
+
const n = t[t.length - 1];
|
|
1788
|
+
if (n === "items") return "items";
|
|
1789
|
+
if (n === "prefixItems") return "prefixItems";
|
|
1790
|
+
const l = Tt(t);
|
|
1791
|
+
return l ? `${l.keyword}[${l.index}]` : n === "allOf" || n === "anyOf" || n === "oneOf" ? n : /^\d+$/.test(n) ? `${t[t.length - 2]}[${n}]` : n;
|
|
1792
|
+
}
|
|
1793
|
+
function Lt(e) {
|
|
1794
|
+
if (e.length === 0) return null;
|
|
1795
|
+
if (at(e)) return [ie];
|
|
1796
|
+
const t = e[e.length - 1];
|
|
1797
|
+
return Tt(e) ? e.slice(0, -2) : t === "items" || t === "prefixItems" ? e.slice(0, -1) : t === "allOf" || t === "anyOf" || t === "oneOf" ? null : (/^\d+$/.test(t), e.slice(0, -1));
|
|
1798
|
+
}
|
|
1799
|
+
function Yl(e) {
|
|
1800
|
+
return e.length > 0 && !ot(e);
|
|
1801
|
+
}
|
|
1802
|
+
function Gl(e) {
|
|
1803
|
+
return ot(e);
|
|
1804
|
+
}
|
|
1805
|
+
const ql = ["aria-label", "aria-expanded"], Xl = {
|
|
1806
|
+
key: 1,
|
|
1807
|
+
class: "jse-tree-node__spacer",
|
|
1808
|
+
"aria-hidden": !0
|
|
1809
|
+
}, Dt = /* @__PURE__ */ D({
|
|
1810
|
+
__name: "JseTreeToggle",
|
|
1811
|
+
props: {
|
|
1812
|
+
expanded: { type: Boolean },
|
|
1813
|
+
hasChildren: { type: Boolean }
|
|
1814
|
+
},
|
|
1815
|
+
emits: ["toggle"],
|
|
1816
|
+
setup(e) {
|
|
1817
|
+
return (t, n) => e.hasChildren ? (u(), h("button", {
|
|
1818
|
+
key: 0,
|
|
1819
|
+
type: "button",
|
|
1820
|
+
class: "jse-tree-node__toggle",
|
|
1821
|
+
"aria-label": e.expanded ? "Einklappen" : "Ausklappen",
|
|
1822
|
+
"aria-expanded": e.hasChildren ? e.expanded : void 0,
|
|
1823
|
+
onClick: n[0] || (n[0] = ye((l) => t.$emit("toggle"), ["stop"]))
|
|
1824
|
+
}, R(e.expanded ? "▼" : "▶"), 9, ql)) : (u(), h("span", Xl));
|
|
1825
|
+
}
|
|
1826
|
+
}), Zl = ["aria-label", "title", "disabled"], Ke = /* @__PURE__ */ D({
|
|
1827
|
+
__name: "JseIconButton",
|
|
1828
|
+
props: {
|
|
1829
|
+
label: {},
|
|
1830
|
+
variant: {},
|
|
1831
|
+
disabled: { type: Boolean }
|
|
1832
|
+
},
|
|
1833
|
+
emits: ["click"],
|
|
1834
|
+
setup(e) {
|
|
1835
|
+
return (t, n) => (u(), h("button", {
|
|
1836
|
+
type: "button",
|
|
1837
|
+
class: re(["jse-icon-btn", {
|
|
1838
|
+
"jse-icon-btn--primary": e.variant === "primary",
|
|
1839
|
+
"jse-icon-btn--danger": e.variant === "danger"
|
|
1840
|
+
}]),
|
|
1841
|
+
"aria-label": e.label,
|
|
1842
|
+
title: e.label,
|
|
1843
|
+
disabled: e.disabled,
|
|
1844
|
+
onClick: n[0] || (n[0] = (l) => t.$emit("click", l))
|
|
1845
|
+
}, [
|
|
1846
|
+
se(t.$slots, "default", {}, () => [
|
|
1847
|
+
n[1] || (n[1] = I("+", -1))
|
|
1848
|
+
])
|
|
1849
|
+
], 10, Zl));
|
|
1850
|
+
}
|
|
1851
|
+
}), Wl = { class: "jse-tree-node__actions" }, At = /* @__PURE__ */ D({
|
|
1852
|
+
__name: "JseTreeNodeActions",
|
|
1853
|
+
props: {
|
|
1854
|
+
showAdd: { type: Boolean },
|
|
1855
|
+
showEdit: { type: Boolean },
|
|
1856
|
+
showDelete: { type: Boolean },
|
|
1857
|
+
addLabel: {},
|
|
1858
|
+
editLabel: {},
|
|
1859
|
+
deleteLabel: {}
|
|
1860
|
+
},
|
|
1861
|
+
emits: ["add", "edit", "delete"],
|
|
1862
|
+
setup(e) {
|
|
1863
|
+
return (t, n) => (u(), h("div", Wl, [
|
|
1864
|
+
e.showAdd ? (u(), C(Ke, {
|
|
1865
|
+
key: 0,
|
|
1866
|
+
variant: "primary",
|
|
1867
|
+
label: e.addLabel ?? "Element hinzufügen",
|
|
1868
|
+
onClick: n[0] || (n[0] = ye((l) => t.$emit("add", l), ["stop"]))
|
|
1869
|
+
}, {
|
|
1870
|
+
default: x(() => [...n[3] || (n[3] = [
|
|
1871
|
+
I(" + ", -1)
|
|
1872
|
+
])]),
|
|
1873
|
+
_: 1
|
|
1874
|
+
}, 8, ["label"])) : P("", !0),
|
|
1875
|
+
e.showEdit ? (u(), C(Ke, {
|
|
1876
|
+
key: 1,
|
|
1877
|
+
label: e.editLabel ?? "Attribute bearbeiten",
|
|
1878
|
+
onClick: n[1] || (n[1] = ye((l) => t.$emit("edit", l), ["stop"]))
|
|
1879
|
+
}, {
|
|
1880
|
+
default: x(() => [...n[4] || (n[4] = [
|
|
1881
|
+
$("svg", {
|
|
1882
|
+
class: "jse-icon-btn__svg",
|
|
1883
|
+
viewBox: "0 0 16 16",
|
|
1884
|
+
"aria-hidden": "true",
|
|
1885
|
+
focusable: "false"
|
|
1886
|
+
}, [
|
|
1887
|
+
$("path", {
|
|
1888
|
+
fill: "currentColor",
|
|
1889
|
+
d: "M11.5 1.5a1.414 1.414 0 0 1 2 2L5.5 11.5 2 12l.5-3.5L11.5 1.5Zm1-1a2.414 2.414 0 0 0-3.414 0L1.086 9.5a.5.5 0 0 0-.121.196l-1 3.5A.5.5 0 0 0 .5 14a.5.5 0 0 0 .121-.01l3.5-1a.5.5 0 0 0 .196-.121l8-8A2.414 2.414 0 0 0 12.5.5Z"
|
|
1890
|
+
})
|
|
1891
|
+
], -1)
|
|
1892
|
+
])]),
|
|
1893
|
+
_: 1
|
|
1894
|
+
}, 8, ["label"])) : P("", !0),
|
|
1895
|
+
e.showDelete ? (u(), C(Ke, {
|
|
1896
|
+
key: 2,
|
|
1897
|
+
variant: "danger",
|
|
1898
|
+
label: e.deleteLabel ?? "Element löschen",
|
|
1899
|
+
onClick: n[2] || (n[2] = ye((l) => t.$emit("delete"), ["stop"]))
|
|
1900
|
+
}, {
|
|
1901
|
+
default: x(() => [...n[5] || (n[5] = [
|
|
1902
|
+
$("svg", {
|
|
1903
|
+
class: "jse-icon-btn__svg",
|
|
1904
|
+
viewBox: "0 0 16 16",
|
|
1905
|
+
"aria-hidden": "true",
|
|
1906
|
+
focusable: "false"
|
|
1907
|
+
}, [
|
|
1908
|
+
$("path", {
|
|
1909
|
+
fill: "currentColor",
|
|
1910
|
+
d: "M5.5 2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1h3.5a.5.5 0 0 1 0 1H12v9.5a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 4 12.5V3H2.5a.5.5 0 0 1 0-1H5.5Zm1 0h3v-.25a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25V2ZM5 3v9.5a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5V3H5Zm2 2.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm3 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Z"
|
|
1911
|
+
})
|
|
1912
|
+
], -1)
|
|
1913
|
+
])]),
|
|
1914
|
+
_: 1
|
|
1915
|
+
}, 8, ["label"])) : P("", !0)
|
|
1916
|
+
]));
|
|
1917
|
+
}
|
|
1918
|
+
}), Ql = {
|
|
1919
|
+
key: 0,
|
|
1920
|
+
class: "jse-tree-node"
|
|
1921
|
+
}, er = { class: "jse-tree-node__kind" }, tr = { class: "jse-tree-node__label" }, nr = {
|
|
1922
|
+
key: 0,
|
|
1923
|
+
class: "jse-tree-node__title"
|
|
1924
|
+
}, lr = {
|
|
1925
|
+
key: 0,
|
|
1926
|
+
class: "jse-tree-node__children"
|
|
1927
|
+
}, dn = /* @__PURE__ */ D({
|
|
1928
|
+
name: "SchemaTreeNode",
|
|
1929
|
+
__name: "SchemaTreeNode",
|
|
1930
|
+
props: {
|
|
1931
|
+
document: {},
|
|
1932
|
+
path: {},
|
|
1933
|
+
selectedPath: {},
|
|
1934
|
+
expandedKeys: {},
|
|
1935
|
+
depth: {}
|
|
1936
|
+
},
|
|
1937
|
+
emits: ["select", "toggle", "add", "edit", "delete"],
|
|
1938
|
+
setup(e, { emit: t }) {
|
|
1939
|
+
const n = e, l = t, r = p(() => Re(n.document, n.path)), o = p(() => on(n.document, n.path)), a = p(
|
|
1940
|
+
() => r.value ? qe(r.value, n.path) : n.path.join(".")
|
|
1941
|
+
), s = p(() => r.value ? Pt(r.value) : ""), d = p(() => Ee(n.path)), i = p(() => Ee(n.selectedPath) === d.value), c = p(
|
|
1942
|
+
() => n.path.length === 0 || n.expandedKeys.has(d.value)
|
|
1943
|
+
), m = p(() => o.value.length > 0), _ = p(() => r.value !== void 0 && Tl(r.value)), V = p(() => Yl(n.path));
|
|
1944
|
+
return (j, E) => {
|
|
1945
|
+
const z = Mt("SchemaTreeNode", !0);
|
|
1946
|
+
return r.value ? (u(), h("div", Ql, [
|
|
1947
|
+
$("div", {
|
|
1948
|
+
class: re(["jse-tree-node__row", { "jse-tree-node__row--selected": i.value }]),
|
|
1949
|
+
style: Vt({ paddingLeft: `${(e.depth ?? 0) * 16 + 4}px` }),
|
|
1950
|
+
onClick: E[4] || (E[4] = (f) => l("select", e.path))
|
|
1951
|
+
}, [
|
|
1952
|
+
w(Dt, {
|
|
1953
|
+
"has-children": m.value,
|
|
1954
|
+
expanded: c.value,
|
|
1955
|
+
onToggle: E[0] || (E[0] = (f) => l("toggle", e.path))
|
|
1956
|
+
}, null, 8, ["has-children", "expanded"]),
|
|
1957
|
+
$("span", er, R(s.value), 1),
|
|
1958
|
+
$("span", tr, R(a.value), 1),
|
|
1959
|
+
r.value.title && r.value.title !== a.value ? (u(), h("span", nr, R(r.value.title), 1)) : P("", !0),
|
|
1960
|
+
w(At, {
|
|
1961
|
+
"show-add": _.value,
|
|
1962
|
+
"show-edit": !0,
|
|
1963
|
+
"show-delete": V.value,
|
|
1964
|
+
"add-label": `Element zu ${a.value} hinzufügen`,
|
|
1965
|
+
"edit-label": `Attribute von ${a.value} bearbeiten`,
|
|
1966
|
+
"delete-label": `${a.value} löschen`,
|
|
1967
|
+
onAdd: E[1] || (E[1] = (f) => l("add", e.path, f)),
|
|
1968
|
+
onEdit: E[2] || (E[2] = (f) => l("edit", e.path, f)),
|
|
1969
|
+
onDelete: E[3] || (E[3] = (f) => l("delete", e.path))
|
|
1970
|
+
}, null, 8, ["show-add", "show-delete", "add-label", "edit-label", "delete-label"])
|
|
1971
|
+
], 6),
|
|
1972
|
+
c.value && m.value ? (u(), h("div", lr, [
|
|
1973
|
+
(u(!0), h(N, null, F(o.value, (f) => (u(), C(z, {
|
|
1974
|
+
key: y(Ee)(f),
|
|
1975
|
+
document: e.document,
|
|
1976
|
+
path: f,
|
|
1977
|
+
"selected-path": e.selectedPath,
|
|
1978
|
+
"expanded-keys": e.expandedKeys,
|
|
1979
|
+
depth: (e.depth ?? 0) + 1,
|
|
1980
|
+
onSelect: E[5] || (E[5] = (b) => l("select", b)),
|
|
1981
|
+
onToggle: E[6] || (E[6] = (b) => l("toggle", b)),
|
|
1982
|
+
onAdd: (b, v) => l("add", b, v),
|
|
1983
|
+
onEdit: (b, v) => l("edit", b, v),
|
|
1984
|
+
onDelete: E[7] || (E[7] = (b) => l("delete", b))
|
|
1985
|
+
}, null, 8, ["document", "path", "selected-path", "expanded-keys", "depth", "onAdd", "onEdit"]))), 128))
|
|
1986
|
+
])) : P("", !0)
|
|
1987
|
+
])) : P("", !0);
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
}), rr = { class: "jse-tree-node" }, or = {
|
|
1991
|
+
key: 0,
|
|
1992
|
+
class: "jse-tree-node__children"
|
|
1993
|
+
}, ar = /* @__PURE__ */ D({
|
|
1994
|
+
__name: "SchemaDefsTreeNode",
|
|
1995
|
+
props: {
|
|
1996
|
+
document: {},
|
|
1997
|
+
selectedPath: {},
|
|
1998
|
+
expandedKeys: {}
|
|
1999
|
+
},
|
|
2000
|
+
emits: ["select", "toggle", "add", "edit", "delete"],
|
|
2001
|
+
setup(e, { emit: t }) {
|
|
2002
|
+
const n = e, l = t, r = [ie], o = p(() => on(n.document, r)), a = p(() => n.expandedKeys.has(ie)), s = p(() => Ee(n.selectedPath) === ie);
|
|
2003
|
+
return (d, i) => (u(), h("div", rr, [
|
|
2004
|
+
$("div", {
|
|
2005
|
+
class: re(["jse-tree-node__row", { "jse-tree-node__row--selected": s.value }]),
|
|
2006
|
+
style: { "padding-left": "4px" },
|
|
2007
|
+
onClick: i[2] || (i[2] = (c) => l("select", r))
|
|
2008
|
+
}, [
|
|
2009
|
+
w(Dt, {
|
|
2010
|
+
"has-children": !0,
|
|
2011
|
+
expanded: a.value,
|
|
2012
|
+
onToggle: i[0] || (i[0] = (c) => l("toggle", r))
|
|
2013
|
+
}, null, 8, ["expanded"]),
|
|
2014
|
+
i[8] || (i[8] = $("span", { class: "jse-tree-node__kind" }, "$defs", -1)),
|
|
2015
|
+
i[9] || (i[9] = $("span", { class: "jse-tree-node__label" }, "Definitionen", -1)),
|
|
2016
|
+
w(At, {
|
|
2017
|
+
"show-add": !0,
|
|
2018
|
+
"show-edit": !1,
|
|
2019
|
+
"show-delete": !1,
|
|
2020
|
+
"add-label": "Definition hinzufügen",
|
|
2021
|
+
onAdd: i[1] || (i[1] = (c) => l("add", r, c))
|
|
2022
|
+
})
|
|
2023
|
+
], 2),
|
|
2024
|
+
a.value ? (u(), h("div", or, [
|
|
2025
|
+
(u(!0), h(N, null, F(o.value, (c) => (u(), C(dn, {
|
|
2026
|
+
key: y(Ee)(c),
|
|
2027
|
+
document: e.document,
|
|
2028
|
+
path: c,
|
|
2029
|
+
"selected-path": e.selectedPath,
|
|
2030
|
+
"expanded-keys": e.expandedKeys,
|
|
2031
|
+
depth: 1,
|
|
2032
|
+
onSelect: i[3] || (i[3] = (m) => l("select", m)),
|
|
2033
|
+
onToggle: i[4] || (i[4] = (m) => l("toggle", m)),
|
|
2034
|
+
onAdd: i[5] || (i[5] = (m, _) => l("add", m, _)),
|
|
2035
|
+
onEdit: i[6] || (i[6] = (m, _) => l("edit", m, _)),
|
|
2036
|
+
onDelete: i[7] || (i[7] = (m) => l("delete", m))
|
|
2037
|
+
}, null, 8, ["document", "path", "selected-path", "expanded-keys"]))), 128))
|
|
2038
|
+
])) : P("", !0)
|
|
2039
|
+
]));
|
|
2040
|
+
}
|
|
2041
|
+
}), sr = { class: "jse-array-items-type" }, ir = {
|
|
2042
|
+
key: 0,
|
|
2043
|
+
class: "jse-array-items-type__current"
|
|
2044
|
+
}, ur = {
|
|
2045
|
+
key: 1,
|
|
2046
|
+
class: "jse-array-items-type__current jse-array-items-type__current--empty"
|
|
2047
|
+
}, dr = { class: "jse-array-items-type__group" }, cr = { class: "jse-structure-editor__buttons" }, mr = { class: "jse-array-items-type__group" }, fr = { class: "jse-structure-editor__buttons" }, vr = { class: "jse-array-items-type__group" }, hr = { class: "jse-structure-editor__buttons" }, pr = {
|
|
2048
|
+
key: 2,
|
|
2049
|
+
class: "jse-structure-editor__note"
|
|
2050
|
+
}, cn = /* @__PURE__ */ D({
|
|
2051
|
+
__name: "ArrayItemsTypeControl",
|
|
2052
|
+
props: {
|
|
2053
|
+
currentKind: {},
|
|
2054
|
+
compact: { type: Boolean }
|
|
2055
|
+
},
|
|
2056
|
+
emits: ["select"],
|
|
2057
|
+
setup(e, { emit: t }) {
|
|
2058
|
+
const n = t;
|
|
2059
|
+
function l(r) {
|
|
2060
|
+
n("select", r);
|
|
2061
|
+
}
|
|
2062
|
+
return (r, o) => (u(), h("div", sr, [
|
|
2063
|
+
e.currentKind ? (u(), h("p", ir, [
|
|
2064
|
+
o[0] || (o[0] = I(" Aktueller Items-Typ: ", -1)),
|
|
2065
|
+
$("strong", null, R(e.currentKind), 1)
|
|
2066
|
+
])) : (u(), h("p", ur, " Noch kein Items-Typ festgelegt ")),
|
|
2067
|
+
$("div", dr, [
|
|
2068
|
+
o[1] || (o[1] = $("span", { class: "jse-structure-editor__hint" }, "Primitiv:", -1)),
|
|
2069
|
+
$("div", cr, [
|
|
2070
|
+
(u(!0), h(N, null, F(y(Wt), (a) => (u(), C(J, {
|
|
2071
|
+
key: a,
|
|
2072
|
+
type: "button",
|
|
2073
|
+
class: re({ "jse-btn--active": e.currentKind === a }),
|
|
2074
|
+
onClick: (s) => l(a)
|
|
2075
|
+
}, {
|
|
2076
|
+
default: x(() => [
|
|
2077
|
+
I(R(a), 1)
|
|
2078
|
+
]),
|
|
2079
|
+
_: 2
|
|
2080
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
2081
|
+
])
|
|
2082
|
+
]),
|
|
2083
|
+
$("div", mr, [
|
|
2084
|
+
o[2] || (o[2] = $("span", { class: "jse-structure-editor__hint" }, "String (format):", -1)),
|
|
2085
|
+
$("div", fr, [
|
|
2086
|
+
(u(!0), h(N, null, F(y(Qt), (a) => (u(), C(J, {
|
|
2087
|
+
key: a,
|
|
2088
|
+
type: "button",
|
|
2089
|
+
class: re({ "jse-btn--active": e.currentKind === a }),
|
|
2090
|
+
onClick: (s) => l(a)
|
|
2091
|
+
}, {
|
|
2092
|
+
default: x(() => [
|
|
2093
|
+
I(R(a), 1)
|
|
2094
|
+
]),
|
|
2095
|
+
_: 2
|
|
2096
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
2097
|
+
])
|
|
2098
|
+
]),
|
|
2099
|
+
$("div", vr, [
|
|
2100
|
+
o[3] || (o[3] = $("span", { class: "jse-structure-editor__hint" }, "Struktur:", -1)),
|
|
2101
|
+
$("div", hr, [
|
|
2102
|
+
(u(!0), h(N, null, F(y(en), (a) => (u(), C(J, {
|
|
2103
|
+
key: a,
|
|
2104
|
+
type: "button",
|
|
2105
|
+
class: re({ "jse-btn--active": e.currentKind === a }),
|
|
2106
|
+
onClick: (s) => l(a)
|
|
2107
|
+
}, {
|
|
2108
|
+
default: x(() => [
|
|
2109
|
+
I(R(a), 1)
|
|
2110
|
+
]),
|
|
2111
|
+
_: 2
|
|
2112
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
2113
|
+
])
|
|
2114
|
+
]),
|
|
2115
|
+
e.compact ? P("", !0) : (u(), h("p", pr, [...o[4] || (o[4] = [
|
|
2116
|
+
I(" Bei ", -1),
|
|
2117
|
+
$("code", null, "object", -1),
|
|
2118
|
+
I(" oder ", -1),
|
|
2119
|
+
$("code", null, "array", -1),
|
|
2120
|
+
I(" im Baum unter „items“ weiter bearbeiten. ", -1)
|
|
2121
|
+
])]))
|
|
2122
|
+
]));
|
|
2123
|
+
}
|
|
2124
|
+
}), mn = /* @__PURE__ */ D({
|
|
2125
|
+
__name: "AttributeControlResolver",
|
|
2126
|
+
props: /* @__PURE__ */ Y({
|
|
2127
|
+
node: {},
|
|
2128
|
+
attributeName: {},
|
|
2129
|
+
label: {},
|
|
2130
|
+
readonly: { type: Boolean },
|
|
2131
|
+
mode: {}
|
|
2132
|
+
}, {
|
|
2133
|
+
modelValue: {},
|
|
2134
|
+
modelModifiers: {}
|
|
2135
|
+
}),
|
|
2136
|
+
emits: ["update:modelValue"],
|
|
2137
|
+
setup(e) {
|
|
2138
|
+
const t = e, n = H(e, "modelValue"), l = Gn(), r = qn(), o = p(() => {
|
|
2139
|
+
const a = {
|
|
2140
|
+
node: t.node,
|
|
2141
|
+
attributeName: t.attributeName,
|
|
2142
|
+
label: t.label,
|
|
2143
|
+
value: n.value,
|
|
2144
|
+
readonly: t.readonly
|
|
2145
|
+
};
|
|
2146
|
+
return t.mode === "schema" ? l.resolve(a) ?? ge : r.resolve(a) ?? ge;
|
|
2147
|
+
});
|
|
2148
|
+
return (a, s) => (u(), C(St(o.value), {
|
|
2149
|
+
modelValue: n.value,
|
|
2150
|
+
"onUpdate:modelValue": s[0] || (s[0] = (d) => n.value = d),
|
|
2151
|
+
label: e.label,
|
|
2152
|
+
readonly: e.readonly
|
|
2153
|
+
}, null, 8, ["modelValue", "label", "readonly"]));
|
|
2154
|
+
}
|
|
2155
|
+
}), yr = [
|
|
2156
|
+
{ name: "title", label: "Titel" },
|
|
2157
|
+
{ name: "description", label: "Beschreibung" }
|
|
2158
|
+
], gr = [
|
|
2159
|
+
{ name: "minLength", label: "minLength" },
|
|
2160
|
+
{ name: "maxLength", label: "maxLength" },
|
|
2161
|
+
{ name: "pattern", label: "pattern" },
|
|
2162
|
+
{ name: "format", label: "format" }
|
|
2163
|
+
], br = [
|
|
2164
|
+
{ name: "minimum", label: "minimum" },
|
|
2165
|
+
{ name: "maximum", label: "maximum" }
|
|
2166
|
+
], $r = [
|
|
2167
|
+
{ name: "minItems", label: "minItems" },
|
|
2168
|
+
{ name: "maxItems", label: "maxItems" }
|
|
2169
|
+
];
|
|
2170
|
+
function Sr(e) {
|
|
2171
|
+
const t = [...yr];
|
|
2172
|
+
return e instanceof te ? t.push(...gr) : e instanceof be || e instanceof $e ? t.push(...br) : e instanceof Z && t.push(...$r), t;
|
|
2173
|
+
}
|
|
2174
|
+
function Vr(e, t) {
|
|
2175
|
+
switch (t) {
|
|
2176
|
+
case "title":
|
|
2177
|
+
return e.title ?? "";
|
|
2178
|
+
case "description":
|
|
2179
|
+
return e.description ?? "";
|
|
2180
|
+
case "minLength":
|
|
2181
|
+
return e instanceof te ? e.minLength ?? void 0 : void 0;
|
|
2182
|
+
case "maxLength":
|
|
2183
|
+
return e instanceof te ? e.maxLength ?? void 0 : void 0;
|
|
2184
|
+
case "pattern":
|
|
2185
|
+
return e instanceof te ? e.pattern ?? "" : "";
|
|
2186
|
+
case "format":
|
|
2187
|
+
return e instanceof te ? e.format ?? "" : "";
|
|
2188
|
+
case "minimum":
|
|
2189
|
+
return e instanceof be || e instanceof $e ? e.minimum ?? void 0 : void 0;
|
|
2190
|
+
case "maximum":
|
|
2191
|
+
return e instanceof be || e instanceof $e ? e.maximum ?? void 0 : void 0;
|
|
2192
|
+
case "minItems":
|
|
2193
|
+
return e instanceof Z ? e.minItems ?? void 0 : void 0;
|
|
2194
|
+
case "maxItems":
|
|
2195
|
+
return e instanceof Z ? e.maxItems ?? void 0 : void 0;
|
|
2196
|
+
default:
|
|
2197
|
+
return e.getCustomAttribute(t);
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
function wr(e, t, n) {
|
|
2201
|
+
switch (t) {
|
|
2202
|
+
case "title":
|
|
2203
|
+
e.title = typeof n == "string" && n ? n : void 0;
|
|
2204
|
+
return;
|
|
2205
|
+
case "description":
|
|
2206
|
+
e.description = typeof n == "string" && n ? n : void 0;
|
|
2207
|
+
return;
|
|
2208
|
+
case "minLength":
|
|
2209
|
+
e instanceof te && (e.minLength = n === void 0 || n === "" ? void 0 : Number(n));
|
|
2210
|
+
return;
|
|
2211
|
+
case "maxLength":
|
|
2212
|
+
e instanceof te && (e.maxLength = n === void 0 || n === "" ? void 0 : Number(n));
|
|
2213
|
+
return;
|
|
2214
|
+
case "pattern":
|
|
2215
|
+
e instanceof te && (e.pattern = typeof n == "string" && n ? n : void 0);
|
|
2216
|
+
return;
|
|
2217
|
+
case "format":
|
|
2218
|
+
e instanceof te && (e.format = typeof n == "string" && n ? n : void 0);
|
|
2219
|
+
return;
|
|
2220
|
+
case "minimum":
|
|
2221
|
+
(e instanceof be || e instanceof $e) && (e.minimum = n === void 0 || n === "" ? void 0 : Number(n));
|
|
2222
|
+
return;
|
|
2223
|
+
case "maximum":
|
|
2224
|
+
(e instanceof be || e instanceof $e) && (e.maximum = n === void 0 || n === "" ? void 0 : Number(n));
|
|
2225
|
+
return;
|
|
2226
|
+
case "minItems":
|
|
2227
|
+
e instanceof Z && (e.minItems = n === void 0 || n === "" ? void 0 : Number(n));
|
|
2228
|
+
return;
|
|
2229
|
+
case "maxItems":
|
|
2230
|
+
e instanceof Z && (e.maxItems = n === void 0 || n === "" ? void 0 : Number(n));
|
|
2231
|
+
return;
|
|
2232
|
+
default:
|
|
2233
|
+
e.setCustomAttribute(t, n);
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
function Er(e, t, n, l) {
|
|
2237
|
+
return zl(e, t, (r) => {
|
|
2238
|
+
wr(r, n, l);
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
function kr(e, t, n) {
|
|
2242
|
+
const l = L(""), r = L(""), o = L(""), a = p(() => {
|
|
2243
|
+
try {
|
|
2244
|
+
return W(e.value, t.value);
|
|
2245
|
+
} catch {
|
|
2246
|
+
return e.value.root;
|
|
2247
|
+
}
|
|
2248
|
+
}), s = p(() => a.value instanceof ve), d = p(() => at(t.value)), i = p(() => e.value.listDefNames()), c = p(() => {
|
|
2249
|
+
const S = Lt(t.value);
|
|
2250
|
+
if (!S) return null;
|
|
2251
|
+
try {
|
|
2252
|
+
const k = W(e.value, S);
|
|
2253
|
+
return k instanceof X ? k : null;
|
|
2254
|
+
} catch {
|
|
2255
|
+
return null;
|
|
2256
|
+
}
|
|
2257
|
+
}), m = p(() => {
|
|
2258
|
+
if (d.value) return t.value[1] ?? null;
|
|
2259
|
+
if (!t.value.length) return null;
|
|
2260
|
+
const S = t.value[t.value.length - 1];
|
|
2261
|
+
return S === "items" || S === "allOf" || S === "anyOf" || S === "oneOf" || /^\d+$/.test(S) ? null : S;
|
|
2262
|
+
}), _ = p(
|
|
2263
|
+
() => !!c.value && !!m.value || d.value
|
|
2264
|
+
), V = p(() => Sr(a.value)), j = p(() => !c.value || !m.value || d.value ? !1 : c.value.isPropertyRequired(m.value)), E = p(
|
|
2265
|
+
() => t.value[t.value.length - 1] === "items"
|
|
2266
|
+
), z = p(
|
|
2267
|
+
() => a.value instanceof Z || E.value
|
|
2268
|
+
), f = p(() => {
|
|
2269
|
+
if (a.value instanceof Z)
|
|
2270
|
+
return rn(a.value);
|
|
2271
|
+
if (E.value) return ln(a.value);
|
|
2272
|
+
});
|
|
2273
|
+
fe(
|
|
2274
|
+
[m, a],
|
|
2275
|
+
([S, k]) => {
|
|
2276
|
+
l.value = S ?? "", r.value = "", k instanceof ve && (o.value = i.value.find((g) => k.ref.includes(`/${g}`)) ?? i.value[0] ?? "");
|
|
2277
|
+
},
|
|
2278
|
+
{ immediate: !0 }
|
|
2279
|
+
);
|
|
2280
|
+
function b() {
|
|
2281
|
+
if (d.value && m.value) {
|
|
2282
|
+
const A = l.value.trim();
|
|
2283
|
+
if (!A) {
|
|
2284
|
+
l.value = m.value, r.value = "Name darf nicht leer sein.";
|
|
2285
|
+
return;
|
|
2286
|
+
}
|
|
2287
|
+
if (A === m.value) {
|
|
2288
|
+
r.value = "";
|
|
2289
|
+
return;
|
|
2290
|
+
}
|
|
2291
|
+
const G = Ol(e.value, m.value, A);
|
|
2292
|
+
if (G === e.value) {
|
|
2293
|
+
r.value = `Definition „${A}“ existiert bereits.`;
|
|
2294
|
+
return;
|
|
2295
|
+
}
|
|
2296
|
+
r.value = "", n("update:document", G), n("update:selectedPath", ["$defs", A]);
|
|
2297
|
+
return;
|
|
2298
|
+
}
|
|
2299
|
+
if (!c.value || !m.value) return;
|
|
2300
|
+
const S = Lt(t.value);
|
|
2301
|
+
if (!S) return;
|
|
2302
|
+
const k = l.value.trim();
|
|
2303
|
+
if (!k) {
|
|
2304
|
+
l.value = m.value, r.value = "Feldname darf nicht leer sein.";
|
|
2305
|
+
return;
|
|
2306
|
+
}
|
|
2307
|
+
if (k === m.value) {
|
|
2308
|
+
r.value = "";
|
|
2309
|
+
return;
|
|
2310
|
+
}
|
|
2311
|
+
if (c.value.getProperty(k)) {
|
|
2312
|
+
r.value = `Der Name „${k}“ existiert bereits.`;
|
|
2313
|
+
return;
|
|
2314
|
+
}
|
|
2315
|
+
const g = Jl(
|
|
2316
|
+
e.value,
|
|
2317
|
+
S,
|
|
2318
|
+
m.value,
|
|
2319
|
+
k
|
|
2320
|
+
);
|
|
2321
|
+
if (g === e.value) {
|
|
2322
|
+
r.value = `Der Name „${k}“ existiert bereits.`;
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
2325
|
+
r.value = "", n("update:document", g), n("update:selectedPath", [...S, k]);
|
|
2326
|
+
}
|
|
2327
|
+
function v(S) {
|
|
2328
|
+
return Vr(a.value, S);
|
|
2329
|
+
}
|
|
2330
|
+
function B(S, k) {
|
|
2331
|
+
Ve(e.value, t.value) && n(
|
|
2332
|
+
"update:document",
|
|
2333
|
+
Er(e.value, t.value, S, k)
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
function U(S) {
|
|
2337
|
+
t.value.length === 0 || d.value || n(
|
|
2338
|
+
"update:document",
|
|
2339
|
+
Hl(e.value, t.value, S)
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
function O() {
|
|
2343
|
+
o.value && n(
|
|
2344
|
+
"update:document",
|
|
2345
|
+
Ml(e.value, t.value, o.value)
|
|
2346
|
+
);
|
|
2347
|
+
}
|
|
2348
|
+
function q(S) {
|
|
2349
|
+
if (a.value instanceof Z) {
|
|
2350
|
+
n(
|
|
2351
|
+
"update:document",
|
|
2352
|
+
un(e.value, t.value, S)
|
|
2353
|
+
);
|
|
2354
|
+
return;
|
|
2355
|
+
}
|
|
2356
|
+
E.value && n(
|
|
2357
|
+
"update:document",
|
|
2358
|
+
sn(e.value, t.value, S)
|
|
2359
|
+
);
|
|
2360
|
+
}
|
|
2361
|
+
return {
|
|
2362
|
+
propertyNameInput: l,
|
|
2363
|
+
propertyNameError: r,
|
|
2364
|
+
selectedDefRef: o,
|
|
2365
|
+
selectedNode: a,
|
|
2366
|
+
isRefNode: s,
|
|
2367
|
+
isDefRoot: d,
|
|
2368
|
+
availableDefs: i,
|
|
2369
|
+
parentObject: c,
|
|
2370
|
+
propertyName: m,
|
|
2371
|
+
showPropertyName: _,
|
|
2372
|
+
attributeFields: V,
|
|
2373
|
+
isRequired: j,
|
|
2374
|
+
showItemsTypeControl: z,
|
|
2375
|
+
itemsTypeKind: f,
|
|
2376
|
+
commitPropertyRename: b,
|
|
2377
|
+
readAttribute: v,
|
|
2378
|
+
updateAttribute: B,
|
|
2379
|
+
setRequired: U,
|
|
2380
|
+
commitRefChange: O,
|
|
2381
|
+
setItemsType: q
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
const xr = { class: "jse-attributes-panel" }, jr = {
|
|
2385
|
+
key: 0,
|
|
2386
|
+
class: "jse-element-actions__error"
|
|
2387
|
+
}, _r = ["value"], Cr = /* @__PURE__ */ D({
|
|
2388
|
+
__name: "SchemaAttributesPanel",
|
|
2389
|
+
props: {
|
|
2390
|
+
document: {},
|
|
2391
|
+
selectedPath: {}
|
|
2392
|
+
},
|
|
2393
|
+
emits: ["update:document", "update:selectedPath"],
|
|
2394
|
+
setup(e, { emit: t }) {
|
|
2395
|
+
const n = e, l = t, {
|
|
2396
|
+
propertyNameInput: r,
|
|
2397
|
+
propertyNameError: o,
|
|
2398
|
+
selectedDefRef: a,
|
|
2399
|
+
selectedNode: s,
|
|
2400
|
+
isRefNode: d,
|
|
2401
|
+
isDefRoot: i,
|
|
2402
|
+
availableDefs: c,
|
|
2403
|
+
parentObject: m,
|
|
2404
|
+
propertyName: _,
|
|
2405
|
+
showPropertyName: V,
|
|
2406
|
+
attributeFields: j,
|
|
2407
|
+
isRequired: E,
|
|
2408
|
+
showItemsTypeControl: z,
|
|
2409
|
+
itemsTypeKind: f,
|
|
2410
|
+
commitPropertyRename: b,
|
|
2411
|
+
readAttribute: v,
|
|
2412
|
+
updateAttribute: B,
|
|
2413
|
+
setRequired: U,
|
|
2414
|
+
commitRefChange: O,
|
|
2415
|
+
setItemsType: q
|
|
2416
|
+
} = kr(Q(n, "document"), Q(n, "selectedPath"), l);
|
|
2417
|
+
return (S, k) => (u(), h("div", xr, [
|
|
2418
|
+
y(V) ? (u(), C(me, {
|
|
2419
|
+
key: 0,
|
|
2420
|
+
label: y(i) ? "Definitionsname" : "Feldname"
|
|
2421
|
+
}, {
|
|
2422
|
+
default: x(() => [
|
|
2423
|
+
w(Se, {
|
|
2424
|
+
"model-value": y(r),
|
|
2425
|
+
placeholder: y(i) ? "z. B. Person" : "JSON-Property-Name",
|
|
2426
|
+
"onUpdate:modelValue": k[0] || (k[0] = (g) => {
|
|
2427
|
+
r.value = String(g), o.value = "";
|
|
2428
|
+
}),
|
|
2429
|
+
onBlur: y(b),
|
|
2430
|
+
onKeydown: k[1] || (k[1] = Sn((g) => g.target.blur(), ["enter"]))
|
|
2431
|
+
}, null, 8, ["model-value", "placeholder", "onBlur"]),
|
|
2432
|
+
y(o) ? (u(), h("p", jr, R(y(o)), 1)) : P("", !0)
|
|
2433
|
+
]),
|
|
2434
|
+
_: 1
|
|
2435
|
+
}, 8, ["label"])) : P("", !0),
|
|
2436
|
+
y(d) ? (u(), C(me, {
|
|
2437
|
+
key: 1,
|
|
2438
|
+
label: "Referenz ($ref)"
|
|
2439
|
+
}, {
|
|
2440
|
+
default: x(() => [
|
|
2441
|
+
w(ze, {
|
|
2442
|
+
"model-value": y(a),
|
|
2443
|
+
class: "jse-field__input",
|
|
2444
|
+
"onUpdate:modelValue": k[2] || (k[2] = (g) => {
|
|
2445
|
+
a.value = String(g), y(O)();
|
|
2446
|
+
})
|
|
2447
|
+
}, {
|
|
2448
|
+
default: x(() => [
|
|
2449
|
+
(u(!0), h(N, null, F(y(c), (g) => (u(), h("option", {
|
|
2450
|
+
key: g,
|
|
2451
|
+
value: g
|
|
2452
|
+
}, " #/$defs/" + R(g), 9, _r))), 128))
|
|
2453
|
+
]),
|
|
2454
|
+
_: 1
|
|
2455
|
+
}, 8, ["model-value"])
|
|
2456
|
+
]),
|
|
2457
|
+
_: 1
|
|
2458
|
+
})) : P("", !0),
|
|
2459
|
+
(u(!0), h(N, null, F(y(j), (g) => (u(), C(mn, {
|
|
2460
|
+
key: g.name,
|
|
2461
|
+
node: y(s),
|
|
2462
|
+
"attribute-name": g.name,
|
|
2463
|
+
label: g.label,
|
|
2464
|
+
mode: "schema",
|
|
2465
|
+
"model-value": y(v)(g.name),
|
|
2466
|
+
"onUpdate:modelValue": (A) => y(B)(g.name, A)
|
|
2467
|
+
}, null, 8, ["node", "attribute-name", "label", "model-value", "onUpdate:modelValue"]))), 128)),
|
|
2468
|
+
y(m) && y(_) && !y(i) ? (u(), C(me, {
|
|
2469
|
+
key: 2,
|
|
2470
|
+
boolean: "",
|
|
2471
|
+
label: "Pflichtfeld (required)"
|
|
2472
|
+
}, {
|
|
2473
|
+
default: x(() => [
|
|
2474
|
+
w(lt, {
|
|
2475
|
+
"model-value": y(E),
|
|
2476
|
+
"onUpdate:modelValue": k[3] || (k[3] = (g) => y(U)(g))
|
|
2477
|
+
}, null, 8, ["model-value"])
|
|
2478
|
+
]),
|
|
2479
|
+
_: 1
|
|
2480
|
+
})) : P("", !0),
|
|
2481
|
+
y(z) ? (u(), C(me, {
|
|
2482
|
+
key: 3,
|
|
2483
|
+
label: "Items-Typ"
|
|
2484
|
+
}, {
|
|
2485
|
+
default: x(() => [
|
|
2486
|
+
w(cn, {
|
|
2487
|
+
compact: "",
|
|
2488
|
+
"current-kind": y(f),
|
|
2489
|
+
onSelect: y(q)
|
|
2490
|
+
}, null, 8, ["current-kind", "onSelect"])
|
|
2491
|
+
]),
|
|
2492
|
+
_: 1
|
|
2493
|
+
})) : P("", !0)
|
|
2494
|
+
]));
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2497
|
+
function Tr(e = {}) {
|
|
2498
|
+
const t = L(!1), n = L(!1), l = L({
|
|
2499
|
+
x: e.initialX ?? 24,
|
|
2500
|
+
y: e.initialY ?? 24,
|
|
2501
|
+
width: e.initialWidth ?? 320,
|
|
2502
|
+
height: e.initialHeight ?? 280
|
|
2503
|
+
}), r = e.minWidth ?? 260, o = e.minHeight ?? 160, a = e.minimizedHeight ?? 42;
|
|
2504
|
+
let s = null, d = null;
|
|
2505
|
+
function i() {
|
|
2506
|
+
const v = Math.max(0, window.innerWidth - l.value.width - 8), B = Math.max(0, window.innerHeight - 40);
|
|
2507
|
+
l.value.x = Math.min(Math.max(8, l.value.x), v), l.value.y = Math.min(Math.max(8, l.value.y), B);
|
|
2508
|
+
}
|
|
2509
|
+
function c(v) {
|
|
2510
|
+
s && (l.value.x = s.rectX + (v.clientX - s.x), l.value.y = s.rectY + (v.clientY - s.y), i());
|
|
2511
|
+
}
|
|
2512
|
+
function m() {
|
|
2513
|
+
s = null, window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", m);
|
|
2514
|
+
}
|
|
2515
|
+
function _(v) {
|
|
2516
|
+
v.button === 0 && (s = {
|
|
2517
|
+
x: v.clientX,
|
|
2518
|
+
y: v.clientY,
|
|
2519
|
+
rectX: l.value.x,
|
|
2520
|
+
rectY: l.value.y
|
|
2521
|
+
}, window.addEventListener("pointermove", c), window.addEventListener("pointerup", m));
|
|
2522
|
+
}
|
|
2523
|
+
function V(v) {
|
|
2524
|
+
d && (l.value.width = Math.max(r, d.width + (v.clientX - d.x)), l.value.height = Math.max(o, d.height + (v.clientY - d.y)), i());
|
|
2525
|
+
}
|
|
2526
|
+
function j() {
|
|
2527
|
+
d = null, window.removeEventListener("pointermove", V), window.removeEventListener("pointerup", j);
|
|
2528
|
+
}
|
|
2529
|
+
function E(v) {
|
|
2530
|
+
v.button !== 0 || n.value || (v.stopPropagation(), d = {
|
|
2531
|
+
x: v.clientX,
|
|
2532
|
+
y: v.clientY,
|
|
2533
|
+
width: l.value.width,
|
|
2534
|
+
height: l.value.height
|
|
2535
|
+
}, window.addEventListener("pointermove", V), window.addEventListener("pointerup", j));
|
|
2536
|
+
}
|
|
2537
|
+
function z() {
|
|
2538
|
+
n.value = !n.value;
|
|
2539
|
+
}
|
|
2540
|
+
function f(v) {
|
|
2541
|
+
(v == null ? void 0 : v.x) !== void 0 && (l.value.x = v.x), (v == null ? void 0 : v.y) !== void 0 && (l.value.y = v.y), (v == null ? void 0 : v.width) !== void 0 && (l.value.width = v.width), (v == null ? void 0 : v.height) !== void 0 && (l.value.height = v.height), n.value = !1, t.value = !0, i();
|
|
2542
|
+
}
|
|
2543
|
+
function b() {
|
|
2544
|
+
t.value = !1;
|
|
2545
|
+
}
|
|
2546
|
+
return zt(() => {
|
|
2547
|
+
m(), j();
|
|
2548
|
+
}), {
|
|
2549
|
+
open: t,
|
|
2550
|
+
minimized: n,
|
|
2551
|
+
rect: l,
|
|
2552
|
+
minimizedHeight: a,
|
|
2553
|
+
startDrag: _,
|
|
2554
|
+
startResize: E,
|
|
2555
|
+
toggleMinimized: z,
|
|
2556
|
+
show: f,
|
|
2557
|
+
hide: b
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
const Rr = ["aria-label"], Pr = { class: "jse-floating-panel__title" }, Dr = { class: "jse-floating-panel__controls" }, Ar = { class: "jse-floating-panel__body" }, Xe = /* @__PURE__ */ D({
|
|
2561
|
+
__name: "JseFloatingPanel",
|
|
2562
|
+
props: {
|
|
2563
|
+
modelValue: { type: Boolean },
|
|
2564
|
+
title: {},
|
|
2565
|
+
initialX: { default: 24 },
|
|
2566
|
+
initialY: { default: 24 },
|
|
2567
|
+
initialWidth: { default: 320 },
|
|
2568
|
+
initialHeight: { default: 280 }
|
|
2569
|
+
},
|
|
2570
|
+
emits: ["update:modelValue"],
|
|
2571
|
+
setup(e, { expose: t, emit: n }) {
|
|
2572
|
+
const l = e, r = n, o = Tr({
|
|
2573
|
+
initialX: l.initialX,
|
|
2574
|
+
initialY: l.initialY,
|
|
2575
|
+
initialWidth: l.initialWidth,
|
|
2576
|
+
initialHeight: l.initialHeight
|
|
2577
|
+
}), a = p(() => ({
|
|
2578
|
+
left: `${o.rect.value.x}px`,
|
|
2579
|
+
top: `${o.rect.value.y}px`,
|
|
2580
|
+
width: `${o.rect.value.width}px`,
|
|
2581
|
+
height: o.minimized.value ? `${o.minimizedHeight}px` : `${o.rect.value.height}px`
|
|
2582
|
+
}));
|
|
2583
|
+
fe(
|
|
2584
|
+
() => l.modelValue,
|
|
2585
|
+
(c) => {
|
|
2586
|
+
c ? o.show() : o.hide();
|
|
2587
|
+
},
|
|
2588
|
+
{ flush: "sync" }
|
|
2589
|
+
), fe(
|
|
2590
|
+
o.open,
|
|
2591
|
+
(c) => {
|
|
2592
|
+
c !== l.modelValue && r("update:modelValue", c);
|
|
2593
|
+
},
|
|
2594
|
+
{ flush: "sync" }
|
|
2595
|
+
);
|
|
2596
|
+
function s() {
|
|
2597
|
+
r("update:modelValue", !1);
|
|
2598
|
+
}
|
|
2599
|
+
function d(c) {
|
|
2600
|
+
c.key === "Escape" && (c.preventDefault(), s());
|
|
2601
|
+
}
|
|
2602
|
+
fe(
|
|
2603
|
+
() => l.modelValue,
|
|
2604
|
+
(c) => {
|
|
2605
|
+
c ? window.addEventListener("keydown", d) : window.removeEventListener("keydown", d);
|
|
2606
|
+
}
|
|
2607
|
+
), zt(() => {
|
|
2608
|
+
window.removeEventListener("keydown", d);
|
|
2609
|
+
});
|
|
2610
|
+
function i(c) {
|
|
2611
|
+
const m = c.getBoundingClientRect();
|
|
2612
|
+
o.show({
|
|
2613
|
+
x: Math.min(m.right + 8, window.innerWidth - o.rect.value.width - 16),
|
|
2614
|
+
y: Math.max(16, m.top)
|
|
2615
|
+
});
|
|
2616
|
+
}
|
|
2617
|
+
return t({ anchorNear: i, show: o.show }), (c, m) => (u(), C(Vn, { to: "body" }, [
|
|
2618
|
+
e.modelValue ? (u(), h("div", {
|
|
2619
|
+
key: 0,
|
|
2620
|
+
class: "jse-floating-panel",
|
|
2621
|
+
style: Vt(a.value),
|
|
2622
|
+
role: "dialog",
|
|
2623
|
+
"aria-label": e.title
|
|
2624
|
+
}, [
|
|
2625
|
+
$("header", {
|
|
2626
|
+
class: "jse-floating-panel__header",
|
|
2627
|
+
onPointerdown: m[1] || (m[1] = //@ts-ignore
|
|
2628
|
+
(..._) => y(o).startDrag && y(o).startDrag(..._))
|
|
2629
|
+
}, [
|
|
2630
|
+
$("span", Pr, R(e.title), 1),
|
|
2631
|
+
$("div", Dr, [
|
|
2632
|
+
w(Ke, {
|
|
2633
|
+
label: y(o).minimized.value ? "Vergrößern" : "Verkleinern",
|
|
2634
|
+
onClick: m[0] || (m[0] = ye((_) => y(o).toggleMinimized(), ["stop"]))
|
|
2635
|
+
}, {
|
|
2636
|
+
default: x(() => [
|
|
2637
|
+
I(R(y(o).minimized.value ? "□" : "−"), 1)
|
|
2638
|
+
]),
|
|
2639
|
+
_: 1
|
|
2640
|
+
}, 8, ["label"]),
|
|
2641
|
+
w(Ke, {
|
|
2642
|
+
label: "Schließen",
|
|
2643
|
+
onClick: ye(s, ["stop"])
|
|
2644
|
+
}, {
|
|
2645
|
+
default: x(() => [...m[3] || (m[3] = [
|
|
2646
|
+
I("×", -1)
|
|
2647
|
+
])]),
|
|
2648
|
+
_: 1
|
|
2649
|
+
})
|
|
2650
|
+
])
|
|
2651
|
+
], 32),
|
|
2652
|
+
Ue($("div", Ar, [
|
|
2653
|
+
se(c.$slots, "default")
|
|
2654
|
+
], 512), [
|
|
2655
|
+
[Oe, !y(o).minimized.value]
|
|
2656
|
+
]),
|
|
2657
|
+
y(o).minimized.value ? P("", !0) : (u(), h("div", {
|
|
2658
|
+
key: 0,
|
|
2659
|
+
class: "jse-floating-panel__resize",
|
|
2660
|
+
"aria-hidden": "true",
|
|
2661
|
+
onPointerdown: m[2] || (m[2] = //@ts-ignore
|
|
2662
|
+
(..._) => y(o).startResize && y(o).startResize(..._))
|
|
2663
|
+
}, null, 32))
|
|
2664
|
+
], 12, Rr)) : P("", !0)
|
|
2665
|
+
]));
|
|
2666
|
+
}
|
|
2667
|
+
}), Ir = { class: "jse-element-actions" }, Ur = { class: "jse-element-actions__target" }, Or = { class: "jse-element-actions__kind" }, Kr = {
|
|
2668
|
+
key: 0,
|
|
2669
|
+
class: "jse-element-actions__section"
|
|
2670
|
+
}, Lr = { class: "jse-attribute-control" }, Nr = {
|
|
2671
|
+
key: 0,
|
|
2672
|
+
class: "jse-element-actions__error"
|
|
2673
|
+
}, Br = { class: "jse-structure-editor__buttons" }, Fr = {
|
|
2674
|
+
key: 1,
|
|
2675
|
+
class: "jse-element-actions__section"
|
|
2676
|
+
}, Mr = { class: "jse-attribute-control" }, zr = {
|
|
2677
|
+
key: 0,
|
|
2678
|
+
class: "jse-element-actions__error"
|
|
2679
|
+
}, Jr = { class: "jse-structure-editor__buttons" }, Hr = {
|
|
2680
|
+
key: 2,
|
|
2681
|
+
class: "jse-element-actions__section"
|
|
2682
|
+
}, Yr = ["value"], Gr = { class: "jse-structure-editor__buttons" }, qr = {
|
|
2683
|
+
key: 3,
|
|
2684
|
+
class: "jse-element-actions__section"
|
|
2685
|
+
}, Xr = { class: "jse-structure-editor__buttons" }, Zr = {
|
|
2686
|
+
key: 4,
|
|
2687
|
+
class: "jse-element-actions__section"
|
|
2688
|
+
}, Wr = {
|
|
2689
|
+
key: 5,
|
|
2690
|
+
class: "jse-element-actions__section"
|
|
2691
|
+
}, Qr = { class: "jse-structure-editor__buttons" }, eo = /* @__PURE__ */ D({
|
|
2692
|
+
__name: "SchemaElementActions",
|
|
2693
|
+
props: {
|
|
2694
|
+
document: {},
|
|
2695
|
+
targetPath: {}
|
|
2696
|
+
},
|
|
2697
|
+
emits: ["update:document", "done", "items-set"],
|
|
2698
|
+
setup(e, { emit: t }) {
|
|
2699
|
+
const n = e, l = t, r = ["allOf", "anyOf", "oneOf"], o = L(""), a = L(""), s = L(""), d = L(""), i = L(""), c = p(() => Re(n.document, n.targetPath)), m = p(
|
|
2700
|
+
() => c.value ? qe(c.value, n.targetPath) : n.targetPath.join(".")
|
|
2701
|
+
), _ = p(
|
|
2702
|
+
() => c.value ? Pt(c.value) : ""
|
|
2703
|
+
), V = p(() => n.document.listDefNames()), j = p(() => Gl(n.targetPath)), E = p(() => c.value instanceof X), z = p(
|
|
2704
|
+
() => c.value instanceof le || n.targetPath.length === 0 && c.value && !(c.value instanceof Z)
|
|
2705
|
+
), f = p(() => c.value instanceof Z), b = p(
|
|
2706
|
+
() => f.value ? rn(c.value) : void 0
|
|
2707
|
+
), v = p(
|
|
2708
|
+
() => n.targetPath.length > 0 && !f.value && !(c.value instanceof le) && !j.value
|
|
2709
|
+
), B = p(
|
|
2710
|
+
() => V.value.length > 0 && (E.value || z.value)
|
|
2711
|
+
);
|
|
2712
|
+
fe(
|
|
2713
|
+
() => [n.targetPath, n.document],
|
|
2714
|
+
() => {
|
|
2715
|
+
s.value = "", d.value = "", i.value = V.value[0] ?? "", c.value instanceof X ? o.value = Rt(c.value) : o.value = "", j.value && (a.value = an(n.document));
|
|
2716
|
+
},
|
|
2717
|
+
{ immediate: !0 }
|
|
2718
|
+
);
|
|
2719
|
+
function U(M, T = !0) {
|
|
2720
|
+
l("update:document", M), T && l("done");
|
|
2721
|
+
}
|
|
2722
|
+
function O(M) {
|
|
2723
|
+
if (!(c.value instanceof X)) return;
|
|
2724
|
+
const T = o.value.trim();
|
|
2725
|
+
if (!T) {
|
|
2726
|
+
s.value = "Bitte einen Feldnamen angeben.";
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
if (c.value.getProperty(T)) {
|
|
2730
|
+
s.value = `Der Name „${T}“ existiert bereits.`;
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
const K = Kl(n.document, n.targetPath, M, T);
|
|
2734
|
+
if (K === n.document) {
|
|
2735
|
+
s.value = `Der Name „${T}“ existiert bereits.`;
|
|
2736
|
+
return;
|
|
2737
|
+
}
|
|
2738
|
+
s.value = "", U(K);
|
|
2739
|
+
}
|
|
2740
|
+
function q() {
|
|
2741
|
+
if (!i.value || !(c.value instanceof X)) return;
|
|
2742
|
+
const M = o.value.trim();
|
|
2743
|
+
if (!M) {
|
|
2744
|
+
s.value = "Bitte einen Feldnamen angeben.";
|
|
2745
|
+
return;
|
|
2746
|
+
}
|
|
2747
|
+
const T = Ll(
|
|
2748
|
+
n.document,
|
|
2749
|
+
n.targetPath,
|
|
2750
|
+
i.value,
|
|
2751
|
+
M
|
|
2752
|
+
);
|
|
2753
|
+
if (T === n.document) {
|
|
2754
|
+
s.value = `Der Name „${M}“ existiert bereits.`;
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
s.value = "", U(T);
|
|
2758
|
+
}
|
|
2759
|
+
function S(M) {
|
|
2760
|
+
const T = a.value.trim();
|
|
2761
|
+
if (!T) {
|
|
2762
|
+
d.value = "Bitte einen Definitionsnamen angeben.";
|
|
2763
|
+
return;
|
|
2764
|
+
}
|
|
2765
|
+
if (n.document.hasDef(T)) {
|
|
2766
|
+
d.value = `Definition „${T}“ existiert bereits.`;
|
|
2767
|
+
return;
|
|
2768
|
+
}
|
|
2769
|
+
d.value = "", U(Il(n.document, M, T));
|
|
2770
|
+
}
|
|
2771
|
+
function k(M) {
|
|
2772
|
+
U(Nl(n.document, n.targetPath, M));
|
|
2773
|
+
}
|
|
2774
|
+
function g(M) {
|
|
2775
|
+
i.value && U(Bl(n.document, n.targetPath, M, i.value));
|
|
2776
|
+
}
|
|
2777
|
+
function A(M) {
|
|
2778
|
+
const T = un(n.document, n.targetPath, M);
|
|
2779
|
+
l("update:document", T), l("items-set", n.targetPath, M), M !== "object" && M !== "array" && l("done");
|
|
2780
|
+
}
|
|
2781
|
+
function G(M) {
|
|
2782
|
+
U(sn(n.document, n.targetPath, M));
|
|
2783
|
+
}
|
|
2784
|
+
return (M, T) => (u(), h("div", Ir, [
|
|
2785
|
+
$("p", Ur, [
|
|
2786
|
+
T[5] || (T[5] = I(" Ziel: ", -1)),
|
|
2787
|
+
$("strong", null, R(m.value), 1),
|
|
2788
|
+
$("span", Or, "(" + R(_.value) + ")", 1)
|
|
2789
|
+
]),
|
|
2790
|
+
j.value ? (u(), h("div", Kr, [
|
|
2791
|
+
$("div", Lr, [
|
|
2792
|
+
w(Le, null, {
|
|
2793
|
+
default: x(() => [...T[6] || (T[6] = [
|
|
2794
|
+
I("Definitionsname", -1)
|
|
2795
|
+
])]),
|
|
2796
|
+
_: 1
|
|
2797
|
+
}),
|
|
2798
|
+
w(Se, {
|
|
2799
|
+
modelValue: a.value,
|
|
2800
|
+
"onUpdate:modelValue": [
|
|
2801
|
+
T[0] || (T[0] = (K) => a.value = K),
|
|
2802
|
+
T[1] || (T[1] = (K) => d.value = "")
|
|
2803
|
+
],
|
|
2804
|
+
placeholder: "z. B. Person"
|
|
2805
|
+
}, null, 8, ["modelValue"])
|
|
2806
|
+
]),
|
|
2807
|
+
d.value ? (u(), h("p", Nr, R(d.value), 1)) : P("", !0),
|
|
2808
|
+
T[7] || (T[7] = $("span", { class: "jse-structure-editor__hint" }, "Typ:", -1)),
|
|
2809
|
+
$("div", Br, [
|
|
2810
|
+
(u(!0), h(N, null, F(y(Ot), (K) => (u(), C(J, {
|
|
2811
|
+
key: `def-${K}`,
|
|
2812
|
+
type: "button",
|
|
2813
|
+
onClick: (Je) => S(K)
|
|
2814
|
+
}, {
|
|
2815
|
+
default: x(() => [
|
|
2816
|
+
I(" + " + R(K), 1)
|
|
2817
|
+
]),
|
|
2818
|
+
_: 2
|
|
2819
|
+
}, 1032, ["onClick"]))), 128))
|
|
2820
|
+
])
|
|
2821
|
+
])) : P("", !0),
|
|
2822
|
+
E.value ? (u(), h("div", Fr, [
|
|
2823
|
+
$("div", Mr, [
|
|
2824
|
+
w(Le, null, {
|
|
2825
|
+
default: x(() => [...T[8] || (T[8] = [
|
|
2826
|
+
I("Feldname", -1)
|
|
2827
|
+
])]),
|
|
2828
|
+
_: 1
|
|
2829
|
+
}),
|
|
2830
|
+
w(Se, {
|
|
2831
|
+
modelValue: o.value,
|
|
2832
|
+
"onUpdate:modelValue": [
|
|
2833
|
+
T[2] || (T[2] = (K) => o.value = K),
|
|
2834
|
+
T[3] || (T[3] = (K) => s.value = "")
|
|
2835
|
+
],
|
|
2836
|
+
placeholder: "z. B. name"
|
|
2837
|
+
}, null, 8, ["modelValue"])
|
|
2838
|
+
]),
|
|
2839
|
+
s.value ? (u(), h("p", zr, R(s.value), 1)) : P("", !0),
|
|
2840
|
+
T[9] || (T[9] = $("span", { class: "jse-structure-editor__hint" }, "Typ:", -1)),
|
|
2841
|
+
$("div", Jr, [
|
|
2842
|
+
(u(!0), h(N, null, F(y(Ot), (K) => (u(), C(J, {
|
|
2843
|
+
key: K,
|
|
2844
|
+
type: "button",
|
|
2845
|
+
onClick: (Je) => O(K)
|
|
2846
|
+
}, {
|
|
2847
|
+
default: x(() => [
|
|
2848
|
+
I(" + " + R(K), 1)
|
|
2849
|
+
]),
|
|
2850
|
+
_: 2
|
|
2851
|
+
}, 1032, ["onClick"]))), 128))
|
|
2852
|
+
])
|
|
2853
|
+
])) : P("", !0),
|
|
2854
|
+
B.value ? (u(), h("div", Hr, [
|
|
2855
|
+
T[11] || (T[11] = $("span", { class: "jse-structure-editor__hint" }, "Referenz ($ref):", -1)),
|
|
2856
|
+
w(ze, {
|
|
2857
|
+
modelValue: i.value,
|
|
2858
|
+
"onUpdate:modelValue": T[4] || (T[4] = (K) => i.value = K),
|
|
2859
|
+
class: "jse-field__input"
|
|
2860
|
+
}, {
|
|
2861
|
+
default: x(() => [
|
|
2862
|
+
(u(!0), h(N, null, F(V.value, (K) => (u(), h("option", {
|
|
2863
|
+
key: K,
|
|
2864
|
+
value: K
|
|
2865
|
+
}, R(K), 9, Yr))), 128))
|
|
2866
|
+
]),
|
|
2867
|
+
_: 1
|
|
2868
|
+
}, 8, ["modelValue"]),
|
|
2869
|
+
$("div", Gr, [
|
|
2870
|
+
E.value ? (u(), C(J, {
|
|
2871
|
+
key: 0,
|
|
2872
|
+
type: "button",
|
|
2873
|
+
onClick: q
|
|
2874
|
+
}, {
|
|
2875
|
+
default: x(() => [...T[10] || (T[10] = [
|
|
2876
|
+
I(" + $ref als Property ", -1)
|
|
2877
|
+
])]),
|
|
2878
|
+
_: 1
|
|
2879
|
+
})) : P("", !0),
|
|
2880
|
+
z.value ? (u(), h(N, { key: 1 }, F(r, (K) => w(J, {
|
|
2881
|
+
key: `ref-${K}`,
|
|
2882
|
+
type: "button",
|
|
2883
|
+
onClick: (Je) => g(K)
|
|
2884
|
+
}, {
|
|
2885
|
+
default: x(() => [
|
|
2886
|
+
I(" + $ref in " + R(K), 1)
|
|
2887
|
+
]),
|
|
2888
|
+
_: 2
|
|
2889
|
+
}, 1032, ["onClick"])), 64)) : P("", !0)
|
|
2890
|
+
])
|
|
2891
|
+
])) : P("", !0),
|
|
2892
|
+
z.value ? (u(), h("div", qr, [
|
|
2893
|
+
T[12] || (T[12] = $("span", { class: "jse-structure-editor__hint" }, "Kompositions-Zweig:", -1)),
|
|
2894
|
+
$("div", Xr, [
|
|
2895
|
+
(u(), h(N, null, F(r, (K) => w(J, {
|
|
2896
|
+
key: K,
|
|
2897
|
+
type: "button",
|
|
2898
|
+
onClick: (Je) => k(K)
|
|
2899
|
+
}, {
|
|
2900
|
+
default: x(() => [
|
|
2901
|
+
I(" + " + R(K), 1)
|
|
2902
|
+
]),
|
|
2903
|
+
_: 2
|
|
2904
|
+
}, 1032, ["onClick"])), 64))
|
|
2905
|
+
])
|
|
2906
|
+
])) : P("", !0),
|
|
2907
|
+
f.value ? (u(), h("div", Zr, [
|
|
2908
|
+
T[13] || (T[13] = $("span", { class: "jse-structure-editor__hint" }, "Items-Typ festlegen:", -1)),
|
|
2909
|
+
w(cn, {
|
|
2910
|
+
"current-kind": b.value,
|
|
2911
|
+
onSelect: A
|
|
2912
|
+
}, null, 8, ["current-kind"])
|
|
2913
|
+
])) : P("", !0),
|
|
2914
|
+
v.value ? (u(), h("div", Wr, [
|
|
2915
|
+
T[14] || (T[14] = $("span", { class: "jse-structure-editor__hint" }, "Typ ändern:", -1)),
|
|
2916
|
+
$("div", Qr, [
|
|
2917
|
+
(u(!0), h(N, null, F(y(Pl), (K) => (u(), C(J, {
|
|
2918
|
+
key: `change-${K}`,
|
|
2919
|
+
type: "button",
|
|
2920
|
+
onClick: (Je) => G(K)
|
|
2921
|
+
}, {
|
|
2922
|
+
default: x(() => [
|
|
2923
|
+
I(" → " + R(K), 1)
|
|
2924
|
+
]),
|
|
2925
|
+
_: 2
|
|
2926
|
+
}, 1032, ["onClick"]))), 128))
|
|
2927
|
+
])
|
|
2928
|
+
])) : P("", !0)
|
|
2929
|
+
]));
|
|
2930
|
+
}
|
|
2931
|
+
}), to = { class: "jse-structure-editor" }, no = {
|
|
2932
|
+
class: "jse-structure-editor__tree",
|
|
2933
|
+
role: "tree",
|
|
2934
|
+
"aria-label": "Schema-Struktur"
|
|
2935
|
+
}, lo = {
|
|
2936
|
+
class: "jse-structure-editor__status",
|
|
2937
|
+
"aria-live": "polite"
|
|
2938
|
+
}, ro = {
|
|
2939
|
+
key: 0,
|
|
2940
|
+
class: "jse-tree-node__kind"
|
|
2941
|
+
}, oo = { class: "jse-structure-editor__status-name" }, ao = /* @__PURE__ */ D({
|
|
2942
|
+
__name: "SchemaStructureEditor",
|
|
2943
|
+
props: {
|
|
2944
|
+
document: {},
|
|
2945
|
+
selectedPath: {}
|
|
2946
|
+
},
|
|
2947
|
+
emits: ["update:document", "update:selectedPath"],
|
|
2948
|
+
setup(e, { emit: t }) {
|
|
2949
|
+
const n = e, l = t, r = L(/* @__PURE__ */ new Set(["root", ie])), o = L(!1), a = L(!1), s = L([]), d = L([]), i = L(null), c = L(null);
|
|
2950
|
+
fe(
|
|
2951
|
+
() => n.document,
|
|
2952
|
+
(g) => {
|
|
2953
|
+
r.value.add("root"), r.value.add(ie), Ve(g, d.value) || (a.value = !1, d.value = []), Ve(g, s.value) || (o.value = !1, s.value = []), Ve(g, n.selectedPath) || l("update:selectedPath", []);
|
|
2954
|
+
}
|
|
2955
|
+
);
|
|
2956
|
+
const m = p(() => {
|
|
2957
|
+
const g = Re(n.document, n.selectedPath);
|
|
2958
|
+
return g ? qe(g, n.selectedPath) : "Kein Element ausgewählt";
|
|
2959
|
+
}), _ = p(() => {
|
|
2960
|
+
const g = Re(n.document, n.selectedPath);
|
|
2961
|
+
return g ? Pt(g) : "";
|
|
2962
|
+
}), V = p(() => {
|
|
2963
|
+
const g = Re(n.document, d.value);
|
|
2964
|
+
return g ? `Attribute – ${qe(g, d.value)}` : "Attribute";
|
|
2965
|
+
});
|
|
2966
|
+
function j(g, A) {
|
|
2967
|
+
return A.length === 0 || g.length > A.length ? !1 : g.every((G, M) => G === A[M]);
|
|
2968
|
+
}
|
|
2969
|
+
function E(g) {
|
|
2970
|
+
l("update:selectedPath", g);
|
|
2971
|
+
}
|
|
2972
|
+
function z(g) {
|
|
2973
|
+
const A = Ee(g), G = new Set(r.value);
|
|
2974
|
+
G.has(A) ? G.delete(A) : G.add(A), r.value = G;
|
|
2975
|
+
}
|
|
2976
|
+
function f(g, A) {
|
|
2977
|
+
l("update:document", g), A && l("update:selectedPath", A);
|
|
2978
|
+
}
|
|
2979
|
+
function b(g) {
|
|
2980
|
+
r.value = /* @__PURE__ */ new Set([...r.value, Ee(g)]);
|
|
2981
|
+
}
|
|
2982
|
+
async function v(g, A) {
|
|
2983
|
+
await Jt();
|
|
2984
|
+
const G = A.currentTarget, M = G instanceof HTMLElement ? G.closest(".jse-tree-node__row") : null;
|
|
2985
|
+
M instanceof HTMLElement && (g == null || g.anchorNear(M));
|
|
2986
|
+
}
|
|
2987
|
+
async function B(g, A) {
|
|
2988
|
+
a.value = !1, s.value = g, l("update:selectedPath", g), o.value = !0, await v(i.value, A);
|
|
2989
|
+
}
|
|
2990
|
+
async function U(g, A) {
|
|
2991
|
+
Ve(n.document, g) && (o.value = !1, d.value = g, l("update:selectedPath", g), a.value = !0, await v(c.value, A));
|
|
2992
|
+
}
|
|
2993
|
+
function O(g) {
|
|
2994
|
+
g.length === 0 || ot(g) || (j(g, d.value) && (a.value = !1, d.value = []), j(g, s.value) && (o.value = !1, s.value = []), f(Fl(n.document, g), []));
|
|
2995
|
+
}
|
|
2996
|
+
function q(g) {
|
|
2997
|
+
f(g), b(s.value);
|
|
2998
|
+
}
|
|
2999
|
+
function S(g) {
|
|
3000
|
+
b(g), b([...g, "items"]);
|
|
3001
|
+
}
|
|
3002
|
+
function k(g) {
|
|
3003
|
+
d.value = g, l("update:selectedPath", g);
|
|
3004
|
+
}
|
|
3005
|
+
return (g, A) => (u(), h("div", to, [
|
|
3006
|
+
A[6] || (A[6] = $("p", { class: "jse-structure-editor__hint jse-structure-editor__hint--top" }, [
|
|
3007
|
+
I(" Klicken Sie ein Element an, um es auszuwählen. Mit "),
|
|
3008
|
+
$("strong", null, "+"),
|
|
3009
|
+
I(" fügen Sie Kinder hinzu, mit dem Stift bearbeiten Sie Attribute. ")
|
|
3010
|
+
], -1)),
|
|
3011
|
+
$("div", no, [
|
|
3012
|
+
w(dn, {
|
|
3013
|
+
document: e.document,
|
|
3014
|
+
path: [],
|
|
3015
|
+
"selected-path": e.selectedPath,
|
|
3016
|
+
"expanded-keys": r.value,
|
|
3017
|
+
onSelect: E,
|
|
3018
|
+
onToggle: z,
|
|
3019
|
+
onAdd: B,
|
|
3020
|
+
onEdit: U,
|
|
3021
|
+
onDelete: O
|
|
3022
|
+
}, null, 8, ["document", "selected-path", "expanded-keys"]),
|
|
3023
|
+
w(ar, {
|
|
3024
|
+
document: e.document,
|
|
3025
|
+
"selected-path": e.selectedPath,
|
|
3026
|
+
"expanded-keys": r.value,
|
|
3027
|
+
onSelect: E,
|
|
3028
|
+
onToggle: z,
|
|
3029
|
+
onAdd: B,
|
|
3030
|
+
onEdit: U,
|
|
3031
|
+
onDelete: O
|
|
3032
|
+
}, null, 8, ["document", "selected-path", "expanded-keys"])
|
|
3033
|
+
]),
|
|
3034
|
+
$("div", lo, [
|
|
3035
|
+
A[5] || (A[5] = $("span", { class: "jse-structure-editor__status-label" }, "Ausgewählt:", -1)),
|
|
3036
|
+
_.value ? (u(), h("span", ro, R(_.value), 1)) : P("", !0),
|
|
3037
|
+
$("span", oo, R(m.value), 1)
|
|
3038
|
+
]),
|
|
3039
|
+
w(Xe, {
|
|
3040
|
+
ref_key: "addPanelRef",
|
|
3041
|
+
ref: i,
|
|
3042
|
+
modelValue: o.value,
|
|
3043
|
+
"onUpdate:modelValue": A[2] || (A[2] = (G) => o.value = G),
|
|
3044
|
+
title: "Element hinzufügen"
|
|
3045
|
+
}, {
|
|
3046
|
+
default: x(() => [
|
|
3047
|
+
w(eo, {
|
|
3048
|
+
document: e.document,
|
|
3049
|
+
"target-path": s.value,
|
|
3050
|
+
"onUpdate:document": q,
|
|
3051
|
+
onDone: A[0] || (A[0] = (G) => o.value = !1),
|
|
3052
|
+
onItemsSet: A[1] || (A[1] = (G) => S(G))
|
|
3053
|
+
}, null, 8, ["document", "target-path"])
|
|
3054
|
+
]),
|
|
3055
|
+
_: 1
|
|
3056
|
+
}, 8, ["modelValue"]),
|
|
3057
|
+
w(Xe, {
|
|
3058
|
+
ref_key: "attributesPanelRef",
|
|
3059
|
+
ref: c,
|
|
3060
|
+
modelValue: a.value,
|
|
3061
|
+
"onUpdate:modelValue": A[4] || (A[4] = (G) => a.value = G),
|
|
3062
|
+
title: V.value,
|
|
3063
|
+
"initial-width": 360,
|
|
3064
|
+
"initial-height": 420
|
|
3065
|
+
}, {
|
|
3066
|
+
default: x(() => [
|
|
3067
|
+
y(Ve)(e.document, d.value) ? (u(), C(Cr, {
|
|
3068
|
+
key: 0,
|
|
3069
|
+
document: e.document,
|
|
3070
|
+
"selected-path": d.value,
|
|
3071
|
+
"onUpdate:document": A[3] || (A[3] = (G) => f(G)),
|
|
3072
|
+
"onUpdate:selectedPath": k
|
|
3073
|
+
}, null, 8, ["document", "selected-path"])) : P("", !0)
|
|
3074
|
+
]),
|
|
3075
|
+
_: 1
|
|
3076
|
+
}, 8, ["modelValue", "title"])
|
|
3077
|
+
]));
|
|
3078
|
+
}
|
|
3079
|
+
});
|
|
3080
|
+
function ae(e) {
|
|
3081
|
+
return e.length ? e.join(".") : "root";
|
|
3082
|
+
}
|
|
3083
|
+
function ee(e) {
|
|
3084
|
+
return e instanceof We || e instanceof Qe || e instanceof ue || e instanceof et || e instanceof Ne || e instanceof tt || e instanceof Be;
|
|
3085
|
+
}
|
|
3086
|
+
function st(e) {
|
|
3087
|
+
return e instanceof de ? e.label ?? e.scope : e instanceof ue ? e.label ?? "Group" : e instanceof Ne ? e.label ?? "Category" : e instanceof Be ? e.label ?? "Step" : e instanceof ke ? e.text : e instanceof et ? "Categorization" : e instanceof tt ? "Stepper" : e.elementKind;
|
|
3088
|
+
}
|
|
3089
|
+
function oe(e, t) {
|
|
3090
|
+
let n = e;
|
|
3091
|
+
for (const l of t) {
|
|
3092
|
+
if (!ee(n))
|
|
3093
|
+
throw new Error("Kein Layout");
|
|
3094
|
+
const r = n.getChild(l);
|
|
3095
|
+
if (!r) throw new Error(`Kind an Index ${l} fehlt`);
|
|
3096
|
+
n = r;
|
|
3097
|
+
}
|
|
3098
|
+
return n;
|
|
3099
|
+
}
|
|
3100
|
+
function Ze(e) {
|
|
3101
|
+
return e.slice(0, -1);
|
|
3102
|
+
}
|
|
3103
|
+
function he(e, t, n) {
|
|
3104
|
+
if (t.length === 0) return n.clone();
|
|
3105
|
+
const l = t.slice(0, -1), r = t[t.length - 1], o = oe(e, l);
|
|
3106
|
+
if (!ee(o)) throw new Error("Eltern ist kein Layout");
|
|
3107
|
+
const a = o.clone();
|
|
3108
|
+
if (!ee(a)) throw new Error("Eltern ist kein Layout");
|
|
3109
|
+
const s = t.slice(l.length + 1);
|
|
3110
|
+
if (s.length === 0)
|
|
3111
|
+
a.setChild(r, n.clone());
|
|
3112
|
+
else {
|
|
3113
|
+
const d = a.getChild(r);
|
|
3114
|
+
if (!d) throw new Error(`Kind an Index ${r} fehlt`);
|
|
3115
|
+
a.setChild(r, he(d, s, n));
|
|
3116
|
+
}
|
|
3117
|
+
return he(e, l, a);
|
|
3118
|
+
}
|
|
3119
|
+
function so(e, t, n, l) {
|
|
3120
|
+
const r = oe(e, t);
|
|
3121
|
+
if (!ee(r)) throw new Error("Eltern ist kein Layout");
|
|
3122
|
+
const o = r.clone();
|
|
3123
|
+
if (!ee(o)) throw new Error("Eltern ist kein Layout");
|
|
3124
|
+
return o.insertChild(o.elements.length, n.clone()), he(e, t, o);
|
|
3125
|
+
}
|
|
3126
|
+
function io(e, t) {
|
|
3127
|
+
if (t.length === 0) return e;
|
|
3128
|
+
const n = Ze(t), l = oe(e, n);
|
|
3129
|
+
if (!ee(l)) throw new Error("Eltern ist kein Layout");
|
|
3130
|
+
const r = l.clone();
|
|
3131
|
+
if (!ee(r)) throw new Error("Eltern ist kein Layout");
|
|
3132
|
+
return r.removeChild(t[t.length - 1]), he(e, n, r);
|
|
3133
|
+
}
|
|
3134
|
+
function uo(e, t, n) {
|
|
3135
|
+
const l = Ze(t), r = Ze(n);
|
|
3136
|
+
if (ae(l) !== ae(r))
|
|
3137
|
+
return e;
|
|
3138
|
+
const o = oe(e, l);
|
|
3139
|
+
if (!ee(o)) return e;
|
|
3140
|
+
const a = o.clone();
|
|
3141
|
+
return ee(a) ? (a.moveChild(t[t.length - 1], n[n.length - 1]), he(e, l, a)) : e;
|
|
3142
|
+
}
|
|
3143
|
+
function fn(e, t) {
|
|
3144
|
+
switch (e) {
|
|
3145
|
+
case "Control":
|
|
3146
|
+
return new de((t == null ? void 0 : t.scope) ?? "#/properties/field", (t == null ? void 0 : t.label) ?? "Feld");
|
|
3147
|
+
case "Group":
|
|
3148
|
+
return new ue((t == null ? void 0 : t.label) ?? "Gruppe");
|
|
3149
|
+
case "HorizontalLayout":
|
|
3150
|
+
return new Qe();
|
|
3151
|
+
case "Label":
|
|
3152
|
+
return new ke((t == null ? void 0 : t.text) ?? "Beschriftung");
|
|
3153
|
+
case "Categorization":
|
|
3154
|
+
return new et();
|
|
3155
|
+
case "Category":
|
|
3156
|
+
return new Ne((t == null ? void 0 : t.label) ?? "Kategorie");
|
|
3157
|
+
case "Stepper":
|
|
3158
|
+
return new tt();
|
|
3159
|
+
case "Step":
|
|
3160
|
+
return new Be((t == null ? void 0 : t.label) ?? "Schritt");
|
|
3161
|
+
default:
|
|
3162
|
+
return new We();
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
function Nt(e, t, n, l) {
|
|
3166
|
+
const r = oe(e, t);
|
|
3167
|
+
if (!(r instanceof de)) return e;
|
|
3168
|
+
const o = r.clone();
|
|
3169
|
+
return o.scope = n, l !== void 0 && (o.label = l), he(e, t, o);
|
|
3170
|
+
}
|
|
3171
|
+
function co(e, t, n, l) {
|
|
3172
|
+
const r = oe(e, t);
|
|
3173
|
+
if (!ee(r)) return e;
|
|
3174
|
+
const o = fn(
|
|
3175
|
+
n,
|
|
3176
|
+
n === "Group" ? { label: l ?? (r instanceof ue ? r.label : void 0) } : void 0
|
|
3177
|
+
);
|
|
3178
|
+
for (const a of r.elements)
|
|
3179
|
+
ee(o) && o.addChild(a.clone());
|
|
3180
|
+
return he(e, t, o);
|
|
3181
|
+
}
|
|
3182
|
+
function mo(e, t, n) {
|
|
3183
|
+
const l = oe(e, t);
|
|
3184
|
+
if (!(l instanceof ue)) return e;
|
|
3185
|
+
const r = l.clone();
|
|
3186
|
+
return r.label = n.trim() || void 0, he(e, t, r);
|
|
3187
|
+
}
|
|
3188
|
+
function fo(e, t, n) {
|
|
3189
|
+
const l = oe(e, t);
|
|
3190
|
+
if (!(l instanceof ke)) return e;
|
|
3191
|
+
const r = l.clone();
|
|
3192
|
+
return r.text = n, he(e, t, r);
|
|
3193
|
+
}
|
|
3194
|
+
function vo(e, t) {
|
|
3195
|
+
if (t.length === 0) return [];
|
|
3196
|
+
const n = oe(e, t);
|
|
3197
|
+
return ee(n) ? t : Ze(t);
|
|
3198
|
+
}
|
|
3199
|
+
function ho(e, t) {
|
|
3200
|
+
return ee(e) ? e.elements.map((n, l) => [...t, l]) : [];
|
|
3201
|
+
}
|
|
3202
|
+
function po(e) {
|
|
3203
|
+
return ee(e);
|
|
3204
|
+
}
|
|
3205
|
+
function yo(e) {
|
|
3206
|
+
return e.length > 0;
|
|
3207
|
+
}
|
|
3208
|
+
const go = { class: "jse-tree-node" }, bo = { class: "jse-tree-node__kind" }, $o = { class: "jse-tree-node__label" }, So = {
|
|
3209
|
+
key: 0,
|
|
3210
|
+
class: "jse-tree-node__meta"
|
|
3211
|
+
}, Vo = {
|
|
3212
|
+
key: 0,
|
|
3213
|
+
class: "jse-tree-node__children"
|
|
3214
|
+
}, wo = /* @__PURE__ */ D({
|
|
3215
|
+
name: "UiTreeNode",
|
|
3216
|
+
__name: "UiTreeNode",
|
|
3217
|
+
props: {
|
|
3218
|
+
root: {},
|
|
3219
|
+
path: {},
|
|
3220
|
+
selectedPath: {},
|
|
3221
|
+
expandedKeys: {},
|
|
3222
|
+
depth: {},
|
|
3223
|
+
dragSourcePath: {}
|
|
3224
|
+
},
|
|
3225
|
+
emits: ["select", "toggle", "add", "edit", "delete", "dragStart", "drop"],
|
|
3226
|
+
setup(e, { emit: t }) {
|
|
3227
|
+
const n = e, l = t, r = p(() => oe(n.root, n.path)), o = p(
|
|
3228
|
+
() => ee(r.value) ? ho(r.value, n.path) : []
|
|
3229
|
+
), a = p(() => st(r.value)), s = p(() => ae(n.path)), d = p(() => ae(n.selectedPath) === s.value), i = p(
|
|
3230
|
+
() => n.path.length === 0 || n.expandedKeys.has(s.value)
|
|
3231
|
+
), c = p(() => ee(r.value)), m = L(!1), _ = p(() => po(r.value)), V = p(() => yo(n.path));
|
|
3232
|
+
function j(b) {
|
|
3233
|
+
var v;
|
|
3234
|
+
l("dragStart", n.path), (v = b.dataTransfer) == null || v.setData("text/plain", s.value), b.dataTransfer.effectAllowed = "move";
|
|
3235
|
+
}
|
|
3236
|
+
function E(b) {
|
|
3237
|
+
!c.value || !n.dragSourcePath || (b.preventDefault(), m.value = !0);
|
|
3238
|
+
}
|
|
3239
|
+
function z() {
|
|
3240
|
+
m.value = !1;
|
|
3241
|
+
}
|
|
3242
|
+
function f(b) {
|
|
3243
|
+
b.preventDefault(), m.value = !1, n.dragSourcePath && l("drop", n.path, n.dragSourcePath);
|
|
3244
|
+
}
|
|
3245
|
+
return (b, v) => {
|
|
3246
|
+
const B = Mt("UiTreeNode", !0);
|
|
3247
|
+
return u(), h("div", go, [
|
|
3248
|
+
$("div", {
|
|
3249
|
+
class: re(["jse-tree-node__row", {
|
|
3250
|
+
"jse-tree-node__row--selected": d.value,
|
|
3251
|
+
"jse-tree-node__row--drag-over": m.value
|
|
3252
|
+
}]),
|
|
3253
|
+
style: Vt({ paddingLeft: `${(e.depth ?? 0) * 16 + 4}px` }),
|
|
3254
|
+
draggable: "true",
|
|
3255
|
+
onClick: v[4] || (v[4] = (U) => l("select", e.path)),
|
|
3256
|
+
onDragstart: j,
|
|
3257
|
+
onDragover: E,
|
|
3258
|
+
onDragleave: z,
|
|
3259
|
+
onDrop: f
|
|
3260
|
+
}, [
|
|
3261
|
+
w(Dt, {
|
|
3262
|
+
"has-children": c.value && o.value.length > 0,
|
|
3263
|
+
expanded: i.value,
|
|
3264
|
+
onToggle: v[0] || (v[0] = (U) => l("toggle", e.path))
|
|
3265
|
+
}, null, 8, ["has-children", "expanded"]),
|
|
3266
|
+
$("span", bo, R(r.value.elementKind), 1),
|
|
3267
|
+
$("span", $o, R(a.value), 1),
|
|
3268
|
+
r.value instanceof y(de) ? (u(), h("span", So, R(r.value.scope), 1)) : P("", !0),
|
|
3269
|
+
w(At, {
|
|
3270
|
+
"show-add": _.value,
|
|
3271
|
+
"show-edit": !0,
|
|
3272
|
+
"show-delete": V.value,
|
|
3273
|
+
"add-label": `Element zu ${a.value} hinzufügen`,
|
|
3274
|
+
"edit-label": `${a.value} bearbeiten`,
|
|
3275
|
+
"delete-label": `${a.value} löschen`,
|
|
3276
|
+
onAdd: v[1] || (v[1] = (U) => l("add", e.path, U)),
|
|
3277
|
+
onEdit: v[2] || (v[2] = (U) => l("edit", e.path, U)),
|
|
3278
|
+
onDelete: v[3] || (v[3] = (U) => l("delete", e.path))
|
|
3279
|
+
}, null, 8, ["show-add", "show-delete", "add-label", "edit-label", "delete-label"])
|
|
3280
|
+
], 38),
|
|
3281
|
+
i.value && c.value && o.value.length ? (u(), h("div", Vo, [
|
|
3282
|
+
(u(!0), h(N, null, F(o.value, (U) => (u(), C(B, {
|
|
3283
|
+
key: y(ae)(U),
|
|
3284
|
+
root: e.root,
|
|
3285
|
+
path: U,
|
|
3286
|
+
"selected-path": e.selectedPath,
|
|
3287
|
+
"expanded-keys": e.expandedKeys,
|
|
3288
|
+
"drag-source-path": e.dragSourcePath,
|
|
3289
|
+
depth: (e.depth ?? 0) + 1,
|
|
3290
|
+
onSelect: v[5] || (v[5] = (O) => l("select", O)),
|
|
3291
|
+
onToggle: v[6] || (v[6] = (O) => l("toggle", O)),
|
|
3292
|
+
onAdd: (O, q) => l("add", O, q),
|
|
3293
|
+
onEdit: (O, q) => l("edit", O, q),
|
|
3294
|
+
onDelete: v[7] || (v[7] = (O) => l("delete", O)),
|
|
3295
|
+
onDragStart: v[8] || (v[8] = (O) => l("dragStart", O)),
|
|
3296
|
+
onDrop: v[9] || (v[9] = (O, q) => l("drop", O, q))
|
|
3297
|
+
}, null, 8, ["root", "path", "selected-path", "expanded-keys", "drag-source-path", "depth", "onAdd", "onEdit"]))), 128))
|
|
3298
|
+
])) : P("", !0)
|
|
3299
|
+
]);
|
|
3300
|
+
};
|
|
3301
|
+
}
|
|
3302
|
+
}), Eo = [
|
|
3303
|
+
{ name: "scope", label: "scope" },
|
|
3304
|
+
{ name: "label", label: "label" }
|
|
3305
|
+
], ko = [
|
|
3306
|
+
{ name: "label", label: "Gruppen-Label" }
|
|
3307
|
+
], xo = [{ name: "text", label: "Text" }];
|
|
3308
|
+
function jo(e) {
|
|
3309
|
+
return e instanceof de ? [...Eo] : e instanceof ue ? [...ko] : e instanceof ke ? [...xo] : [];
|
|
3310
|
+
}
|
|
3311
|
+
function _o(e, t) {
|
|
3312
|
+
switch (t) {
|
|
3313
|
+
case "scope":
|
|
3314
|
+
return e instanceof de ? e.scope : void 0;
|
|
3315
|
+
case "label":
|
|
3316
|
+
return e instanceof de || e instanceof ue ? e.label ?? "" : void 0;
|
|
3317
|
+
case "text":
|
|
3318
|
+
return e instanceof ke ? e.text : void 0;
|
|
3319
|
+
default:
|
|
3320
|
+
return e.getCustomAttribute(t);
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
function Co(e, t, n, l) {
|
|
3324
|
+
const r = oe(e, t);
|
|
3325
|
+
switch (n) {
|
|
3326
|
+
case "scope":
|
|
3327
|
+
if (r instanceof de) {
|
|
3328
|
+
const o = typeof l == "string" ? l.trim() : "";
|
|
3329
|
+
return Nt(e, t, o || "#");
|
|
3330
|
+
}
|
|
3331
|
+
break;
|
|
3332
|
+
case "label":
|
|
3333
|
+
if (r instanceof de) {
|
|
3334
|
+
const o = typeof l == "string" && l.trim() || void 0;
|
|
3335
|
+
return Nt(e, t, r.scope, o);
|
|
3336
|
+
}
|
|
3337
|
+
if (r instanceof ue)
|
|
3338
|
+
return mo(e, t, typeof l == "string" ? l : "");
|
|
3339
|
+
break;
|
|
3340
|
+
case "text":
|
|
3341
|
+
if (r instanceof ke)
|
|
3342
|
+
return fo(e, t, typeof l == "string" ? l : "");
|
|
3343
|
+
break;
|
|
3344
|
+
}
|
|
3345
|
+
return e;
|
|
3346
|
+
}
|
|
3347
|
+
function To(e, t, n) {
|
|
3348
|
+
const l = p(() => {
|
|
3349
|
+
try {
|
|
3350
|
+
return oe(e.value, t.value);
|
|
3351
|
+
} catch {
|
|
3352
|
+
return e.value;
|
|
3353
|
+
}
|
|
3354
|
+
}), r = p(() => ee(l.value)), o = p(() => jo(l.value)), a = p(() => {
|
|
3355
|
+
const m = l.value;
|
|
3356
|
+
return m instanceof We ? "VerticalLayout" : m instanceof Qe ? "HorizontalLayout" : m instanceof ue ? "Group" : null;
|
|
3357
|
+
});
|
|
3358
|
+
function s(m) {
|
|
3359
|
+
n("update:root", m);
|
|
3360
|
+
}
|
|
3361
|
+
function d(m) {
|
|
3362
|
+
return _o(l.value, m);
|
|
3363
|
+
}
|
|
3364
|
+
function i(m, _) {
|
|
3365
|
+
s(Co(e.value, t.value, m, _));
|
|
3366
|
+
}
|
|
3367
|
+
function c(m) {
|
|
3368
|
+
if (!a.value) return;
|
|
3369
|
+
const _ = m === "Group" && l.value instanceof ue ? l.value.label : void 0;
|
|
3370
|
+
s(co(e.value, t.value, m, _));
|
|
3371
|
+
}
|
|
3372
|
+
return {
|
|
3373
|
+
selectedElement: l,
|
|
3374
|
+
isLayout: r,
|
|
3375
|
+
layoutKind: a,
|
|
3376
|
+
attributeFields: o,
|
|
3377
|
+
readAttribute: d,
|
|
3378
|
+
updateAttribute: i,
|
|
3379
|
+
setLayoutKind: c,
|
|
3380
|
+
getUiElementLabel: st
|
|
3381
|
+
};
|
|
3382
|
+
}
|
|
3383
|
+
const Ro = { class: "jse-attributes-panel" }, Po = {
|
|
3384
|
+
key: 0,
|
|
3385
|
+
class: "jse-structure-editor__hint"
|
|
3386
|
+
}, Do = { class: "jse-structure-editor__buttons" }, Ao = /* @__PURE__ */ D({
|
|
3387
|
+
__name: "UiAttributesPanel",
|
|
3388
|
+
props: {
|
|
3389
|
+
root: {},
|
|
3390
|
+
selectedPath: {}
|
|
3391
|
+
},
|
|
3392
|
+
emits: ["update:root"],
|
|
3393
|
+
setup(e, { emit: t }) {
|
|
3394
|
+
const n = e, l = t, {
|
|
3395
|
+
selectedElement: r,
|
|
3396
|
+
isLayout: o,
|
|
3397
|
+
layoutKind: a,
|
|
3398
|
+
attributeFields: s,
|
|
3399
|
+
readAttribute: d,
|
|
3400
|
+
updateAttribute: i,
|
|
3401
|
+
setLayoutKind: c,
|
|
3402
|
+
getUiElementLabel: m
|
|
3403
|
+
} = To(Q(n, "root"), Q(n, "selectedPath"), l);
|
|
3404
|
+
return (_, V) => (u(), h("div", Ro, [
|
|
3405
|
+
e.selectedPath.length === 0 ? (u(), h("p", Po, " Root-Layout: " + R(y(m)(y(r))), 1)) : P("", !0),
|
|
3406
|
+
y(o) ? (u(), C(me, {
|
|
3407
|
+
key: 1,
|
|
3408
|
+
label: "Layout-Typ"
|
|
3409
|
+
}, {
|
|
3410
|
+
default: x(() => [
|
|
3411
|
+
$("div", Do, [
|
|
3412
|
+
w(J, {
|
|
3413
|
+
type: "button",
|
|
3414
|
+
class: re({ "jse-btn--active": y(a) === "VerticalLayout" }),
|
|
3415
|
+
onClick: V[0] || (V[0] = (j) => y(c)("VerticalLayout"))
|
|
3416
|
+
}, {
|
|
3417
|
+
default: x(() => [...V[3] || (V[3] = [
|
|
3418
|
+
I(" VerticalLayout ", -1)
|
|
3419
|
+
])]),
|
|
3420
|
+
_: 1
|
|
3421
|
+
}, 8, ["class"]),
|
|
3422
|
+
w(J, {
|
|
3423
|
+
type: "button",
|
|
3424
|
+
class: re({ "jse-btn--active": y(a) === "HorizontalLayout" }),
|
|
3425
|
+
onClick: V[1] || (V[1] = (j) => y(c)("HorizontalLayout"))
|
|
3426
|
+
}, {
|
|
3427
|
+
default: x(() => [...V[4] || (V[4] = [
|
|
3428
|
+
I(" HorizontalLayout ", -1)
|
|
3429
|
+
])]),
|
|
3430
|
+
_: 1
|
|
3431
|
+
}, 8, ["class"]),
|
|
3432
|
+
w(J, {
|
|
3433
|
+
type: "button",
|
|
3434
|
+
class: re({ "jse-btn--active": y(a) === "Group" }),
|
|
3435
|
+
onClick: V[2] || (V[2] = (j) => y(c)("Group"))
|
|
3436
|
+
}, {
|
|
3437
|
+
default: x(() => [...V[5] || (V[5] = [
|
|
3438
|
+
I(" Group ", -1)
|
|
3439
|
+
])]),
|
|
3440
|
+
_: 1
|
|
3441
|
+
}, 8, ["class"])
|
|
3442
|
+
])
|
|
3443
|
+
]),
|
|
3444
|
+
_: 1
|
|
3445
|
+
})) : P("", !0),
|
|
3446
|
+
(u(!0), h(N, null, F(y(s), (j) => (u(), C(mn, {
|
|
3447
|
+
key: j.name,
|
|
3448
|
+
node: y(r),
|
|
3449
|
+
"attribute-name": j.name,
|
|
3450
|
+
label: j.label,
|
|
3451
|
+
mode: "ui",
|
|
3452
|
+
"model-value": y(d)(j.name),
|
|
3453
|
+
"onUpdate:modelValue": (E) => y(i)(j.name, E)
|
|
3454
|
+
}, null, 8, ["node", "attribute-name", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
3455
|
+
]));
|
|
3456
|
+
}
|
|
3457
|
+
}), Io = { class: "jse-element-actions" }, Uo = { class: "jse-element-actions__target" }, Oo = { class: "jse-element-actions__kind" }, Ko = { class: "jse-element-actions__section" }, Lo = { class: "jse-structure-editor__buttons" }, No = /* @__PURE__ */ D({
|
|
3458
|
+
__name: "UiElementActions",
|
|
3459
|
+
props: {
|
|
3460
|
+
root: {},
|
|
3461
|
+
targetPath: {}
|
|
3462
|
+
},
|
|
3463
|
+
emits: ["update:root", "done"],
|
|
3464
|
+
setup(e, { emit: t }) {
|
|
3465
|
+
const n = e, l = t, r = p(() => oe(n.root, n.targetPath)), o = p(() => st(r.value)), a = p(() => vo(n.root, n.targetPath));
|
|
3466
|
+
function s(d) {
|
|
3467
|
+
const i = fn(d);
|
|
3468
|
+
l("update:root", so(n.root, a.value, i)), l("done");
|
|
3469
|
+
}
|
|
3470
|
+
return (d, i) => (u(), h("div", Io, [
|
|
3471
|
+
$("p", Uo, [
|
|
3472
|
+
i[9] || (i[9] = I(" Ziel: ", -1)),
|
|
3473
|
+
$("strong", null, R(o.value), 1),
|
|
3474
|
+
$("span", Oo, "(" + R(r.value.elementKind) + ")", 1)
|
|
3475
|
+
]),
|
|
3476
|
+
$("div", Ko, [
|
|
3477
|
+
i[19] || (i[19] = $("span", { class: "jse-structure-editor__hint" }, "UI-Element hinzufügen:", -1)),
|
|
3478
|
+
$("div", Lo, [
|
|
3479
|
+
w(J, {
|
|
3480
|
+
type: "button",
|
|
3481
|
+
onClick: i[0] || (i[0] = (c) => s("Control"))
|
|
3482
|
+
}, {
|
|
3483
|
+
default: x(() => [...i[10] || (i[10] = [
|
|
3484
|
+
I("+ Control", -1)
|
|
3485
|
+
])]),
|
|
3486
|
+
_: 1
|
|
3487
|
+
}),
|
|
3488
|
+
w(J, {
|
|
3489
|
+
type: "button",
|
|
3490
|
+
onClick: i[1] || (i[1] = (c) => s("Group"))
|
|
3491
|
+
}, {
|
|
3492
|
+
default: x(() => [...i[11] || (i[11] = [
|
|
3493
|
+
I("+ Group", -1)
|
|
3494
|
+
])]),
|
|
3495
|
+
_: 1
|
|
3496
|
+
}),
|
|
3497
|
+
w(J, {
|
|
3498
|
+
type: "button",
|
|
3499
|
+
onClick: i[2] || (i[2] = (c) => s("VerticalLayout"))
|
|
3500
|
+
}, {
|
|
3501
|
+
default: x(() => [...i[12] || (i[12] = [
|
|
3502
|
+
I("+ VerticalLayout", -1)
|
|
3503
|
+
])]),
|
|
3504
|
+
_: 1
|
|
3505
|
+
}),
|
|
3506
|
+
w(J, {
|
|
3507
|
+
type: "button",
|
|
3508
|
+
onClick: i[3] || (i[3] = (c) => s("HorizontalLayout"))
|
|
3509
|
+
}, {
|
|
3510
|
+
default: x(() => [...i[13] || (i[13] = [
|
|
3511
|
+
I("+ HorizontalLayout", -1)
|
|
3512
|
+
])]),
|
|
3513
|
+
_: 1
|
|
3514
|
+
}),
|
|
3515
|
+
w(J, {
|
|
3516
|
+
type: "button",
|
|
3517
|
+
onClick: i[4] || (i[4] = (c) => s("Label"))
|
|
3518
|
+
}, {
|
|
3519
|
+
default: x(() => [...i[14] || (i[14] = [
|
|
3520
|
+
I("+ Label", -1)
|
|
3521
|
+
])]),
|
|
3522
|
+
_: 1
|
|
3523
|
+
}),
|
|
3524
|
+
w(J, {
|
|
3525
|
+
type: "button",
|
|
3526
|
+
onClick: i[5] || (i[5] = (c) => s("Categorization"))
|
|
3527
|
+
}, {
|
|
3528
|
+
default: x(() => [...i[15] || (i[15] = [
|
|
3529
|
+
I("+ Categorization", -1)
|
|
3530
|
+
])]),
|
|
3531
|
+
_: 1
|
|
3532
|
+
}),
|
|
3533
|
+
w(J, {
|
|
3534
|
+
type: "button",
|
|
3535
|
+
onClick: i[6] || (i[6] = (c) => s("Category"))
|
|
3536
|
+
}, {
|
|
3537
|
+
default: x(() => [...i[16] || (i[16] = [
|
|
3538
|
+
I("+ Category", -1)
|
|
3539
|
+
])]),
|
|
3540
|
+
_: 1
|
|
3541
|
+
}),
|
|
3542
|
+
w(J, {
|
|
3543
|
+
type: "button",
|
|
3544
|
+
onClick: i[7] || (i[7] = (c) => s("Stepper"))
|
|
3545
|
+
}, {
|
|
3546
|
+
default: x(() => [...i[17] || (i[17] = [
|
|
3547
|
+
I("+ Stepper", -1)
|
|
3548
|
+
])]),
|
|
3549
|
+
_: 1
|
|
3550
|
+
}),
|
|
3551
|
+
w(J, {
|
|
3552
|
+
type: "button",
|
|
3553
|
+
onClick: i[8] || (i[8] = (c) => s("Step"))
|
|
3554
|
+
}, {
|
|
3555
|
+
default: x(() => [...i[18] || (i[18] = [
|
|
3556
|
+
I("+ Step", -1)
|
|
3557
|
+
])]),
|
|
3558
|
+
_: 1
|
|
3559
|
+
})
|
|
3560
|
+
])
|
|
3561
|
+
])
|
|
3562
|
+
]));
|
|
3563
|
+
}
|
|
3564
|
+
}), Bo = { class: "jse-structure-editor" }, Fo = {
|
|
3565
|
+
class: "jse-structure-editor__tree",
|
|
3566
|
+
role: "tree",
|
|
3567
|
+
"aria-label": "UI-Struktur"
|
|
3568
|
+
}, Mo = /* @__PURE__ */ D({
|
|
3569
|
+
__name: "UiStructureEditor",
|
|
3570
|
+
props: {
|
|
3571
|
+
root: {},
|
|
3572
|
+
selectedPath: {}
|
|
3573
|
+
},
|
|
3574
|
+
emits: ["update:root", "update:selectedPath"],
|
|
3575
|
+
setup(e, { emit: t }) {
|
|
3576
|
+
const n = e, l = t, r = L(/* @__PURE__ */ new Set(["root"])), o = L(null), a = L(!1), s = L(!1), d = L([]), i = L([]), c = L(null), m = L(null), _ = p(() => {
|
|
3577
|
+
try {
|
|
3578
|
+
const S = oe(n.root, i.value);
|
|
3579
|
+
return `UI – ${st(S)}`;
|
|
3580
|
+
} catch {
|
|
3581
|
+
return "UI bearbeiten";
|
|
3582
|
+
}
|
|
3583
|
+
});
|
|
3584
|
+
function V(S, k) {
|
|
3585
|
+
l("update:root", S), k && l("update:selectedPath", k);
|
|
3586
|
+
}
|
|
3587
|
+
function j(S) {
|
|
3588
|
+
l("update:selectedPath", S);
|
|
3589
|
+
}
|
|
3590
|
+
function E(S) {
|
|
3591
|
+
const k = ae(S), g = new Set(r.value);
|
|
3592
|
+
g.has(k) ? g.delete(k) : g.add(k), r.value = g;
|
|
3593
|
+
}
|
|
3594
|
+
async function z(S, k) {
|
|
3595
|
+
await Jt();
|
|
3596
|
+
const g = k.currentTarget, A = g instanceof HTMLElement ? g.closest(".jse-tree-node__row") : null;
|
|
3597
|
+
A instanceof HTMLElement && (S == null || S.anchorNear(A));
|
|
3598
|
+
}
|
|
3599
|
+
async function f(S, k) {
|
|
3600
|
+
s.value = !1, d.value = S, l("update:selectedPath", S), a.value = !0, await z(c.value, k);
|
|
3601
|
+
}
|
|
3602
|
+
async function b(S, k) {
|
|
3603
|
+
a.value = !1, i.value = S, l("update:selectedPath", S), s.value = !0, await z(m.value, k);
|
|
3604
|
+
}
|
|
3605
|
+
function v(S) {
|
|
3606
|
+
S.length !== 0 && V(io(n.root, S), []);
|
|
3607
|
+
}
|
|
3608
|
+
function B(S) {
|
|
3609
|
+
r.value = /* @__PURE__ */ new Set([...r.value, ae(S)]);
|
|
3610
|
+
}
|
|
3611
|
+
function U(S) {
|
|
3612
|
+
V(S), B(d.value);
|
|
3613
|
+
}
|
|
3614
|
+
function O(S) {
|
|
3615
|
+
o.value = S;
|
|
3616
|
+
}
|
|
3617
|
+
function q(S, k) {
|
|
3618
|
+
if (o.value = null, ae(k) === ae(S)) return;
|
|
3619
|
+
const g = k.slice(0, -1), A = S.slice(0, -1);
|
|
3620
|
+
ae(g) === ae(A) && V(uo(n.root, k, S));
|
|
3621
|
+
}
|
|
3622
|
+
return (S, k) => (u(), h("div", Bo, [
|
|
3623
|
+
k[4] || (k[4] = $("p", { class: "jse-structure-editor__hint jse-structure-editor__hint--top" }, " Elemente per Drag & Drop innerhalb desselben Layouts sortieren. + fügt hinzu, Stift bearbeitet Layout und Eigenschaften. ", -1)),
|
|
3624
|
+
$("div", Fo, [
|
|
3625
|
+
w(wo, {
|
|
3626
|
+
root: e.root,
|
|
3627
|
+
path: [],
|
|
3628
|
+
"selected-path": e.selectedPath,
|
|
3629
|
+
"expanded-keys": r.value,
|
|
3630
|
+
"drag-source-path": o.value,
|
|
3631
|
+
onSelect: j,
|
|
3632
|
+
onToggle: E,
|
|
3633
|
+
onAdd: f,
|
|
3634
|
+
onEdit: b,
|
|
3635
|
+
onDelete: v,
|
|
3636
|
+
onDragStart: O,
|
|
3637
|
+
onDrop: q
|
|
3638
|
+
}, null, 8, ["root", "selected-path", "expanded-keys", "drag-source-path"])
|
|
3639
|
+
]),
|
|
3640
|
+
w(Xe, {
|
|
3641
|
+
ref_key: "addPanelRef",
|
|
3642
|
+
ref: c,
|
|
3643
|
+
modelValue: a.value,
|
|
3644
|
+
"onUpdate:modelValue": k[1] || (k[1] = (g) => a.value = g),
|
|
3645
|
+
title: "UI-Element hinzufügen"
|
|
3646
|
+
}, {
|
|
3647
|
+
default: x(() => [
|
|
3648
|
+
w(No, {
|
|
3649
|
+
root: e.root,
|
|
3650
|
+
"target-path": d.value,
|
|
3651
|
+
"onUpdate:root": U,
|
|
3652
|
+
onDone: k[0] || (k[0] = (g) => a.value = !1)
|
|
3653
|
+
}, null, 8, ["root", "target-path"])
|
|
3654
|
+
]),
|
|
3655
|
+
_: 1
|
|
3656
|
+
}, 8, ["modelValue"]),
|
|
3657
|
+
w(Xe, {
|
|
3658
|
+
ref_key: "attributesPanelRef",
|
|
3659
|
+
ref: m,
|
|
3660
|
+
modelValue: s.value,
|
|
3661
|
+
"onUpdate:modelValue": k[3] || (k[3] = (g) => s.value = g),
|
|
3662
|
+
title: _.value,
|
|
3663
|
+
"initial-width": 380,
|
|
3664
|
+
"initial-height": 360
|
|
3665
|
+
}, {
|
|
3666
|
+
default: x(() => [
|
|
3667
|
+
w(Ao, {
|
|
3668
|
+
root: e.root,
|
|
3669
|
+
"selected-path": i.value,
|
|
3670
|
+
"onUpdate:root": k[2] || (k[2] = (g) => V(g))
|
|
3671
|
+
}, null, 8, ["root", "selected-path"])
|
|
3672
|
+
]),
|
|
3673
|
+
_: 1
|
|
3674
|
+
}, 8, ["modelValue", "title"])
|
|
3675
|
+
]));
|
|
3676
|
+
}
|
|
3677
|
+
}), zo = Symbol("rendererRegistry"), vn = Symbol("editorContext");
|
|
3678
|
+
class Jo {
|
|
3679
|
+
constructor(t = wt, n = Et, l = jt) {
|
|
3680
|
+
this.schemaFormTypes = t, this.schemaEditorTypes = n, this.schemaAttributes = l;
|
|
3681
|
+
}
|
|
3682
|
+
registerFormKind(t, n) {
|
|
3683
|
+
return this.schemaFormTypes.registerKind(t, n), this;
|
|
3684
|
+
}
|
|
3685
|
+
registerFormAttribute(t, n) {
|
|
3686
|
+
return this.schemaAttributes.registerName(t, n), this;
|
|
3687
|
+
}
|
|
3688
|
+
registerEditorKind(t, n) {
|
|
3689
|
+
return this.schemaEditorTypes.registerKind(t, n), this;
|
|
3690
|
+
}
|
|
3691
|
+
registerEditorAttribute(t, n) {
|
|
3692
|
+
return this.schemaAttributes.registerName(t, n), this;
|
|
3693
|
+
}
|
|
3694
|
+
registerFormInstanceOf(t, n, l) {
|
|
3695
|
+
return this.schemaFormTypes.registerInstanceOf(t, n, { priority: l }), this;
|
|
3696
|
+
}
|
|
3697
|
+
registerFormMatch(t, n, l) {
|
|
3698
|
+
return this.schemaFormTypes.registerMatch(t, n, l), this;
|
|
3699
|
+
}
|
|
3700
|
+
setDefaultFormRenderer(t) {
|
|
3701
|
+
return this.schemaFormTypes.setDefault(t), this;
|
|
3702
|
+
}
|
|
3703
|
+
setDefaultEditorKindRenderer(t) {
|
|
3704
|
+
return this.schemaEditorTypes.setDefault(t), this;
|
|
3705
|
+
}
|
|
3706
|
+
setDefaultEditorAttributeRenderer(t) {
|
|
3707
|
+
return this.schemaAttributes.setDefault(t), this;
|
|
3708
|
+
}
|
|
3709
|
+
resolveFormRenderer(t, n) {
|
|
3710
|
+
if (n) {
|
|
3711
|
+
const l = this.schemaAttributes.resolve({
|
|
3712
|
+
node: t,
|
|
3713
|
+
attributeName: n,
|
|
3714
|
+
label: n,
|
|
3715
|
+
value: void 0
|
|
3716
|
+
});
|
|
3717
|
+
if (l) return l;
|
|
3718
|
+
}
|
|
3719
|
+
return this.schemaFormTypes.resolve(t);
|
|
3720
|
+
}
|
|
3721
|
+
resolveEditorKindRenderer(t) {
|
|
3722
|
+
return this.schemaEditorTypes.resolve(t);
|
|
3723
|
+
}
|
|
3724
|
+
resolveEditorAttributeRenderer(t) {
|
|
3725
|
+
return this.schemaAttributes.resolve({
|
|
3726
|
+
node: {},
|
|
3727
|
+
attributeName: t,
|
|
3728
|
+
label: t,
|
|
3729
|
+
value: void 0
|
|
3730
|
+
});
|
|
3731
|
+
}
|
|
3732
|
+
/** Direkter Zugriff auf die Typ-Registry (Formular). */
|
|
3733
|
+
get schemaFormTypeRegistry() {
|
|
3734
|
+
return this.schemaFormTypes;
|
|
3735
|
+
}
|
|
3736
|
+
/** Direkter Zugriff auf die Typ-Registry (Editor). */
|
|
3737
|
+
get schemaEditorTypeRegistry() {
|
|
3738
|
+
return this.schemaEditorTypes;
|
|
3739
|
+
}
|
|
3740
|
+
/** Direkter Zugriff auf die Attribut-Registry (Schema). */
|
|
3741
|
+
get schemaAttributeControlRegistry() {
|
|
3742
|
+
return this.schemaAttributes;
|
|
3743
|
+
}
|
|
3744
|
+
/** UI-Formular-Typen. */
|
|
3745
|
+
get uiFormTypeRegistry() {
|
|
3746
|
+
return kt;
|
|
3747
|
+
}
|
|
3748
|
+
/** UI-Editor-Typen. */
|
|
3749
|
+
get uiEditorTypeRegistry() {
|
|
3750
|
+
return xt;
|
|
3751
|
+
}
|
|
3752
|
+
/** UI-Attribut-Controls. */
|
|
3753
|
+
get uiAttributeControlRegistry() {
|
|
3754
|
+
return _t;
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
const Ho = new Jo(), Yo = [
|
|
3758
|
+
{
|
|
3759
|
+
id: "schema",
|
|
3760
|
+
label: "Schema",
|
|
3761
|
+
description: "Datenstruktur, Typen und Validierung definieren."
|
|
3762
|
+
},
|
|
3763
|
+
{
|
|
3764
|
+
id: "ui",
|
|
3765
|
+
label: "Schema-UI",
|
|
3766
|
+
description: "Layout, Gruppierung und Darstellung des Formulars anpassen."
|
|
3767
|
+
}
|
|
3768
|
+
];
|
|
3769
|
+
function Go(e, t, n) {
|
|
3770
|
+
const l = L("schema"), r = L([]), o = L([]), a = L(!1), s = L(!1), d = It(e.value), i = It(t.value);
|
|
3771
|
+
fe(
|
|
3772
|
+
e,
|
|
3773
|
+
(f) => {
|
|
3774
|
+
d.value = f;
|
|
3775
|
+
},
|
|
3776
|
+
{ immediate: !0 }
|
|
3777
|
+
), fe(t, (f) => {
|
|
3778
|
+
i.value = f;
|
|
3779
|
+
});
|
|
3780
|
+
const c = p(() => i.value.root);
|
|
3781
|
+
function m(f) {
|
|
3782
|
+
if (d.value = f, n("update:schema", f), !a.value) {
|
|
3783
|
+
const b = He.generateForSchema(f.root, "#", (v) => f.resolveRef(v));
|
|
3784
|
+
i.value = b, n("update:uiSchema", b);
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
function _(f) {
|
|
3788
|
+
a.value = !0;
|
|
3789
|
+
const b = new He(f);
|
|
3790
|
+
i.value = b, n("update:uiSchema", b);
|
|
3791
|
+
}
|
|
3792
|
+
function V() {
|
|
3793
|
+
a.value = !1;
|
|
3794
|
+
const f = d.value, b = He.generateForSchema(f.root, "#", (v) => f.resolveRef(v));
|
|
3795
|
+
i.value = b, n("update:uiSchema", b);
|
|
3796
|
+
}
|
|
3797
|
+
function j(f, b = !0) {
|
|
3798
|
+
b && (a.value = !0), i.value = f, n("update:uiSchema", f);
|
|
3799
|
+
}
|
|
3800
|
+
const E = p({
|
|
3801
|
+
get: () => JSON.stringify(d.value.toJSON(), null, 2),
|
|
3802
|
+
set: (f) => {
|
|
3803
|
+
try {
|
|
3804
|
+
const b = JSON.parse(f);
|
|
3805
|
+
m(bn(b));
|
|
3806
|
+
} catch {
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
}), z = p({
|
|
3810
|
+
get: () => JSON.stringify(i.value.toJSON(), null, 2),
|
|
3811
|
+
set: (f) => {
|
|
3812
|
+
try {
|
|
3813
|
+
const b = JSON.parse(f);
|
|
3814
|
+
a.value = !0;
|
|
3815
|
+
const v = He.fromJSON(b);
|
|
3816
|
+
i.value = v, n("update:uiSchema", v);
|
|
3817
|
+
} catch {
|
|
3818
|
+
}
|
|
3819
|
+
}
|
|
3820
|
+
});
|
|
3821
|
+
return wn(vn, {
|
|
3822
|
+
document: d,
|
|
3823
|
+
schema: p(() => d.value.root),
|
|
3824
|
+
uiSchema: i,
|
|
3825
|
+
updateDocument: m,
|
|
3826
|
+
updateSchema: m,
|
|
3827
|
+
updateUiSchema: j
|
|
3828
|
+
}), {
|
|
3829
|
+
editorTab: l,
|
|
3830
|
+
selectedSchemaPath: r,
|
|
3831
|
+
selectedUiPath: o,
|
|
3832
|
+
uiManualEdit: a,
|
|
3833
|
+
showAdvancedJson: s,
|
|
3834
|
+
documentRef: d,
|
|
3835
|
+
uiSchemaRef: i,
|
|
3836
|
+
uiRoot: c,
|
|
3837
|
+
updateDocument: m,
|
|
3838
|
+
updateUiRoot: _,
|
|
3839
|
+
regenerateUiFromSchema: V,
|
|
3840
|
+
schemaJson: E,
|
|
3841
|
+
uiSchemaJson: z
|
|
3842
|
+
};
|
|
3843
|
+
}
|
|
3844
|
+
const qo = { class: "jse-editor" }, Xo = { class: "jse-editor__panel jse-editor__panel--main" }, Zo = {
|
|
3845
|
+
id: "jse-editor-schema",
|
|
3846
|
+
class: "jse-editor__tab-panel",
|
|
3847
|
+
role: "tabpanel",
|
|
3848
|
+
"aria-labelledby": "jse-editor-tab-schema"
|
|
3849
|
+
}, Wo = {
|
|
3850
|
+
id: "jse-editor-ui",
|
|
3851
|
+
class: "jse-editor__tab-panel",
|
|
3852
|
+
role: "tabpanel",
|
|
3853
|
+
"aria-labelledby": "jse-editor-tab-ui"
|
|
3854
|
+
}, Qo = {
|
|
3855
|
+
key: 0,
|
|
3856
|
+
class: "jse-editor__banner"
|
|
3857
|
+
}, ea = ["open"], ta = { class: "jse-editor__json" }, na = { class: "jse-editor__json" }, la = /* @__PURE__ */ D({
|
|
3858
|
+
__name: "JsonSchemaFormEditor",
|
|
3859
|
+
props: {
|
|
3860
|
+
schema: {},
|
|
3861
|
+
uiSchema: {}
|
|
3862
|
+
},
|
|
3863
|
+
emits: ["update:schema", "update:uiSchema"],
|
|
3864
|
+
setup(e, { emit: t }) {
|
|
3865
|
+
const n = e, l = t, {
|
|
3866
|
+
editorTab: r,
|
|
3867
|
+
selectedSchemaPath: o,
|
|
3868
|
+
selectedUiPath: a,
|
|
3869
|
+
uiManualEdit: s,
|
|
3870
|
+
showAdvancedJson: d,
|
|
3871
|
+
documentRef: i,
|
|
3872
|
+
uiRoot: c,
|
|
3873
|
+
updateDocument: m,
|
|
3874
|
+
updateUiRoot: _,
|
|
3875
|
+
regenerateUiFromSchema: V,
|
|
3876
|
+
schemaJson: j,
|
|
3877
|
+
uiSchemaJson: E
|
|
3878
|
+
} = Go(Q(n, "schema"), Q(n, "uiSchema"), l);
|
|
3879
|
+
return (z, f) => (u(), h("div", qo, [
|
|
3880
|
+
$("section", Xo, [
|
|
3881
|
+
w(Xt, {
|
|
3882
|
+
modelValue: y(r),
|
|
3883
|
+
"onUpdate:modelValue": f[0] || (f[0] = (b) => it(r) ? r.value = b : null),
|
|
3884
|
+
"panel-id-prefix": "jse-editor",
|
|
3885
|
+
tabs: y(Yo)
|
|
3886
|
+
}, null, 8, ["modelValue", "tabs"]),
|
|
3887
|
+
Ue($("div", Zo, [
|
|
3888
|
+
w(ao, {
|
|
3889
|
+
document: y(i),
|
|
3890
|
+
"selected-path": y(o),
|
|
3891
|
+
"onUpdate:document": y(m),
|
|
3892
|
+
"onUpdate:selectedPath": f[1] || (f[1] = (b) => o.value = b)
|
|
3893
|
+
}, null, 8, ["document", "selected-path", "onUpdate:document"])
|
|
3894
|
+
], 512), [
|
|
3895
|
+
[Oe, y(r) === "schema"]
|
|
3896
|
+
]),
|
|
3897
|
+
Ue($("div", Wo, [
|
|
3898
|
+
y(s) ? (u(), h("div", Qo, [
|
|
3899
|
+
f[7] || (f[7] = I(" UI manuell bearbeitet. ", -1)),
|
|
3900
|
+
w(J, {
|
|
3901
|
+
type: "button",
|
|
3902
|
+
onClick: y(V)
|
|
3903
|
+
}, {
|
|
3904
|
+
default: x(() => [...f[6] || (f[6] = [
|
|
3905
|
+
I("Aus Schema neu generieren", -1)
|
|
3906
|
+
])]),
|
|
3907
|
+
_: 1
|
|
3908
|
+
}, 8, ["onClick"])
|
|
3909
|
+
])) : P("", !0),
|
|
3910
|
+
w(Mo, {
|
|
3911
|
+
root: y(c),
|
|
3912
|
+
"selected-path": y(a),
|
|
3913
|
+
"onUpdate:root": y(_),
|
|
3914
|
+
"onUpdate:selectedPath": f[2] || (f[2] = (b) => a.value = b)
|
|
3915
|
+
}, null, 8, ["root", "selected-path", "onUpdate:root"])
|
|
3916
|
+
], 512), [
|
|
3917
|
+
[Oe, y(r) === "ui"]
|
|
3918
|
+
]),
|
|
3919
|
+
$("details", {
|
|
3920
|
+
class: "jse-editor__advanced",
|
|
3921
|
+
open: y(d)
|
|
3922
|
+
}, [
|
|
3923
|
+
$("summary", {
|
|
3924
|
+
onClick: f[3] || (f[3] = ye((b) => d.value = !y(d), ["prevent"]))
|
|
3925
|
+
}, "JSON (Erweitert)"),
|
|
3926
|
+
Ue($("label", ta, [
|
|
3927
|
+
f[8] || (f[8] = I(" JSON Schema ", -1)),
|
|
3928
|
+
w(gt, {
|
|
3929
|
+
modelValue: y(j),
|
|
3930
|
+
"onUpdate:modelValue": f[4] || (f[4] = (b) => it(j) ? j.value = b : null),
|
|
3931
|
+
rows: 8
|
|
3932
|
+
}, null, 8, ["modelValue"])
|
|
3933
|
+
], 512), [
|
|
3934
|
+
[Oe, y(r) === "schema"]
|
|
3935
|
+
]),
|
|
3936
|
+
Ue($("label", na, [
|
|
3937
|
+
f[9] || (f[9] = I(" UI Schema ", -1)),
|
|
3938
|
+
w(gt, {
|
|
3939
|
+
modelValue: y(E),
|
|
3940
|
+
"onUpdate:modelValue": f[5] || (f[5] = (b) => it(E) ? E.value = b : null),
|
|
3941
|
+
rows: 8
|
|
3942
|
+
}, null, 8, ["modelValue"])
|
|
3943
|
+
], 512), [
|
|
3944
|
+
[Oe, y(r) === "ui"]
|
|
3945
|
+
])
|
|
3946
|
+
], 8, ea)
|
|
3947
|
+
])
|
|
3948
|
+
]));
|
|
3949
|
+
}
|
|
3950
|
+
}), ra = /* @__PURE__ */ D({
|
|
3951
|
+
__name: "ControlField",
|
|
3952
|
+
props: /* @__PURE__ */ Y({
|
|
3953
|
+
schema: {},
|
|
3954
|
+
scope: {},
|
|
3955
|
+
label: {},
|
|
3956
|
+
readonly: { type: Boolean }
|
|
3957
|
+
}, {
|
|
3958
|
+
modelValue: { required: !0 },
|
|
3959
|
+
modelModifiers: {}
|
|
3960
|
+
}),
|
|
3961
|
+
emits: ["update:modelValue"],
|
|
3962
|
+
setup(e) {
|
|
3963
|
+
const t = H(e, "modelValue");
|
|
3964
|
+
return (n, l) => (u(), C(Ct, {
|
|
3965
|
+
modelValue: t.value,
|
|
3966
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => t.value = r),
|
|
3967
|
+
schema: e.schema,
|
|
3968
|
+
scope: e.scope,
|
|
3969
|
+
label: e.label,
|
|
3970
|
+
readonly: e.readonly
|
|
3971
|
+
}, null, 8, ["modelValue", "schema", "scope", "label", "readonly"]));
|
|
3972
|
+
}
|
|
3973
|
+
});
|
|
3974
|
+
function $a() {
|
|
3975
|
+
return ce(zo, Ho);
|
|
3976
|
+
}
|
|
3977
|
+
function Sa() {
|
|
3978
|
+
const e = ce(vn);
|
|
3979
|
+
if (!e)
|
|
3980
|
+
throw new Error("useEditorContext requires JsonSchemaFormEditor");
|
|
3981
|
+
return e;
|
|
3982
|
+
}
|
|
3983
|
+
function oa(e) {
|
|
3984
|
+
e.component("JsonSchemaForm", Cl), e.component("JsonSchemaFormEditor", la), e.component("ControlField", ra), e.component("UiElementRenderer", Zt);
|
|
3985
|
+
}
|
|
3986
|
+
const Va = { install: oa };
|
|
3987
|
+
export {
|
|
3988
|
+
Yt as AttributeControlRegistry,
|
|
3989
|
+
ra as ControlField,
|
|
3990
|
+
vn as EDITOR_CONTEXT_KEY,
|
|
3991
|
+
Yo as EDITOR_TABS,
|
|
3992
|
+
Rn as JSON_SCHEMA_ATTRIBUTE_REGISTRY_KEY,
|
|
3993
|
+
Cl as JsonSchemaForm,
|
|
3994
|
+
la as JsonSchemaFormEditor,
|
|
3995
|
+
zo as RENDERER_REGISTRY_KEY,
|
|
3996
|
+
Jo as RendererRegistry,
|
|
3997
|
+
Cn as SCHEMA_ATTRIBUTE_CONTROL_REGISTRY_KEY,
|
|
3998
|
+
xn as SCHEMA_EDITOR_TYPE_REGISTRY_KEY,
|
|
3999
|
+
kn as SCHEMA_FORM_TYPE_REGISTRY_KEY,
|
|
4000
|
+
ka as SchemaDocument,
|
|
4001
|
+
nt as TypeControlRegistry,
|
|
4002
|
+
Tn as UI_ATTRIBUTE_CONTROL_REGISTRY_KEY,
|
|
4003
|
+
_n as UI_EDITOR_TYPE_REGISTRY_KEY,
|
|
4004
|
+
jn as UI_FORM_TYPE_REGISTRY_KEY,
|
|
4005
|
+
Pn as UI_SCHEMA_ATTRIBUTE_REGISTRY_KEY,
|
|
4006
|
+
Zt as UiElementRenderer,
|
|
4007
|
+
xa as buildDefRef,
|
|
4008
|
+
Va as default,
|
|
4009
|
+
ja as documentFromJSON,
|
|
4010
|
+
Ho as globalRendererRegistry,
|
|
4011
|
+
jt as globalSchemaAttributeControlRegistry,
|
|
4012
|
+
Et as globalSchemaEditorTypeRegistry,
|
|
4013
|
+
wt as globalSchemaFormTypeRegistry,
|
|
4014
|
+
_t as globalUiAttributeControlRegistry,
|
|
4015
|
+
xt as globalUiEditorTypeRegistry,
|
|
4016
|
+
kt as globalUiFormTypeRegistry,
|
|
4017
|
+
we as inferValueType,
|
|
4018
|
+
oa as install,
|
|
4019
|
+
ca as isControl,
|
|
4020
|
+
va as isGroup,
|
|
4021
|
+
fa as isHorizontalLayout,
|
|
4022
|
+
ha as isLabel,
|
|
4023
|
+
ma as isVerticalLayout,
|
|
4024
|
+
_a as parseDefRef,
|
|
4025
|
+
El as registerDefaultControls,
|
|
4026
|
+
Sa as useEditorContext,
|
|
4027
|
+
Fe as useFormFieldLabel,
|
|
4028
|
+
ga as useJsonSchemaAttributeRegistry,
|
|
4029
|
+
$a as useRendererRegistry,
|
|
4030
|
+
Gn as useSchemaAttributeControlRegistry,
|
|
4031
|
+
pa as useSchemaEditorTypeRegistry,
|
|
4032
|
+
Go as useSchemaFormEditorState,
|
|
4033
|
+
Hn as useSchemaFormTypeRegistry,
|
|
4034
|
+
Pe as useScopedField,
|
|
4035
|
+
qn as useUiAttributeControlRegistry,
|
|
4036
|
+
ya as useUiEditorTypeRegistry,
|
|
4037
|
+
Yn as useUiFormTypeRegistry,
|
|
4038
|
+
ba as useUiSchemaAttributeRegistry
|
|
4039
|
+
};
|