@king-one/form-design 0.0.28 → 0.0.30
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 +10 -8
- package/dist/es/src/components/form-material.vue.mjs +44 -49
- package/dist/es/src/components/panel/widget/grid.vue2.mjs +1 -1
- package/dist/es/src/components/props/widget/GridProps.vue2.mjs +15 -20
- package/dist/es/src/config/index.mjs +225 -149
- package/dist/es/src/core/FormSchema.mjs +37 -58
- package/dist/es/src/index.mjs +15 -14
- package/dist/es/src/plugins/modules/drag-add.mjs +1 -1
- package/dist/es/src/utils/index.mjs +15 -13
- package/dist/es/src/utils/schema.mjs +29 -0
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/form-material.vue.js +1 -1
- package/dist/lib/src/components/panel/widget/grid.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/GridProps.vue2.js +1 -1
- package/dist/lib/src/config/index.js +14 -14
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-add.js +1 -1
- package/dist/lib/src/utils/index.js +1 -1
- package/dist/lib/src/utils/schema.js +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/src/core/Design.d.ts +546 -186
- package/dist/types/src/core/FormSchema.d.ts +176 -62
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/types.d.ts +41 -30
- package/dist/types/src/utils/index.d.ts +1 -0
- package/dist/types/src/utils/schema.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.mjs
CHANGED
|
@@ -5,19 +5,21 @@ import { useInjectDesignContext as f } from "./src/context/design.mjs";
|
|
|
5
5
|
import { default as p } from "./src/components/form-desgin.mjs";
|
|
6
6
|
import { CreateFormDesign as i } from "./src/core/index.mjs";
|
|
7
7
|
import { default as l } from "./src/components/props/form-config.vue.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { jsonToSchema as c } from "./src/utils/schema.mjs";
|
|
9
|
+
import { BaseSchema as h, ExtendSchema as C, LayoutSchema as D, tempSchema as F } from "./src/config/index.mjs";
|
|
10
|
+
import { onDesignFieldChange as I, onDesignInit as j } from "./src/effects/onEffects.mjs";
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
h as BaseSchema,
|
|
12
13
|
t as Carousel,
|
|
13
14
|
i as CreateFormDesign,
|
|
14
|
-
|
|
15
|
+
C as ExtendSchema,
|
|
15
16
|
l as FormConfig,
|
|
16
17
|
p as FormDesign,
|
|
17
18
|
a as FormPanelItem,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
D as LayoutSchema,
|
|
20
|
+
c as jsonToSchema,
|
|
21
|
+
I as onDesignFieldChange,
|
|
22
|
+
j as onDesignInit,
|
|
23
|
+
F as tempSchema,
|
|
22
24
|
f as useInjectDesignContext
|
|
23
25
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as J, ref as
|
|
1
|
+
import { defineComponent as J, ref as h, openBlock as l, createElementBlock as d, normalizeClass as u, unref as o, createElementVNode as n, createVNode as a, withCtx as r, createTextVNode as N, Fragment as T, renderList as W, toDisplayString as k, createBlock as K, createCommentVNode as p } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
3
|
import { RadioGroup as L, RadioButton as S } from "ant-design-vue";
|
|
4
4
|
import $ from "vuedraggable";
|
|
@@ -14,16 +14,16 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
14
14
|
}, X = { class: "widget-item-title" }, Y = { class: "template-item" }, Z = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "template-item-icon"
|
|
17
|
-
}, ee = { class: "template-item-name" },
|
|
17
|
+
}, ee = { class: "template-item-name" }, ue = /* @__PURE__ */ J({
|
|
18
18
|
name: "FormMaterial",
|
|
19
19
|
__name: "form-material",
|
|
20
20
|
setup(te) {
|
|
21
|
-
const
|
|
21
|
+
const y = h(), { updateDrag: m } = M(), { b: B } = g("material"), { b: E } = g("toolbar"), { b: I } = g("widget"), { b: R } = g("temp"), f = U(), { schema: j, tempSchema: O } = f, _ = h("1");
|
|
22
22
|
function z(s) {
|
|
23
|
-
const { icon: e, ...t } = s, i = JSON.parse(JSON.stringify(t)),
|
|
23
|
+
const { icon: e, ...t } = s, i = JSON.parse(JSON.stringify(t)), C = D(), c = {
|
|
24
24
|
...i,
|
|
25
|
-
name:
|
|
26
|
-
id:
|
|
25
|
+
name: C,
|
|
26
|
+
id: C,
|
|
27
27
|
"x-design-props": Object.assign({
|
|
28
28
|
validate: {
|
|
29
29
|
status: "",
|
|
@@ -31,53 +31,48 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
31
31
|
}
|
|
32
32
|
}, s["x-design-props"] || {})
|
|
33
33
|
};
|
|
34
|
-
if (
|
|
34
|
+
if (i.key === "k-grid") {
|
|
35
35
|
const b = [];
|
|
36
36
|
let v = 0;
|
|
37
37
|
for (; v < 2; ) {
|
|
38
|
-
const
|
|
38
|
+
const w = D();
|
|
39
39
|
b.push({
|
|
40
40
|
title: `栅格容器${v + 1}`,
|
|
41
|
-
name:
|
|
42
|
-
id:
|
|
41
|
+
name: w,
|
|
42
|
+
id: w,
|
|
43
43
|
key: "k-grid-column",
|
|
44
44
|
type: "void",
|
|
45
|
-
icon: "form-list",
|
|
46
45
|
children: [],
|
|
47
46
|
"x-component": "GridColumn",
|
|
48
47
|
"x-decorator": "Void",
|
|
49
48
|
"x-component-props": {
|
|
50
49
|
span: 12
|
|
51
|
-
},
|
|
52
|
-
"x-design-props": {
|
|
53
|
-
"convert-key": "properties",
|
|
54
|
-
"convert-type": "base"
|
|
55
50
|
}
|
|
56
51
|
}), v++;
|
|
57
52
|
}
|
|
58
|
-
|
|
53
|
+
c.children = b;
|
|
59
54
|
}
|
|
60
|
-
const { shared:
|
|
61
|
-
return
|
|
55
|
+
const { shared: x } = f;
|
|
56
|
+
return x.draggedContext.field = c, x.draggedContext.key = c.key, c;
|
|
62
57
|
}
|
|
63
58
|
function F(s) {
|
|
64
59
|
const { schema: e } = s, { shared: t } = f;
|
|
65
|
-
return t.draggedContext.field = e, t.draggedContext.key = e.key, e;
|
|
60
|
+
return t.draggedContext.field = e, t.draggedContext.key = e.key || "", e;
|
|
66
61
|
}
|
|
67
62
|
function G(s) {
|
|
68
63
|
var e;
|
|
69
|
-
(e =
|
|
64
|
+
(e = y.value) == null || e.goTo(Number(s.target.value) - 1);
|
|
70
65
|
}
|
|
71
|
-
return (s, e) => (
|
|
66
|
+
return (s, e) => (l(), d(
|
|
72
67
|
"div",
|
|
73
68
|
{
|
|
74
|
-
class:
|
|
69
|
+
class: u(o(B)())
|
|
75
70
|
},
|
|
76
71
|
[
|
|
77
72
|
n(
|
|
78
73
|
"div",
|
|
79
74
|
{
|
|
80
|
-
class:
|
|
75
|
+
class: u(o(E)())
|
|
81
76
|
},
|
|
82
77
|
[
|
|
83
78
|
a(o(L), {
|
|
@@ -87,12 +82,12 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
87
82
|
size: "default",
|
|
88
83
|
onChange: G
|
|
89
84
|
}, {
|
|
90
|
-
default:
|
|
85
|
+
default: r(() => [
|
|
91
86
|
a(o(S), {
|
|
92
87
|
class: "toolbar-button",
|
|
93
88
|
value: "1"
|
|
94
89
|
}, {
|
|
95
|
-
default:
|
|
90
|
+
default: r(() => e[5] || (e[5] = [
|
|
96
91
|
N(" 组件库 ")
|
|
97
92
|
])),
|
|
98
93
|
_: 1,
|
|
@@ -102,7 +97,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
102
97
|
class: "toolbar-button",
|
|
103
98
|
value: "2"
|
|
104
99
|
}, {
|
|
105
|
-
default:
|
|
100
|
+
default: r(() => e[6] || (e[6] = [
|
|
106
101
|
N(" 业务套件 ")
|
|
107
102
|
])),
|
|
108
103
|
_: 1,
|
|
@@ -120,32 +115,32 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
120
115
|
q,
|
|
121
116
|
{
|
|
122
117
|
ref_key: "carouselRef",
|
|
123
|
-
ref:
|
|
118
|
+
ref: y,
|
|
124
119
|
"model-value": 0
|
|
125
120
|
},
|
|
126
121
|
{
|
|
127
|
-
default:
|
|
122
|
+
default: r(() => [
|
|
128
123
|
n(
|
|
129
124
|
"div",
|
|
130
125
|
{
|
|
131
|
-
class:
|
|
126
|
+
class: u(o(I)())
|
|
132
127
|
},
|
|
133
128
|
[
|
|
134
|
-
(
|
|
129
|
+
(l(!0), d(
|
|
135
130
|
T,
|
|
136
131
|
null,
|
|
137
|
-
W(o(
|
|
132
|
+
W(o(j), (t) => (l(), d("div", {
|
|
138
133
|
key: t.key,
|
|
139
134
|
class: "widget-group"
|
|
140
135
|
}, [
|
|
141
136
|
n(
|
|
142
137
|
"div",
|
|
143
138
|
A,
|
|
144
|
-
|
|
139
|
+
k(t.name),
|
|
145
140
|
1
|
|
146
141
|
/* TEXT */
|
|
147
142
|
),
|
|
148
|
-
t.widget ? (
|
|
143
|
+
t.widget ? (l(), K(o($), {
|
|
149
144
|
key: 0,
|
|
150
145
|
list: t.widget,
|
|
151
146
|
class: "widget-list-drag",
|
|
@@ -154,21 +149,21 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
154
149
|
sort: !1,
|
|
155
150
|
options: { animation: 150 },
|
|
156
151
|
clone: z,
|
|
157
|
-
onStart: e[1] || (e[1] = (i) => o(
|
|
158
|
-
onEnd: e[2] || (e[2] = (i) => o(
|
|
152
|
+
onStart: e[1] || (e[1] = (i) => o(m)(!0)),
|
|
153
|
+
onEnd: e[2] || (e[2] = (i) => o(m)(!1))
|
|
159
154
|
}, {
|
|
160
|
-
item:
|
|
155
|
+
item: r(({ element: i }) => [
|
|
161
156
|
n("div", H, [
|
|
162
157
|
n("div", P, [
|
|
163
|
-
i.icon ? (
|
|
158
|
+
i.icon ? (l(), d("div", Q, [
|
|
164
159
|
a(o(V), {
|
|
165
160
|
icon: i.icon
|
|
166
161
|
}, null, 8, ["icon"])
|
|
167
|
-
])) :
|
|
162
|
+
])) : p("v-if", !0),
|
|
168
163
|
n(
|
|
169
164
|
"div",
|
|
170
165
|
X,
|
|
171
|
-
|
|
166
|
+
k(i.title),
|
|
172
167
|
1
|
|
173
168
|
/* TEXT */
|
|
174
169
|
)
|
|
@@ -177,7 +172,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
177
172
|
]),
|
|
178
173
|
_: 2
|
|
179
174
|
/* DYNAMIC */
|
|
180
|
-
}, 1032, ["list"])) :
|
|
175
|
+
}, 1032, ["list"])) : p("v-if", !0)
|
|
181
176
|
]))),
|
|
182
177
|
128
|
|
183
178
|
/* KEYED_FRAGMENT */
|
|
@@ -189,7 +184,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
189
184
|
n(
|
|
190
185
|
"div",
|
|
191
186
|
{
|
|
192
|
-
class:
|
|
187
|
+
class: u(o(R)())
|
|
193
188
|
},
|
|
194
189
|
[
|
|
195
190
|
a(o($), {
|
|
@@ -200,20 +195,20 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
200
195
|
sort: !1,
|
|
201
196
|
options: { animation: 150 },
|
|
202
197
|
clone: F,
|
|
203
|
-
onStart: e[3] || (e[3] = (t) => o(
|
|
204
|
-
onEnd: e[4] || (e[4] = (t) => o(
|
|
198
|
+
onStart: e[3] || (e[3] = (t) => o(m)(!0)),
|
|
199
|
+
onEnd: e[4] || (e[4] = (t) => o(m)(!1))
|
|
205
200
|
}, {
|
|
206
|
-
item:
|
|
201
|
+
item: r(({ element: t }) => [
|
|
207
202
|
n("div", Y, [
|
|
208
|
-
t.icon ? (
|
|
203
|
+
t.icon ? (l(), d("div", Z, [
|
|
209
204
|
a(o(V), {
|
|
210
205
|
icon: t.icon
|
|
211
206
|
}, null, 8, ["icon"])
|
|
212
|
-
])) :
|
|
207
|
+
])) : p("v-if", !0),
|
|
213
208
|
n(
|
|
214
209
|
"div",
|
|
215
210
|
ee,
|
|
216
|
-
|
|
211
|
+
k(t.name),
|
|
217
212
|
1
|
|
218
213
|
/* TEXT */
|
|
219
214
|
)
|
|
@@ -222,7 +217,7 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
222
217
|
_: 1
|
|
223
218
|
/* STABLE */
|
|
224
219
|
}, 8, ["list"]),
|
|
225
|
-
|
|
220
|
+
p(` <div class="template-list">
|
|
226
221
|
<div v-for="g in tempSchema" :key="g.key" class="template-item">
|
|
227
222
|
<div v-if="g.icon" class="template-item-icon">
|
|
228
223
|
<WidgetIcon :icon="g.icon" />
|
|
@@ -250,5 +245,5 @@ const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { cla
|
|
|
250
245
|
}
|
|
251
246
|
});
|
|
252
247
|
export {
|
|
253
|
-
|
|
248
|
+
ue as default
|
|
254
249
|
};
|
|
@@ -28,7 +28,7 @@ const V = { class: "form-item" }, J = /* @__PURE__ */ w({
|
|
|
28
28
|
};
|
|
29
29
|
if (d.hooks.syncDragAdd.call(n), !d.dragAddResult.every((e) => e)) {
|
|
30
30
|
const e = a.field.children.findIndex((t) => t.id === r.id);
|
|
31
|
-
e !== -1 && (a.field.children.splice(e, 1), B.warning("
|
|
31
|
+
e !== -1 && (a.field.children.splice(e, 1), B.warning("不能将该控件拖拽到明细表中"));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
return (o, r) => (l(), g(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as _, computed as k, openBlock as
|
|
2
|
-
import { Form as B, FormItem as
|
|
1
|
+
import { defineComponent as _, computed as k, openBlock as m, createBlock as y, unref as t, normalizeClass as g, withCtx as p, createVNode as n, createElementBlock as u, Fragment as h, renderList as C, createTextVNode as b } from "vue";
|
|
2
|
+
import { Form as B, FormItem as c, InputNumber as d, Button as F } from "ant-design-vue";
|
|
3
3
|
import "../../../internal.mjs";
|
|
4
4
|
import { uid as N } from "@king-one/utils";
|
|
5
5
|
import "../../form-icon.vue.mjs";
|
|
@@ -9,43 +9,38 @@ import U from "../../form-icon.vue2.mjs";
|
|
|
9
9
|
const T = /* @__PURE__ */ _({
|
|
10
10
|
__name: "GridProps",
|
|
11
11
|
setup(V) {
|
|
12
|
-
const { b: f } = w("grid-props"), { checkedField: r } = I(),
|
|
12
|
+
const { b: f } = w("grid-props"), { checkedField: r } = I(), s = k(() => r.value["x-component-props"] || {});
|
|
13
13
|
function v(l) {
|
|
14
14
|
var e;
|
|
15
15
|
(e = r.value.children) == null || e.splice(l, 1);
|
|
16
16
|
}
|
|
17
17
|
function x() {
|
|
18
|
-
var
|
|
18
|
+
var i, a;
|
|
19
19
|
const l = N(), o = {
|
|
20
|
-
title: `栅格容器${(((
|
|
20
|
+
title: `栅格容器${(((i = r.value.children) == null ? void 0 : i.length) || 0) + 1}`,
|
|
21
21
|
name: l,
|
|
22
22
|
id: l,
|
|
23
23
|
key: "k-grid-column",
|
|
24
24
|
type: "void",
|
|
25
|
-
icon: "form-list",
|
|
26
25
|
children: [],
|
|
27
26
|
"x-component": "GridColumn",
|
|
28
27
|
"x-decorator": "Void",
|
|
29
28
|
"x-component-props": {
|
|
30
29
|
span: 12
|
|
31
|
-
},
|
|
32
|
-
"x-design-props": {
|
|
33
|
-
"convert-key": "properties",
|
|
34
|
-
"convert-type": "base"
|
|
35
30
|
}
|
|
36
31
|
};
|
|
37
|
-
(
|
|
32
|
+
(a = r.value.children) == null || a.push(o);
|
|
38
33
|
}
|
|
39
|
-
return (l, e) => (
|
|
34
|
+
return (l, e) => (m(), y(t(B), {
|
|
40
35
|
layout: "vertical",
|
|
41
36
|
class: g(t(f)())
|
|
42
37
|
}, {
|
|
43
38
|
default: p(() => [
|
|
44
|
-
n(t(
|
|
39
|
+
n(t(c), { label: "间隔大小" }, {
|
|
45
40
|
default: p(() => [
|
|
46
41
|
n(t(d), {
|
|
47
|
-
value:
|
|
48
|
-
"onUpdate:value": e[0] || (e[0] = (o) =>
|
|
42
|
+
value: s.value.gutter,
|
|
43
|
+
"onUpdate:value": e[0] || (e[0] = (o) => s.value.gutter = o),
|
|
49
44
|
style: { width: "100%" },
|
|
50
45
|
min: 1,
|
|
51
46
|
precision: 0,
|
|
@@ -56,18 +51,18 @@ const T = /* @__PURE__ */ _({
|
|
|
56
51
|
_: 1
|
|
57
52
|
/* STABLE */
|
|
58
53
|
}),
|
|
59
|
-
n(t(
|
|
54
|
+
n(t(c), { label: "配置项" }, {
|
|
60
55
|
default: p(() => [
|
|
61
|
-
(
|
|
56
|
+
(m(!0), u(
|
|
62
57
|
h,
|
|
63
58
|
null,
|
|
64
|
-
C(t(r).children, (o,
|
|
59
|
+
C(t(r).children, (o, i) => (m(), u("div", {
|
|
65
60
|
key: o.id,
|
|
66
61
|
class: "col-item"
|
|
67
62
|
}, [
|
|
68
63
|
n(t(d), {
|
|
69
64
|
value: o["x-component-props"].span,
|
|
70
|
-
"onUpdate:value": (
|
|
65
|
+
"onUpdate:value": (a) => o["x-component-props"].span = a,
|
|
71
66
|
min: 1,
|
|
72
67
|
style: { width: "200px" },
|
|
73
68
|
precision: 0,
|
|
@@ -76,7 +71,7 @@ const T = /* @__PURE__ */ _({
|
|
|
76
71
|
n(U, {
|
|
77
72
|
name: "delete1",
|
|
78
73
|
class: "close-icon",
|
|
79
|
-
onClick: (
|
|
74
|
+
onClick: (a) => v(i)
|
|
80
75
|
}, null, 8, ["onClick"])
|
|
81
76
|
]))),
|
|
82
77
|
128
|