@king-one/form-antdv 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/index.mjs +4 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/contexts.mjs +15 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/destructor.mjs +72 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/index.mjs +317 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/matcher.mjs +83 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/parser.mjs +232 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/shared.mjs +62 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/tokenizer.mjs +192 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/tokens.mjs +140 -0
- package/dist/es/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/types.mjs +18 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/index.mjs +47 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/array.mjs +124 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/checkers.mjs +43 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/delay.mjs +10 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/file.mjs +10 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/img.mjs +20 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/install.mjs +19 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/number.mjs +18 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/uid.mjs +11 -0
- package/dist/es/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/validate.mjs +6 -0
- package/dist/es/node_modules/.pnpm/async-validator@4.2.5/node_modules/async-validator/dist-web/index.mjs +648 -0
- package/dist/es/{src → packages/form-antdv/src}/components/ArrayCard/array-card.vue2.mjs +24 -23
- package/dist/es/packages/form-antdv/src/components/ArrayCard/index.mjs +13 -0
- package/dist/es/{src → packages/form-antdv/src}/components/ArrayTable/array-table.vue2.mjs +17 -16
- package/dist/es/packages/form-antdv/src/components/ArrayTable/index.mjs +13 -0
- package/dist/es/packages/form-antdv/src/components/DateRange/index.mjs +12 -0
- package/dist/es/packages/form-antdv/src/components/FormArea/index.mjs +11 -0
- package/dist/es/packages/form-antdv/src/components/Input/index.mjs +12 -0
- package/dist/es/packages/form-antdv/src/components/InputNumber/index.mjs +12 -0
- package/dist/es/packages/form-antdv/src/components/Select/index.mjs +15 -0
- package/dist/es/packages/form-antdv/src/internal.mjs +2 -0
- package/dist/es/packages/form-render/src/components/FormProvider.vue.mjs +4 -0
- package/dist/es/packages/form-render/src/components/FormProvider.vue2.mjs +28 -0
- package/dist/es/packages/form-render/src/components/SchemaField.mjs +40 -0
- package/dist/es/packages/form-render/src/components/propsType.mjs +33 -0
- package/dist/es/packages/form-render/src/components/widget/ArrayField.mjs +40 -0
- package/dist/es/packages/form-render/src/components/widget/ErrorField.mjs +14 -0
- package/dist/es/packages/form-render/src/components/widget/Field.mjs +43 -0
- package/dist/es/packages/form-render/src/components/widget/FormItem.mjs +48 -0
- package/dist/es/packages/form-render/src/components/widget/ObjectField.mjs +54 -0
- package/dist/es/packages/form-render/src/components/widget/RecursionField.mjs +31 -0
- package/dist/es/packages/form-render/src/components/widget/index.mjs +8 -0
- package/dist/es/packages/form-render/src/context/field.mjs +12 -0
- package/dist/es/packages/form-render/src/context/form.mjs +12 -0
- package/dist/es/packages/form-render/src/context/index.mjs +8 -0
- package/dist/es/packages/form-render/src/core/ArrayField.mjs +22 -0
- package/dist/es/packages/form-render/src/core/Base.mjs +162 -0
- package/dist/es/packages/form-render/src/core/Event.mjs +59 -0
- package/dist/es/packages/form-render/src/core/Field.mjs +17 -0
- package/dist/es/packages/form-render/src/core/Form.mjs +103 -0
- package/dist/es/packages/form-render/src/core/Heart.mjs +25 -0
- package/dist/es/packages/form-render/src/core/ObjectField.mjs +13 -0
- package/dist/es/packages/form-render/src/core/index.mjs +7 -0
- package/dist/es/packages/form-render/src/effects/LifeCycle.mjs +25 -0
- package/dist/es/packages/form-render/src/effects/contants.mjs +10 -0
- package/dist/es/packages/form-render/src/effects/effect.enum.mjs +5 -0
- package/dist/es/packages/form-render/src/effects/effective.mjs +25 -0
- package/dist/es/packages/form-render/src/effects/index.mjs +16 -0
- package/dist/es/packages/form-render/src/effects/onEffects.mjs +22 -0
- package/dist/es/packages/form-render/src/hooks/index.mjs +9 -0
- package/dist/es/packages/form-render/src/hooks/use-event-hook.mjs +31 -0
- package/dist/es/packages/form-render/src/hooks/use-namespace/index.mjs +49 -0
- package/dist/es/packages/form-render/src/index.mjs +21 -0
- package/dist/es/packages/form-render/src/internal.mjs +7 -0
- package/dist/es/packages/form-render/src/schema/index.mjs +5 -0
- package/dist/es/packages/form-render/src/schema/makeProxy.mjs +46 -0
- package/dist/es/packages/form-render/src/utils/connect.mjs +12 -0
- package/dist/es/packages/form-render/src/utils/index.mjs +7 -0
- package/dist/es/packages/form-render/src/utils/mapProps.mjs +27 -0
- package/dist/es/packages/form-render/src/utils/schema.mjs +26 -0
- package/dist/es/packages/form-render/src/utils/style.mjs +13 -0
- package/dist/es/packages/form-render/src/utils/transformComponent.mjs +20 -0
- package/dist/es/packages/form-render/theme-chalk/index.css +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/index.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/contexts.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/destructor.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/index.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/matcher.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/parser.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/shared.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/tokenizer.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/tokens.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_path@1.0.4/node_modules/@king-one/path/dist/es/src/types.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/index.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/array.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/checkers.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/delay.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/file.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/img.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/install.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/number.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/uid.js +1 -0
- package/dist/lib/node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/validate.js +1 -0
- package/dist/lib/node_modules/.pnpm/async-validator@4.2.5/node_modules/async-validator/dist-web/index.js +12 -0
- package/dist/lib/packages/form-antdv/src/components/ArrayCard/array-card.vue2.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/ArrayCard/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/ArrayTable/array-table.vue2.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/ArrayTable/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/DateRange/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/FormArea/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/Input/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/InputNumber/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/components/Select/index.js +1 -0
- package/dist/lib/packages/form-antdv/src/internal.js +1 -0
- package/dist/lib/packages/form-render/src/components/FormProvider.vue.js +1 -0
- package/dist/lib/packages/form-render/src/components/FormProvider.vue2.js +1 -0
- package/dist/lib/packages/form-render/src/components/SchemaField.js +1 -0
- package/dist/lib/packages/form-render/src/components/propsType.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/ArrayField.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/ErrorField.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/Field.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/FormItem.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/ObjectField.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/RecursionField.js +1 -0
- package/dist/lib/packages/form-render/src/components/widget/index.js +1 -0
- package/dist/lib/packages/form-render/src/context/field.js +1 -0
- package/dist/lib/packages/form-render/src/context/form.js +1 -0
- package/dist/lib/packages/form-render/src/context/index.js +1 -0
- package/dist/lib/packages/form-render/src/core/ArrayField.js +1 -0
- package/dist/lib/packages/form-render/src/core/Base.js +5 -0
- package/dist/lib/packages/form-render/src/core/Event.js +1 -0
- package/dist/lib/packages/form-render/src/core/Field.js +1 -0
- package/dist/lib/packages/form-render/src/core/Form.js +1 -0
- package/dist/lib/packages/form-render/src/core/Heart.js +1 -0
- package/dist/lib/packages/form-render/src/core/ObjectField.js +1 -0
- package/dist/lib/packages/form-render/src/core/index.js +1 -0
- package/dist/lib/packages/form-render/src/effects/LifeCycle.js +1 -0
- package/dist/lib/packages/form-render/src/effects/contants.js +1 -0
- package/dist/lib/packages/form-render/src/effects/effect.enum.js +1 -0
- package/dist/lib/packages/form-render/src/effects/effective.js +1 -0
- package/dist/lib/packages/form-render/src/effects/index.js +1 -0
- package/dist/lib/packages/form-render/src/effects/onEffects.js +1 -0
- package/dist/lib/packages/form-render/src/hooks/index.js +1 -0
- package/dist/lib/packages/form-render/src/hooks/use-event-hook.js +1 -0
- package/dist/lib/packages/form-render/src/hooks/use-namespace/index.js +1 -0
- package/dist/lib/packages/form-render/src/index.js +1 -0
- package/dist/lib/packages/form-render/src/internal.js +1 -0
- package/dist/lib/packages/form-render/src/schema/index.js +1 -0
- package/dist/lib/packages/form-render/src/schema/makeProxy.js +1 -0
- package/dist/lib/packages/form-render/src/utils/connect.js +1 -0
- package/dist/lib/packages/form-render/src/utils/index.js +1 -0
- package/dist/lib/packages/form-render/src/utils/mapProps.js +1 -0
- package/dist/lib/packages/form-render/src/utils/schema.js +1 -0
- package/dist/lib/packages/form-render/src/utils/style.js +1 -0
- package/dist/lib/packages/form-render/src/utils/transformComponent.js +1 -0
- package/dist/lib/packages/form-render/theme-chalk/index.css +1 -0
- package/dist/types/src/components/ArrayCard/index.d.ts +2 -2
- package/dist/types/src/components/ArrayTable/index.d.ts +2 -2
- package/dist/types/src/components/DateRange/index.d.ts +2 -2
- package/dist/types/src/components/FormArea/index.d.ts +2 -2
- package/dist/types/src/components/Input/index.d.ts +2 -2
- package/dist/types/src/components/InputNumber/index.d.ts +2 -2
- package/dist/types/src/components/Select/index.d.ts +2 -2
- package/dist/types/src/internal.d.ts +1 -1
- package/package.json +2 -2
- package/dist/es/src/components/ArrayCard/index.mjs +0 -11
- package/dist/es/src/components/ArrayTable/index.mjs +0 -11
- package/dist/es/src/components/DateRange/index.mjs +0 -10
- package/dist/es/src/components/FormArea/index.mjs +0 -9
- package/dist/es/src/components/Input/index.mjs +0 -10
- package/dist/es/src/components/InputNumber/index.mjs +0 -10
- package/dist/es/src/components/Select/index.mjs +0 -13
- package/dist/es/src/internal.mjs +0 -9
- package/dist/lib/src/components/ArrayCard/array-card.vue2.js +0 -1
- package/dist/lib/src/components/ArrayCard/index.js +0 -1
- package/dist/lib/src/components/ArrayTable/array-table.vue2.js +0 -1
- package/dist/lib/src/components/ArrayTable/index.js +0 -1
- package/dist/lib/src/components/DateRange/index.js +0 -1
- package/dist/lib/src/components/FormArea/index.js +0 -1
- package/dist/lib/src/components/Input/index.js +0 -1
- package/dist/lib/src/components/InputNumber/index.js +0 -1
- package/dist/lib/src/components/Select/index.js +0 -1
- package/dist/lib/src/internal.js +0 -1
- /package/dist/es/{index.mjs → packages/form-antdv/index.mjs} +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/components/ArrayCard/array-card.vue.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/components/ArrayTable/array-table.vue.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/components/FormArea/form-area.vue.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/components/FormArea/form-area.vue2.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/hooks/index.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/hooks/use-namespace/index.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/index.mjs +0 -0
- /package/dist/es/{src → packages/form-antdv/src}/style/index.mjs +0 -0
- /package/dist/lib/{index.js → packages/form-antdv/index.js} +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/components/ArrayCard/array-card.vue.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/components/ArrayTable/array-table.vue.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/components/FormArea/form-area.vue.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/components/FormArea/form-area.vue2.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/hooks/index.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/hooks/use-namespace/index.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/index.js +0 -0
- /package/dist/lib/{src → packages/form-antdv/src}/style/index.js +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as w, mergeModels as B, useModel as E, computed as h, toRaw as N, openBlock as a, createElementBlock as p, normalizeClass as F, unref as
|
|
1
|
+
import { defineComponent as w, mergeModels as B, useModel as E, computed as h, toRaw as N, openBlock as a, createElementBlock as p, normalizeClass as F, unref as r, createBlock as v, withCtx as o, createElementVNode as s, toDisplayString as f, createVNode as g, Fragment as k, renderList as C, createTextVNode as M } from "vue";
|
|
2
2
|
import { Card as b, Empty as S, Button as V } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
4
|
import { useNamespace as j } from "../../hooks/use-namespace/index.mjs";
|
|
5
|
-
import { useInjectFieldContext as A
|
|
6
|
-
|
|
5
|
+
import { useInjectFieldContext as A } from "../../../../form-render/src/context/field.mjs";
|
|
6
|
+
import I from "../../../../form-render/src/components/widget/RecursionField.mjs";
|
|
7
|
+
const q = /* @__PURE__ */ w({
|
|
7
8
|
__name: "array-card",
|
|
8
9
|
props: /* @__PURE__ */ B({
|
|
9
10
|
title: {
|
|
@@ -16,38 +17,38 @@ const T = /* @__PURE__ */ w({
|
|
|
16
17
|
}),
|
|
17
18
|
emits: ["update:value"],
|
|
18
19
|
setup(i) {
|
|
19
|
-
const _ = j("ArrayCard"), e = A(),
|
|
20
|
+
const _ = j("ArrayCard"), e = A(), n = E(i, "value"), y = h(() => {
|
|
20
21
|
var t;
|
|
21
22
|
return ((t = e == null ? void 0 : e.path) == null ? void 0 : t.toString()) || "";
|
|
22
23
|
}), m = h(() => (e == null ? void 0 : e.schema.items.properties) || {});
|
|
23
24
|
function x() {
|
|
24
|
-
if (
|
|
25
|
+
if (n.value) {
|
|
25
26
|
const t = {};
|
|
26
27
|
Object.keys(m.value).forEach((l) => {
|
|
27
|
-
const
|
|
28
|
-
t[l] =
|
|
29
|
-
}),
|
|
28
|
+
const u = m.value[l].type || "string";
|
|
29
|
+
t[l] = u === "number" ? 0 : "";
|
|
30
|
+
}), n.value = [...N(n.value || []), t];
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
return (t, l) => {
|
|
33
|
-
var
|
|
34
|
+
var u;
|
|
34
35
|
return a(), p(
|
|
35
36
|
"div",
|
|
36
37
|
{
|
|
37
|
-
class: F(
|
|
38
|
+
class: F(r(_).b())
|
|
38
39
|
},
|
|
39
40
|
[
|
|
40
|
-
(
|
|
41
|
+
(u = n.value) != null && u.length ? (a(!0), p(
|
|
41
42
|
k,
|
|
42
43
|
{ key: 1 },
|
|
43
|
-
C(
|
|
44
|
-
|
|
44
|
+
C(n.value, (R, c) => (a(), v(
|
|
45
|
+
r(b),
|
|
45
46
|
{
|
|
46
47
|
key: c,
|
|
47
48
|
style: { "margin-bottom": "12px" }
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
|
-
title:
|
|
51
|
+
title: o(() => [
|
|
51
52
|
s("div", null, [
|
|
52
53
|
s(
|
|
53
54
|
"span",
|
|
@@ -58,11 +59,11 @@ const T = /* @__PURE__ */ w({
|
|
|
58
59
|
)
|
|
59
60
|
])
|
|
60
61
|
]),
|
|
61
|
-
default:
|
|
62
|
+
default: o(() => [
|
|
62
63
|
(a(!0), p(
|
|
63
64
|
k,
|
|
64
65
|
null,
|
|
65
|
-
C(m.value, (d, $) => (a(), v(
|
|
66
|
+
C(m.value, (d, $) => (a(), v(r(I), {
|
|
66
67
|
key: `${y.value}.${$}.${d.name}`,
|
|
67
68
|
schema: d,
|
|
68
69
|
name: d.name,
|
|
@@ -80,8 +81,8 @@ const T = /* @__PURE__ */ w({
|
|
|
80
81
|
))),
|
|
81
82
|
128
|
|
82
83
|
/* KEYED_FRAGMENT */
|
|
83
|
-
)) : (a(), v(
|
|
84
|
-
title:
|
|
84
|
+
)) : (a(), v(r(b), { key: 0 }, {
|
|
85
|
+
title: o(() => [
|
|
85
86
|
s("div", null, [
|
|
86
87
|
s(
|
|
87
88
|
"span",
|
|
@@ -92,18 +93,18 @@ const T = /* @__PURE__ */ w({
|
|
|
92
93
|
)
|
|
93
94
|
])
|
|
94
95
|
]),
|
|
95
|
-
default:
|
|
96
|
-
g(
|
|
96
|
+
default: o(() => [
|
|
97
|
+
g(r(S), { description: "暂无数据" })
|
|
97
98
|
]),
|
|
98
99
|
_: 1
|
|
99
100
|
/* STABLE */
|
|
100
101
|
})),
|
|
101
|
-
g(
|
|
102
|
+
g(r(V), {
|
|
102
103
|
type: "dashed",
|
|
103
104
|
style: { "margin-top": "10px", width: "100%" },
|
|
104
105
|
onClick: x
|
|
105
106
|
}, {
|
|
106
|
-
default:
|
|
107
|
+
default: o(() => l[0] || (l[0] = [
|
|
107
108
|
M(" 添加 ")
|
|
108
109
|
])),
|
|
109
110
|
_: 1,
|
|
@@ -117,5 +118,5 @@ const T = /* @__PURE__ */ w({
|
|
|
117
118
|
}
|
|
118
119
|
});
|
|
119
120
|
export {
|
|
120
|
-
|
|
121
|
+
q as default
|
|
121
122
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../../internal.mjs";
|
|
2
|
+
import "./array-card.vue.mjs";
|
|
3
|
+
import { transformComponent as r } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import o from "./array-card.vue2.mjs";
|
|
5
|
+
import { connect as m } from "../../../../form-render/src/utils/connect.mjs";
|
|
6
|
+
import { mapProps as t } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
7
|
+
const a = r(o, {
|
|
8
|
+
change: "update:value"
|
|
9
|
+
}), s = m(a, t());
|
|
10
|
+
export {
|
|
11
|
+
s as ArrayCard,
|
|
12
|
+
a as TransformArrayCard
|
|
13
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as C, mergeModels as y, computed as d, useModel as w, toRaw as m, openBlock as u, createElementBlock as c, normalizeClass as B, unref as n, createVNode as
|
|
1
|
+
import { defineComponent as C, mergeModels as y, computed as d, useModel as w, toRaw as m, openBlock as u, createElementBlock as c, normalizeClass as B, unref as n, createVNode as i, withCtx as o, Fragment as T, renderList as $, createBlock as F, createTextVNode as p } from "vue";
|
|
2
2
|
import { Table as M, TableColumn as f, Button as v } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { useInjectFieldContext as N
|
|
5
|
-
import { useNamespace as
|
|
6
|
-
|
|
4
|
+
import { useInjectFieldContext as N } from "../../../../form-render/src/context/field.mjs";
|
|
5
|
+
import { useNamespace as V } from "../../hooks/use-namespace/index.mjs";
|
|
6
|
+
import z from "../../../../form-render/src/components/widget/RecursionField.mjs";
|
|
7
|
+
const I = /* @__PURE__ */ C({
|
|
7
8
|
__name: "array-table",
|
|
8
9
|
props: /* @__PURE__ */ y({
|
|
9
10
|
title: {
|
|
@@ -16,26 +17,26 @@ const E = /* @__PURE__ */ C({
|
|
|
16
17
|
}),
|
|
17
18
|
emits: ["update:value"],
|
|
18
19
|
setup(_) {
|
|
19
|
-
const l = N(), h =
|
|
20
|
-
var
|
|
21
|
-
return ((
|
|
20
|
+
const l = N(), h = V("ArrayTable"), x = d(() => {
|
|
21
|
+
var r;
|
|
22
|
+
return ((r = l == null ? void 0 : l.path) == null ? void 0 : r.toString()) || "";
|
|
22
23
|
}), e = w(_, "value"), b = d(() => (l == null ? void 0 : l.schema.items.properties) || {});
|
|
23
24
|
function g() {
|
|
24
25
|
e.value && (e.value = [...m(e.value || []), {}]);
|
|
25
26
|
}
|
|
26
|
-
function k(
|
|
27
|
+
function k(r) {
|
|
27
28
|
if (e.value) {
|
|
28
29
|
const t = m(e.value);
|
|
29
|
-
t.splice(
|
|
30
|
+
t.splice(r, 1), e.value = t;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
return (
|
|
33
|
+
return (r, t) => (u(), c(
|
|
33
34
|
"div",
|
|
34
35
|
{
|
|
35
36
|
class: B(n(h).b())
|
|
36
37
|
},
|
|
37
38
|
[
|
|
38
|
-
|
|
39
|
+
i(n(M), {
|
|
39
40
|
"data-source": e.value,
|
|
40
41
|
pagination: !1,
|
|
41
42
|
bordered: "",
|
|
@@ -52,7 +53,7 @@ const E = /* @__PURE__ */ C({
|
|
|
52
53
|
"data-index": a.name
|
|
53
54
|
}, {
|
|
54
55
|
default: o(({ index: s }) => [
|
|
55
|
-
|
|
56
|
+
i(n(z), {
|
|
56
57
|
schema: a,
|
|
57
58
|
name: a.name,
|
|
58
59
|
"base-path": `${x.value}.${s}`
|
|
@@ -64,14 +65,14 @@ const E = /* @__PURE__ */ C({
|
|
|
64
65
|
128
|
|
65
66
|
/* KEYED_FRAGMENT */
|
|
66
67
|
)),
|
|
67
|
-
|
|
68
|
+
i(n(f), {
|
|
68
69
|
title: "操作",
|
|
69
70
|
"data-index": "action",
|
|
70
71
|
align: "center",
|
|
71
72
|
width: "100px"
|
|
72
73
|
}, {
|
|
73
74
|
default: o(({ index: a }) => [
|
|
74
|
-
|
|
75
|
+
i(n(v), {
|
|
75
76
|
type: "link",
|
|
76
77
|
onClick: (s) => k(a)
|
|
77
78
|
}, {
|
|
@@ -89,7 +90,7 @@ const E = /* @__PURE__ */ C({
|
|
|
89
90
|
_: 1
|
|
90
91
|
/* STABLE */
|
|
91
92
|
}, 8, ["data-source"]),
|
|
92
|
-
|
|
93
|
+
i(n(v), {
|
|
93
94
|
type: "dashed",
|
|
94
95
|
style: { "margin-top": "10px", width: "100%" },
|
|
95
96
|
onClick: g
|
|
@@ -107,5 +108,5 @@ const E = /* @__PURE__ */ C({
|
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
+
I as default
|
|
111
112
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../../internal.mjs";
|
|
2
|
+
import "./array-table.vue.mjs";
|
|
3
|
+
import { transformComponent as r } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import o from "./array-table.vue2.mjs";
|
|
5
|
+
import { connect as m } from "../../../../form-render/src/utils/connect.mjs";
|
|
6
|
+
import { mapProps as t } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
7
|
+
const a = r(o, {
|
|
8
|
+
change: "update:value"
|
|
9
|
+
}), s = m(a, t());
|
|
10
|
+
export {
|
|
11
|
+
s as ArrayTable,
|
|
12
|
+
a as TransformArrayTable
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../../internal.mjs";
|
|
2
|
+
import { RangePicker as o } from "ant-design-vue";
|
|
3
|
+
import { transformComponent as r } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import { connect as t } from "../../../../form-render/src/utils/connect.mjs";
|
|
5
|
+
import { mapProps as m } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
6
|
+
const e = r(o, {
|
|
7
|
+
change: "update:value"
|
|
8
|
+
}), f = t(e, m());
|
|
9
|
+
export {
|
|
10
|
+
f as DateRange,
|
|
11
|
+
e as TransformDatePicker
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../../internal.mjs";
|
|
2
|
+
import "./form-area.vue.mjs";
|
|
3
|
+
import { transformComponent as o } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import r from "./form-area.vue2.mjs";
|
|
5
|
+
import { connect as m } from "../../../../form-render/src/utils/connect.mjs";
|
|
6
|
+
import { mapProps as t } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
7
|
+
const p = o(r, {}), e = m(p, t());
|
|
8
|
+
export {
|
|
9
|
+
e as FormArea,
|
|
10
|
+
p as TransformFormArea
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Input as o } from "ant-design-vue";
|
|
2
|
+
import "../../internal.mjs";
|
|
3
|
+
import { transformComponent as t } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import { connect as r } from "../../../../form-render/src/utils/connect.mjs";
|
|
5
|
+
import { mapProps as p } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
6
|
+
const m = t(o, {
|
|
7
|
+
change: "update:value"
|
|
8
|
+
}), u = r(m, p());
|
|
9
|
+
export {
|
|
10
|
+
u as Input,
|
|
11
|
+
m as TransformInput
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputNumber as o } from "ant-design-vue";
|
|
2
|
+
import "../../internal.mjs";
|
|
3
|
+
import { transformComponent as r } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import { connect as m } from "../../../../form-render/src/utils/connect.mjs";
|
|
5
|
+
import { mapProps as t } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
6
|
+
const p = r(o, {
|
|
7
|
+
change: "update:value"
|
|
8
|
+
}), s = m(p, t());
|
|
9
|
+
export {
|
|
10
|
+
s as InputNumber,
|
|
11
|
+
p as TransformInput
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Select as r } from "ant-design-vue";
|
|
2
|
+
import "../../internal.mjs";
|
|
3
|
+
import { transformComponent as m } from "../../../../form-render/src/utils/transformComponent.mjs";
|
|
4
|
+
import { connect as e } from "../../../../form-render/src/utils/connect.mjs";
|
|
5
|
+
import { mapProps as n } from "../../../../form-render/src/utils/mapProps.mjs";
|
|
6
|
+
const p = m(r, {
|
|
7
|
+
change: "update:value"
|
|
8
|
+
}), f = e(p, n({}, (t, o) => ({
|
|
9
|
+
...t,
|
|
10
|
+
options: o == null ? void 0 : o.enum
|
|
11
|
+
})));
|
|
12
|
+
export {
|
|
13
|
+
f as Select,
|
|
14
|
+
p as TransformSelect
|
|
15
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as i, useSlots as l, onUnmounted as d, openBlock as p, createElementBlock as a, renderSlot as f } from "vue";
|
|
2
|
+
import { useProvideFromContext as u } from "../context/form.mjs";
|
|
3
|
+
import { FormProviderProps as v } from "./propsType.mjs";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const _ = { class: "k-render-form-provider" }, k = /* @__PURE__ */ i({
|
|
6
|
+
__name: "FormProvider",
|
|
7
|
+
props: v,
|
|
8
|
+
setup(s) {
|
|
9
|
+
var c;
|
|
10
|
+
const t = s, e = ["SchemaField"], r = l();
|
|
11
|
+
return (((c = r.default) == null ? void 0 : c.call(r)) || []).forEach((o) => {
|
|
12
|
+
var m;
|
|
13
|
+
const n = (m = o.type) == null ? void 0 : m.name;
|
|
14
|
+
if (!n) {
|
|
15
|
+
console.warn(`FormProvider 组件内只能包含 ${e.join(", ")} 组件`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
typeof o.type == "object" && !e.includes(n) && console.warn(`FormProvider 组件内只能包含 ${e.join(", ")} 组件`);
|
|
19
|
+
}), d(() => {
|
|
20
|
+
t.form.event.clearAll();
|
|
21
|
+
}), u(t.form), (o, n) => (p(), a("div", _, [
|
|
22
|
+
f(o.$slots, "default")
|
|
23
|
+
]));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
k as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent as i, ref as n, toRaw as c, watch as l, createVNode as s } from "vue";
|
|
2
|
+
import "../internal.mjs";
|
|
3
|
+
import "../../../../node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/index.mjs";
|
|
4
|
+
import "../context/index.mjs";
|
|
5
|
+
import { SchemaFieldProps as d } from "./propsType.mjs";
|
|
6
|
+
import h from "./widget/RecursionField.mjs";
|
|
7
|
+
import { useInjectFormContext as u } from "../context/form.mjs";
|
|
8
|
+
import { formatSchema as f } from "../utils/schema.mjs";
|
|
9
|
+
import { delay as p } from "../../../../node_modules/.pnpm/@king-one_utils@1.0.14/node_modules/@king-one/utils/src/delay.mjs";
|
|
10
|
+
const z = /* @__PURE__ */ i({
|
|
11
|
+
name: "SchemaField",
|
|
12
|
+
props: d,
|
|
13
|
+
setup(r) {
|
|
14
|
+
const o = n(!1);
|
|
15
|
+
let a = null;
|
|
16
|
+
const t = u(), m = async () => {
|
|
17
|
+
try {
|
|
18
|
+
const e = c(r.schema);
|
|
19
|
+
if (!e || !Object.keys(e).length)
|
|
20
|
+
return;
|
|
21
|
+
a = await f(e), o.value = !0, t.event.trigger("FormMount");
|
|
22
|
+
} catch (e) {
|
|
23
|
+
console.error("[SchemaField] Schema initialization failed:", e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return t.event.on("FormDestroy", () => {
|
|
27
|
+
o.value = !1;
|
|
28
|
+
}), l(() => r.schema, async () => {
|
|
29
|
+
console.log("SchemaField watch triggered"), t.mounted && (t.destroy(), await p(100)), m();
|
|
30
|
+
}, {
|
|
31
|
+
deep: !0,
|
|
32
|
+
immediate: !0
|
|
33
|
+
}), () => o.value ? s(h, {
|
|
34
|
+
schema: a
|
|
35
|
+
}, null, 8, ["schema"]) : null;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
z as default
|
|
40
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const e = (r) => r, t = {
|
|
2
|
+
form: {
|
|
3
|
+
type: e(Object),
|
|
4
|
+
required: !0
|
|
5
|
+
}
|
|
6
|
+
}, n = {
|
|
7
|
+
schema: {
|
|
8
|
+
type: e(Object)
|
|
9
|
+
}
|
|
10
|
+
}, o = {
|
|
11
|
+
schema: {
|
|
12
|
+
type: e(Object),
|
|
13
|
+
required: !0
|
|
14
|
+
},
|
|
15
|
+
name: e([String, Number]),
|
|
16
|
+
basePath: e([String, Number, RegExp, Function])
|
|
17
|
+
}, c = {
|
|
18
|
+
schema: {
|
|
19
|
+
type: e(Object),
|
|
20
|
+
required: !0
|
|
21
|
+
},
|
|
22
|
+
name: {
|
|
23
|
+
type: e([String, Number])
|
|
24
|
+
},
|
|
25
|
+
basePath: e([String, Number, RegExp, Function])
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
c as BaseFieldProps,
|
|
29
|
+
t as FormProviderProps,
|
|
30
|
+
o as RecursionFieldProps,
|
|
31
|
+
n as SchemaFieldProps,
|
|
32
|
+
e as definePropType
|
|
33
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isVNode as s, defineComponent as d, createVNode as c } from "vue";
|
|
2
|
+
import { BaseFieldProps as u } from "../propsType.mjs";
|
|
3
|
+
import "../../context/index.mjs";
|
|
4
|
+
import { useInjectFormContext as m } from "../../context/form.mjs";
|
|
5
|
+
import { useProvideFieldContext as f } from "../../context/field.mjs";
|
|
6
|
+
function p(e) {
|
|
7
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
|
|
8
|
+
}
|
|
9
|
+
const j = /* @__PURE__ */ d({
|
|
10
|
+
name: "ArrayField",
|
|
11
|
+
props: u,
|
|
12
|
+
setup(e) {
|
|
13
|
+
const o = m(), t = o == null ? void 0 : o.createArrayField(e.schema, e.name, e.basePath);
|
|
14
|
+
f(t);
|
|
15
|
+
const a = () => {
|
|
16
|
+
if (t.component) {
|
|
17
|
+
const r = t.component;
|
|
18
|
+
return c(r, {
|
|
19
|
+
onChange: (l) => {
|
|
20
|
+
t.change(l);
|
|
21
|
+
}
|
|
22
|
+
}, null, 16);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}, i = (r) => {
|
|
26
|
+
if (t.decorator) {
|
|
27
|
+
const n = t.decorator;
|
|
28
|
+
return c(n, null, p(r) ? r : {
|
|
29
|
+
default: () => [r],
|
|
30
|
+
_: 2
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return r;
|
|
34
|
+
};
|
|
35
|
+
return () => i(a());
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
j as default
|
|
40
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineComponent as e, createVNode as r, createTextVNode as o } from "vue";
|
|
2
|
+
const u = /* @__PURE__ */ e({
|
|
3
|
+
name: "ErrorField",
|
|
4
|
+
setup() {
|
|
5
|
+
return () => r("div", {
|
|
6
|
+
style: {
|
|
7
|
+
color: "red"
|
|
8
|
+
}
|
|
9
|
+
}, [o("该组件未定义")]);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
u as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isVNode as u, defineComponent as s, createVNode as c } from "vue";
|
|
2
|
+
import { BaseFieldProps as d } from "../propsType.mjs";
|
|
3
|
+
import "../../context/index.mjs";
|
|
4
|
+
import { useInjectFormContext as m } from "../../context/form.mjs";
|
|
5
|
+
import { useProvideFieldContext as f } from "../../context/field.mjs";
|
|
6
|
+
function p(e) {
|
|
7
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !u(e);
|
|
8
|
+
}
|
|
9
|
+
const g = /* @__PURE__ */ s({
|
|
10
|
+
name: "KField",
|
|
11
|
+
props: d,
|
|
12
|
+
setup(e) {
|
|
13
|
+
const r = m(), t = r == null ? void 0 : r.createField(e.schema, e.name, e.basePath);
|
|
14
|
+
f(t);
|
|
15
|
+
const i = () => {
|
|
16
|
+
if (t.component) {
|
|
17
|
+
const o = t.component;
|
|
18
|
+
return c(o, {
|
|
19
|
+
onChange: (a) => {
|
|
20
|
+
t.change(a);
|
|
21
|
+
},
|
|
22
|
+
onBlur: () => {
|
|
23
|
+
t.blur();
|
|
24
|
+
}
|
|
25
|
+
}, null, 16);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}, l = (o) => {
|
|
29
|
+
if (t.decorator) {
|
|
30
|
+
const n = t.decorator;
|
|
31
|
+
return c(n, null, p(o) ? o : {
|
|
32
|
+
default: () => [o],
|
|
33
|
+
_: 2
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return o;
|
|
37
|
+
};
|
|
38
|
+
return () => l(i());
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
g as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as b, computed as t, createVNode as o, createTextVNode as x, Transition as F } from "vue";
|
|
2
|
+
import "../../internal.mjs";
|
|
3
|
+
import "../../context/index.mjs";
|
|
4
|
+
import { useNamespace as g } from "../../hooks/use-namespace/index.mjs";
|
|
5
|
+
import { useInjectFieldContext as C } from "../../context/field.mjs";
|
|
6
|
+
import { useInjectFormContext as I } from "../../context/form.mjs";
|
|
7
|
+
import { addUnit as N } from "../../utils/style.mjs";
|
|
8
|
+
const V = /* @__PURE__ */ b({
|
|
9
|
+
name: "KItem",
|
|
10
|
+
setup(T, {
|
|
11
|
+
slots: a
|
|
12
|
+
}) {
|
|
13
|
+
const {
|
|
14
|
+
b: i,
|
|
15
|
+
e: r,
|
|
16
|
+
em: l
|
|
17
|
+
} = g("item"), u = t(() => [i()]), e = C(), p = (e == null ? void 0 : e.schema["x-decorator-props"]) || {}, n = I(), c = n == null ? void 0 : n.schema, d = t(() => {
|
|
18
|
+
if (c)
|
|
19
|
+
return {
|
|
20
|
+
width: N(c.labelWidth),
|
|
21
|
+
textAlign: c.labelPosition
|
|
22
|
+
};
|
|
23
|
+
}), v = t(() => {
|
|
24
|
+
if (e)
|
|
25
|
+
return e.schema.title;
|
|
26
|
+
}), s = t(() => e == null ? void 0 : e.validateReactive.status), f = t(() => e == null ? void 0 : e.validateReactive.message), h = t(() => s.value === "error" ? [r("content"), r("error")] : [r("content")]);
|
|
27
|
+
return () => {
|
|
28
|
+
var m;
|
|
29
|
+
return o("div", {
|
|
30
|
+
class: u.value
|
|
31
|
+
}, [p.hideTitle ? null : o("label", {
|
|
32
|
+
class: r("label"),
|
|
33
|
+
style: d.value
|
|
34
|
+
}, [v.value, x(":")], 6), o("div", {
|
|
35
|
+
class: h.value
|
|
36
|
+
}, [(m = a.default) == null ? void 0 : m.call(a), o(F, {
|
|
37
|
+
name: "king-form-zoom-in-top"
|
|
38
|
+
}, {
|
|
39
|
+
default: () => [s.value === "error" && o("div", {
|
|
40
|
+
class: [l("content", "error")]
|
|
41
|
+
}, [f.value], 2)]
|
|
42
|
+
})], 2)], 2);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
V as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isVNode as f, defineComponent as p, toRefs as h, createVNode as n, Fragment as i } from "vue";
|
|
2
|
+
import "../../internal.mjs";
|
|
3
|
+
import { BaseFieldProps as b } from "../propsType.mjs";
|
|
4
|
+
import "../../context/index.mjs";
|
|
5
|
+
import F from "./RecursionField.mjs";
|
|
6
|
+
import { useInjectFormContext as j } from "../../context/form.mjs";
|
|
7
|
+
import { useProvideFieldContext as C } from "../../context/field.mjs";
|
|
8
|
+
import { getSchemaProperties as P } from "../../utils/schema.mjs";
|
|
9
|
+
function g(e) {
|
|
10
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !f(e);
|
|
11
|
+
}
|
|
12
|
+
const B = /* @__PURE__ */ p({
|
|
13
|
+
name: "ObjectField",
|
|
14
|
+
props: b,
|
|
15
|
+
setup(e) {
|
|
16
|
+
const {
|
|
17
|
+
schema: a
|
|
18
|
+
} = h(e), c = j();
|
|
19
|
+
let t = null;
|
|
20
|
+
a.value["x-component"] && (t = c == null ? void 0 : c.createObjectField(e.schema, e.name, e.basePath), C(t));
|
|
21
|
+
const s = () => {
|
|
22
|
+
const l = P(a.value);
|
|
23
|
+
return n(i, null, [l.map((o, r) => n(F, {
|
|
24
|
+
key: `${r}-${o.key}`,
|
|
25
|
+
schema: o.schema,
|
|
26
|
+
name: o.key,
|
|
27
|
+
basePath: e.name
|
|
28
|
+
}, null, 8, ["schema", "name", "basePath"]))]);
|
|
29
|
+
}, u = () => t ? ((r) => {
|
|
30
|
+
if (t.decorator) {
|
|
31
|
+
const m = t.decorator;
|
|
32
|
+
return n(m, null, g(r) ? r : {
|
|
33
|
+
default: () => [r],
|
|
34
|
+
_: 2
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return r;
|
|
38
|
+
})((() => {
|
|
39
|
+
if (t.component) {
|
|
40
|
+
const r = t.component;
|
|
41
|
+
return n(r, {
|
|
42
|
+
onChange: (d) => {
|
|
43
|
+
t.change(d);
|
|
44
|
+
}
|
|
45
|
+
}, null, 16);
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
})()) : null;
|
|
49
|
+
return () => n(i, null, [a.value["x-component"] ? u() : s()]);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
B as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent as m, toRefs as n, createVNode as t, createTextVNode as r } from "vue";
|
|
2
|
+
import { RecursionFieldProps as s } from "../propsType.mjs";
|
|
3
|
+
import "./index.mjs";
|
|
4
|
+
import u from "./ObjectField.mjs";
|
|
5
|
+
import l from "./ArrayField.mjs";
|
|
6
|
+
import c from "./Field.mjs";
|
|
7
|
+
const F = /* @__PURE__ */ m({
|
|
8
|
+
name: "RecursionField",
|
|
9
|
+
props: s,
|
|
10
|
+
setup(e) {
|
|
11
|
+
const {
|
|
12
|
+
schema: a
|
|
13
|
+
} = n(e);
|
|
14
|
+
return () => a.value.type === "object" ? t(u, {
|
|
15
|
+
schema: e.schema,
|
|
16
|
+
basePath: e.basePath,
|
|
17
|
+
name: e.name
|
|
18
|
+
}, null, 8, ["schema", "basePath", "name"]) : a.value.type === "array" ? t(l, {
|
|
19
|
+
schema: e.schema,
|
|
20
|
+
basePath: e.basePath,
|
|
21
|
+
name: e.name
|
|
22
|
+
}, null, 8, ["schema", "basePath", "name"]) : a.value.type === "string" || a.value.type === "number" ? t(c, {
|
|
23
|
+
schema: e.schema,
|
|
24
|
+
basePath: e.basePath,
|
|
25
|
+
name: e.name
|
|
26
|
+
}, null, 8, ["schema", "basePath", "name"]) : t("div", null, [r("未知类型的组件")]);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
F as default
|
|
31
|
+
};
|