@duxweb/dvha-core 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/auth/can.cjs +1 -1
- package/dist/cjs/components/loader/iframe.cjs +1 -1
- package/dist/cjs/components/loader/remote/loader.cjs +1 -1
- package/dist/cjs/components/loader/remote/render.cjs +1 -1
- package/dist/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/components/status/exception.cjs +1 -1
- package/dist/cjs/directive/permission.cjs +1 -1
- package/dist/cjs/hooks/auth.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/export.cjs +1 -1
- package/dist/cjs/hooks/exportCsv.cjs +2 -2
- package/dist/cjs/hooks/form.cjs +1 -1
- package/dist/cjs/hooks/formExtend.cjs +1 -1
- package/dist/cjs/hooks/i18n.cjs +1 -1
- package/dist/cjs/hooks/import.cjs +1 -1
- package/dist/cjs/hooks/importCsv.cjs +2 -2
- package/dist/cjs/hooks/json/utils/expressionParser.cjs +1 -1
- package/dist/cjs/hooks/json/vFor.cjs +1 -1
- package/dist/cjs/hooks/json/vOn.cjs +1 -1
- package/dist/cjs/hooks/json/vShow.cjs +1 -1
- package/dist/cjs/hooks/json.cjs +1 -1
- package/dist/cjs/hooks/list.cjs +1 -1
- package/dist/cjs/hooks/manage.cjs +1 -1
- package/dist/cjs/hooks/menu.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +3 -3
- package/dist/cjs/hooks/tree.cjs +1 -1
- package/dist/cjs/hooks/upload/s3.cjs +1 -1
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/preset/authProvider.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/cjs/preset/i18nProvider.cjs +1 -1
- package/dist/cjs/provider/app.cjs +1 -1
- package/dist/cjs/router/route.cjs +1 -1
- package/dist/cjs/stores/auth.cjs +1 -1
- package/dist/cjs/stores/i18n.cjs +1 -1
- package/dist/cjs/stores/jsonSchema.cjs +1 -1
- package/dist/cjs/stores/manage.cjs +1 -1
- package/dist/cjs/stores/route.cjs +1 -1
- package/dist/cjs/stores/tab.cjs +1 -1
- package/dist/cjs/stores/theme.cjs +1 -1
- package/dist/cjs/utils/tree.cjs +1 -1
- package/dist/esm/components/auth/can.js +8 -11
- package/dist/esm/components/loader/iframe.js +14 -17
- package/dist/esm/components/loader/remote/loader.js +103 -105
- package/dist/esm/components/loader/remote/render.js +10 -11
- package/dist/esm/components/overlay/overlay.js +7 -7
- package/dist/esm/components/status/exception.js +10 -13
- package/dist/esm/directive/permission.js +6 -7
- package/dist/esm/hooks/auth.js +73 -83
- package/dist/esm/hooks/data.js +290 -345
- package/dist/esm/hooks/export.js +16 -17
- package/dist/esm/hooks/exportCsv.js +26 -27
- package/dist/esm/hooks/form.js +49 -54
- package/dist/esm/hooks/formExtend.js +24 -25
- package/dist/esm/hooks/i18n.js +11 -29
- package/dist/esm/hooks/import.js +31 -32
- package/dist/esm/hooks/importCsv.js +24 -25
- package/dist/esm/hooks/json/utils/expressionParser.js +36 -42
- package/dist/esm/hooks/json/vFor.js +15 -16
- package/dist/esm/hooks/json/vOn.js +17 -18
- package/dist/esm/hooks/json/vShow.js +9 -10
- package/dist/esm/hooks/json.js +88 -94
- package/dist/esm/hooks/list.js +100 -127
- package/dist/esm/hooks/manage.js +13 -17
- package/dist/esm/hooks/menu.js +39 -52
- package/dist/esm/hooks/select.js +35 -40
- package/dist/esm/hooks/theme.js +127 -141
- package/dist/esm/hooks/tree.js +22 -28
- package/dist/esm/hooks/upload/s3.js +22 -23
- package/dist/esm/hooks/upload.js +152 -159
- package/dist/esm/preset/authProvider.js +63 -117
- package/dist/esm/preset/dataProvider.js +69 -76
- package/dist/esm/preset/i18nProvider.js +18 -18
- package/dist/esm/provider/app.js +74 -81
- package/dist/esm/router/route.js +16 -24
- package/dist/esm/stores/auth.js +17 -20
- package/dist/esm/stores/i18n.js +10 -10
- package/dist/esm/stores/jsonSchema.js +20 -23
- package/dist/esm/stores/manage.js +33 -33
- package/dist/esm/stores/route.js +38 -50
- package/dist/esm/stores/tab.js +38 -54
- package/dist/esm/stores/theme.js +28 -29
- package/dist/esm/utils/tree.js +23 -24
- package/package.json +1 -1
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { unref as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import l from "jsep";
|
|
2
|
+
import { unref as n } from "vue";
|
|
3
|
+
l.addIdentifierChar("$");
|
|
4
|
+
l.addIdentifierChar("@");
|
|
5
5
|
function y(r) {
|
|
6
6
|
try {
|
|
7
|
-
return
|
|
7
|
+
return l(r);
|
|
8
8
|
} catch (e) {
|
|
9
9
|
return console.warn(`Expression parsing failed: ${r}`, e), null;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
function m(r, e) {
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return i(
|
|
13
|
+
const t = y(r);
|
|
14
|
+
if (t)
|
|
15
|
+
return i(t, e);
|
|
16
16
|
}
|
|
17
17
|
function i(r, e) {
|
|
18
|
-
var n, l;
|
|
19
18
|
if (!(!r || typeof r != "object"))
|
|
20
19
|
switch (r.type) {
|
|
21
20
|
case "Literal":
|
|
@@ -26,11 +25,12 @@ function i(r, e) {
|
|
|
26
25
|
const t = i(r.object, e);
|
|
27
26
|
if (t == null)
|
|
28
27
|
return;
|
|
29
|
-
const s = r.computed ? i(r.property, e) :
|
|
30
|
-
return
|
|
28
|
+
const s = r.computed ? i(r.property, e) : r.property?.name;
|
|
29
|
+
return n(t)?.[s];
|
|
31
30
|
}
|
|
32
31
|
case "BinaryExpression": {
|
|
33
|
-
const t = i(r.left, e), s = i(r.right, e)
|
|
32
|
+
const t = i(r.left, e), s = i(r.right, e);
|
|
33
|
+
return {
|
|
34
34
|
"+": () => t + s,
|
|
35
35
|
"-": () => t - s,
|
|
36
36
|
"*": () => t * s,
|
|
@@ -44,8 +44,7 @@ function i(r, e) {
|
|
|
44
44
|
">": () => t > s,
|
|
45
45
|
"<=": () => t <= s,
|
|
46
46
|
">=": () => t >= s
|
|
47
|
-
};
|
|
48
|
-
return ((l = a[r.operator]) == null ? void 0 : l.call(a)) ?? void 0;
|
|
47
|
+
}[r.operator]?.() ?? void 0;
|
|
49
48
|
}
|
|
50
49
|
case "LogicalExpression": {
|
|
51
50
|
const t = i(r.left, e);
|
|
@@ -60,24 +59,24 @@ function i(r, e) {
|
|
|
60
59
|
return i(t ? r.consequent : r.alternate, e);
|
|
61
60
|
}
|
|
62
61
|
case "CallExpression": {
|
|
63
|
-
const t = i(r.callee, e), s =
|
|
62
|
+
const t = i(r.callee, e), s = n(t);
|
|
64
63
|
if (typeof s != "function") {
|
|
65
64
|
console.warn("Attempting to call non-function value:", s);
|
|
66
65
|
return;
|
|
67
66
|
}
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
return
|
|
67
|
+
const u = Array.isArray(r.arguments) ? r.arguments.map((a) => {
|
|
68
|
+
const p = i(a, e);
|
|
69
|
+
return n(p);
|
|
71
70
|
}) : [];
|
|
72
71
|
try {
|
|
73
|
-
let
|
|
72
|
+
let a;
|
|
74
73
|
if (r.callee.type === "MemberExpression") {
|
|
75
|
-
const
|
|
76
|
-
|
|
74
|
+
const p = i(r.callee.object, e);
|
|
75
|
+
a = n(p);
|
|
77
76
|
}
|
|
78
|
-
return s.apply(
|
|
79
|
-
} catch (
|
|
80
|
-
console.warn("Function call error:",
|
|
77
|
+
return s.apply(a, u);
|
|
78
|
+
} catch (a) {
|
|
79
|
+
console.warn("Function call error:", a);
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
82
|
}
|
|
@@ -86,7 +85,7 @@ function i(r, e) {
|
|
|
86
85
|
if (!t)
|
|
87
86
|
return;
|
|
88
87
|
const s = i(t, e);
|
|
89
|
-
return
|
|
88
|
+
return n(s);
|
|
90
89
|
}) : [];
|
|
91
90
|
default:
|
|
92
91
|
console.warn(`Unsupported expression type: ${r.type}`);
|
|
@@ -96,32 +95,27 @@ function i(r, e) {
|
|
|
96
95
|
function v(r, e) {
|
|
97
96
|
if (!(!e || !r))
|
|
98
97
|
try {
|
|
99
|
-
return e.split(".").reduce((
|
|
100
|
-
if (n == null)
|
|
101
|
-
return;
|
|
102
|
-
const t = c(n);
|
|
103
|
-
return t == null ? void 0 : t[l];
|
|
104
|
-
}, r);
|
|
98
|
+
return e.split(".").reduce((t, s) => t == null ? void 0 : n(t)?.[s], r);
|
|
105
99
|
} catch {
|
|
106
100
|
return;
|
|
107
101
|
}
|
|
108
102
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const [,
|
|
103
|
+
function E(r, e) {
|
|
104
|
+
const t = r.trim(), s = t.match(/^\((\w+),\s*(\w+)\) in (.+)$/);
|
|
105
|
+
if (s) {
|
|
106
|
+
const [, a, p, c] = s, o = m(c, e), f = n(o);
|
|
113
107
|
return {
|
|
114
108
|
items: Array.isArray(f) ? f : [],
|
|
115
|
-
itemName:
|
|
116
|
-
indexName:
|
|
109
|
+
itemName: a,
|
|
110
|
+
indexName: p
|
|
117
111
|
};
|
|
118
112
|
}
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
121
|
-
const [,
|
|
113
|
+
const u = t.match(/^(\w+) in (.+)$/);
|
|
114
|
+
if (u) {
|
|
115
|
+
const [, a, p] = u, c = m(p, e), o = n(c);
|
|
122
116
|
return {
|
|
123
117
|
items: Array.isArray(o) ? o : [],
|
|
124
|
-
itemName:
|
|
118
|
+
itemName: a,
|
|
125
119
|
indexName: "index"
|
|
126
120
|
};
|
|
127
121
|
}
|
|
@@ -130,5 +124,5 @@ function g(r, e) {
|
|
|
130
124
|
export {
|
|
131
125
|
m as evaluateExpression,
|
|
132
126
|
y as parseExpression,
|
|
133
|
-
|
|
127
|
+
E as parseVForExpression
|
|
134
128
|
};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { extractContext as
|
|
2
|
-
import { parseVForExpression as
|
|
3
|
-
const
|
|
1
|
+
import { extractContext as c, injectContext as f, cleanProps as x } from "./utils/contextManager.js";
|
|
2
|
+
import { parseVForExpression as u } from "./utils/expressionParser.js";
|
|
3
|
+
const y = {
|
|
4
4
|
name: "v-for",
|
|
5
5
|
priority: 90,
|
|
6
6
|
process(r, n) {
|
|
7
|
-
|
|
8
|
-
const e = ((a = r.attrs) == null ? void 0 : a["v-for"]) || ((m = r.attrs) == null ? void 0 : m.vFor);
|
|
7
|
+
const e = r.attrs?.["v-for"] || r.attrs?.vFor;
|
|
9
8
|
if (!e)
|
|
10
9
|
return null;
|
|
11
10
|
const o = { ...r.attrs };
|
|
12
11
|
delete o["v-for"], delete o.vFor;
|
|
13
|
-
const i =
|
|
12
|
+
const i = c(n);
|
|
14
13
|
let t;
|
|
15
14
|
try {
|
|
16
15
|
if (Array.isArray(e))
|
|
@@ -26,32 +25,32 @@ const A = {
|
|
|
26
25
|
indexName: e.index || "index"
|
|
27
26
|
};
|
|
28
27
|
else if (typeof e == "string")
|
|
29
|
-
t =
|
|
28
|
+
t = u(e, i);
|
|
30
29
|
else
|
|
31
30
|
return console.warn("Unsupported v-for format:", e), null;
|
|
32
31
|
} catch (s) {
|
|
33
32
|
return console.warn("v-for parsing failed:", s), null;
|
|
34
33
|
}
|
|
35
|
-
const
|
|
36
|
-
const
|
|
34
|
+
const m = t.items.map((s, a) => {
|
|
35
|
+
const l = {
|
|
37
36
|
[t.itemName]: s,
|
|
38
|
-
[t.indexName]:
|
|
39
|
-
},
|
|
37
|
+
[t.indexName]: a
|
|
38
|
+
}, p = { ...i, ...l };
|
|
40
39
|
return {
|
|
41
40
|
...r,
|
|
42
41
|
attrs: {
|
|
43
42
|
...o,
|
|
44
|
-
key: `${t.itemName}_${
|
|
45
|
-
...
|
|
43
|
+
key: `${t.itemName}_${a}`,
|
|
44
|
+
...f({}, p)
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
});
|
|
49
48
|
return {
|
|
50
|
-
props:
|
|
51
|
-
nodes:
|
|
49
|
+
props: x(n),
|
|
50
|
+
nodes: m
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
53
|
};
|
|
55
54
|
export {
|
|
56
|
-
|
|
55
|
+
y as vForAdaptor
|
|
57
56
|
};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
const
|
|
1
|
+
const u = {
|
|
2
2
|
name: "v-on",
|
|
3
3
|
priority: 60,
|
|
4
|
-
process(
|
|
5
|
-
const
|
|
4
|
+
process(v, c) {
|
|
5
|
+
const o = {}, s = {};
|
|
6
6
|
let i = !1;
|
|
7
|
-
return Object.entries(
|
|
8
|
-
if (
|
|
7
|
+
return Object.entries(c).forEach(([t, e]) => {
|
|
8
|
+
if (t.startsWith("@") || t.startsWith("v-on:")) {
|
|
9
9
|
i = !0;
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
console.warn(`Invalid event name: ${
|
|
10
|
+
const l = t.startsWith("@") ? t.slice(1) : t.slice(5), [n, ...a] = l.split(".");
|
|
11
|
+
if (!n) {
|
|
12
|
+
console.warn(`Invalid event name: ${t}`);
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
a.includes("prevent") && ((c = t.preventDefault) == null || c.call(t)), a.includes("stop") && ((l = t.stopPropagation) == null || l.call(t));
|
|
15
|
+
const p = `on${n.charAt(0).toUpperCase()}${n.slice(1)}`, f = (r, ...d) => {
|
|
16
|
+
a.includes("prevent") && r.preventDefault?.(), a.includes("stop") && r.stopPropagation?.();
|
|
18
17
|
try {
|
|
19
|
-
typeof
|
|
20
|
-
} catch (
|
|
21
|
-
console.error(`Event handler execution error (${
|
|
18
|
+
typeof e == "function" ? e(r, ...d) : console.warn(`Invalid event handler type: ${typeof e}`);
|
|
19
|
+
} catch (h) {
|
|
20
|
+
console.error(`Event handler execution error (${n}):`, h);
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
|
-
|
|
23
|
+
o[p] = f;
|
|
25
24
|
} else
|
|
26
|
-
|
|
27
|
-
}), i ? { props: { ...
|
|
25
|
+
s[t] = e;
|
|
26
|
+
}), i ? { props: { ...s, ...o } } : null;
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
u as vOnAdaptor
|
|
32
31
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { extractContext as
|
|
2
|
-
import { evaluateExpression as
|
|
3
|
-
const
|
|
1
|
+
import { extractContext as l, evaluateCondition as a } from "./utils/contextManager.js";
|
|
2
|
+
import { evaluateExpression as p } from "./utils/expressionParser.js";
|
|
3
|
+
const y = {
|
|
4
4
|
name: "v-show",
|
|
5
5
|
priority: 95,
|
|
6
|
-
process(
|
|
7
|
-
|
|
8
|
-
const e = (r = c.attrs) == null ? void 0 : r["v-show"];
|
|
6
|
+
process(r, t) {
|
|
7
|
+
const e = r.attrs?.["v-show"];
|
|
9
8
|
if (e === void 0)
|
|
10
9
|
return null;
|
|
11
|
-
const
|
|
10
|
+
const c = l(t), n = a(e, c, p), o = { ...t };
|
|
12
11
|
delete o["v-show"];
|
|
13
|
-
const s = o.style || {},
|
|
12
|
+
const s = o.style || {}, i = typeof s == "object" ? { ...s, display: n ? void 0 : "none" } : { display: n ? void 0 : "none" };
|
|
14
13
|
return {
|
|
15
14
|
props: {
|
|
16
15
|
...o,
|
|
17
|
-
style:
|
|
16
|
+
style: i
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
};
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
y as vShowAdaptor
|
|
24
23
|
};
|
package/dist/esm/hooks/json.js
CHANGED
|
@@ -1,132 +1,126 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { useJsonSchemaStore as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { defaultAdaptors as
|
|
5
|
-
import { injectContext as
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
import { computed as w, isRef as S, defineComponent as M, markRaw as A, h as b, unref as T } from "vue";
|
|
2
|
+
import { useJsonSchemaStore as N } from "../stores/jsonSchema.js";
|
|
3
|
+
import { useConfig as U } from "./config.js";
|
|
4
|
+
import { defaultAdaptors as D } from "./json/index.js";
|
|
5
|
+
import { injectContext as F } from "./json/utils/contextManager.js";
|
|
6
|
+
function G(n) {
|
|
7
|
+
return n.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
Array.isArray(
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
!
|
|
14
|
-
}) : typeof
|
|
15
|
-
|
|
9
|
+
function B(n, u) {
|
|
10
|
+
Array.isArray(n) ? n.forEach((s) => {
|
|
11
|
+
const c = s;
|
|
12
|
+
let m = c.name;
|
|
13
|
+
!m && c.__name && (m = c.__name.replace(/\.(vue|ts|tsx|js|jsx)$/, "").split("/").pop()), m && u.addComponent(A(s), m);
|
|
14
|
+
}) : typeof n == "object" && n !== null && Object.entries(n).forEach(([s, c]) => {
|
|
15
|
+
u.addComponent(A(c), s);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var S;
|
|
23
|
-
(S = y.jsonSchema) != null && S.components && J(y.jsonSchema.components, c);
|
|
18
|
+
function K(n, u) {
|
|
19
|
+
const s = N(u);
|
|
20
|
+
n.jsonSchema?.components && B(n.jsonSchema.components, s), n.manages?.forEach((c) => {
|
|
21
|
+
c.jsonSchema?.components && B(c.jsonSchema.components, s);
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (_(e == null ? void 0 : e.context) ? e == null ? void 0 : e.context.value : e == null ? void 0 : e.context) || {};
|
|
24
|
+
function Q(n) {
|
|
25
|
+
const u = U(), s = N(), c = [...D, ...u.jsonSchema?.adaptors || [], ...n?.adaptors || []];
|
|
26
|
+
n?.components && B(n.components, s);
|
|
27
|
+
const m = w(() => S(n?.data) ? n?.data.value : n?.data);
|
|
28
|
+
function _() {
|
|
29
|
+
return (S(n?.context) ? n?.context.value : n?.context) || {};
|
|
33
30
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
return Object.entries(
|
|
31
|
+
function O(e) {
|
|
32
|
+
const o = {};
|
|
33
|
+
return Object.entries(e).forEach(([t, a]) => {
|
|
37
34
|
if (t === "_context") return;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
}),
|
|
35
|
+
const h = t === "modelValue" || t.startsWith("modelValue") || t !== "value" && (t.includes("model") || t.includes("Model"));
|
|
36
|
+
o[t] = h && S(a) ? T(a) : a;
|
|
37
|
+
}), o;
|
|
41
38
|
}
|
|
42
|
-
function
|
|
43
|
-
return typeof
|
|
39
|
+
function j(e, o, t) {
|
|
40
|
+
return typeof e == "string" ? e : typeof e == "function" ? j(e(o), o, t) : Array.isArray(e) ? e.flatMap((a) => j(a, o, t)).filter(Boolean) : e?.tag ? p(e, !0, t) : e;
|
|
44
41
|
}
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
47
|
-
return typeof
|
|
42
|
+
function R(e, o, t) {
|
|
43
|
+
if (e)
|
|
44
|
+
return typeof e == "string" ? e : Array.isArray(e) ? e.flatMap((a) => typeof a == "string" ? a : p(a, o, t)).filter(Boolean) : p(e, o, t);
|
|
48
45
|
}
|
|
49
|
-
function
|
|
46
|
+
function p(e, o = !1, t = {}) {
|
|
50
47
|
const {
|
|
51
48
|
tag: a,
|
|
52
|
-
attrs:
|
|
53
|
-
children:
|
|
54
|
-
slots:
|
|
55
|
-
} =
|
|
56
|
-
...
|
|
49
|
+
attrs: h = {},
|
|
50
|
+
children: V,
|
|
51
|
+
slots: v
|
|
52
|
+
} = e, l = {
|
|
53
|
+
..._(),
|
|
57
54
|
...t
|
|
58
55
|
};
|
|
59
|
-
let
|
|
60
|
-
...
|
|
56
|
+
let y = {
|
|
57
|
+
...h
|
|
61
58
|
};
|
|
62
|
-
Object.keys(
|
|
63
|
-
...
|
|
64
|
-
...
|
|
59
|
+
Object.keys(l).length > 0 && (y = {
|
|
60
|
+
...y,
|
|
61
|
+
...F({}, l)
|
|
65
62
|
});
|
|
66
|
-
for (const
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
...g
|
|
76
|
-
...h
|
|
63
|
+
for (const i of c) {
|
|
64
|
+
const r = i.process(e, y);
|
|
65
|
+
if (r) {
|
|
66
|
+
if (y = r.props, r.skip) return null;
|
|
67
|
+
if (r.nodes)
|
|
68
|
+
return r.nodes.map((d) => {
|
|
69
|
+
const g = d.attrs?._context || {};
|
|
70
|
+
return p(d, o, {
|
|
71
|
+
...l,
|
|
72
|
+
...g
|
|
77
73
|
});
|
|
78
74
|
}).filter(Boolean);
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
|
-
let
|
|
82
|
-
let
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
88
|
-
const
|
|
89
|
-
return
|
|
77
|
+
let f = typeof a == "string" && ((i) => {
|
|
78
|
+
let r = s.getComponentByName(i);
|
|
79
|
+
if (r)
|
|
80
|
+
return r;
|
|
81
|
+
const d = G(i);
|
|
82
|
+
if (r = s.getComponentByName(d), r)
|
|
83
|
+
return r;
|
|
84
|
+
const g = i.replace(/-([a-z])/g, (J, $) => $.toUpperCase()).replace(/^[a-z]/, (J) => J.toUpperCase());
|
|
85
|
+
return r = s.getComponentByName(g), r || null;
|
|
90
86
|
})(a) || a;
|
|
91
|
-
typeof
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
const
|
|
95
|
-
return Object.entries(
|
|
96
|
-
|
|
97
|
-
}),
|
|
87
|
+
typeof f != "string" && typeof f == "object" && (f = A(f));
|
|
88
|
+
const E = typeof f != "string", x = O(y);
|
|
89
|
+
if (v && E && !o) {
|
|
90
|
+
const i = {};
|
|
91
|
+
return Object.entries(v).forEach(([r, d]) => {
|
|
92
|
+
i[r] = (g = {}) => j(d, g, l);
|
|
93
|
+
}), b(f, x, i);
|
|
98
94
|
}
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
default: () =>
|
|
102
|
-
}) :
|
|
95
|
+
const C = R(V, o, l);
|
|
96
|
+
return E && C !== void 0 ? b(f, x, {
|
|
97
|
+
default: () => C
|
|
98
|
+
}) : b(f, x, C);
|
|
103
99
|
}
|
|
104
|
-
const
|
|
100
|
+
const z = /* @__PURE__ */ M({
|
|
105
101
|
name: "JsonSchemaRenderer",
|
|
106
102
|
render() {
|
|
107
|
-
|
|
108
|
-
return ((n = i.value) == null ? void 0 : n.map((r) => d(r)).filter(Boolean)) || [];
|
|
103
|
+
return m.value?.map((e) => p(e)).filter(Boolean) || [];
|
|
109
104
|
}
|
|
110
105
|
});
|
|
111
|
-
function
|
|
112
|
-
return /* @__PURE__ */
|
|
106
|
+
function P(e) {
|
|
107
|
+
return /* @__PURE__ */ M({
|
|
113
108
|
name: "DynamicJsonSchemaRenderer",
|
|
114
109
|
render() {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
...
|
|
118
|
-
...n.context
|
|
110
|
+
const o = {
|
|
111
|
+
..._(),
|
|
112
|
+
...e.context
|
|
119
113
|
};
|
|
120
|
-
return
|
|
114
|
+
return e.data?.map((t) => p(t, !1, o)).filter(Boolean);
|
|
121
115
|
}
|
|
122
116
|
});
|
|
123
117
|
}
|
|
124
118
|
return {
|
|
125
|
-
render:
|
|
126
|
-
renderAsync:
|
|
119
|
+
render: z,
|
|
120
|
+
renderAsync: P
|
|
127
121
|
};
|
|
128
122
|
}
|
|
129
123
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
K as initJsonSchemaComponents,
|
|
125
|
+
Q as useJsonSchema
|
|
132
126
|
};
|