@king-one/form-design 0.0.2 → 0.0.3
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 +6 -0
- package/dist/es/index.mjs +14 -6
- package/dist/es/src/components/form-desgin.mjs +51 -19
- package/dist/es/src/components/form-material.vue.mjs +64 -53
- package/dist/es/src/components/form-panel.vue.mjs +76 -59
- package/dist/es/src/components/form-setting.vue.mjs +55 -56
- package/dist/es/src/components/panel/index.mjs +16 -6
- package/dist/es/src/components/panel/panel-item.vue.mjs +112 -2
- package/dist/es/src/components/panel/panel-item.vue2.mjs +2 -64
- package/dist/es/src/components/panel/panel-wrapper.mjs +34 -0
- package/dist/es/src/components/panel/widget/array-card.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/array-card.vue2.mjs +71 -0
- package/dist/es/src/components/panel/widget/object.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/object.vue2.mjs +71 -0
- package/dist/es/src/components/panel/widget/select.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/select.vue2.mjs +23 -0
- package/dist/es/src/components/props/form-props.vue.mjs +4 -0
- package/dist/es/src/components/props/form-props.vue2.mjs +68 -0
- package/dist/es/src/components/props/index.mjs +5 -2
- package/dist/es/src/components/props/widget/BaseProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +63 -0
- package/dist/es/src/components/props/widget/InputNumberProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +125 -0
- package/dist/es/src/components/props/widget/InputProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/InputProps.vue2.mjs +80 -0
- package/dist/es/src/components/props/widget/TextareaProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +79 -0
- package/dist/es/src/components/props/widget/index.mjs +27 -0
- package/dist/es/src/config/index.mjs +53 -4
- package/dist/es/src/core/Design.mjs +50 -26
- package/dist/es/src/core/Field.mjs +18 -0
- package/dist/es/src/core/FormSchema.mjs +39 -12
- package/dist/es/src/effects/effect-dict.mjs +7 -0
- package/dist/es/src/effects/onEffects.mjs +12 -0
- package/dist/es/src/hooks/use-monaco.mjs +6 -6
- package/dist/es/src/hooks/use-namespace/index.mjs +24 -24
- package/dist/es/src/index.mjs +14 -7
- package/dist/es/src/plugins/index.mjs +17 -0
- package/dist/es/src/utils/instanceof.mjs +9 -0
- package/dist/es/src/utils/isEmpty.mjs +41 -0
- package/dist/es/src/utils/merge.mjs +64 -0
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/form-desgin.js +1 -1
- package/dist/lib/src/components/form-material.vue.js +1 -1
- package/dist/lib/src/components/form-panel.vue.js +2 -2
- package/dist/lib/src/components/form-setting.vue.js +1 -1
- package/dist/lib/src/components/panel/index.js +1 -1
- package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
- package/dist/lib/src/components/panel/panel-item.vue2.js +1 -1
- package/dist/lib/src/components/panel/panel-wrapper.js +1 -0
- package/dist/lib/src/components/panel/widget/array-card.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/array-card.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/object.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/select.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/select.vue2.js +1 -0
- package/dist/lib/src/components/props/form-props.vue.js +1 -0
- package/dist/lib/src/components/props/form-props.vue2.js +1 -0
- package/dist/lib/src/components/props/index.js +1 -1
- package/dist/lib/src/components/props/widget/BaseProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/InputNumberProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/InputProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/TextareaProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/index.js +1 -0
- package/dist/lib/src/config/index.js +1 -1
- package/dist/lib/src/core/Design.js +1 -1
- package/dist/lib/src/core/Field.js +1 -0
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/effects/effect-dict.js +1 -0
- package/dist/lib/src/effects/onEffects.js +1 -0
- package/dist/lib/src/hooks/use-monaco.js +1 -1
- package/dist/lib/src/hooks/use-namespace/index.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/plugins/index.js +1 -0
- package/dist/lib/src/utils/instanceof.js +1 -0
- package/dist/lib/src/utils/isEmpty.js +1 -0
- package/dist/lib/src/utils/merge.js +1 -0
- package/dist/theme-chalk/fonts/iconfont.ttf +0 -0
- package/dist/theme-chalk/fonts/iconfont.woff +0 -0
- package/dist/theme-chalk/fonts/iconfont.woff2 +0 -0
- package/dist/theme-chalk/form-design.css +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/material.css +1 -1
- package/dist/theme-chalk/panel-item.css +1 -1
- package/dist/theme-chalk/panel.css +1 -1
- package/dist/theme-chalk/setting.css +1 -1
- package/dist/types/src/components/form-panel.vue.d.ts +3 -1
- package/dist/types/src/components/panel/index.d.ts +2 -2
- package/dist/types/src/components/panel/panel-item.vue.d.ts +2 -0
- package/dist/types/src/components/panel/panel-wrapper.d.ts +11 -0
- package/dist/types/src/components/panel/widget/array-card.vue.d.ts +20 -0
- package/dist/types/src/components/panel/widget/object.vue.d.ts +20 -0
- package/dist/types/src/components/panel/widget/select.vue.d.ts +8 -0
- package/dist/types/src/components/props/index.d.ts +2 -2
- package/dist/types/src/components/props/widget/InputNumberProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/InputProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/TextareaProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/index.d.ts +8 -0
- package/dist/types/src/config/index.d.ts +1 -0
- package/dist/types/src/core/Design.d.ts +175 -18
- package/dist/types/src/core/Field.d.ts +6 -0
- package/dist/types/src/core/FormSchema.d.ts +33 -11
- package/dist/types/src/effects/onEffects.d.ts +2 -2
- package/dist/types/src/hooks/use-namespace/index.d.ts +1 -1
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/plugins/index.d.ts +8 -0
- package/dist/types/src/types.d.ts +36 -5
- package/dist/types/src/utils/instanceof.d.ts +2 -0
- package/dist/types/src/utils/isEmpty.d.ts +2 -0
- package/dist/types/src/utils/merge.d.ts +12 -0
- package/package.json +2 -1
- package/dist/es/src/components/props/base-props.vue.mjs +0 -60
- package/dist/es/src/components/props/base-props.vue2.mjs +0 -4
- package/dist/es/src/components/props/component-props.vue.mjs +0 -21
- package/dist/es/src/components/props/component-props.vue2.mjs +0 -4
- package/dist/lib/src/components/props/base-props.vue.js +0 -1
- package/dist/lib/src/components/props/base-props.vue2.js +0 -1
- package/dist/lib/src/components/props/component-props.vue.js +0 -1
- package/dist/lib/src/components/props/component-props.vue2.js +0 -1
- /package/dist/types/src/components/props/{base-props.vue.d.ts → form-props.vue.d.ts} +0 -0
- /package/dist/types/src/components/props/{component-props.vue.d.ts → widget/BaseProps.vue.d.ts} +0 -0
|
@@ -1,80 +1,79 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Tabs as
|
|
1
|
+
import { defineComponent as C, ref as w, computed as c, openBlock as e, createElementBlock as _, normalizeClass as x, createVNode as s, withCtx as n, withDirectives as z, createElementVNode as m, unref as t, createBlock as r, Fragment as P, renderList as $, resolveDynamicComponent as B, vShow as D } from "vue";
|
|
2
|
+
import { Tabs as E, TabPane as v, Collapse as F, Empty as N } from "ant-design-vue";
|
|
3
3
|
import "../internal.mjs";
|
|
4
4
|
import "../hooks/index.mjs";
|
|
5
5
|
import "./form-icon.vue.mjs";
|
|
6
6
|
import "./base/collapse.vue.mjs";
|
|
7
7
|
import "./props/index.mjs";
|
|
8
|
-
import { useInjectDesignContext as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
const V = { class: "setting-aside" }, R = /* @__PURE__ */ k({
|
|
8
|
+
import { useInjectDesignContext as j } from "../context/design.mjs";
|
|
9
|
+
import { useNamespace as k } from "../hooks/use-namespace/index.mjs";
|
|
10
|
+
import S from "./base/collapse.vue2.mjs";
|
|
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({
|
|
15
14
|
name: "FormSetting",
|
|
16
15
|
__name: "form-setting",
|
|
17
|
-
setup(
|
|
18
|
-
const { checkedField:
|
|
19
|
-
|
|
16
|
+
setup(K) {
|
|
17
|
+
const { checkedField: u, shared: p } = j(), { b: y } = k("setting"), { b: h } = k("setting-collapse"), o = w(!0), b = c(() => [y(), !o.value && h()]), l = c(() => u.value.key), d = c(() => l.value && p.widgetProps[l.value] ? p.widgetProps[l.value].component.map((f, a) => ({
|
|
18
|
+
...f,
|
|
19
|
+
key: a
|
|
20
|
+
})) : []);
|
|
21
|
+
return (f, a) => (e(), _(
|
|
20
22
|
"div",
|
|
21
23
|
{
|
|
22
|
-
class:
|
|
24
|
+
class: x(b.value)
|
|
23
25
|
},
|
|
24
26
|
[
|
|
25
|
-
|
|
26
|
-
default:
|
|
27
|
-
|
|
27
|
+
s(S, null, {
|
|
28
|
+
default: n(() => [
|
|
29
|
+
z(m(
|
|
28
30
|
"div",
|
|
29
|
-
|
|
31
|
+
V,
|
|
30
32
|
[
|
|
31
|
-
|
|
32
|
-
t(
|
|
33
|
+
m("aside", I, [
|
|
34
|
+
s(t(E), {
|
|
33
35
|
size: "small",
|
|
34
|
-
centered: ""
|
|
36
|
+
centered: "",
|
|
37
|
+
class: "setting-tabs"
|
|
35
38
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
t(
|
|
39
|
+
default: n(() => [
|
|
40
|
+
s(t(v), {
|
|
38
41
|
key: "1",
|
|
39
42
|
tab: "组件配置"
|
|
40
43
|
}, {
|
|
41
|
-
default:
|
|
42
|
-
Object.keys(
|
|
43
|
-
default:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
t(e(T))
|
|
54
|
-
]),
|
|
55
|
-
_: 1
|
|
56
|
-
/* STABLE */
|
|
57
|
-
})
|
|
44
|
+
default: n(() => [
|
|
45
|
+
Object.keys(t(u)).length && d.value.length ? (e(), r(t(F), { key: 0 }, {
|
|
46
|
+
default: n(() => [
|
|
47
|
+
(e(!0), _(
|
|
48
|
+
P,
|
|
49
|
+
null,
|
|
50
|
+
$(d.value, (i) => (e(), r(B(i), {
|
|
51
|
+
key: i.key
|
|
52
|
+
}))),
|
|
53
|
+
128
|
|
54
|
+
/* KEYED_FRAGMENT */
|
|
55
|
+
))
|
|
58
56
|
]),
|
|
59
57
|
_: 1
|
|
60
58
|
/* STABLE */
|
|
61
|
-
})) : (
|
|
59
|
+
})) : (e(), r(t(N), {
|
|
62
60
|
key: 1,
|
|
63
|
-
|
|
61
|
+
style: { "margin-top": "50px" },
|
|
62
|
+
description: "请选择添加的组件"
|
|
64
63
|
}))
|
|
65
64
|
]),
|
|
66
65
|
_: 1
|
|
67
66
|
/* STABLE */
|
|
68
67
|
}),
|
|
69
|
-
t(
|
|
68
|
+
s(t(v), {
|
|
70
69
|
key: "2",
|
|
71
70
|
tab: "表单配置"
|
|
72
71
|
}, {
|
|
73
|
-
default:
|
|
74
|
-
|
|
75
|
-
])
|
|
76
|
-
_: 1
|
|
77
|
-
|
|
72
|
+
default: n(() => [
|
|
73
|
+
s(t(T))
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
/* STABLE */
|
|
78
77
|
})
|
|
79
78
|
]),
|
|
80
79
|
_: 1
|
|
@@ -85,24 +84,24 @@ const V = { class: "setting-aside" }, R = /* @__PURE__ */ k({
|
|
|
85
84
|
512
|
|
86
85
|
/* NEED_PATCH */
|
|
87
86
|
), [
|
|
88
|
-
[
|
|
87
|
+
[D, o.value]
|
|
89
88
|
])
|
|
90
89
|
]),
|
|
91
90
|
_: 1
|
|
92
91
|
/* STABLE */
|
|
93
92
|
}),
|
|
94
|
-
|
|
93
|
+
m("div", {
|
|
95
94
|
class: "setting-collapse",
|
|
96
|
-
onClick:
|
|
95
|
+
onClick: a[0] || (a[0] = (i) => o.value = !o.value)
|
|
97
96
|
}, [
|
|
98
|
-
|
|
99
|
-
key: 0,
|
|
100
|
-
name: "double-left",
|
|
101
|
-
size: 18
|
|
102
|
-
})) : (s(), r(p, {
|
|
97
|
+
o.value ? (e(), r(g, {
|
|
103
98
|
key: 1,
|
|
104
99
|
name: "double-right",
|
|
105
100
|
size: 18
|
|
101
|
+
})) : (e(), r(g, {
|
|
102
|
+
key: 0,
|
|
103
|
+
name: "double-left",
|
|
104
|
+
size: 18
|
|
106
105
|
}))
|
|
107
106
|
])
|
|
108
107
|
],
|
|
@@ -112,5 +111,5 @@ const V = { class: "setting-aside" }, R = /* @__PURE__ */ k({
|
|
|
112
111
|
}
|
|
113
112
|
});
|
|
114
113
|
export {
|
|
115
|
-
|
|
114
|
+
X as default
|
|
116
115
|
};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import { Input as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Input as r, Textarea as m, InputNumber as o } from "ant-design-vue";
|
|
2
|
+
import "./widget/object.vue.mjs";
|
|
3
|
+
import { panelWarpper as t } from "./panel-wrapper.mjs";
|
|
4
|
+
import "./widget/select.vue.mjs";
|
|
5
|
+
import "./widget/array-card.vue.mjs";
|
|
6
|
+
import p from "./widget/select.vue2.mjs";
|
|
7
|
+
import e from "./widget/object.vue2.mjs";
|
|
8
|
+
import n from "./widget/array-card.vue2.mjs";
|
|
9
|
+
const a = t(r), i = t(m), c = t(o), l = {
|
|
10
|
+
"k-input": a,
|
|
11
|
+
"k-textarea": i,
|
|
12
|
+
"k-input-number": c,
|
|
13
|
+
"k-select": p,
|
|
14
|
+
"k-object": e,
|
|
15
|
+
"k-array-card": n
|
|
6
16
|
};
|
|
7
17
|
export {
|
|
8
|
-
|
|
18
|
+
l as widgetPanels
|
|
9
19
|
};
|
|
@@ -1,4 +1,114 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { defineComponent as j, computed as g, openBlock as n, createElementBlock as b, normalizeClass as f, withModifiers as F, unref as t, createBlock as d, resolveDynamicComponent as $, withCtx as z, createElementVNode as A, createCommentVNode as r, createVNode as M, defineAsyncComponent as O } from "vue";
|
|
2
|
+
import { FormItem as S, Tooltip as T } from "ant-design-vue";
|
|
3
|
+
import "../../internal.mjs";
|
|
4
|
+
import { useInjectDesignContext as W } from "../../context/design.mjs";
|
|
5
|
+
import "../index.mjs";
|
|
6
|
+
import { useNamespace as _ } from "../../hooks/use-namespace/index.mjs";
|
|
7
|
+
import p from "../form-icon.vue2.mjs";
|
|
8
|
+
const q = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "icons"
|
|
11
|
+
}, R = /* @__PURE__ */ j({
|
|
12
|
+
__name: "panel-item",
|
|
13
|
+
props: {
|
|
14
|
+
field: {},
|
|
15
|
+
space: {}
|
|
16
|
+
},
|
|
17
|
+
setup(D) {
|
|
18
|
+
const o = D, { b: I, e: m, m: u } = _("panel-item"), v = W(), { checkedField: a, shared: N } = v;
|
|
19
|
+
function w(e, i = {}) {
|
|
20
|
+
return Object.entries(e).forEach(([l, s]) => {
|
|
21
|
+
typeof s == "function" ? i[l] = O(s) : i[l] = s;
|
|
22
|
+
}), i;
|
|
23
|
+
}
|
|
24
|
+
const k = w(N.panelWidgets);
|
|
25
|
+
function B(e) {
|
|
26
|
+
a.value = e;
|
|
27
|
+
}
|
|
28
|
+
const c = g(() => {
|
|
29
|
+
var i, l;
|
|
30
|
+
return ((l = (i = o.field["k-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
|
|
31
|
+
}), E = g(() => {
|
|
32
|
+
var i;
|
|
33
|
+
const e = [I()];
|
|
34
|
+
return ((i = a.value) == null ? void 0 : i.id) === o.field.id && e.push(u("active")), c.value && e.push(u("error")), e;
|
|
35
|
+
});
|
|
36
|
+
function V() {
|
|
37
|
+
if (!v.hooks.beforeDelete.call(o.field))
|
|
38
|
+
return;
|
|
39
|
+
const i = o.space.findIndex((l) => l.id === o.field.id);
|
|
40
|
+
i !== -1 && o.space.splice(i, 1);
|
|
41
|
+
}
|
|
42
|
+
return (e, i) => {
|
|
43
|
+
var l, s, y, C, h;
|
|
44
|
+
return n(), b(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
class: f(E.value),
|
|
48
|
+
onClick: i[0] || (i[0] = F((x) => B(e.field), ["stop"]))
|
|
49
|
+
},
|
|
50
|
+
[
|
|
51
|
+
t(k)[e.field.key] ? (n(), d($(t(k)[e.field.key]), {
|
|
52
|
+
key: 0,
|
|
53
|
+
style: { width: "100%" },
|
|
54
|
+
readonly: "",
|
|
55
|
+
field: e.field
|
|
56
|
+
}, null, 8, ["field"])) : (n(), d(t(S), {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: f(t(m)("form")),
|
|
59
|
+
label: e.field.title
|
|
60
|
+
}, {
|
|
61
|
+
default: z(() => [
|
|
62
|
+
A(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
class: f(t(m)("error"))
|
|
66
|
+
},
|
|
67
|
+
" 未定义组件 ",
|
|
68
|
+
2
|
|
69
|
+
/* CLASS */
|
|
70
|
+
)
|
|
71
|
+
]),
|
|
72
|
+
_: 1
|
|
73
|
+
/* STABLE */
|
|
74
|
+
}, 8, ["class", "label"])),
|
|
75
|
+
((l = t(a)) == null ? void 0 : l.id) === e.field.id || c.value ? (n(), b("div", q, [
|
|
76
|
+
((s = t(a)) == null ? void 0 : s.id) === e.field.id ? (n(), d(t(p), {
|
|
77
|
+
key: 0,
|
|
78
|
+
name: "copy",
|
|
79
|
+
class: "panel-icon",
|
|
80
|
+
size: 15
|
|
81
|
+
})) : r("v-if", !0),
|
|
82
|
+
((y = t(a)) == null ? void 0 : y.id) === e.field.id ? (n(), d(t(p), {
|
|
83
|
+
key: 1,
|
|
84
|
+
name: "delete1",
|
|
85
|
+
class: "panel-icon",
|
|
86
|
+
size: 15,
|
|
87
|
+
onClick: V
|
|
88
|
+
})) : r("v-if", !0),
|
|
89
|
+
M(t(T), {
|
|
90
|
+
title: (h = (C = e.field["k-design-props"]) == null ? void 0 : C.validate) == null ? void 0 : h.message,
|
|
91
|
+
color: "pink"
|
|
92
|
+
}, {
|
|
93
|
+
default: z(() => [
|
|
94
|
+
c.value ? (n(), d(t(p), {
|
|
95
|
+
key: 0,
|
|
96
|
+
name: "exclamation-circle-filled",
|
|
97
|
+
size: 13,
|
|
98
|
+
class: "panel-exclamation-icon"
|
|
99
|
+
})) : r("v-if", !0)
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
/* STABLE */
|
|
103
|
+
}, 8, ["title"])
|
|
104
|
+
])) : r("v-if", !0)
|
|
105
|
+
],
|
|
106
|
+
2
|
|
107
|
+
/* CLASS */
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
});
|
|
2
112
|
export {
|
|
3
|
-
|
|
113
|
+
R as default
|
|
4
114
|
};
|
|
@@ -1,66 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FormItem as B } from "ant-design-vue";
|
|
3
|
-
import "../../internal.mjs";
|
|
4
|
-
import { useInjectDesignContext as w } from "../../context/design.mjs";
|
|
5
|
-
import { useNamespace as D } from "../../hooks/use-namespace/index.mjs";
|
|
6
|
-
const P = /* @__PURE__ */ k({
|
|
7
|
-
__name: "panel-item",
|
|
8
|
-
props: {
|
|
9
|
-
field: {}
|
|
10
|
-
},
|
|
11
|
-
setup(p) {
|
|
12
|
-
const d = p, { b: t, e: r, m: i } = D("panel-item");
|
|
13
|
-
console.log(i("active"));
|
|
14
|
-
const { panelComponents: s, checkedField: a } = w();
|
|
15
|
-
function f(e) {
|
|
16
|
-
a.value = e;
|
|
17
|
-
}
|
|
18
|
-
const u = v(() => {
|
|
19
|
-
var e;
|
|
20
|
-
return ((e = a.value) == null ? void 0 : e.id) === d.field.id ? [t(), i("active")] : [t()];
|
|
21
|
-
});
|
|
22
|
-
return (e, m) => (l(), c(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
class: n(u.value),
|
|
26
|
-
onClick: m[0] || (m[0] = (F) => f(e.field))
|
|
27
|
-
},
|
|
28
|
-
[
|
|
29
|
-
C(o(B), {
|
|
30
|
-
class: n(o(r)("form")),
|
|
31
|
-
label: e.field.title
|
|
32
|
-
}, {
|
|
33
|
-
default: y(() => [
|
|
34
|
-
o(s)[e.field.key] ? (l(), b(
|
|
35
|
-
g(o(s)[e.field.key]),
|
|
36
|
-
h({
|
|
37
|
-
key: 0,
|
|
38
|
-
style: { width: "100%" },
|
|
39
|
-
readonly: ""
|
|
40
|
-
}, e.field["k-component-props"]),
|
|
41
|
-
null,
|
|
42
|
-
16
|
|
43
|
-
/* FULL_PROPS */
|
|
44
|
-
)) : (l(), c(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
key: 1,
|
|
48
|
-
class: n(o(r)("error"))
|
|
49
|
-
},
|
|
50
|
-
" 未定义组件 ",
|
|
51
|
-
2
|
|
52
|
-
/* CLASS */
|
|
53
|
-
))
|
|
54
|
-
]),
|
|
55
|
-
_: 1
|
|
56
|
-
/* STABLE */
|
|
57
|
-
}, 8, ["class", "label"])
|
|
58
|
-
],
|
|
59
|
-
2
|
|
60
|
-
/* CLASS */
|
|
61
|
-
));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
1
|
+
import f from "./panel-item.vue.mjs";
|
|
64
2
|
export {
|
|
65
|
-
|
|
3
|
+
f as default
|
|
66
4
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineComponent as n, createVNode as m, h as a } from "vue";
|
|
2
|
+
import { FormItem as l } from "ant-design-vue";
|
|
3
|
+
import "../../internal.mjs";
|
|
4
|
+
import { defaultNamespace as f } from "../../hooks/use-namespace/index.mjs";
|
|
5
|
+
function s(o) {
|
|
6
|
+
return /* @__PURE__ */ n({
|
|
7
|
+
name: "panelWarpper",
|
|
8
|
+
props: {
|
|
9
|
+
field: {
|
|
10
|
+
type: Object
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
var r;
|
|
15
|
+
const p = (r = e.field) == null ? void 0 : r["k-component-props"];
|
|
16
|
+
return () => {
|
|
17
|
+
var t;
|
|
18
|
+
return m(l, {
|
|
19
|
+
class: [`${f}-panel-item__form`],
|
|
20
|
+
label: (t = e.field) == null ? void 0 : t.title
|
|
21
|
+
}, {
|
|
22
|
+
default: () => a(o, {
|
|
23
|
+
...p,
|
|
24
|
+
readonly: !0
|
|
25
|
+
}),
|
|
26
|
+
_: 1
|
|
27
|
+
}, 8, ["label"]);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
s as panelWarpper
|
|
34
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as u, toRaw as g, openBlock as h, createElementBlock as y, createElementVNode as n, toDisplayString as k, createVNode as l, unref as r, normalizeClass as C, withCtx as v, renderSlot as b } from "vue";
|
|
2
|
+
import w from "vuedraggable";
|
|
3
|
+
import "../../../internal.mjs";
|
|
4
|
+
import "../../../index.mjs";
|
|
5
|
+
import { useInjectDesignContext as x } from "../../../context/design.mjs";
|
|
6
|
+
import { useNamespace as S } from "../../../hooks/use-namespace/index.mjs";
|
|
7
|
+
import D from "../panel-item.vue.mjs";
|
|
8
|
+
const N = { class: "form-item" }, j = /* @__PURE__ */ u({
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
__name: "array-card",
|
|
11
|
+
props: {
|
|
12
|
+
field: {}
|
|
13
|
+
},
|
|
14
|
+
setup(s) {
|
|
15
|
+
const a = x(), { b: d } = S("panel-drag");
|
|
16
|
+
function m() {
|
|
17
|
+
return !0;
|
|
18
|
+
}
|
|
19
|
+
function c(e, t) {
|
|
20
|
+
const o = g(e), { oldIndex: f } = t, i = o[f];
|
|
21
|
+
if (i) {
|
|
22
|
+
const { shared: p } = a;
|
|
23
|
+
p.draggedContext.key = i.key;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return console.log(s.field), (e, t) => (h(), y("div", null, [
|
|
27
|
+
n(
|
|
28
|
+
"div",
|
|
29
|
+
null,
|
|
30
|
+
k(e.field.title),
|
|
31
|
+
1
|
|
32
|
+
/* TEXT */
|
|
33
|
+
),
|
|
34
|
+
n("div", null, [
|
|
35
|
+
l(r(w), {
|
|
36
|
+
list: e.field.children,
|
|
37
|
+
class: C(r(d)()),
|
|
38
|
+
group: { name: "form", put: m },
|
|
39
|
+
animation: 300,
|
|
40
|
+
sort: !0,
|
|
41
|
+
"item-key": "id",
|
|
42
|
+
"chosen-class": "choose",
|
|
43
|
+
onStart: t[0] || (t[0] = (o) => c(e.field.children, o))
|
|
44
|
+
}, {
|
|
45
|
+
item: v(({ element: o }) => [
|
|
46
|
+
n("div", N, [
|
|
47
|
+
b(e.$slots, `panel-${o.key}`, {}, () => [
|
|
48
|
+
l(r(D), {
|
|
49
|
+
field: o,
|
|
50
|
+
space: e.field.children
|
|
51
|
+
}, null, 8, ["field", "space"])
|
|
52
|
+
])
|
|
53
|
+
])
|
|
54
|
+
]),
|
|
55
|
+
_: 3
|
|
56
|
+
/* FORWARDED */
|
|
57
|
+
}, 8, ["list", "class", "group"]),
|
|
58
|
+
t[1] || (t[1] = n(
|
|
59
|
+
"div",
|
|
60
|
+
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
61
|
+
" ☝ 拖拽控件到容器内部 ",
|
|
62
|
+
-1
|
|
63
|
+
/* CACHED */
|
|
64
|
+
))
|
|
65
|
+
])
|
|
66
|
+
]));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
j as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as u, toRaw as g, openBlock as h, createElementBlock as k, createElementVNode as n, toDisplayString as y, createVNode as l, unref as i, normalizeClass as C, withCtx as b, renderSlot as v } from "vue";
|
|
2
|
+
import w from "vuedraggable";
|
|
3
|
+
import "../../../internal.mjs";
|
|
4
|
+
import "../../../index.mjs";
|
|
5
|
+
import { useInjectDesignContext as x } from "../../../context/design.mjs";
|
|
6
|
+
import { useNamespace as S } from "../../../hooks/use-namespace/index.mjs";
|
|
7
|
+
import D from "../panel-item.vue.mjs";
|
|
8
|
+
const N = { class: "form-item" }, _ = /* @__PURE__ */ u({
|
|
9
|
+
inheritAttrs: !1,
|
|
10
|
+
__name: "object",
|
|
11
|
+
props: {
|
|
12
|
+
field: {}
|
|
13
|
+
},
|
|
14
|
+
setup(s) {
|
|
15
|
+
const a = x(), { b: d } = S("panel-drag");
|
|
16
|
+
function m() {
|
|
17
|
+
return !0;
|
|
18
|
+
}
|
|
19
|
+
function c(e, t) {
|
|
20
|
+
const o = g(e), { oldIndex: f } = t, r = o[f];
|
|
21
|
+
if (r) {
|
|
22
|
+
const { shared: p } = a;
|
|
23
|
+
p.draggedContext.key = r.key;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return console.log(s.field), (e, t) => (h(), k("div", null, [
|
|
27
|
+
n(
|
|
28
|
+
"div",
|
|
29
|
+
null,
|
|
30
|
+
y(e.field.title),
|
|
31
|
+
1
|
|
32
|
+
/* TEXT */
|
|
33
|
+
),
|
|
34
|
+
n("div", null, [
|
|
35
|
+
l(i(w), {
|
|
36
|
+
list: e.field.children,
|
|
37
|
+
class: C(i(d)()),
|
|
38
|
+
group: { name: "form", put: m },
|
|
39
|
+
animation: 300,
|
|
40
|
+
sort: !0,
|
|
41
|
+
"item-key": "id",
|
|
42
|
+
"chosen-class": "choose",
|
|
43
|
+
onStart: t[0] || (t[0] = (o) => c(e.field.children, o))
|
|
44
|
+
}, {
|
|
45
|
+
item: b(({ element: o }) => [
|
|
46
|
+
n("div", N, [
|
|
47
|
+
v(e.$slots, `panel-${o.key}`, {}, () => [
|
|
48
|
+
l(i(D), {
|
|
49
|
+
field: o,
|
|
50
|
+
space: e.field.children
|
|
51
|
+
}, null, 8, ["field", "space"])
|
|
52
|
+
])
|
|
53
|
+
])
|
|
54
|
+
]),
|
|
55
|
+
_: 3
|
|
56
|
+
/* FORWARDED */
|
|
57
|
+
}, 8, ["list", "class", "group"]),
|
|
58
|
+
t[1] || (t[1] = n(
|
|
59
|
+
"div",
|
|
60
|
+
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
61
|
+
" ☝ 拖拽控件到布局容器内部 ",
|
|
62
|
+
-1
|
|
63
|
+
/* CACHED */
|
|
64
|
+
))
|
|
65
|
+
])
|
|
66
|
+
]));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
_ as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineComponent as p, toRef as r, openBlock as l, createBlock as s, unref as o, withCtx as i, createVNode as c, mergeProps as f } from "vue";
|
|
2
|
+
import { FormItem as m, Select as a } from "ant-design-vue";
|
|
3
|
+
const b = /* @__PURE__ */ p({
|
|
4
|
+
__name: "select",
|
|
5
|
+
props: {
|
|
6
|
+
field: {}
|
|
7
|
+
},
|
|
8
|
+
setup(t) {
|
|
9
|
+
const n = r(t.field, "enum");
|
|
10
|
+
return (e, d) => (l(), s(o(m), {
|
|
11
|
+
label: e.field.title
|
|
12
|
+
}, {
|
|
13
|
+
default: i(() => [
|
|
14
|
+
c(o(a), f(e.field["k-component-props"], { options: n.value }), null, 16, ["options"])
|
|
15
|
+
]),
|
|
16
|
+
_: 1
|
|
17
|
+
/* STABLE */
|
|
18
|
+
}, 8, ["label"]));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
b as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineComponent as s, openBlock as m, createElementBlock as c, createCommentVNode as d, createVNode as t, unref as e, withCtx as n } from "vue";
|
|
2
|
+
import { Form as f, FormItem as r, Select as p } from "ant-design-vue";
|
|
3
|
+
import "../../internal.mjs";
|
|
4
|
+
import { useInjectDesignContext as v } from "../../context/design.mjs";
|
|
5
|
+
const b = { style: { padding: "10px" } }, k = /* @__PURE__ */ s({
|
|
6
|
+
__name: "form-props",
|
|
7
|
+
setup(_) {
|
|
8
|
+
const o = v().getFormProps(), i = [
|
|
9
|
+
{
|
|
10
|
+
value: "horizontal",
|
|
11
|
+
label: "水平"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: "vertical",
|
|
15
|
+
label: "垂直"
|
|
16
|
+
}
|
|
17
|
+
], u = [
|
|
18
|
+
{
|
|
19
|
+
value: "left",
|
|
20
|
+
label: "左对齐"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "right",
|
|
24
|
+
label: "右对齐"
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
return (g, l) => (m(), c("div", b, [
|
|
28
|
+
d(` :label-col="{ style: { width: '85px' } }" `),
|
|
29
|
+
t(e(f), { layout: "vertical" }, {
|
|
30
|
+
default: n(() => [
|
|
31
|
+
t(e(r), {
|
|
32
|
+
label: "表单布局",
|
|
33
|
+
tooltip: "表单布局"
|
|
34
|
+
}, {
|
|
35
|
+
default: n(() => [
|
|
36
|
+
t(e(p), {
|
|
37
|
+
value: e(o).layout,
|
|
38
|
+
"onUpdate:value": l[0] || (l[0] = (a) => e(o).layout = a),
|
|
39
|
+
options: i
|
|
40
|
+
}, null, 8, ["value"])
|
|
41
|
+
]),
|
|
42
|
+
_: 1
|
|
43
|
+
/* STABLE */
|
|
44
|
+
}),
|
|
45
|
+
t(e(r), {
|
|
46
|
+
label: "标签对齐方式",
|
|
47
|
+
tooltip: "标签对齐方式"
|
|
48
|
+
}, {
|
|
49
|
+
default: n(() => [
|
|
50
|
+
t(e(p), {
|
|
51
|
+
value: e(o).labelAlign,
|
|
52
|
+
"onUpdate:value": l[1] || (l[1] = (a) => e(o).labelAlign = a),
|
|
53
|
+
options: u
|
|
54
|
+
}, null, 8, ["value"])
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
/* STABLE */
|
|
58
|
+
})
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
/* STABLE */
|
|
62
|
+
})
|
|
63
|
+
]));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
export {
|
|
67
|
+
k as default
|
|
68
|
+
};
|