@king-one/form-design 0.0.4 → 0.0.6
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 +12 -0
- package/dist/es/index.mjs +13 -11
- package/dist/es/src/components/form-desgin.mjs +32 -29
- package/dist/es/src/components/form-panel.vue.mjs +3 -1
- package/dist/es/src/components/form-setting.vue.mjs +40 -78
- package/dist/es/src/components/index.mjs +1 -0
- package/dist/es/src/components/props/form-config.vue.mjs +78 -0
- package/dist/es/src/components/props/form-config.vue2.mjs +4 -0
- package/dist/es/src/components/props/form-props.vue2.mjs +22 -21
- package/dist/es/src/components/props/index.mjs +3 -2
- package/dist/es/src/components/props/widget/index.mjs +41 -14
- package/dist/es/src/components/types.mjs +7 -1
- package/dist/es/src/config/index.mjs +1 -2
- package/dist/es/src/core/Design.mjs +10 -13
- package/dist/es/src/core/FormSchema.mjs +16 -21
- package/dist/es/src/hooks/use-monaco.mjs +38 -25
- package/dist/es/src/index.mjs +10 -9
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/form-desgin.js +1 -1
- package/dist/lib/src/components/form-panel.vue.js +1 -1
- package/dist/lib/src/components/form-setting.vue.js +11 -1
- package/dist/lib/src/components/index.js +1 -1
- package/dist/lib/src/components/props/form-config.vue.js +1 -0
- package/dist/lib/src/components/props/form-config.vue2.js +1 -0
- package/dist/lib/src/components/props/form-props.vue2.js +1 -1
- package/dist/lib/src/components/props/index.js +1 -1
- package/dist/lib/src/components/props/widget/index.js +1 -1
- package/dist/lib/src/components/types.js +1 -1
- package/dist/lib/src/config/index.js +1 -1
- package/dist/lib/src/core/Design.js +1 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/hooks/use-monaco.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/theme-chalk/form-config.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/setting.css +1 -1
- package/dist/types/src/components/form-setting.vue.d.ts +15 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/panel/index.d.ts +2 -2
- package/dist/types/src/components/props/form-config.vue.d.ts +30 -0
- package/dist/types/src/components/props/index.d.ts +1 -0
- package/dist/types/src/components/props/widget/index.d.ts +8 -3
- package/dist/types/src/components/types.d.ts +11 -1
- package/dist/types/src/core/Design.d.ts +10 -14
- package/dist/types/src/core/FormSchema.d.ts +4 -8
- package/dist/types/src/hooks/use-monaco.d.ts +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/types.d.ts +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.mjs
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import "./src/index.mjs";
|
|
2
2
|
import { default as t } from "./src/components/panel/panel-item.vue.mjs";
|
|
3
|
-
import { useInjectDesignContext as
|
|
4
|
-
import { default as
|
|
3
|
+
import { useInjectDesignContext as a } from "./src/context/design.mjs";
|
|
4
|
+
import { default as f } from "./src/components/form-desgin.mjs";
|
|
5
5
|
import { CreateFormDesign as i } from "./src/core/index.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { default as p } from "./src/components/props/form-config.vue.mjs";
|
|
7
|
+
import { BaseSchema as d, ExtendSchema as l, LayoutSchema as u } from "./src/config/index.mjs";
|
|
8
|
+
import { onDesignFieldChange as F, onDesignInit as c } from "./src/effects/onEffects.mjs";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
d as BaseSchema,
|
|
10
11
|
i as CreateFormDesign,
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
l as ExtendSchema,
|
|
13
|
+
p as FormConfig,
|
|
14
|
+
f as FormDesign,
|
|
13
15
|
t as FormPanelItem,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
u as LayoutSchema,
|
|
17
|
+
F as onDesignFieldChange,
|
|
18
|
+
c as onDesignInit,
|
|
19
|
+
a as useInjectDesignContext
|
|
18
20
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, ref as i, h as o } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { useProvideDragContext as
|
|
3
|
+
import { useProvideDragContext as f, useProvideDesignContext as p } from "../context/design.mjs";
|
|
4
4
|
import "./index.mjs";
|
|
5
|
-
import { FormDesignProps as
|
|
6
|
-
import { merge as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
5
|
+
import { FormDesignProps as c } from "./types.mjs";
|
|
6
|
+
import { merge as g } from "../utils/merge.mjs";
|
|
7
|
+
import { useNamespace as u } from "../hooks/use-namespace/index.mjs";
|
|
8
|
+
import l from "./form-material.vue.mjs";
|
|
9
|
+
import d from "./form-panel.vue.mjs";
|
|
10
|
+
import D from "./form-setting.vue.mjs";
|
|
11
11
|
const {
|
|
12
|
-
b:
|
|
13
|
-
} =
|
|
12
|
+
b: _
|
|
13
|
+
} = u("main"), v = {
|
|
14
14
|
config: {
|
|
15
15
|
theme: "dark",
|
|
16
16
|
tags: ["frontend", "vue"]
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, C = {
|
|
19
19
|
config: {
|
|
20
20
|
language: "zh-CN",
|
|
21
21
|
tags: ["typescript", "javascript"]
|
|
22
22
|
}
|
|
23
|
-
},
|
|
23
|
+
}, h = g(v, C, {
|
|
24
24
|
// customMerge: () => {
|
|
25
25
|
// return (target, source) => {
|
|
26
26
|
// if (Array.isArray(target) && Array.isArray(source)) {
|
|
@@ -34,28 +34,31 @@ const {
|
|
|
34
34
|
// return type
|
|
35
35
|
// }
|
|
36
36
|
});
|
|
37
|
-
console.log(
|
|
38
|
-
const
|
|
37
|
+
console.log(h);
|
|
38
|
+
const q = /* @__PURE__ */ a({
|
|
39
39
|
name: "FormDesign",
|
|
40
|
-
props:
|
|
41
|
-
setup(
|
|
42
|
-
slots:
|
|
40
|
+
props: c,
|
|
41
|
+
setup(t, {
|
|
42
|
+
slots: s
|
|
43
43
|
}) {
|
|
44
44
|
const {
|
|
45
|
-
toolbar:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
toolbar: m,
|
|
46
|
+
setting: r
|
|
47
|
+
} = s, e = i(!1);
|
|
48
|
+
return f({
|
|
49
|
+
isDrag: e,
|
|
50
|
+
updateDrag: (n) => {
|
|
51
|
+
e.value = n;
|
|
51
52
|
}
|
|
52
|
-
}), p(
|
|
53
|
-
class:
|
|
54
|
-
}, [o(
|
|
55
|
-
toolbar:
|
|
56
|
-
}), o(
|
|
53
|
+
}), p(t.design), () => o("form", {
|
|
54
|
+
class: _()
|
|
55
|
+
}, [o(l), o(d, {}, {
|
|
56
|
+
toolbar: m
|
|
57
|
+
}), o(D, null, {
|
|
58
|
+
default: () => r == null ? void 0 : r()
|
|
59
|
+
})]);
|
|
57
60
|
}
|
|
58
61
|
});
|
|
59
62
|
export {
|
|
60
|
-
|
|
63
|
+
q as default
|
|
61
64
|
};
|
|
@@ -21,7 +21,9 @@ const A = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
21
21
|
setup(U) {
|
|
22
22
|
const S = $("contentEditorTel"), { isDrag: w } = J(), { setEditorValue: x } = O(S), i = R(!1), c = M(), { fields: m } = c;
|
|
23
23
|
function E() {
|
|
24
|
-
|
|
24
|
+
x(c.getFormSchema()).then(() => {
|
|
25
|
+
i.value = !i.value;
|
|
26
|
+
});
|
|
25
27
|
}
|
|
26
28
|
function y() {
|
|
27
29
|
}
|
|
@@ -1,104 +1,66 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import "../internal.mjs";
|
|
1
|
+
import { defineComponent as d, ref as u, computed as f, openBlock as t, createElementBlock as v, normalizeClass as b, createVNode as o, withCtx as _, withDirectives as g, createElementVNode as s, createCommentVNode as k, renderSlot as y, unref as h, vShow as C, createBlock as a } from "vue";
|
|
2
|
+
import { Empty as P } from "ant-design-vue";
|
|
4
3
|
import "../hooks/index.mjs";
|
|
5
4
|
import "./form-icon.vue.mjs";
|
|
6
5
|
import "./base/collapse.vue.mjs";
|
|
7
|
-
import "
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
import T from "./props/form-props.vue2.mjs";
|
|
12
|
-
import g from "./form-icon.vue2.mjs";
|
|
13
|
-
const V = { style: { height: "100%" } }, I = { class: "setting-aside" }, X = /* @__PURE__ */ C({
|
|
6
|
+
import { useNamespace as l } from "../hooks/use-namespace/index.mjs";
|
|
7
|
+
import T from "./base/collapse.vue2.mjs";
|
|
8
|
+
import i from "./form-icon.vue2.mjs";
|
|
9
|
+
const z = { style: { height: "100%" } }, E = { class: "setting-aside" }, O = /* @__PURE__ */ d({
|
|
14
10
|
name: "FormSetting",
|
|
15
11
|
__name: "form-setting",
|
|
16
|
-
setup(
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
key: a
|
|
20
|
-
})) : []);
|
|
21
|
-
return (f, a) => (e(), _(
|
|
12
|
+
setup(N) {
|
|
13
|
+
const { b: r } = l("setting"), { b: m } = l("setting-collapse"), e = u(!0), c = f(() => [r(), !e.value && m()]);
|
|
14
|
+
return (p, n) => (t(), v(
|
|
22
15
|
"div",
|
|
23
16
|
{
|
|
24
|
-
class:
|
|
17
|
+
class: b(c.value)
|
|
25
18
|
},
|
|
26
19
|
[
|
|
27
|
-
|
|
28
|
-
default:
|
|
29
|
-
|
|
20
|
+
o(T, null, {
|
|
21
|
+
default: _(() => [
|
|
22
|
+
g(s(
|
|
30
23
|
"div",
|
|
31
|
-
|
|
24
|
+
z,
|
|
32
25
|
[
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
key: i.key
|
|
52
|
-
}))),
|
|
53
|
-
128
|
|
54
|
-
/* KEYED_FRAGMENT */
|
|
55
|
-
))
|
|
56
|
-
]),
|
|
57
|
-
_: 1
|
|
58
|
-
/* STABLE */
|
|
59
|
-
})) : (e(), r(t(N), {
|
|
60
|
-
key: 1,
|
|
61
|
-
style: { "margin-top": "50px" },
|
|
62
|
-
description: "请选择添加的组件"
|
|
63
|
-
}))
|
|
64
|
-
]),
|
|
65
|
-
_: 1
|
|
66
|
-
/* STABLE */
|
|
67
|
-
}),
|
|
68
|
-
s(t(v), {
|
|
69
|
-
key: "2",
|
|
70
|
-
tab: "表单配置"
|
|
71
|
-
}, {
|
|
72
|
-
default: n(() => [
|
|
73
|
-
s(t(T))
|
|
74
|
-
]),
|
|
75
|
-
_: 1
|
|
76
|
-
/* STABLE */
|
|
77
|
-
})
|
|
78
|
-
]),
|
|
79
|
-
_: 1
|
|
80
|
-
/* STABLE */
|
|
81
|
-
})
|
|
26
|
+
s("aside", E, [
|
|
27
|
+
k(` <Tabs size="small" centered class="setting-tabs">
|
|
28
|
+
<TabPane key="1" tab="组件配置">
|
|
29
|
+
<Collapse v-if="Object.keys(checkedField).length && CollapsePanels.length">
|
|
30
|
+
<component :is="item" v-for="item in CollapsePanels" :key="item.key" />
|
|
31
|
+
</Collapse>
|
|
32
|
+
<Empty v-else style="margin-top: 50px;" description="请选择添加的组件" />
|
|
33
|
+
</TabPane>
|
|
34
|
+
<TabPane key="2" tab="表单配置">
|
|
35
|
+
<FormProps />
|
|
36
|
+
</TabPane>
|
|
37
|
+
</Tabs> `),
|
|
38
|
+
y(p.$slots, "default", {}, () => [
|
|
39
|
+
o(h(P), {
|
|
40
|
+
class: "setting-empty",
|
|
41
|
+
description: "暂无配置项"
|
|
42
|
+
})
|
|
43
|
+
])
|
|
82
44
|
])
|
|
83
45
|
],
|
|
84
46
|
512
|
|
85
47
|
/* NEED_PATCH */
|
|
86
48
|
), [
|
|
87
|
-
[
|
|
49
|
+
[C, e.value]
|
|
88
50
|
])
|
|
89
51
|
]),
|
|
90
|
-
_:
|
|
91
|
-
/*
|
|
52
|
+
_: 3
|
|
53
|
+
/* FORWARDED */
|
|
92
54
|
}),
|
|
93
|
-
|
|
55
|
+
s("div", {
|
|
94
56
|
class: "setting-collapse",
|
|
95
|
-
onClick:
|
|
57
|
+
onClick: n[0] || (n[0] = ($) => e.value = !e.value)
|
|
96
58
|
}, [
|
|
97
|
-
|
|
59
|
+
e.value ? (t(), a(i, {
|
|
98
60
|
key: 1,
|
|
99
61
|
name: "double-right",
|
|
100
62
|
size: 18
|
|
101
|
-
})) : (
|
|
63
|
+
})) : (t(), a(i, {
|
|
102
64
|
key: 0,
|
|
103
65
|
name: "double-left",
|
|
104
66
|
size: 18
|
|
@@ -111,5 +73,5 @@ const V = { style: { height: "100%" } }, I = { class: "setting-aside" }, X = /*
|
|
|
111
73
|
}
|
|
112
74
|
});
|
|
113
75
|
export {
|
|
114
|
-
|
|
76
|
+
O as default
|
|
115
77
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as k, computed as y, openBlock as o, createElementBlock as a, normalizeClass as _, unref as e, createVNode as t, withCtx as n, Fragment as g, createBlock as s, resolveDynamicComponent as x, renderSlot as b } from "vue";
|
|
2
|
+
import { Tabs as v, TabPane as p, Empty as c } from "ant-design-vue";
|
|
3
|
+
import "../../internal.mjs";
|
|
4
|
+
import { FormConfigProps as C } from "../types.mjs";
|
|
5
|
+
import "./form-props.vue.mjs";
|
|
6
|
+
import { expandProps as P } from "./widget/index.mjs";
|
|
7
|
+
import "@king-one/form-design/dist/theme-chalk/form-config.css";
|
|
8
|
+
import { useInjectDesignContext as h } from "../../context/design.mjs";
|
|
9
|
+
import { useNamespace as F } from "../../hooks/use-namespace/index.mjs";
|
|
10
|
+
import B from "./form-props.vue2.mjs";
|
|
11
|
+
const V = /* @__PURE__ */ k({
|
|
12
|
+
__name: "form-config",
|
|
13
|
+
props: C,
|
|
14
|
+
setup(i) {
|
|
15
|
+
const l = i, { checkedField: f } = h(), r = y(() => f.value.key || ""), { b: d } = F("form-config"), m = P(l.expandProps);
|
|
16
|
+
return (u, z) => (o(), a(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
class: _(e(d)())
|
|
20
|
+
},
|
|
21
|
+
[
|
|
22
|
+
t(e(v), {
|
|
23
|
+
size: "small",
|
|
24
|
+
centered: "",
|
|
25
|
+
class: "setting-tabs"
|
|
26
|
+
}, {
|
|
27
|
+
default: n(() => [
|
|
28
|
+
t(e(p), {
|
|
29
|
+
key: "1",
|
|
30
|
+
tab: "组件配置"
|
|
31
|
+
}, {
|
|
32
|
+
default: n(() => [
|
|
33
|
+
r.value ? (o(), a(
|
|
34
|
+
g,
|
|
35
|
+
{ key: 0 },
|
|
36
|
+
[
|
|
37
|
+
e(m)[r.value] ? (o(), s(x(e(m)[r.value]), { key: 0 })) : (o(), s(e(c), {
|
|
38
|
+
key: 1,
|
|
39
|
+
style: { "margin-top": "50px" },
|
|
40
|
+
description: "当前组件不支持配置"
|
|
41
|
+
}))
|
|
42
|
+
],
|
|
43
|
+
64
|
|
44
|
+
/* STABLE_FRAGMENT */
|
|
45
|
+
)) : (o(), s(e(c), {
|
|
46
|
+
key: 1,
|
|
47
|
+
style: { "margin-top": "50px" },
|
|
48
|
+
description: "请选择添加的组件"
|
|
49
|
+
}))
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
/* STABLE */
|
|
53
|
+
}),
|
|
54
|
+
t(e(p), {
|
|
55
|
+
key: "2",
|
|
56
|
+
tab: "表单配置"
|
|
57
|
+
}, {
|
|
58
|
+
default: n(() => [
|
|
59
|
+
b(u.$slots, "formProps", {}, () => [
|
|
60
|
+
t(B)
|
|
61
|
+
])
|
|
62
|
+
]),
|
|
63
|
+
_: 3
|
|
64
|
+
/* FORWARDED */
|
|
65
|
+
})
|
|
66
|
+
]),
|
|
67
|
+
_: 3
|
|
68
|
+
/* FORWARDED */
|
|
69
|
+
})
|
|
70
|
+
],
|
|
71
|
+
2
|
|
72
|
+
/* CLASS */
|
|
73
|
+
));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
V as default
|
|
78
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent as s,
|
|
2
|
-
import { Form as
|
|
3
|
-
|
|
4
|
-
import { useInjectDesignContext as v } from "../../context/design.mjs";
|
|
5
|
-
const b = { style: { padding: "10px" } }, k = /* @__PURE__ */ s({
|
|
1
|
+
import { defineComponent as s, reactive as m, openBlock as d, createElementBlock as v, createCommentVNode as f, createVNode as l, unref as e, withCtx as n } from "vue";
|
|
2
|
+
import { Form as c, FormItem as r, Select as i } from "ant-design-vue";
|
|
3
|
+
const b = { style: { padding: "10px" } }, h = /* @__PURE__ */ s({
|
|
6
4
|
__name: "form-props",
|
|
7
5
|
setup(_) {
|
|
8
|
-
const
|
|
6
|
+
const t = m({
|
|
7
|
+
layout: "horizontal",
|
|
8
|
+
labelAlign: "left"
|
|
9
|
+
}), u = [
|
|
9
10
|
{
|
|
10
11
|
value: "horizontal",
|
|
11
12
|
label: "水平"
|
|
@@ -14,7 +15,7 @@ const b = { style: { padding: "10px" } }, k = /* @__PURE__ */ s({
|
|
|
14
15
|
value: "vertical",
|
|
15
16
|
label: "垂直"
|
|
16
17
|
}
|
|
17
|
-
],
|
|
18
|
+
], p = [
|
|
18
19
|
{
|
|
19
20
|
value: "left",
|
|
20
21
|
label: "左对齐"
|
|
@@ -24,33 +25,33 @@ const b = { style: { padding: "10px" } }, k = /* @__PURE__ */ s({
|
|
|
24
25
|
label: "右对齐"
|
|
25
26
|
}
|
|
26
27
|
];
|
|
27
|
-
return (
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
return (y, o) => (d(), v("div", b, [
|
|
29
|
+
f(` :label-col="{ style: { width: '85px' } }" `),
|
|
30
|
+
l(e(c), { layout: "vertical" }, {
|
|
30
31
|
default: n(() => [
|
|
31
|
-
|
|
32
|
+
l(e(r), {
|
|
32
33
|
label: "表单布局",
|
|
33
34
|
tooltip: "表单布局"
|
|
34
35
|
}, {
|
|
35
36
|
default: n(() => [
|
|
36
|
-
|
|
37
|
-
value:
|
|
38
|
-
"onUpdate:value":
|
|
39
|
-
options:
|
|
37
|
+
l(e(i), {
|
|
38
|
+
value: t.layout,
|
|
39
|
+
"onUpdate:value": o[0] || (o[0] = (a) => t.layout = a),
|
|
40
|
+
options: u
|
|
40
41
|
}, null, 8, ["value"])
|
|
41
42
|
]),
|
|
42
43
|
_: 1
|
|
43
44
|
/* STABLE */
|
|
44
45
|
}),
|
|
45
|
-
|
|
46
|
+
l(e(r), {
|
|
46
47
|
label: "标签对齐方式",
|
|
47
48
|
tooltip: "标签对齐方式"
|
|
48
49
|
}, {
|
|
49
50
|
default: n(() => [
|
|
50
|
-
|
|
51
|
-
value:
|
|
52
|
-
"onUpdate:value":
|
|
53
|
-
options:
|
|
51
|
+
l(e(i), {
|
|
52
|
+
value: t.labelAlign,
|
|
53
|
+
"onUpdate:value": o[1] || (o[1] = (a) => t.labelAlign = a),
|
|
54
|
+
options: p
|
|
54
55
|
}, null, 8, ["value"])
|
|
55
56
|
]),
|
|
56
57
|
_: 1
|
|
@@ -64,5 +65,5 @@ const b = { style: { padding: "10px" } }, k = /* @__PURE__ */ s({
|
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
+
h as default
|
|
68
69
|
};
|
|
@@ -1,27 +1,54 @@
|
|
|
1
|
+
import { defineComponent as u, h as i } from "vue";
|
|
2
|
+
import { Collapse as d } from "ant-design-vue";
|
|
1
3
|
import "./InputProps.vue.mjs";
|
|
2
4
|
import "./TextareaProps.vue.mjs";
|
|
3
5
|
import "./InputNumberProps.vue.mjs";
|
|
4
6
|
import "./BaseProps.vue.mjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
"k-input":
|
|
11
|
-
"k-textarea":
|
|
12
|
-
"k-input-number":
|
|
13
|
-
},
|
|
7
|
+
import s from "./InputProps.vue2.mjs";
|
|
8
|
+
import c from "./TextareaProps.vue2.mjs";
|
|
9
|
+
import a from "./InputNumberProps.vue2.mjs";
|
|
10
|
+
import e from "./BaseProps.vue2.mjs";
|
|
11
|
+
const j = {
|
|
12
|
+
"k-input": s,
|
|
13
|
+
"k-textarea": c,
|
|
14
|
+
"k-input-number": a
|
|
15
|
+
}, _ = {
|
|
14
16
|
"k-input": {
|
|
15
|
-
component: [
|
|
17
|
+
component: [e, s]
|
|
16
18
|
},
|
|
17
19
|
"k-textarea": {
|
|
18
|
-
component: [
|
|
20
|
+
component: [e, c]
|
|
19
21
|
},
|
|
20
22
|
"k-input-number": {
|
|
21
|
-
component: [
|
|
23
|
+
component: [e, a]
|
|
22
24
|
}
|
|
23
25
|
};
|
|
26
|
+
function D(n = []) {
|
|
27
|
+
const o = {};
|
|
28
|
+
for (const [t, f] of Object.entries(_)) {
|
|
29
|
+
const p = [...f.component];
|
|
30
|
+
for (const m of n) {
|
|
31
|
+
const { keys: r } = m;
|
|
32
|
+
(Array.isArray(r) ? r.includes(t) : r.test(t)) && p.push(m.component);
|
|
33
|
+
}
|
|
34
|
+
o[t] = k(t, p);
|
|
35
|
+
}
|
|
36
|
+
return o;
|
|
37
|
+
}
|
|
38
|
+
function k(n, o) {
|
|
39
|
+
return u({
|
|
40
|
+
name: `${n}-props`,
|
|
41
|
+
inheritAttrs: !1,
|
|
42
|
+
setup() {
|
|
43
|
+
return () => i(d, null, {
|
|
44
|
+
default: () => o.map((t) => i(t))
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
24
49
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
50
|
+
j as components,
|
|
51
|
+
D as expandProps,
|
|
52
|
+
k as propsWidgetDecorator,
|
|
53
|
+
_ as widgetProps
|
|
27
54
|
};
|
|
@@ -15,14 +15,20 @@ const r = (e) => e, t = {
|
|
|
15
15
|
required: !0
|
|
16
16
|
}
|
|
17
17
|
}, n = {
|
|
18
|
+
expandProps: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: () => []
|
|
21
|
+
}
|
|
22
|
+
}, p = {
|
|
18
23
|
icon: {
|
|
19
24
|
type: r([Object, String]),
|
|
20
25
|
required: !0
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
export {
|
|
29
|
+
n as FormConfigProps,
|
|
24
30
|
o as FormDesignProps,
|
|
25
31
|
r as definePropType,
|
|
26
32
|
t as iconProps,
|
|
27
|
-
|
|
33
|
+
p as widgetIconProps
|
|
28
34
|
};
|
|
@@ -74,7 +74,6 @@ const e = {
|
|
|
74
74
|
key: "k-object",
|
|
75
75
|
type: "object",
|
|
76
76
|
icon: "form-object",
|
|
77
|
-
"k-component": "FormLayout",
|
|
78
77
|
children: []
|
|
79
78
|
},
|
|
80
79
|
{
|
|
@@ -83,7 +82,7 @@ const e = {
|
|
|
83
82
|
type: "array",
|
|
84
83
|
icon: "form-list",
|
|
85
84
|
children: [],
|
|
86
|
-
"k-component": "
|
|
85
|
+
"k-component": "ArrayCard"
|
|
87
86
|
},
|
|
88
87
|
{
|
|
89
88
|
title: "明细表",
|
|
@@ -6,16 +6,16 @@ import "../effects/index.mjs";
|
|
|
6
6
|
import { widgetPanels as c } from "../components/panel/index.mjs";
|
|
7
7
|
import "../components/props/index.mjs";
|
|
8
8
|
import { Plugin as g } from "../plugins/index.mjs";
|
|
9
|
-
import { Heart as
|
|
10
|
-
import { FormSchema as
|
|
11
|
-
import { widgetProps as
|
|
12
|
-
import { runEffects as
|
|
9
|
+
import { Heart as d } from "./Heart.mjs";
|
|
10
|
+
import { FormSchema as l } from "./FormSchema.mjs";
|
|
11
|
+
import { widgetProps as a } from "../components/props/widget/index.mjs";
|
|
12
|
+
import { runEffects as f } from "../effects/effective.mjs";
|
|
13
13
|
class b {
|
|
14
14
|
constructor(e) {
|
|
15
15
|
t(this, "schema");
|
|
16
16
|
t(this, "heart");
|
|
17
17
|
t(this, "plugin");
|
|
18
|
-
t(this, "FormSchema", new
|
|
18
|
+
t(this, "FormSchema", new l());
|
|
19
19
|
t(this, "props");
|
|
20
20
|
t(this, "checkedField", n({}));
|
|
21
21
|
t(this, "shared", {
|
|
@@ -23,7 +23,7 @@ class b {
|
|
|
23
23
|
key: ""
|
|
24
24
|
},
|
|
25
25
|
panelWidgets: {},
|
|
26
|
-
|
|
26
|
+
propsWidgets: {}
|
|
27
27
|
});
|
|
28
28
|
t(this, "extendFormProps", []);
|
|
29
29
|
t(this, "notify", (e, ...r) => {
|
|
@@ -33,10 +33,10 @@ class b {
|
|
|
33
33
|
this.shared.panelWidgets = {
|
|
34
34
|
...c,
|
|
35
35
|
...o
|
|
36
|
-
}, this.shared.
|
|
37
|
-
...
|
|
36
|
+
}, this.shared.propsWidgets = {
|
|
37
|
+
...a,
|
|
38
38
|
...i
|
|
39
|
-
}, this.props = { ...h }, this.schema = e.schema, this.plugin = new g(), this.heart = new
|
|
39
|
+
}, this.props = { ...h }, this.schema = e.schema, this.plugin = new g(), this.heart = new d({
|
|
40
40
|
lifecycles: this.lifecycles,
|
|
41
41
|
context: this
|
|
42
42
|
}), this.extendFormProps = r;
|
|
@@ -51,10 +51,7 @@ class b {
|
|
|
51
51
|
return this.FormSchema.getFieldList();
|
|
52
52
|
}
|
|
53
53
|
get lifecycles() {
|
|
54
|
-
return this.props.effects ?
|
|
55
|
-
}
|
|
56
|
-
getFormProps() {
|
|
57
|
-
return this.FormSchema.formProps;
|
|
54
|
+
return this.props.effects ? f(this, this.props.effects) : [];
|
|
58
55
|
}
|
|
59
56
|
get hooks() {
|
|
60
57
|
return this.plugin.hooks;
|