@king-one/form-design 0.0.18 → 0.0.20
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/src/components/form-desgin.mjs +8 -7
- package/dist/es/src/components/form-material.vue.mjs +53 -51
- package/dist/es/src/components/form-panel.vue.mjs +69 -70
- package/dist/es/src/components/panel/index.mjs +12 -9
- package/dist/es/src/components/panel/panel-item.vue.mjs +28 -28
- package/dist/es/src/components/panel/panel-wrapper.mjs +25 -15
- package/dist/es/src/components/panel/widget/array-card.vue2.mjs +39 -26
- package/dist/es/src/components/panel/widget/array-table.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/array-table.vue2.mjs +105 -0
- package/dist/es/src/components/panel/widget/date-range.vue2.mjs +10 -10
- package/dist/es/src/components/panel/widget/object.vue2.mjs +40 -29
- package/dist/es/src/components/props/form-config.vue.mjs +7 -8
- package/dist/es/src/config/index.mjs +90 -21
- package/dist/es/src/core/Design.mjs +15 -12
- package/dist/es/src/core/FormSchema.mjs +1 -1
- package/dist/es/src/internal.mjs +5 -4
- package/dist/es/src/plugins/index.mjs +23 -11
- package/dist/es/src/plugins/modules/drag-add.mjs +23 -0
- 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/panel/index.js +1 -1
- package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
- package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
- package/dist/lib/src/components/panel/widget/array-card.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/array-table.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/array-table.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
- package/dist/lib/src/components/props/form-config.vue.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/internal.js +1 -1
- package/dist/lib/src/plugins/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-add.js +1 -0
- package/dist/theme-chalk/array-table.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/panel-item.css +1 -1
- package/dist/theme-chalk/panel.css +1 -1
- package/dist/types/src/components/base/Carousel.vue.d.ts +1 -1
- package/dist/types/src/components/panel/panel-item.vue.d.ts +2 -0
- package/dist/types/src/components/panel/panel-wrapper.d.ts +11 -1
- package/dist/types/src/components/panel/widget/array-table.vue.d.ts +20 -0
- package/dist/types/src/core/Design.d.ts +3 -2
- package/dist/types/src/internal.d.ts +1 -0
- package/dist/types/src/plugins/index.d.ts +3 -2
- package/dist/types/src/plugins/modules/{drag-put.d.ts → drag-add.d.ts} +2 -1
- package/dist/types/src/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/es/src/plugins/modules/drag-put.mjs +0 -14
- package/dist/lib/src/plugins/modules/drag-put.js +0 -1
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { defineComponent as V, computed as g, openBlock as n, createElementBlock as b, normalizeClass as p, withModifiers as j, unref as t, createBlock as a, resolveDynamicComponent as
|
|
2
|
-
import { FormItem as
|
|
1
|
+
import { defineComponent as V, computed as g, openBlock as n, createElementBlock as b, normalizeClass as p, withModifiers as j, unref as t, createBlock as a, resolveDynamicComponent as w, withCtx as z, createElementVNode as $, createCommentVNode as r, createVNode as x, defineAsyncComponent as A } from "vue";
|
|
2
|
+
import { FormItem as M, Tooltip as O } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { useInjectDesignContext as
|
|
4
|
+
import { useInjectDesignContext as S } from "../../context/design.mjs";
|
|
5
5
|
import "../index.mjs";
|
|
6
6
|
import { useNamespace as W } from "../../hooks/use-namespace/index.mjs";
|
|
7
7
|
import m from "../form-icon.vue2.mjs";
|
|
8
|
-
const
|
|
8
|
+
const q = {
|
|
9
9
|
key: 2,
|
|
10
10
|
class: "icons"
|
|
11
|
-
},
|
|
11
|
+
}, U = /* @__PURE__ */ V({
|
|
12
12
|
__name: "panel-item",
|
|
13
13
|
props: {
|
|
14
14
|
field: {},
|
|
15
|
-
space: {}
|
|
15
|
+
space: {},
|
|
16
|
+
hideTitle: { type: Boolean }
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const o =
|
|
19
|
-
function
|
|
18
|
+
setup(B) {
|
|
19
|
+
const o = B, { b: D, e: u, m: v } = W("panel-item"), c = S(), { checkedField: d, shared: I } = c;
|
|
20
|
+
function N(e, i = {}) {
|
|
20
21
|
return Object.entries(e).forEach(([l, s]) => {
|
|
21
|
-
typeof s == "function" ? i[l] =
|
|
22
|
+
typeof s == "function" ? i[l] = A(s) : i[l] = s;
|
|
22
23
|
}), i;
|
|
23
24
|
}
|
|
24
|
-
const k =
|
|
25
|
-
function
|
|
25
|
+
const k = N(I.panelWidgets);
|
|
26
|
+
function E(e) {
|
|
26
27
|
c.setCheckedField(e);
|
|
27
28
|
}
|
|
28
29
|
const f = g(() => {
|
|
29
30
|
var i, l;
|
|
30
31
|
return ((l = (i = o.field["x-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
|
|
31
|
-
}),
|
|
32
|
+
}), F = g(() => {
|
|
32
33
|
var i;
|
|
33
|
-
const e = [
|
|
34
|
+
const e = [D()];
|
|
34
35
|
return ((i = d.value) == null ? void 0 : i.id) === o.field.id && e.push(v("active")), f.value && e.push(v("error")), e;
|
|
35
36
|
});
|
|
36
|
-
function
|
|
37
|
+
function T() {
|
|
37
38
|
if (!c.hooks.beforeDelete.call(o.field))
|
|
38
39
|
return;
|
|
39
40
|
const i = o.space.findIndex((l) => l.id === o.field.id);
|
|
40
41
|
i !== -1 && o.space.splice(i, 1);
|
|
41
42
|
}
|
|
42
43
|
return (e, i) => {
|
|
43
|
-
var l, s,
|
|
44
|
+
var l, s, C, h, y;
|
|
44
45
|
return n(), b(
|
|
45
46
|
"div",
|
|
46
47
|
{
|
|
47
|
-
class: p(
|
|
48
|
-
onClick: i[0] || (i[0] = j((
|
|
48
|
+
class: p(F.value),
|
|
49
|
+
onClick: i[0] || (i[0] = j((G) => E(e.field), ["stop"]))
|
|
49
50
|
},
|
|
50
51
|
[
|
|
51
|
-
t(k)[e.field.key] ? (n(), a(
|
|
52
|
+
t(k)[e.field.key] ? (n(), a(w(t(k)[e.field.key]), {
|
|
52
53
|
key: 0,
|
|
53
|
-
|
|
54
|
-
readonly: "",
|
|
54
|
+
"hide-title": e.hideTitle,
|
|
55
55
|
field: e.field
|
|
56
|
-
}, null, 8, ["field"])) : (n(), a(t(
|
|
56
|
+
}, null, 8, ["hide-title", "field"])) : (n(), a(t(M), {
|
|
57
57
|
key: 1,
|
|
58
58
|
class: p(t(u)("form")),
|
|
59
59
|
label: e.field.title
|
|
@@ -72,22 +72,22 @@ const _ = {
|
|
|
72
72
|
_: 1
|
|
73
73
|
/* STABLE */
|
|
74
74
|
}, 8, ["class", "label"])),
|
|
75
|
-
((l = t(d)) == null ? void 0 : l.id) === e.field.id || f.value ? (n(), b("div",
|
|
75
|
+
((l = t(d)) == null ? void 0 : l.id) === e.field.id || f.value ? (n(), b("div", q, [
|
|
76
76
|
((s = t(d)) == null ? void 0 : s.id) === e.field.id ? (n(), a(t(m), {
|
|
77
77
|
key: 0,
|
|
78
78
|
name: "copy",
|
|
79
79
|
class: "panel-icon",
|
|
80
80
|
size: 15
|
|
81
81
|
})) : r("v-if", !0),
|
|
82
|
-
((
|
|
82
|
+
((C = t(d)) == null ? void 0 : C.id) === e.field.id ? (n(), a(t(m), {
|
|
83
83
|
key: 1,
|
|
84
84
|
name: "delete1",
|
|
85
85
|
class: "panel-icon",
|
|
86
86
|
size: 15,
|
|
87
|
-
onClick:
|
|
87
|
+
onClick: T
|
|
88
88
|
})) : r("v-if", !0),
|
|
89
|
-
|
|
90
|
-
title: (
|
|
89
|
+
x(t(O), {
|
|
90
|
+
title: (y = (h = e.field["x-design-props"]) == null ? void 0 : h.validate) == null ? void 0 : y.message,
|
|
91
91
|
color: "pink"
|
|
92
92
|
}, {
|
|
93
93
|
default: z(() => [
|
|
@@ -110,5 +110,5 @@ const _ = {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
U as default
|
|
114
114
|
};
|
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { FormItem as
|
|
1
|
+
import { defineComponent as a, createVNode as n, h as p } from "vue";
|
|
2
|
+
import { FormItem as i } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { defaultNamespace as
|
|
5
|
-
function s(
|
|
6
|
-
return /* @__PURE__ */
|
|
4
|
+
import { defaultNamespace as m } from "../../hooks/use-namespace/index.mjs";
|
|
5
|
+
function s(t) {
|
|
6
|
+
return /* @__PURE__ */ a({
|
|
7
7
|
name: "panelWarpper",
|
|
8
8
|
props: {
|
|
9
9
|
field: {
|
|
10
10
|
type: Object
|
|
11
|
+
},
|
|
12
|
+
hideTitle: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
setup(e) {
|
|
14
|
-
var
|
|
15
|
-
const
|
|
18
|
+
var l;
|
|
19
|
+
const r = (l = e.field) == null ? void 0 : l["x-component-props"];
|
|
16
20
|
return () => {
|
|
17
|
-
var
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
var o;
|
|
22
|
+
return n("div", null, [e.hideTitle ? p(t, {
|
|
23
|
+
...r,
|
|
24
|
+
readonly: !0
|
|
25
|
+
}) : n(i, {
|
|
26
|
+
class: [`${m}-panel-item__form`],
|
|
27
|
+
label: (o = e.field) == null ? void 0 : o.title
|
|
21
28
|
}, {
|
|
22
|
-
default: () =>
|
|
23
|
-
...
|
|
24
|
-
readonly: !0
|
|
29
|
+
default: () => p(t, {
|
|
30
|
+
...r,
|
|
31
|
+
readonly: !0,
|
|
32
|
+
style: {
|
|
33
|
+
width: "100%"
|
|
34
|
+
}
|
|
25
35
|
}),
|
|
26
36
|
_: 1
|
|
27
|
-
}, 8, ["label"]);
|
|
37
|
+
}, 8, ["label"])]);
|
|
28
38
|
};
|
|
29
39
|
}
|
|
30
40
|
});
|
|
@@ -1,52 +1,65 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as p, toRaw as h, openBlock as y, createElementBlock as k, createElementVNode as o, toDisplayString as x, createVNode as c, unref as a, normalizeClass as C, withCtx as v, renderSlot as w } from "vue";
|
|
2
|
+
import A from "vuedraggable";
|
|
3
3
|
import "../../../internal.mjs";
|
|
4
|
+
import { message as D } from "ant-design-vue";
|
|
4
5
|
import "../../../index.mjs";
|
|
5
|
-
import { useInjectDesignContext as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
import
|
|
8
|
-
const N = { class: "form-item" },
|
|
6
|
+
import { useInjectDesignContext as b } from "../../../context/design.mjs";
|
|
7
|
+
import { useNamespace as I } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import S from "../panel-item.vue.mjs";
|
|
9
|
+
const N = { class: "form-item" }, F = /* @__PURE__ */ p({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "array-card",
|
|
11
12
|
props: {
|
|
12
13
|
field: {}
|
|
13
14
|
},
|
|
14
15
|
setup(s) {
|
|
15
|
-
const
|
|
16
|
+
const i = b(), { b: f } = I("panel-drag");
|
|
16
17
|
function m() {
|
|
17
18
|
return !0;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const { shared:
|
|
23
|
-
|
|
20
|
+
function g(e, t) {
|
|
21
|
+
const n = h(e), { oldIndex: l } = t, r = n[l];
|
|
22
|
+
if (r) {
|
|
23
|
+
const { shared: d } = i;
|
|
24
|
+
d.draggedContext.key = r.key, d.draggedContext.field = r;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
n
|
|
27
|
+
function u() {
|
|
28
|
+
const { shared: e } = i, { field: t } = e.draggedContext, n = {
|
|
29
|
+
source: t,
|
|
30
|
+
traget: s.field.children,
|
|
31
|
+
region: "k-array-card"
|
|
32
|
+
};
|
|
33
|
+
if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((r) => r)) {
|
|
34
|
+
const r = s.field.children.findIndex((d) => d.id === t.id);
|
|
35
|
+
r !== -1 && (s.field.children.splice(r, 1), D.warning("不能将该控件拖拽到列表容器中"));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return (e, t) => (y(), k("div", null, [
|
|
39
|
+
o(
|
|
28
40
|
"div",
|
|
29
41
|
null,
|
|
30
|
-
|
|
42
|
+
x(e.field.title),
|
|
31
43
|
1
|
|
32
44
|
/* TEXT */
|
|
33
45
|
),
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
o("div", null, [
|
|
47
|
+
c(a(A), {
|
|
36
48
|
list: e.field.children,
|
|
37
|
-
class: C(
|
|
49
|
+
class: C(a(f)()),
|
|
38
50
|
group: { name: "form", put: m },
|
|
39
51
|
animation: 300,
|
|
40
52
|
sort: !0,
|
|
41
53
|
"item-key": "id",
|
|
42
54
|
"chosen-class": "choose",
|
|
43
|
-
onStart: t[0] || (t[0] = (
|
|
55
|
+
onStart: t[0] || (t[0] = (n) => g(e.field.children, n)),
|
|
56
|
+
onAdd: u
|
|
44
57
|
}, {
|
|
45
|
-
item: v(({ element:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
field:
|
|
58
|
+
item: v(({ element: n }) => [
|
|
59
|
+
o("div", N, [
|
|
60
|
+
w(e.$slots, `panel-${n.key}`, {}, () => [
|
|
61
|
+
c(a(S), {
|
|
62
|
+
field: n,
|
|
50
63
|
space: e.field.children
|
|
51
64
|
}, null, 8, ["field", "space"])
|
|
52
65
|
])
|
|
@@ -55,7 +68,7 @@ const N = { class: "form-item" }, j = /* @__PURE__ */ u({
|
|
|
55
68
|
_: 3
|
|
56
69
|
/* FORWARDED */
|
|
57
70
|
}, 8, ["list", "class", "group"]),
|
|
58
|
-
t[1] || (t[1] =
|
|
71
|
+
t[1] || (t[1] = o(
|
|
59
72
|
"div",
|
|
60
73
|
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
61
74
|
" ☝ 拖拽控件到容器内部 ",
|
|
@@ -67,5 +80,5 @@ const N = { class: "form-item" }, j = /* @__PURE__ */ u({
|
|
|
67
80
|
}
|
|
68
81
|
});
|
|
69
82
|
export {
|
|
70
|
-
|
|
83
|
+
F as default
|
|
71
84
|
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineComponent as f, openBlock as g, createElementBlock as p, normalizeClass as b, unref as l, createElementVNode as e, createVNode as o, withCtx as y, renderSlot as u, toDisplayString as v } from "vue";
|
|
2
|
+
import h from "vuedraggable";
|
|
3
|
+
import "../../../index.mjs";
|
|
4
|
+
import "../../../internal.mjs";
|
|
5
|
+
import { message as x } from "ant-design-vue";
|
|
6
|
+
import { useInjectDesignContext as _ } from "../../../context/design.mjs";
|
|
7
|
+
import { useNamespace as C } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import k from "../panel-item.vue.mjs";
|
|
9
|
+
const A = { class: "array-table-box" }, D = { class: "array-table-drag" }, w = { class: "form-item" }, I = { class: "table-item" }, N = { class: "array-table-drag-header" }, $ = { class: "array-table-drag-content" }, T = /* @__PURE__ */ f({
|
|
10
|
+
name: "ArrayTable",
|
|
11
|
+
__name: "array-table",
|
|
12
|
+
props: {
|
|
13
|
+
field: {}
|
|
14
|
+
},
|
|
15
|
+
setup(s) {
|
|
16
|
+
const d = _(), { b: n } = C("array-table");
|
|
17
|
+
function c() {
|
|
18
|
+
const { shared: a } = d, { field: t } = a.draggedContext, r = {
|
|
19
|
+
source: t,
|
|
20
|
+
traget: s.field.children,
|
|
21
|
+
region: "k-array-card"
|
|
22
|
+
};
|
|
23
|
+
if (d.hooks.syncDragAdd.call(r), !d.dragAddResult.every((i) => i)) {
|
|
24
|
+
const i = s.field.children.findIndex((m) => m.id === t.id);
|
|
25
|
+
i !== -1 && (s.field.children.splice(i, 1), x.warning("不能将该控件拖拽到列表容器中"));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return (a, t) => (g(), p(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
class: b(l(n)())
|
|
32
|
+
},
|
|
33
|
+
[
|
|
34
|
+
t[1] || (t[1] = e(
|
|
35
|
+
"div",
|
|
36
|
+
null,
|
|
37
|
+
"明细列表",
|
|
38
|
+
-1
|
|
39
|
+
/* CACHED */
|
|
40
|
+
)),
|
|
41
|
+
e("div", A, [
|
|
42
|
+
t[0] || (t[0] = e(
|
|
43
|
+
"div",
|
|
44
|
+
{ class: "array-table-left" },
|
|
45
|
+
[
|
|
46
|
+
e("div", { class: "array-table-drag-header" }, " 表头 "),
|
|
47
|
+
e("div", { class: "array-table-drag-content" })
|
|
48
|
+
],
|
|
49
|
+
-1
|
|
50
|
+
/* CACHED */
|
|
51
|
+
)),
|
|
52
|
+
e("div", D, [
|
|
53
|
+
o(l(h), {
|
|
54
|
+
class: "widget-drag",
|
|
55
|
+
list: a.field.children,
|
|
56
|
+
group: { name: "form", direction: "vertical", removeCloneOnHide: !1 },
|
|
57
|
+
animation: 300,
|
|
58
|
+
sort: !0,
|
|
59
|
+
"item-key": "id",
|
|
60
|
+
"drag-class": "table-item-drag-class",
|
|
61
|
+
onAdd: c
|
|
62
|
+
}, {
|
|
63
|
+
item: y(({ element: r }) => [
|
|
64
|
+
e("div", w, [
|
|
65
|
+
u(a.$slots, `panel-${r.key}`, {}, () => [
|
|
66
|
+
e("div", I, [
|
|
67
|
+
e(
|
|
68
|
+
"div",
|
|
69
|
+
N,
|
|
70
|
+
v(r.title),
|
|
71
|
+
1
|
|
72
|
+
/* TEXT */
|
|
73
|
+
),
|
|
74
|
+
e("div", $, [
|
|
75
|
+
o(l(k), {
|
|
76
|
+
field: r,
|
|
77
|
+
space: a.field.children,
|
|
78
|
+
"hide-title": ""
|
|
79
|
+
}, null, 8, ["field", "space"])
|
|
80
|
+
])
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
_: 3
|
|
86
|
+
/* FORWARDED */
|
|
87
|
+
}, 8, ["list"])
|
|
88
|
+
])
|
|
89
|
+
]),
|
|
90
|
+
t[2] || (t[2] = e(
|
|
91
|
+
"div",
|
|
92
|
+
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
93
|
+
" ☝ 拖拽控件到明细列表 ",
|
|
94
|
+
-1
|
|
95
|
+
/* CACHED */
|
|
96
|
+
))
|
|
97
|
+
],
|
|
98
|
+
2
|
|
99
|
+
/* CLASS */
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
export {
|
|
104
|
+
T as default
|
|
105
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { FormItem as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as r, openBlock as t, createBlock as n, unref as o, withCtx as l, createVNode as p, mergeProps as a } from "vue";
|
|
2
|
+
import { FormItem as f, RangePicker as m } from "ant-design-vue";
|
|
3
|
+
const u = /* @__PURE__ */ r({
|
|
4
4
|
__name: "date-range",
|
|
5
5
|
props: {
|
|
6
6
|
field: {}
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
return (e,
|
|
8
|
+
setup(i) {
|
|
9
|
+
return (e, c) => (t(), n(o(f), {
|
|
10
10
|
label: e.field.title
|
|
11
11
|
}, {
|
|
12
|
-
default:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
default: l(() => [
|
|
13
|
+
p(
|
|
14
|
+
o(m),
|
|
15
|
+
a(e.field["x-component-props"], { open: !1 }),
|
|
16
16
|
null,
|
|
17
17
|
16
|
|
18
18
|
/* FULL_PROPS */
|
|
@@ -24,5 +24,5 @@ const _ = /* @__PURE__ */ o({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
u as default
|
|
28
28
|
};
|
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, toRaw as u, openBlock as h, createElementBlock as k, createElementVNode as r, toDisplayString as x, createVNode as c, unref as l, normalizeClass as y, withCtx as C, renderSlot as b } from "vue";
|
|
2
2
|
import v from "vuedraggable";
|
|
3
3
|
import "../../../internal.mjs";
|
|
4
4
|
import "../../../index.mjs";
|
|
5
|
+
import { message as A } from "ant-design-vue";
|
|
5
6
|
import { useInjectDesignContext as w } from "../../../context/design.mjs";
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
7
|
+
import { useNamespace as D } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import I from "../panel-item.vue.mjs";
|
|
9
|
+
const S = { class: "form-item" }, q = /* @__PURE__ */ p({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "object",
|
|
11
12
|
props: {
|
|
12
13
|
field: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
|
|
15
|
+
setup(s) {
|
|
16
|
+
const i = w(), { b: f } = D("panel-drag");
|
|
17
|
+
function m(e, t) {
|
|
18
|
+
const n = u(e), { oldIndex: a } = t, o = n[a];
|
|
19
|
+
if (o) {
|
|
20
|
+
const { shared: d } = i;
|
|
21
|
+
d.draggedContext.key = o.key, d.draggedContext.field = o;
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
function g() {
|
|
25
|
+
console.log("dragAdd");
|
|
26
|
+
const { shared: e } = i, { field: t } = e.draggedContext, n = {
|
|
27
|
+
source: t,
|
|
28
|
+
traget: s.field.children,
|
|
29
|
+
region: "k-object"
|
|
30
|
+
};
|
|
31
|
+
if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((o) => o)) {
|
|
32
|
+
const o = s.field.children.findIndex((d) => d.id === t.id);
|
|
33
|
+
o !== -1 && (s.field.children.splice(o, 1), A.warning("不能将该控件拖拽到对象容器中"));
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
|
-
return (e, t) => (
|
|
27
|
-
|
|
36
|
+
return (e, t) => (h(), k("div", null, [
|
|
37
|
+
r(
|
|
28
38
|
"div",
|
|
29
39
|
null,
|
|
30
|
-
|
|
40
|
+
x(e.field.title),
|
|
31
41
|
1
|
|
32
42
|
/* TEXT */
|
|
33
43
|
),
|
|
34
|
-
|
|
35
|
-
|
|
44
|
+
r("div", null, [
|
|
45
|
+
c(l(v), {
|
|
36
46
|
list: e.field.children,
|
|
37
|
-
class: y(
|
|
38
|
-
group: { name: "form"
|
|
47
|
+
class: y(l(f)()),
|
|
48
|
+
group: { name: "form" },
|
|
39
49
|
animation: 300,
|
|
40
50
|
sort: !0,
|
|
41
51
|
"item-key": "id",
|
|
42
52
|
"chosen-class": "choose",
|
|
43
|
-
onStart: t[0] || (t[0] = (
|
|
53
|
+
onStart: t[0] || (t[0] = (n) => m(e.field.children, n)),
|
|
54
|
+
onAdd: g
|
|
44
55
|
}, {
|
|
45
|
-
item: C(({ element:
|
|
46
|
-
|
|
47
|
-
b(e.$slots, `panel-${
|
|
48
|
-
|
|
49
|
-
field:
|
|
56
|
+
item: C(({ element: n }) => [
|
|
57
|
+
r("div", S, [
|
|
58
|
+
b(e.$slots, `panel-${n.key}`, {}, () => [
|
|
59
|
+
c(l(I), {
|
|
60
|
+
field: n,
|
|
50
61
|
space: e.field.children
|
|
51
62
|
}, null, 8, ["field", "space"])
|
|
52
63
|
])
|
|
@@ -54,8 +65,8 @@ const _ = { class: "form-item" }, V = /* @__PURE__ */ f({
|
|
|
54
65
|
]),
|
|
55
66
|
_: 3
|
|
56
67
|
/* FORWARDED */
|
|
57
|
-
}, 8, ["list", "class"
|
|
58
|
-
t[1] || (t[1] =
|
|
68
|
+
}, 8, ["list", "class"]),
|
|
69
|
+
t[1] || (t[1] = r(
|
|
59
70
|
"div",
|
|
60
71
|
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
61
72
|
" ☝ 拖拽控件到布局容器内部 ",
|
|
@@ -67,5 +78,5 @@ const _ = { class: "form-item" }, V = /* @__PURE__ */ f({
|
|
|
67
78
|
}
|
|
68
79
|
});
|
|
69
80
|
export {
|
|
70
|
-
|
|
81
|
+
q as default
|
|
71
82
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { defineComponent as k, computed as y, openBlock as o, createElementBlock as
|
|
1
|
+
import { defineComponent as k, computed as y, openBlock as o, createElementBlock as m, 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
2
|
import { Tabs as v, TabPane as p, Empty as c } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
4
|
import { FormConfigProps as C } from "../types.mjs";
|
|
5
5
|
import "./form-props.vue.mjs";
|
|
6
6
|
import { expandProps as P } from "./widget/index.mjs";
|
|
7
|
-
import "@king-one/form-design/dist/theme-chalk/form-config.css";
|
|
8
7
|
import { useInjectDesignContext as h } from "../../context/design.mjs";
|
|
9
8
|
import { useNamespace as F } from "../../hooks/use-namespace/index.mjs";
|
|
10
9
|
import B from "./form-props.vue2.mjs";
|
|
11
|
-
const
|
|
10
|
+
const S = /* @__PURE__ */ k({
|
|
12
11
|
__name: "form-config",
|
|
13
12
|
props: C,
|
|
14
13
|
setup(i) {
|
|
15
|
-
const l = i, { checkedField: f } = h(), r = y(() => f.value.key || ""), { b: d } = F("form-config"),
|
|
16
|
-
return (u, z) => (o(),
|
|
14
|
+
const l = i, { checkedField: f } = h(), r = y(() => f.value.key || ""), { b: d } = F("form-config"), a = P(l.expandProps);
|
|
15
|
+
return (u, z) => (o(), m(
|
|
17
16
|
"div",
|
|
18
17
|
{
|
|
19
18
|
class: _(e(d)())
|
|
@@ -30,11 +29,11 @@ const V = /* @__PURE__ */ k({
|
|
|
30
29
|
tab: "组件配置"
|
|
31
30
|
}, {
|
|
32
31
|
default: n(() => [
|
|
33
|
-
r.value ? (o(),
|
|
32
|
+
r.value ? (o(), m(
|
|
34
33
|
g,
|
|
35
34
|
{ key: 0 },
|
|
36
35
|
[
|
|
37
|
-
e(
|
|
36
|
+
e(a)[r.value] ? (o(), s(x(e(a)[r.value]), { key: 0 })) : (o(), s(e(c), {
|
|
38
37
|
key: 1,
|
|
39
38
|
style: { "margin-top": "50px" },
|
|
40
39
|
description: "暂无配置"
|
|
@@ -74,5 +73,5 @@ const V = /* @__PURE__ */ k({
|
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
75
|
export {
|
|
77
|
-
|
|
76
|
+
S as default
|
|
78
77
|
};
|