@king-one/form-design 0.0.23 → 0.0.25
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-material.vue.mjs +91 -70
- package/dist/es/src/components/form-panel.vue.mjs +44 -32
- package/dist/es/src/components/panel/index.mjs +17 -14
- package/dist/es/src/components/panel/widget/grid.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/grid.vue2.mjs +117 -0
- package/dist/es/src/components/props/widget/GridProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/GridProps.vue2.mjs +108 -0
- package/dist/es/src/components/props/widget/index.mjs +17 -10
- package/dist/es/src/config/index.mjs +42 -38
- package/dist/es/src/core/Design.mjs +20 -13
- package/dist/es/src/core/FormSchema.mjs +57 -34
- package/dist/es/src/effects/index.mjs +2 -0
- package/dist/es/src/plugins/modules/drag-add.mjs +11 -11
- package/dist/es/src/types.mjs +11 -0
- package/dist/lib/src/components/form-material.vue.js +2 -2
- 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/widget/grid.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/grid.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/GridProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/GridProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/index.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/effects/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-add.js +1 -1
- package/dist/lib/src/types.js +1 -0
- package/dist/theme-chalk/grid-props.css +1 -0
- package/dist/theme-chalk/grid.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/src/components/panel/widget/grid.vue.d.ts +20 -0
- package/dist/types/src/components/props/widget/GridProps.vue.d.ts +3 -0
- package/dist/types/src/core/Design.d.ts +4 -2
- package/dist/types/src/core/FormSchema.d.ts +8 -0
- package/dist/types/src/effects/index.d.ts +1 -0
- package/dist/types/src/types.d.ts +2 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as J, ref as w, openBlock as l, createElementBlock as m, 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 y, createBlock as K, createCommentVNode as p } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { RadioGroup as
|
|
4
|
-
import
|
|
5
|
-
import { uid as
|
|
6
|
-
import { useInjectDragContext as
|
|
3
|
+
import { RadioGroup as L, RadioButton as S } from "ant-design-vue";
|
|
4
|
+
import $ from "vuedraggable";
|
|
5
|
+
import { uid as D } from "@king-one/utils";
|
|
6
|
+
import { useInjectDragContext as M, useInjectDesignContext as U } from "../context/design.mjs";
|
|
7
7
|
import "./base/Carousel.vue2.mjs";
|
|
8
|
-
import
|
|
8
|
+
import V from "./base/widget-icon.mjs";
|
|
9
9
|
import { useNamespace as g } from "../hooks/use-namespace/index.mjs";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
10
|
+
import q from "./base/Carousel.vue.mjs";
|
|
11
|
+
const A = { class: "widget-group-name" }, H = { class: "widget-col" }, P = { class: "widget-item" }, Q = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "widget-item-icon"
|
|
14
|
-
},
|
|
14
|
+
}, X = { class: "widget-item-title" }, Y = { class: "template-item" }, Z = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "template-item-icon"
|
|
17
|
-
},
|
|
17
|
+
}, ee = { class: "template-item-name" }, ue = /* @__PURE__ */ J({
|
|
18
18
|
name: "FormMaterial",
|
|
19
19
|
__name: "form-material",
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
function
|
|
23
|
-
const { icon: e, ...t } = s,
|
|
24
|
-
...
|
|
25
|
-
name:
|
|
26
|
-
id:
|
|
20
|
+
setup(te) {
|
|
21
|
+
const k = w(), { updateDrag: c } = M(), { b: j } = g("material"), { b: B } = g("toolbar"), { b: E } = g("widget"), { b: I } = g("temp"), f = U(), { schema: R, tempSchema: O } = f, _ = w("1");
|
|
22
|
+
function z(s) {
|
|
23
|
+
const { icon: e, ...t } = s, i = JSON.parse(JSON.stringify(t)), C = D(), d = {
|
|
24
|
+
...i,
|
|
25
|
+
name: C,
|
|
26
|
+
id: C,
|
|
27
27
|
"x-design-props": Object.assign({
|
|
28
28
|
validate: {
|
|
29
29
|
status: "",
|
|
@@ -31,54 +31,75 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
31
31
|
}
|
|
32
32
|
}, s["x-design-props"] || {})
|
|
33
33
|
};
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if ((i.type === "array" || i.type === "object") && (d.children = []), i.key === "k-grid") {
|
|
35
|
+
const b = [];
|
|
36
|
+
let v = 0;
|
|
37
|
+
for (; v < 2; ) {
|
|
38
|
+
const h = D();
|
|
39
|
+
b.push({
|
|
40
|
+
title: `列表容器${v + 1}`,
|
|
41
|
+
name: h,
|
|
42
|
+
id: h,
|
|
43
|
+
key: "k-grid-column",
|
|
44
|
+
type: "void",
|
|
45
|
+
icon: "form-list",
|
|
46
|
+
children: [],
|
|
47
|
+
"x-component": "GridColumn",
|
|
48
|
+
"x-decorator": "Void",
|
|
49
|
+
"x-component-props": {
|
|
50
|
+
span: 12
|
|
51
|
+
}
|
|
52
|
+
}), v++;
|
|
53
|
+
}
|
|
54
|
+
d.children = b;
|
|
55
|
+
}
|
|
56
|
+
const { shared: x } = f;
|
|
57
|
+
return x.draggedContext.field = d, x.draggedContext.key = d.key, d;
|
|
37
58
|
}
|
|
38
|
-
function
|
|
59
|
+
function F(s) {
|
|
39
60
|
const { schema: e } = s, { shared: t } = f;
|
|
40
61
|
return t.draggedContext.field = e, t.draggedContext.key = e.key, e;
|
|
41
62
|
}
|
|
42
|
-
function
|
|
63
|
+
function G(s) {
|
|
43
64
|
var e;
|
|
44
|
-
(e =
|
|
65
|
+
(e = k.value) == null || e.goTo(Number(s.target.value) - 1);
|
|
45
66
|
}
|
|
46
|
-
return (s, e) => (l(),
|
|
67
|
+
return (s, e) => (l(), m(
|
|
47
68
|
"div",
|
|
48
69
|
{
|
|
49
|
-
class: u(o(
|
|
70
|
+
class: u(o(j)())
|
|
50
71
|
},
|
|
51
72
|
[
|
|
52
|
-
|
|
73
|
+
n(
|
|
53
74
|
"div",
|
|
54
75
|
{
|
|
55
|
-
class: u(o(
|
|
76
|
+
class: u(o(B)())
|
|
56
77
|
},
|
|
57
78
|
[
|
|
58
|
-
a(o(
|
|
79
|
+
a(o(L), {
|
|
59
80
|
value: _.value,
|
|
60
81
|
"onUpdate:value": e[0] || (e[0] = (t) => _.value = t),
|
|
61
82
|
"button-style": "solid",
|
|
62
83
|
size: "default",
|
|
63
|
-
onChange:
|
|
84
|
+
onChange: G
|
|
64
85
|
}, {
|
|
65
86
|
default: r(() => [
|
|
66
|
-
a(o(
|
|
87
|
+
a(o(S), {
|
|
67
88
|
class: "toolbar-button",
|
|
68
89
|
value: "1"
|
|
69
90
|
}, {
|
|
70
91
|
default: r(() => e[5] || (e[5] = [
|
|
71
|
-
|
|
92
|
+
N(" 组件库 ")
|
|
72
93
|
])),
|
|
73
94
|
_: 1,
|
|
74
95
|
__: [5]
|
|
75
96
|
}),
|
|
76
|
-
a(o(
|
|
97
|
+
a(o(S), {
|
|
77
98
|
class: "toolbar-button",
|
|
78
99
|
value: "2"
|
|
79
100
|
}, {
|
|
80
101
|
default: r(() => e[6] || (e[6] = [
|
|
81
|
-
|
|
102
|
+
N(" 业务套件 ")
|
|
82
103
|
])),
|
|
83
104
|
_: 1,
|
|
84
105
|
__: [6]
|
|
@@ -92,35 +113,35 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
92
113
|
/* CLASS */
|
|
93
114
|
),
|
|
94
115
|
a(
|
|
95
|
-
|
|
116
|
+
q,
|
|
96
117
|
{
|
|
97
118
|
ref_key: "carouselRef",
|
|
98
|
-
ref:
|
|
119
|
+
ref: k,
|
|
99
120
|
"model-value": 0
|
|
100
121
|
},
|
|
101
122
|
{
|
|
102
123
|
default: r(() => [
|
|
103
|
-
|
|
124
|
+
n(
|
|
104
125
|
"div",
|
|
105
126
|
{
|
|
106
|
-
class: u(o(
|
|
127
|
+
class: u(o(E)())
|
|
107
128
|
},
|
|
108
129
|
[
|
|
109
|
-
(l(!0),
|
|
110
|
-
|
|
130
|
+
(l(!0), m(
|
|
131
|
+
T,
|
|
111
132
|
null,
|
|
112
|
-
|
|
133
|
+
W(o(R), (t) => (l(), m("div", {
|
|
113
134
|
key: t.key,
|
|
114
135
|
class: "widget-group"
|
|
115
136
|
}, [
|
|
116
|
-
|
|
137
|
+
n(
|
|
117
138
|
"div",
|
|
118
|
-
|
|
119
|
-
|
|
139
|
+
A,
|
|
140
|
+
y(t.name),
|
|
120
141
|
1
|
|
121
142
|
/* TEXT */
|
|
122
143
|
),
|
|
123
|
-
t.widget ? (l(),
|
|
144
|
+
t.widget ? (l(), K(o($), {
|
|
124
145
|
key: 0,
|
|
125
146
|
list: t.widget,
|
|
126
147
|
class: "widget-list-drag",
|
|
@@ -128,22 +149,22 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
128
149
|
group: { name: "form", pull: "clone", put: !1 },
|
|
129
150
|
sort: !1,
|
|
130
151
|
options: { animation: 150 },
|
|
131
|
-
clone:
|
|
132
|
-
onStart: e[1] || (e[1] = (
|
|
133
|
-
onEnd: e[2] || (e[2] = (
|
|
152
|
+
clone: z,
|
|
153
|
+
onStart: e[1] || (e[1] = (i) => o(c)(!0)),
|
|
154
|
+
onEnd: e[2] || (e[2] = (i) => o(c)(!1))
|
|
134
155
|
}, {
|
|
135
|
-
item: r(({ element:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
a(o(
|
|
140
|
-
icon:
|
|
156
|
+
item: r(({ element: i }) => [
|
|
157
|
+
n("div", H, [
|
|
158
|
+
n("div", P, [
|
|
159
|
+
i.icon ? (l(), m("div", Q, [
|
|
160
|
+
a(o(V), {
|
|
161
|
+
icon: i.icon
|
|
141
162
|
}, null, 8, ["icon"])
|
|
142
163
|
])) : p("v-if", !0),
|
|
143
|
-
|
|
164
|
+
n(
|
|
144
165
|
"div",
|
|
145
|
-
|
|
146
|
-
|
|
166
|
+
X,
|
|
167
|
+
y(i.title),
|
|
147
168
|
1
|
|
148
169
|
/* TEXT */
|
|
149
170
|
)
|
|
@@ -161,34 +182,34 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
161
182
|
2
|
|
162
183
|
/* CLASS */
|
|
163
184
|
),
|
|
164
|
-
|
|
185
|
+
n(
|
|
165
186
|
"div",
|
|
166
187
|
{
|
|
167
|
-
class: u(o(
|
|
188
|
+
class: u(o(I)())
|
|
168
189
|
},
|
|
169
190
|
[
|
|
170
|
-
a(o(
|
|
171
|
-
list: o(
|
|
191
|
+
a(o($), {
|
|
192
|
+
list: o(O),
|
|
172
193
|
class: "template-list-drag",
|
|
173
194
|
"item-key": "key",
|
|
174
195
|
group: { name: "form", pull: "clone", put: !1 },
|
|
175
196
|
sort: !1,
|
|
176
197
|
options: { animation: 150 },
|
|
177
|
-
clone:
|
|
178
|
-
onStart: e[3] || (e[3] = (t) => o(
|
|
179
|
-
onEnd: e[4] || (e[4] = (t) => o(
|
|
198
|
+
clone: F,
|
|
199
|
+
onStart: e[3] || (e[3] = (t) => o(c)(!0)),
|
|
200
|
+
onEnd: e[4] || (e[4] = (t) => o(c)(!1))
|
|
180
201
|
}, {
|
|
181
202
|
item: r(({ element: t }) => [
|
|
182
|
-
|
|
183
|
-
t.icon ? (l(),
|
|
184
|
-
a(o(
|
|
203
|
+
n("div", Y, [
|
|
204
|
+
t.icon ? (l(), m("div", Z, [
|
|
205
|
+
a(o(V), {
|
|
185
206
|
icon: t.icon
|
|
186
207
|
}, null, 8, ["icon"])
|
|
187
208
|
])) : p("v-if", !0),
|
|
188
|
-
|
|
209
|
+
n(
|
|
189
210
|
"div",
|
|
190
|
-
|
|
191
|
-
|
|
211
|
+
ee,
|
|
212
|
+
y(t.name),
|
|
192
213
|
1
|
|
193
214
|
/* TEXT */
|
|
194
215
|
)
|
|
@@ -225,5 +246,5 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
225
246
|
}
|
|
226
247
|
});
|
|
227
248
|
export {
|
|
228
|
-
|
|
249
|
+
ue as default
|
|
229
250
|
};
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as V, ref as v, nextTick as z, toRaw as A, openBlock as h, createElementBlock as C, normalizeClass as c, unref as e, createElementVNode as o, createVNode as s, withCtx as i, createCommentVNode as f, renderSlot as k, withDirectives as x, vShow as b } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { Tooltip as D, Form as R } from "ant-design-vue";
|
|
4
|
-
import
|
|
5
|
-
import { useInjectDragContext as
|
|
3
|
+
import { Modal as E, Tooltip as D, Form as R } from "ant-design-vue";
|
|
4
|
+
import j from "vuedraggable";
|
|
5
|
+
import { useInjectDragContext as B, useInjectDesignContext as J } from "../context/design.mjs";
|
|
6
6
|
import "./panel/panel-item.vue2.mjs";
|
|
7
|
-
import
|
|
7
|
+
import O from "./base/json-preview.vue.mjs";
|
|
8
8
|
import "./index.mjs";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as M } from "../hooks/use-namespace/index.mjs";
|
|
10
10
|
import S from "./form-icon.vue2.mjs";
|
|
11
11
|
import P from "./panel/panel-item.vue.mjs";
|
|
12
12
|
const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel" }, K = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "prompt"
|
|
15
|
-
}, L = { class: "form-item" },
|
|
15
|
+
}, L = { class: "form-item" }, Q = { class: "content-editor" }, ie = /* @__PURE__ */ V({
|
|
16
16
|
name: "FormPanel",
|
|
17
17
|
__name: "form-panel",
|
|
18
|
-
setup(
|
|
19
|
-
const p = v({}), { isDrag: w } =
|
|
18
|
+
setup(U) {
|
|
19
|
+
const p = v({}), { isDrag: w } = B(), d = v(!1), a = J(), { fields: r } = a;
|
|
20
20
|
function y() {
|
|
21
|
-
d.value = !d.value,
|
|
21
|
+
d.value = !d.value, z(() => {
|
|
22
22
|
p.value = a.getFormSchema();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function I(l, t) {
|
|
29
|
-
const n = E(l), { oldIndex: V } = t, m = n[V];
|
|
25
|
+
const { b: F, e: u, em: g } = M("panel");
|
|
26
|
+
function $(l, t) {
|
|
27
|
+
const n = A(l), { oldIndex: T } = t, m = n[T];
|
|
30
28
|
if (m) {
|
|
31
29
|
const { shared: _ } = a;
|
|
32
30
|
_.draggedContext.key = m.key, _.draggedContext.field = m;
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
|
-
async function
|
|
33
|
+
async function I() {
|
|
36
34
|
const { shared: l } = a, { field: t } = l.draggedContext, n = {
|
|
37
35
|
source: t,
|
|
38
36
|
traget: r.value,
|
|
@@ -40,10 +38,24 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
40
38
|
};
|
|
41
39
|
a.hooks.syncDragAdd.call(n), a.setCheckedField(t);
|
|
42
40
|
}
|
|
43
|
-
|
|
41
|
+
function N() {
|
|
42
|
+
E.confirm({
|
|
43
|
+
title: "提示?",
|
|
44
|
+
content: "确定要清空所有字段吗?",
|
|
45
|
+
okText: "确定",
|
|
46
|
+
cancelText: "取消",
|
|
47
|
+
onOk() {
|
|
48
|
+
a.clearFields();
|
|
49
|
+
},
|
|
50
|
+
onCancel() {
|
|
51
|
+
console.log("Cancel");
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return (l, t) => (h(), C(
|
|
44
56
|
"div",
|
|
45
57
|
{
|
|
46
|
-
class: c(e(
|
|
58
|
+
class: c(e(F)())
|
|
47
59
|
},
|
|
48
60
|
[
|
|
49
61
|
o(
|
|
@@ -68,7 +80,7 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
68
80
|
name: "delete1",
|
|
69
81
|
class: c(e(g)("toolbar", "icon")),
|
|
70
82
|
size: 18,
|
|
71
|
-
onClick:
|
|
83
|
+
onClick: N
|
|
72
84
|
}, null, 8, ["class"])
|
|
73
85
|
]),
|
|
74
86
|
_: 1
|
|
@@ -99,7 +111,7 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
99
111
|
<FormIcon name="mobile" /> `)
|
|
100
112
|
]),
|
|
101
113
|
o("div", G, [
|
|
102
|
-
|
|
114
|
+
k(l.$slots, "toolbar")
|
|
103
115
|
])
|
|
104
116
|
],
|
|
105
117
|
2
|
|
@@ -112,18 +124,18 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
112
124
|
class: c(e(u)("content"))
|
|
113
125
|
},
|
|
114
126
|
[
|
|
115
|
-
|
|
127
|
+
x(o(
|
|
116
128
|
"div",
|
|
117
129
|
H,
|
|
118
130
|
[
|
|
119
|
-
!e(w) && e(r).length === 0 ? (h(),
|
|
131
|
+
!e(w) && e(r).length === 0 ? (h(), C("div", K, " 👈 请在左侧选择控件并拖至此处 ")) : f("v-if", !0),
|
|
120
132
|
s(e(R), {
|
|
121
133
|
autocomplete: "off",
|
|
122
134
|
class: "design-from",
|
|
123
135
|
"label-align": "left"
|
|
124
136
|
}, {
|
|
125
137
|
default: i(() => [
|
|
126
|
-
s(e(
|
|
138
|
+
s(e(j), {
|
|
127
139
|
class: "drag-from",
|
|
128
140
|
list: e(r),
|
|
129
141
|
group: { name: "form" },
|
|
@@ -131,12 +143,12 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
131
143
|
sort: !0,
|
|
132
144
|
"item-key": "id",
|
|
133
145
|
"chosen-class": "choose",
|
|
134
|
-
onStart: t[0] || (t[0] = (n) =>
|
|
135
|
-
onAdd:
|
|
146
|
+
onStart: t[0] || (t[0] = (n) => $(e(r), n)),
|
|
147
|
+
onAdd: I
|
|
136
148
|
}, {
|
|
137
149
|
item: i(({ element: n }) => [
|
|
138
150
|
o("div", L, [
|
|
139
|
-
|
|
151
|
+
k(l.$slots, `panel-${n.key}`, {}, () => [
|
|
140
152
|
s(P, {
|
|
141
153
|
field: n,
|
|
142
154
|
space: e(r)
|
|
@@ -155,18 +167,18 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
155
167
|
512
|
|
156
168
|
/* NEED_PATCH */
|
|
157
169
|
), [
|
|
158
|
-
[
|
|
170
|
+
[b, !d.value]
|
|
159
171
|
]),
|
|
160
|
-
|
|
172
|
+
x(o(
|
|
161
173
|
"div",
|
|
162
|
-
|
|
174
|
+
Q,
|
|
163
175
|
[
|
|
164
|
-
s(
|
|
176
|
+
s(O, { data: p.value }, null, 8, ["data"])
|
|
165
177
|
],
|
|
166
178
|
512
|
|
167
179
|
/* NEED_PATCH */
|
|
168
180
|
), [
|
|
169
|
-
[
|
|
181
|
+
[b, d.value]
|
|
170
182
|
])
|
|
171
183
|
],
|
|
172
184
|
2
|
|
@@ -179,5 +191,5 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
179
191
|
}
|
|
180
192
|
});
|
|
181
193
|
export {
|
|
182
|
-
|
|
194
|
+
ie as default
|
|
183
195
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Input as
|
|
1
|
+
import { Input as t, Textarea as o, InputNumber as i } from "ant-design-vue";
|
|
2
2
|
import "./widget/object.vue.mjs";
|
|
3
3
|
import { panelWarpper as r } from "./panel-wrapper.mjs";
|
|
4
4
|
import "./widget/select.vue.mjs";
|
|
@@ -7,26 +7,29 @@ import "./widget/date-range.vue.mjs";
|
|
|
7
7
|
import "./widget/date-single.vue.mjs";
|
|
8
8
|
import "./widget/kit.vue.mjs";
|
|
9
9
|
import "./widget/array-table.vue.mjs";
|
|
10
|
-
import
|
|
11
|
-
import p from "./widget/
|
|
10
|
+
import "./widget/grid.vue.mjs";
|
|
11
|
+
import p from "./widget/select.vue2.mjs";
|
|
12
|
+
import e from "./widget/object.vue2.mjs";
|
|
12
13
|
import a from "./widget/date-range.vue2.mjs";
|
|
13
14
|
import n from "./widget/date-single.vue2.mjs";
|
|
14
15
|
import f from "./widget/array-card.vue2.mjs";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
16
|
+
import m from "./widget/kit.vue2.mjs";
|
|
17
|
+
import _ from "./widget/array-table.vue2.mjs";
|
|
18
|
+
import c from "./widget/grid.vue2.mjs";
|
|
19
|
+
const s = r(t), k = r(o), u = r(i), z = {
|
|
18
20
|
"k-input": s,
|
|
19
|
-
"k-textarea":
|
|
20
|
-
"k-input-number":
|
|
21
|
-
"k-select":
|
|
22
|
-
"k-object":
|
|
21
|
+
"k-textarea": k,
|
|
22
|
+
"k-input-number": u,
|
|
23
|
+
"k-select": p,
|
|
24
|
+
"k-object": e,
|
|
23
25
|
"k-date-range": a,
|
|
24
26
|
"k-date-single": n,
|
|
25
27
|
"k-array-card": f,
|
|
26
|
-
"k-overtime":
|
|
27
|
-
"k-leave":
|
|
28
|
-
"k-table":
|
|
28
|
+
"k-overtime": m,
|
|
29
|
+
"k-leave": m,
|
|
30
|
+
"k-table": _,
|
|
31
|
+
"k-grid": c
|
|
29
32
|
};
|
|
30
33
|
export {
|
|
31
|
-
|
|
34
|
+
z as widgetPanels
|
|
32
35
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { defineComponent as w, toRaw as b, openBlock as l, createElementBlock as g, normalizeClass as p, unref as i, createElementVNode as c, toDisplayString as v, createVNode as f, mergeProps as D, withCtx as m, Fragment as S, renderList as A, createBlock as I, renderSlot as R } from "vue";
|
|
2
|
+
import _ from "vuedraggable";
|
|
3
|
+
import { message as B, Row as N, Col as u } from "ant-design-vue";
|
|
4
|
+
import "../../../index.mjs";
|
|
5
|
+
import "../../../internal.mjs";
|
|
6
|
+
import { useNamespace as h } from "../../../hooks/use-namespace/index.mjs";
|
|
7
|
+
import { useInjectDesignContext as $ } from "../../../context/design.mjs";
|
|
8
|
+
import E from "../panel-item.vue.mjs";
|
|
9
|
+
const V = { class: "form-item" }, J = /* @__PURE__ */ w({
|
|
10
|
+
__name: "grid",
|
|
11
|
+
props: {
|
|
12
|
+
field: {}
|
|
13
|
+
},
|
|
14
|
+
setup(a) {
|
|
15
|
+
const { b: x } = h("grid-widget"), { b: k } = h("panel-drag"), d = $();
|
|
16
|
+
function y(o, r) {
|
|
17
|
+
const n = b(o), { oldIndex: s } = r, e = n[s];
|
|
18
|
+
if (e) {
|
|
19
|
+
const { shared: t } = d;
|
|
20
|
+
t.draggedContext.key = e.key, t.draggedContext.field = e;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function C() {
|
|
24
|
+
const { shared: o } = d, { field: r } = o.draggedContext, n = {
|
|
25
|
+
source: r,
|
|
26
|
+
traget: a.field.children,
|
|
27
|
+
region: "k-grid"
|
|
28
|
+
};
|
|
29
|
+
if (d.hooks.syncDragAdd.call(n), !d.dragAddResult.every((e) => e)) {
|
|
30
|
+
const e = a.field.children.findIndex((t) => t.id === r.id);
|
|
31
|
+
e !== -1 && (a.field.children.splice(e, 1), B.warning("不能将该控件拖拽到列表容器中"));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return (o, r) => (l(), g(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
class: p(i(x)())
|
|
38
|
+
},
|
|
39
|
+
[
|
|
40
|
+
c(
|
|
41
|
+
"div",
|
|
42
|
+
null,
|
|
43
|
+
v(o.field.title),
|
|
44
|
+
1
|
|
45
|
+
/* TEXT */
|
|
46
|
+
),
|
|
47
|
+
f(
|
|
48
|
+
i(N),
|
|
49
|
+
D(i(u)["x-component-props"], { class: "grid-row" }),
|
|
50
|
+
{
|
|
51
|
+
default: m(() => [
|
|
52
|
+
(l(!0), g(
|
|
53
|
+
S,
|
|
54
|
+
null,
|
|
55
|
+
A(o.field.children, (n, s) => {
|
|
56
|
+
var e;
|
|
57
|
+
return l(), I(i(u), {
|
|
58
|
+
key: s,
|
|
59
|
+
span: ((e = n["x-component-props"]) == null ? void 0 : e.span) || 12,
|
|
60
|
+
class: "grid-col"
|
|
61
|
+
}, {
|
|
62
|
+
default: m(() => [
|
|
63
|
+
f(i(_), {
|
|
64
|
+
list: n.children,
|
|
65
|
+
group: { name: "form" },
|
|
66
|
+
animation: 300,
|
|
67
|
+
sort: !0,
|
|
68
|
+
class: p(i(k)()),
|
|
69
|
+
"item-key": "id",
|
|
70
|
+
"chosen-class": "choose",
|
|
71
|
+
onStart: (t) => y(n.children, t),
|
|
72
|
+
onAdd: C
|
|
73
|
+
}, {
|
|
74
|
+
item: m(({ element: t }) => [
|
|
75
|
+
c("div", V, [
|
|
76
|
+
R(o.$slots, `panel-${t.key}`, {}, () => [
|
|
77
|
+
f(i(E), {
|
|
78
|
+
field: t,
|
|
79
|
+
space: n.children
|
|
80
|
+
}, null, 8, ["field", "space"])
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
]),
|
|
84
|
+
_: 2
|
|
85
|
+
/* DYNAMIC */
|
|
86
|
+
}, 1032, ["list", "class", "onStart"])
|
|
87
|
+
]),
|
|
88
|
+
_: 2
|
|
89
|
+
/* DYNAMIC */
|
|
90
|
+
}, 1032, ["span"]);
|
|
91
|
+
}),
|
|
92
|
+
128
|
|
93
|
+
/* KEYED_FRAGMENT */
|
|
94
|
+
))
|
|
95
|
+
]),
|
|
96
|
+
_: 3
|
|
97
|
+
/* FORWARDED */
|
|
98
|
+
},
|
|
99
|
+
16
|
|
100
|
+
/* FULL_PROPS */
|
|
101
|
+
),
|
|
102
|
+
r[0] || (r[0] = c(
|
|
103
|
+
"div",
|
|
104
|
+
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
105
|
+
" ☝ 拖拽控件到容器内部 ",
|
|
106
|
+
-1
|
|
107
|
+
/* CACHED */
|
|
108
|
+
))
|
|
109
|
+
],
|
|
110
|
+
2
|
|
111
|
+
/* CLASS */
|
|
112
|
+
));
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
J as default
|
|
117
|
+
};
|