@king-one/form-design 0.0.2 → 0.0.4
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 +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 +24 -28
- 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 +4 -2
- 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
package/CHANGELOG.md
CHANGED
package/dist/es/index.mjs
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import "./src/index.mjs";
|
|
2
|
-
import { default as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { default as t } from "./src/components/panel/panel-item.vue.mjs";
|
|
3
|
+
import { useInjectDesignContext as n } from "./src/context/design.mjs";
|
|
4
|
+
import { default as s } from "./src/components/form-desgin.mjs";
|
|
5
|
+
import { CreateFormDesign as i } from "./src/core/index.mjs";
|
|
6
|
+
import { BaseSchema as p, ExtendSchema as g, LayoutSchema as D } from "./src/config/index.mjs";
|
|
7
|
+
import { onDesignFieldChange as d, onDesignInit as h } from "./src/effects/onEffects.mjs";
|
|
5
8
|
export {
|
|
6
9
|
p as BaseSchema,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
s as
|
|
10
|
+
i as CreateFormDesign,
|
|
11
|
+
g as ExtendSchema,
|
|
12
|
+
s as FormDesign,
|
|
13
|
+
t as FormPanelItem,
|
|
14
|
+
D as LayoutSchema,
|
|
15
|
+
d as onDesignFieldChange,
|
|
16
|
+
h as onDesignInit,
|
|
17
|
+
n as useInjectDesignContext
|
|
10
18
|
};
|
|
@@ -1,29 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as n, ref as i, h as o } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { useProvideDragContext as
|
|
3
|
+
import { useProvideDragContext as a, useProvideDesignContext as p } from "../context/design.mjs";
|
|
4
4
|
import "./index.mjs";
|
|
5
|
-
import { FormDesignProps as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import u from "./form-
|
|
9
|
-
import
|
|
5
|
+
import { FormDesignProps as f } from "./types.mjs";
|
|
6
|
+
import { merge as c } from "../utils/merge.mjs";
|
|
7
|
+
import { useNamespace as g } from "../hooks/use-namespace/index.mjs";
|
|
8
|
+
import u from "./form-material.vue.mjs";
|
|
9
|
+
import l from "./form-panel.vue.mjs";
|
|
10
|
+
import d from "./form-setting.vue.mjs";
|
|
10
11
|
const {
|
|
11
|
-
b:
|
|
12
|
-
} =
|
|
12
|
+
b: D
|
|
13
|
+
} = g("main"), _ = {
|
|
14
|
+
config: {
|
|
15
|
+
theme: "dark",
|
|
16
|
+
tags: ["frontend", "vue"]
|
|
17
|
+
}
|
|
18
|
+
}, v = {
|
|
19
|
+
config: {
|
|
20
|
+
language: "zh-CN",
|
|
21
|
+
tags: ["typescript", "javascript"]
|
|
22
|
+
}
|
|
23
|
+
}, C = c(_, v, {
|
|
24
|
+
// customMerge: () => {
|
|
25
|
+
// return (target, source) => {
|
|
26
|
+
// if (Array.isArray(target) && Array.isArray(source)) {
|
|
27
|
+
// return [...source, ...target]
|
|
28
|
+
// }
|
|
29
|
+
// return source
|
|
30
|
+
// }
|
|
31
|
+
// }
|
|
32
|
+
// isMergeableObject: (value) => {
|
|
33
|
+
// const type = value !== null && typeof value === 'object'
|
|
34
|
+
// return type
|
|
35
|
+
// }
|
|
36
|
+
});
|
|
37
|
+
console.log(C);
|
|
38
|
+
const z = /* @__PURE__ */ n({
|
|
13
39
|
name: "FormDesign",
|
|
14
|
-
props:
|
|
15
|
-
setup(e
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
40
|
+
props: f,
|
|
41
|
+
setup(e, {
|
|
42
|
+
slots: t
|
|
43
|
+
}) {
|
|
44
|
+
const {
|
|
45
|
+
toolbar: s
|
|
46
|
+
} = t, r = i(!1);
|
|
47
|
+
return a({
|
|
48
|
+
isDrag: r,
|
|
19
49
|
updateDrag: (m) => {
|
|
20
|
-
|
|
50
|
+
r.value = m;
|
|
21
51
|
}
|
|
22
|
-
}),
|
|
23
|
-
class:
|
|
24
|
-
}, [
|
|
52
|
+
}), p(e.design), () => o("form", {
|
|
53
|
+
class: D()
|
|
54
|
+
}, [o(u), o(l, {}, {
|
|
55
|
+
toolbar: s
|
|
56
|
+
}), o(d)]);
|
|
25
57
|
}
|
|
26
58
|
});
|
|
27
59
|
export {
|
|
28
|
-
|
|
60
|
+
z as default
|
|
29
61
|
};
|
|
@@ -1,65 +1,76 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, ref as I, openBlock as r, createElementBlock as l, normalizeClass as u, unref as s, createElementVNode as i, createVNode as d, withCtx as c, createTextVNode as v, Fragment as V, renderList as j, toDisplayString as _, createBlock as E, createCommentVNode as w } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { RadioGroup as
|
|
4
|
-
import
|
|
5
|
-
import { uid as
|
|
6
|
-
import { useInjectDragContext as
|
|
7
|
-
import
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const
|
|
3
|
+
import { RadioGroup as O, RadioButton as k } from "ant-design-vue";
|
|
4
|
+
import z from "vuedraggable";
|
|
5
|
+
import { uid as F } from "@king-one/utils";
|
|
6
|
+
import { useInjectDragContext as J, useInjectDesignContext as R } from "../context/design.mjs";
|
|
7
|
+
import h from "./base/widget-icon.mjs";
|
|
8
|
+
import { useNamespace as m } from "../hooks/use-namespace/index.mjs";
|
|
9
|
+
const G = { class: "widget-group-name" }, K = { class: "widget-col" }, L = { class: "widget-item" }, M = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "widget-item-icon"
|
|
12
|
-
},
|
|
12
|
+
}, T = { class: "widget-item-title" }, Y = /* @__PURE__ */ B({
|
|
13
13
|
name: "FormMaterial",
|
|
14
14
|
__name: "form-material",
|
|
15
|
-
setup(
|
|
16
|
-
const { updateDrag:
|
|
17
|
-
function
|
|
18
|
-
const t =
|
|
15
|
+
setup(U) {
|
|
16
|
+
const { updateDrag: p } = J(), { b: y } = m("material"), { b } = m("toolbar"), { b: x } = m("widget"), g = R(), { schema: C } = g, f = I("1");
|
|
17
|
+
function N(n) {
|
|
18
|
+
const { icon: t, ...e } = n, o = JSON.parse(JSON.stringify(e)), a = F();
|
|
19
19
|
return {
|
|
20
|
-
...
|
|
21
|
-
name:
|
|
22
|
-
id:
|
|
20
|
+
...o,
|
|
21
|
+
name: a,
|
|
22
|
+
id: a,
|
|
23
|
+
"k-design-props": Object.assign({
|
|
24
|
+
validate: {
|
|
25
|
+
status: "",
|
|
26
|
+
message: ""
|
|
27
|
+
}
|
|
28
|
+
}, n["k-design-props"] || {})
|
|
23
29
|
};
|
|
24
30
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
31
|
+
function S(n, t) {
|
|
32
|
+
const { oldIndex: e } = t, { widget: o = [] } = n, a = o[e];
|
|
33
|
+
if (a) {
|
|
34
|
+
const { shared: D } = g;
|
|
35
|
+
D.draggedContext.key = a.key;
|
|
36
|
+
}
|
|
37
|
+
p(!0);
|
|
27
38
|
}
|
|
28
|
-
return (
|
|
39
|
+
return (n, t) => (r(), l(
|
|
29
40
|
"div",
|
|
30
41
|
{
|
|
31
|
-
class:
|
|
42
|
+
class: u(s(y)())
|
|
32
43
|
},
|
|
33
44
|
[
|
|
34
45
|
i(
|
|
35
46
|
"div",
|
|
36
47
|
{
|
|
37
|
-
class:
|
|
48
|
+
class: u(s(b)())
|
|
38
49
|
},
|
|
39
50
|
[
|
|
40
|
-
|
|
41
|
-
value:
|
|
42
|
-
"onUpdate:value": t[0] || (t[0] = (
|
|
51
|
+
d(s(O), {
|
|
52
|
+
value: f.value,
|
|
53
|
+
"onUpdate:value": t[0] || (t[0] = (e) => f.value = e),
|
|
43
54
|
"button-style": "solid",
|
|
44
55
|
size: "default"
|
|
45
56
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
|
|
57
|
+
default: c(() => [
|
|
58
|
+
d(s(k), {
|
|
48
59
|
class: "toolbar-button",
|
|
49
60
|
value: "1"
|
|
50
61
|
}, {
|
|
51
|
-
default:
|
|
52
|
-
|
|
62
|
+
default: c(() => t[2] || (t[2] = [
|
|
63
|
+
v(" 组件库 ")
|
|
53
64
|
])),
|
|
54
65
|
_: 1,
|
|
55
66
|
__: [2]
|
|
56
67
|
}),
|
|
57
|
-
|
|
68
|
+
d(s(k), {
|
|
58
69
|
class: "toolbar-button",
|
|
59
70
|
value: "2"
|
|
60
71
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
72
|
+
default: c(() => t[3] || (t[3] = [
|
|
73
|
+
v(" 流程模版 ")
|
|
63
74
|
])),
|
|
64
75
|
_: 1,
|
|
65
76
|
__: [3]
|
|
@@ -75,47 +86,47 @@ const K = { class: "widget-group-name" }, L = { class: "widget-col" }, M = { cla
|
|
|
75
86
|
i(
|
|
76
87
|
"div",
|
|
77
88
|
{
|
|
78
|
-
class:
|
|
89
|
+
class: u(s(x)())
|
|
79
90
|
},
|
|
80
91
|
[
|
|
81
|
-
(
|
|
92
|
+
(r(!0), l(
|
|
82
93
|
V,
|
|
83
94
|
null,
|
|
84
|
-
|
|
85
|
-
key:
|
|
95
|
+
j(s(C), (e) => (r(), l("div", {
|
|
96
|
+
key: e.key,
|
|
86
97
|
class: "widget-group"
|
|
87
98
|
}, [
|
|
88
99
|
i(
|
|
89
100
|
"div",
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
G,
|
|
102
|
+
_(e.name),
|
|
92
103
|
1
|
|
93
104
|
/* TEXT */
|
|
94
105
|
),
|
|
95
|
-
|
|
106
|
+
e.widget ? (r(), E(s(z), {
|
|
96
107
|
key: 0,
|
|
97
|
-
list:
|
|
108
|
+
list: e.widget,
|
|
98
109
|
class: "widget-list-drag",
|
|
99
110
|
"item-key": "key",
|
|
100
111
|
group: { name: "form", pull: "clone", put: !1 },
|
|
101
112
|
sort: !1,
|
|
102
113
|
options: { animation: 150 },
|
|
103
|
-
clone:
|
|
104
|
-
onStart:
|
|
105
|
-
onEnd: t[1] || (t[1] = (
|
|
114
|
+
clone: N,
|
|
115
|
+
onStart: (o) => S(e, o),
|
|
116
|
+
onEnd: t[1] || (t[1] = (o) => s(p)(!1))
|
|
106
117
|
}, {
|
|
107
|
-
item:
|
|
108
|
-
i("div",
|
|
109
|
-
i("div",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
icon:
|
|
118
|
+
item: c(({ element: o }) => [
|
|
119
|
+
i("div", K, [
|
|
120
|
+
i("div", L, [
|
|
121
|
+
o.icon ? (r(), l("div", M, [
|
|
122
|
+
d(s(h), {
|
|
123
|
+
icon: o.icon
|
|
113
124
|
}, null, 8, ["icon"])
|
|
114
|
-
])) :
|
|
125
|
+
])) : w("v-if", !0),
|
|
115
126
|
i(
|
|
116
127
|
"div",
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
T,
|
|
129
|
+
_(o.title),
|
|
119
130
|
1
|
|
120
131
|
/* TEXT */
|
|
121
132
|
)
|
|
@@ -124,7 +135,7 @@ const K = { class: "widget-group-name" }, L = { class: "widget-col" }, M = { cla
|
|
|
124
135
|
]),
|
|
125
136
|
_: 2
|
|
126
137
|
/* DYNAMIC */
|
|
127
|
-
}, 1032, ["list"])) :
|
|
138
|
+
}, 1032, ["list", "onStart"])) : w("v-if", !0)
|
|
128
139
|
]))),
|
|
129
140
|
128
|
|
130
141
|
/* KEYED_FRAGMENT */
|
|
@@ -140,5 +151,5 @@ const K = { class: "widget-group-name" }, L = { class: "widget-col" }, M = { cla
|
|
|
140
151
|
}
|
|
141
152
|
});
|
|
142
153
|
export {
|
|
143
|
-
|
|
154
|
+
Y as default
|
|
144
155
|
};
|
|
@@ -1,47 +1,58 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as V, useTemplateRef as $, ref as R, toRaw as z, openBlock as g, createElementBlock as _, normalizeClass as r, unref as e, createElementVNode as o, createVNode as n, withCtx as a, createCommentVNode as d, renderSlot as h, withDirectives as v, vShow as k } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import
|
|
5
|
-
import { useInjectDragContext as
|
|
6
|
-
import "./panel/panel-item.
|
|
3
|
+
import { Tooltip as C, Form as j } from "ant-design-vue";
|
|
4
|
+
import B from "vuedraggable";
|
|
5
|
+
import { useInjectDragContext as J, useInjectDesignContext as M } from "../context/design.mjs";
|
|
6
|
+
import "./panel/panel-item.vue2.mjs";
|
|
7
7
|
import "./index.mjs";
|
|
8
|
-
import { useMonaco as
|
|
9
|
-
import { useNamespace as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
8
|
+
import { useMonaco as O } from "../hooks/use-monaco.mjs";
|
|
9
|
+
import { useNamespace as P } from "../hooks/use-namespace/index.mjs";
|
|
10
|
+
import b from "./form-icon.vue2.mjs";
|
|
11
|
+
import q from "./panel/panel-item.vue.mjs";
|
|
12
|
+
const A = { class: "left" }, G = { class: "right" }, H = { class: "content-panel" }, K = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "prompt"
|
|
15
|
-
},
|
|
15
|
+
}, L = { class: "form-item" }, Q = {
|
|
16
16
|
ref: "contentEditorTel",
|
|
17
17
|
class: "content-editor"
|
|
18
|
-
},
|
|
18
|
+
}, re = /* @__PURE__ */ V({
|
|
19
19
|
name: "FormPanel",
|
|
20
20
|
__name: "form-panel",
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
21
|
+
setup(U) {
|
|
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
|
+
i.value = !i.value, x(c.getFormSchema());
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function y() {
|
|
27
27
|
}
|
|
28
|
-
const { b:
|
|
29
|
-
|
|
28
|
+
const { b: D, e: f, em: p } = P("panel");
|
|
29
|
+
function F() {
|
|
30
|
+
const { shared: s } = c, { key: t } = s.draggedContext;
|
|
31
|
+
return t !== "";
|
|
32
|
+
}
|
|
33
|
+
function I(s, t) {
|
|
34
|
+
const l = z(s), { oldIndex: N } = t, u = l[N];
|
|
35
|
+
if (u) {
|
|
36
|
+
const { shared: T } = c;
|
|
37
|
+
T.draggedContext.key = u.key;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return (s, t) => (g(), _(
|
|
30
41
|
"div",
|
|
31
42
|
{
|
|
32
|
-
class:
|
|
43
|
+
class: r(e(D)())
|
|
33
44
|
},
|
|
34
45
|
[
|
|
35
|
-
|
|
46
|
+
o(
|
|
36
47
|
"div",
|
|
37
48
|
{
|
|
38
|
-
class:
|
|
49
|
+
class: r(e(f)("toolbar"))
|
|
39
50
|
},
|
|
40
51
|
[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
title:
|
|
44
|
-
|
|
52
|
+
o("div", A, [
|
|
53
|
+
n(e(C), { placement: "bottom" }, {
|
|
54
|
+
title: a(() => t[1] || (t[1] = [
|
|
55
|
+
o(
|
|
45
56
|
"span",
|
|
46
57
|
null,
|
|
47
58
|
"全部删除",
|
|
@@ -49,20 +60,20 @@ const R = { class: "left" }, J = { class: "content-panel" }, M = {
|
|
|
49
60
|
/* CACHED */
|
|
50
61
|
)
|
|
51
62
|
])),
|
|
52
|
-
default:
|
|
53
|
-
|
|
63
|
+
default: a(() => [
|
|
64
|
+
n(e(b), {
|
|
54
65
|
name: "delete1",
|
|
55
|
-
class:
|
|
66
|
+
class: r(e(p)("toolbar", "icon")),
|
|
56
67
|
size: 18,
|
|
57
|
-
onClick:
|
|
68
|
+
onClick: y
|
|
58
69
|
}, null, 8, ["class"])
|
|
59
70
|
]),
|
|
60
71
|
_: 1
|
|
61
72
|
/* STABLE */
|
|
62
73
|
}),
|
|
63
|
-
|
|
64
|
-
title:
|
|
65
|
-
|
|
74
|
+
n(e(C), { placement: "bottom" }, {
|
|
75
|
+
title: a(() => t[2] || (t[2] = [
|
|
76
|
+
o(
|
|
66
77
|
"span",
|
|
67
78
|
null,
|
|
68
79
|
"查看JSON Schema",
|
|
@@ -70,10 +81,10 @@ const R = { class: "left" }, J = { class: "content-panel" }, M = {
|
|
|
70
81
|
/* CACHED */
|
|
71
82
|
)
|
|
72
83
|
])),
|
|
73
|
-
default:
|
|
74
|
-
|
|
84
|
+
default: a(() => [
|
|
85
|
+
n(e(b), {
|
|
75
86
|
name: "code",
|
|
76
|
-
class:
|
|
87
|
+
class: r(e(p)("toolbar", "icon")),
|
|
77
88
|
size: 18,
|
|
78
89
|
onClick: E
|
|
79
90
|
}, null, 8, ["class"])
|
|
@@ -81,51 +92,57 @@ const R = { class: "left" }, J = { class: "content-panel" }, M = {
|
|
|
81
92
|
_: 1
|
|
82
93
|
/* STABLE */
|
|
83
94
|
}),
|
|
84
|
-
|
|
95
|
+
d(` <FormIcon name="desktop" />
|
|
85
96
|
<FormIcon name="mobile" /> `)
|
|
97
|
+
]),
|
|
98
|
+
o("div", G, [
|
|
99
|
+
h(s.$slots, "toolbar")
|
|
86
100
|
])
|
|
87
101
|
],
|
|
88
102
|
2
|
|
89
103
|
/* CLASS */
|
|
90
104
|
),
|
|
91
|
-
|
|
92
|
-
|
|
105
|
+
d(' ref="contentTelRef" '),
|
|
106
|
+
o(
|
|
93
107
|
"div",
|
|
94
108
|
{
|
|
95
|
-
class:
|
|
109
|
+
class: r(e(f)("content"))
|
|
96
110
|
},
|
|
97
111
|
[
|
|
98
|
-
|
|
112
|
+
v(o(
|
|
99
113
|
"div",
|
|
100
|
-
|
|
114
|
+
H,
|
|
101
115
|
[
|
|
102
|
-
!e(
|
|
103
|
-
|
|
116
|
+
!e(w) && e(m).length === 0 ? (g(), _("div", K, " 👈 请在左侧选择控件并拖至此处 ")) : d("v-if", !0),
|
|
117
|
+
n(e(j), {
|
|
104
118
|
autocomplete: "off",
|
|
105
119
|
class: "design-from",
|
|
106
|
-
"label-col": { style: { width: "100px" } },
|
|
107
120
|
"label-align": "left"
|
|
108
121
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
|
|
122
|
+
default: a(() => [
|
|
123
|
+
n(e(B), {
|
|
111
124
|
class: "drag-from",
|
|
112
|
-
list: e(
|
|
113
|
-
group: "form",
|
|
125
|
+
list: e(m),
|
|
126
|
+
group: { name: "form", put: F },
|
|
114
127
|
animation: 300,
|
|
115
128
|
sort: !0,
|
|
116
129
|
"item-key": "id",
|
|
117
|
-
"chosen-class": "choose"
|
|
130
|
+
"chosen-class": "choose",
|
|
131
|
+
onStart: t[0] || (t[0] = (l) => I(e(m), l))
|
|
118
132
|
}, {
|
|
119
|
-
item:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
item: a(({ element: l }) => [
|
|
134
|
+
o("div", L, [
|
|
135
|
+
h(s.$slots, `panel-${l.key}`, {}, () => [
|
|
136
|
+
n(q, {
|
|
137
|
+
field: l,
|
|
138
|
+
space: e(m)
|
|
139
|
+
}, null, 8, ["field", "space"])
|
|
123
140
|
])
|
|
124
141
|
])
|
|
125
142
|
]),
|
|
126
143
|
_: 3
|
|
127
144
|
/* FORWARDED */
|
|
128
|
-
}, 8, ["list"])
|
|
145
|
+
}, 8, ["list", "group"])
|
|
129
146
|
]),
|
|
130
147
|
_: 3
|
|
131
148
|
/* FORWARDED */
|
|
@@ -134,16 +151,16 @@ const R = { class: "left" }, J = { class: "content-panel" }, M = {
|
|
|
134
151
|
512
|
|
135
152
|
/* NEED_PATCH */
|
|
136
153
|
), [
|
|
137
|
-
[
|
|
154
|
+
[k, !i.value]
|
|
138
155
|
]),
|
|
139
|
-
|
|
156
|
+
v(o(
|
|
140
157
|
"div",
|
|
141
|
-
|
|
158
|
+
Q,
|
|
142
159
|
null,
|
|
143
160
|
512
|
|
144
161
|
/* NEED_PATCH */
|
|
145
162
|
), [
|
|
146
|
-
[
|
|
163
|
+
[k, i.value]
|
|
147
164
|
])
|
|
148
165
|
],
|
|
149
166
|
2
|
|
@@ -156,5 +173,5 @@ const R = { class: "left" }, J = { class: "content-panel" }, M = {
|
|
|
156
173
|
}
|
|
157
174
|
});
|
|
158
175
|
export {
|
|
159
|
-
|
|
176
|
+
re as default
|
|
160
177
|
};
|