@king-one/form-design 0.0.34 → 0.0.35
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 +10 -9
- package/dist/es/src/components/form-panel.vue.mjs +56 -55
- package/dist/es/src/components/panel/panel-item.vue.mjs +38 -36
- package/dist/es/src/components/panel/widget/array-table.vue2.mjs +31 -29
- package/dist/es/src/components/panel/widget/grid.vue2.mjs +33 -31
- package/dist/es/src/components/panel/widget/object.vue2.mjs +18 -16
- package/dist/es/src/config/index.mjs +29 -7
- package/dist/es/src/effects/effect-dict.mjs +1 -0
- package/dist/es/src/effects/onEffects.mjs +8 -7
- package/dist/es/src/hooks/index.mjs +6 -4
- package/dist/es/src/hooks/use-actions.mjs +20 -0
- package/dist/es/src/index.mjs +9 -8
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/form-panel.vue.js +2 -2
- package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
- package/dist/lib/src/components/panel/widget/array-table.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/grid.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
- package/dist/lib/src/config/index.js +2 -2
- package/dist/lib/src/effects/effect-dict.js +1 -1
- package/dist/lib/src/effects/onEffects.js +1 -1
- package/dist/lib/src/hooks/index.js +1 -1
- package/dist/lib/src/hooks/use-actions.js +1 -0
- package/dist/lib/src/index.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/src/effects/effect-dict.d.ts +1 -0
- package/dist/types/src/effects/onEffects.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/use-actions.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/es/index.mjs
CHANGED
|
@@ -4,22 +4,23 @@ import { default as a } from "./src/components/panel/panel-item.vue.mjs";
|
|
|
4
4
|
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
|
-
import { default as
|
|
8
|
-
import { jsonToSchema as
|
|
9
|
-
import { BaseSchema as
|
|
10
|
-
import {
|
|
7
|
+
import { default as h } from "./src/components/props/form-config.vue.mjs";
|
|
8
|
+
import { jsonToSchema as u } from "./src/utils/schema.mjs";
|
|
9
|
+
import { BaseSchema as d, ExtendSchema as C, LayoutSchema as D, tempSchema as F } from "./src/config/index.mjs";
|
|
10
|
+
import { onDesignChange as I, onDesignFieldChange as j, onDesignInit as y } from "./src/effects/onEffects.mjs";
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
d as BaseSchema,
|
|
13
13
|
t as Carousel,
|
|
14
14
|
i as CreateFormDesign,
|
|
15
15
|
C as ExtendSchema,
|
|
16
|
-
|
|
16
|
+
h as FormConfig,
|
|
17
17
|
p as FormDesign,
|
|
18
18
|
a as FormPanelItem,
|
|
19
19
|
D as LayoutSchema,
|
|
20
|
-
|
|
21
|
-
I as
|
|
22
|
-
j as
|
|
20
|
+
u as jsonToSchema,
|
|
21
|
+
I as onDesignChange,
|
|
22
|
+
j as onDesignFieldChange,
|
|
23
|
+
y as onDesignInit,
|
|
23
24
|
F as tempSchema,
|
|
24
25
|
f as useInjectDesignContext
|
|
25
26
|
};
|
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as z, ref as v, nextTick as E, toRaw as R, openBlock as h, createElementBlock as C, normalizeClass as r, unref as e, createElementVNode as t, 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 { Modal as
|
|
4
|
-
import
|
|
5
|
-
import { useInjectDragContext as
|
|
3
|
+
import { Modal as j, Tooltip as D, Form as B } from "ant-design-vue";
|
|
4
|
+
import J from "vuedraggable";
|
|
5
|
+
import { useInjectDragContext as O, useInjectDesignContext as M } from "../context/design.mjs";
|
|
6
6
|
import "./panel/panel-item.vue2.mjs";
|
|
7
|
-
import
|
|
7
|
+
import P from "./base/json-preview.vue.mjs";
|
|
8
8
|
import "./index.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { useDesignActions as q } from "../hooks/use-actions.mjs";
|
|
10
|
+
import { useNamespace as G } from "../hooks/use-namespace/index.mjs";
|
|
10
11
|
import S from "./form-icon.vue2.mjs";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
12
|
+
import H from "./panel/panel-item.vue.mjs";
|
|
13
|
+
const K = { class: "left" }, L = { class: "right" }, Q = { class: "content-panel" }, U = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "prompt"
|
|
15
|
-
},
|
|
16
|
+
}, W = { class: "form-item" }, X = { class: "content-editor" }, me = /* @__PURE__ */ z({
|
|
16
17
|
name: "FormPanel",
|
|
17
18
|
__name: "form-panel",
|
|
18
|
-
setup(
|
|
19
|
-
const p = v({}), { isDrag: w } =
|
|
20
|
-
function
|
|
21
|
-
d.value = !d.value,
|
|
19
|
+
setup(Y) {
|
|
20
|
+
const p = v({}), { isDrag: w } = O(), d = v(!1), a = M(), { fields: c } = a, { dragAddAction: y, clearFieldsAction: A } = q(a);
|
|
21
|
+
function F() {
|
|
22
|
+
d.value = !d.value, E(() => {
|
|
22
23
|
p.value = a.getFormSchema();
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
const { b:
|
|
26
|
-
function
|
|
27
|
-
const n =
|
|
26
|
+
const { b: $, e: u, em: g } = G("panel");
|
|
27
|
+
function I(l, o) {
|
|
28
|
+
const n = R(l), { oldIndex: V } = o, m = n[V];
|
|
28
29
|
if (m) {
|
|
29
30
|
const { shared: _ } = a;
|
|
30
31
|
_.draggedContext.key = m.key, _.draggedContext.field = m;
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
async function
|
|
34
|
-
const { shared: l } = a, { field:
|
|
35
|
-
source:
|
|
36
|
-
traget:
|
|
34
|
+
async function N() {
|
|
35
|
+
const { shared: l } = a, { field: o } = l.draggedContext, n = {
|
|
36
|
+
source: o,
|
|
37
|
+
traget: c.value,
|
|
37
38
|
region: "form-panel"
|
|
38
39
|
};
|
|
39
|
-
a.hooks.syncDragAdd.call(n), a.setCheckedField(
|
|
40
|
+
a.hooks.syncDragAdd.call(n), a.setCheckedField(o), y();
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
42
|
+
function T() {
|
|
43
|
+
j.confirm({
|
|
43
44
|
title: "提示?",
|
|
44
45
|
content: "确定要清空所有字段吗?",
|
|
45
46
|
okText: "确定",
|
|
46
47
|
cancelText: "取消",
|
|
47
48
|
onOk() {
|
|
48
|
-
|
|
49
|
+
A();
|
|
49
50
|
},
|
|
50
51
|
onCancel() {
|
|
51
52
|
console.log("Cancel");
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
return (l,
|
|
56
|
+
return (l, o) => (h(), C(
|
|
56
57
|
"div",
|
|
57
58
|
{
|
|
58
|
-
class:
|
|
59
|
+
class: r(e($)())
|
|
59
60
|
},
|
|
60
61
|
[
|
|
61
|
-
|
|
62
|
+
t(
|
|
62
63
|
"div",
|
|
63
64
|
{
|
|
64
|
-
class:
|
|
65
|
+
class: r(e(u)("toolbar"))
|
|
65
66
|
},
|
|
66
67
|
[
|
|
67
|
-
|
|
68
|
+
t("div", K, [
|
|
68
69
|
s(e(D), { placement: "bottom" }, {
|
|
69
|
-
title: i(() =>
|
|
70
|
-
|
|
70
|
+
title: i(() => o[1] || (o[1] = [
|
|
71
|
+
t(
|
|
71
72
|
"span",
|
|
72
73
|
null,
|
|
73
74
|
"全部删除",
|
|
@@ -78,17 +79,17 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
78
79
|
default: i(() => [
|
|
79
80
|
s(e(S), {
|
|
80
81
|
name: "delete1",
|
|
81
|
-
class:
|
|
82
|
+
class: r(e(g)("toolbar", "icon")),
|
|
82
83
|
size: 18,
|
|
83
|
-
onClick:
|
|
84
|
+
onClick: T
|
|
84
85
|
}, null, 8, ["class"])
|
|
85
86
|
]),
|
|
86
87
|
_: 1
|
|
87
88
|
/* STABLE */
|
|
88
89
|
}),
|
|
89
90
|
s(e(D), { placement: "bottom" }, {
|
|
90
|
-
title: i(() =>
|
|
91
|
-
|
|
91
|
+
title: i(() => o[2] || (o[2] = [
|
|
92
|
+
t(
|
|
92
93
|
"span",
|
|
93
94
|
null,
|
|
94
95
|
"查看JSON Schema",
|
|
@@ -99,9 +100,9 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
99
100
|
default: i(() => [
|
|
100
101
|
s(e(S), {
|
|
101
102
|
name: "code",
|
|
102
|
-
class:
|
|
103
|
+
class: r(e(g)("toolbar", "icon")),
|
|
103
104
|
size: 18,
|
|
104
|
-
onClick:
|
|
105
|
+
onClick: F
|
|
105
106
|
}, null, 8, ["class"])
|
|
106
107
|
]),
|
|
107
108
|
_: 1
|
|
@@ -110,7 +111,7 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
110
111
|
f(` <FormIcon name="desktop" />
|
|
111
112
|
<FormIcon name="mobile" /> `)
|
|
112
113
|
]),
|
|
113
|
-
|
|
114
|
+
t("div", L, [
|
|
114
115
|
k(l.$slots, "toolbar")
|
|
115
116
|
])
|
|
116
117
|
],
|
|
@@ -118,40 +119,40 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
118
119
|
/* CLASS */
|
|
119
120
|
),
|
|
120
121
|
f(' ref="contentTelRef" '),
|
|
121
|
-
|
|
122
|
+
t(
|
|
122
123
|
"div",
|
|
123
124
|
{
|
|
124
|
-
class:
|
|
125
|
+
class: r(e(u)("content"))
|
|
125
126
|
},
|
|
126
127
|
[
|
|
127
|
-
x(
|
|
128
|
+
x(t(
|
|
128
129
|
"div",
|
|
129
|
-
|
|
130
|
+
Q,
|
|
130
131
|
[
|
|
131
|
-
!e(w) && e(
|
|
132
|
-
s(e(
|
|
132
|
+
!e(w) && e(c).length === 0 ? (h(), C("div", U, " 👈 请在左侧选择控件并拖至此处 ")) : f("v-if", !0),
|
|
133
|
+
s(e(B), {
|
|
133
134
|
autocomplete: "off",
|
|
134
135
|
class: "design-from",
|
|
135
136
|
"label-align": "left"
|
|
136
137
|
}, {
|
|
137
138
|
default: i(() => [
|
|
138
|
-
s(e(
|
|
139
|
+
s(e(J), {
|
|
139
140
|
class: "drag-from",
|
|
140
|
-
list: e(
|
|
141
|
+
list: e(c),
|
|
141
142
|
group: { name: "form" },
|
|
142
143
|
animation: 300,
|
|
143
144
|
sort: !0,
|
|
144
145
|
"item-key": "id",
|
|
145
146
|
"chosen-class": "choose",
|
|
146
|
-
onStart:
|
|
147
|
-
onAdd:
|
|
147
|
+
onStart: o[0] || (o[0] = (n) => I(e(c), n)),
|
|
148
|
+
onAdd: N
|
|
148
149
|
}, {
|
|
149
150
|
item: i(({ element: n }) => [
|
|
150
|
-
|
|
151
|
+
t("div", W, [
|
|
151
152
|
k(l.$slots, `panel-${n.key}`, {}, () => [
|
|
152
|
-
s(
|
|
153
|
+
s(H, {
|
|
153
154
|
field: n,
|
|
154
|
-
space: e(
|
|
155
|
+
space: e(c)
|
|
155
156
|
}, null, 8, ["field", "space"])
|
|
156
157
|
])
|
|
157
158
|
])
|
|
@@ -169,11 +170,11 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
169
170
|
), [
|
|
170
171
|
[b, !d.value]
|
|
171
172
|
]),
|
|
172
|
-
x(
|
|
173
|
+
x(t(
|
|
173
174
|
"div",
|
|
174
|
-
|
|
175
|
+
X,
|
|
175
176
|
[
|
|
176
|
-
s(
|
|
177
|
+
s(P, { data: p.value }, null, 8, ["data"])
|
|
177
178
|
],
|
|
178
179
|
512
|
|
179
180
|
/* NEED_PATCH */
|
|
@@ -191,5 +192,5 @@ const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel
|
|
|
191
192
|
}
|
|
192
193
|
});
|
|
193
194
|
export {
|
|
194
|
-
|
|
195
|
+
me as default
|
|
195
196
|
};
|
|
@@ -1,64 +1,66 @@
|
|
|
1
|
-
import { defineComponent as V, computed as g, openBlock as
|
|
2
|
-
import { FormItem as
|
|
1
|
+
import { defineComponent as V, computed as g, openBlock as o, createElementBlock as b, normalizeClass as p, withModifiers as j, unref as t, createBlock as a, resolveDynamicComponent as w, withCtx as D, createElementVNode as $, createCommentVNode as c, createVNode as x, defineAsyncComponent as M } from "vue";
|
|
2
|
+
import { FormItem as O, Tooltip as S } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { useInjectDesignContext as
|
|
4
|
+
import { useInjectDesignContext as W } from "../../context/design.mjs";
|
|
5
5
|
import "../index.mjs";
|
|
6
|
-
import
|
|
6
|
+
import "../../hooks/index.mjs";
|
|
7
|
+
import { useNamespace as q } from "../../hooks/use-namespace/index.mjs";
|
|
7
8
|
import m from "../form-icon.vue2.mjs";
|
|
8
|
-
|
|
9
|
+
import { useDesignActions as G } from "../../hooks/use-actions.mjs";
|
|
10
|
+
const H = {
|
|
9
11
|
key: 2,
|
|
10
12
|
class: "icons"
|
|
11
|
-
},
|
|
13
|
+
}, _ = /* @__PURE__ */ V({
|
|
12
14
|
__name: "panel-item",
|
|
13
15
|
props: {
|
|
14
16
|
field: {},
|
|
15
17
|
space: {},
|
|
16
18
|
hideTitle: { type: Boolean }
|
|
17
19
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
+
setup(z) {
|
|
21
|
+
const n = z, { b: B, e: u, m: v } = q("panel-item"), d = W(), { checkedField: r, shared: F } = d, { deleteFieldAction: I } = G(d);
|
|
20
22
|
function N(e, i = {}) {
|
|
21
23
|
return Object.entries(e).forEach(([l, s]) => {
|
|
22
|
-
typeof s == "function" ? i[l] =
|
|
24
|
+
typeof s == "function" ? i[l] = M(s) : i[l] = s;
|
|
23
25
|
}), i;
|
|
24
26
|
}
|
|
25
|
-
const k = N(
|
|
26
|
-
function
|
|
27
|
-
|
|
27
|
+
const k = N(F.panelWidgets);
|
|
28
|
+
function A(e) {
|
|
29
|
+
d.setCheckedField(e), I();
|
|
28
30
|
}
|
|
29
31
|
const f = g(() => {
|
|
30
32
|
var i, l;
|
|
31
|
-
return ((l = (i =
|
|
32
|
-
}),
|
|
33
|
+
return ((l = (i = n.field["x-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
|
|
34
|
+
}), E = g(() => {
|
|
33
35
|
var i;
|
|
34
|
-
const e = [
|
|
35
|
-
return ((i =
|
|
36
|
+
const e = [B()];
|
|
37
|
+
return ((i = r.value) == null ? void 0 : i.id) === n.field.id && e.push(v("active")), f.value && e.push(v("error")), e;
|
|
36
38
|
});
|
|
37
39
|
function T() {
|
|
38
|
-
if (!
|
|
40
|
+
if (!d.hooks.beforeDelete.call(n.field))
|
|
39
41
|
return;
|
|
40
|
-
const i =
|
|
41
|
-
i !== -1 &&
|
|
42
|
+
const i = n.space.findIndex((l) => l.id === n.field.id);
|
|
43
|
+
i !== -1 && n.space.splice(i, 1);
|
|
42
44
|
}
|
|
43
45
|
return (e, i) => {
|
|
44
46
|
var l, s, C, h, y;
|
|
45
|
-
return
|
|
47
|
+
return o(), b(
|
|
46
48
|
"div",
|
|
47
49
|
{
|
|
48
|
-
class: p(
|
|
49
|
-
onClick: i[0] || (i[0] = j((
|
|
50
|
+
class: p(E.value),
|
|
51
|
+
onClick: i[0] || (i[0] = j((J) => A(e.field), ["stop"]))
|
|
50
52
|
},
|
|
51
53
|
[
|
|
52
|
-
t(k)[e.field.key] ? (
|
|
54
|
+
t(k)[e.field.key] ? (o(), a(w(t(k)[e.field.key]), {
|
|
53
55
|
key: 0,
|
|
54
56
|
"hide-title": e.hideTitle,
|
|
55
57
|
field: e.field
|
|
56
|
-
}, null, 8, ["hide-title", "field"])) : (
|
|
58
|
+
}, null, 8, ["hide-title", "field"])) : (o(), a(t(O), {
|
|
57
59
|
key: 1,
|
|
58
60
|
class: p(t(u)("form")),
|
|
59
61
|
label: e.field.title
|
|
60
62
|
}, {
|
|
61
|
-
default:
|
|
63
|
+
default: D(() => [
|
|
62
64
|
$(
|
|
63
65
|
"div",
|
|
64
66
|
{
|
|
@@ -72,36 +74,36 @@ const q = {
|
|
|
72
74
|
_: 1
|
|
73
75
|
/* STABLE */
|
|
74
76
|
}, 8, ["class", "label"])),
|
|
75
|
-
((l = t(
|
|
76
|
-
((s = t(
|
|
77
|
+
((l = t(r)) == null ? void 0 : l.id) === e.field.id || f.value ? (o(), b("div", H, [
|
|
78
|
+
((s = t(r)) == null ? void 0 : s.id) === e.field.id ? (o(), a(t(m), {
|
|
77
79
|
key: 0,
|
|
78
80
|
name: "copy",
|
|
79
81
|
class: "panel-icon",
|
|
80
82
|
size: 15
|
|
81
|
-
})) :
|
|
82
|
-
((C = t(
|
|
83
|
+
})) : c("v-if", !0),
|
|
84
|
+
((C = t(r)) == null ? void 0 : C.id) === e.field.id ? (o(), a(t(m), {
|
|
83
85
|
key: 1,
|
|
84
86
|
name: "delete1",
|
|
85
87
|
class: "panel-icon",
|
|
86
88
|
size: 15,
|
|
87
89
|
onClick: T
|
|
88
|
-
})) :
|
|
89
|
-
x(t(
|
|
90
|
+
})) : c("v-if", !0),
|
|
91
|
+
x(t(S), {
|
|
90
92
|
title: (y = (h = e.field["x-design-props"]) == null ? void 0 : h.validate) == null ? void 0 : y.message,
|
|
91
93
|
color: "pink"
|
|
92
94
|
}, {
|
|
93
|
-
default:
|
|
94
|
-
f.value ? (
|
|
95
|
+
default: D(() => [
|
|
96
|
+
f.value ? (o(), a(t(m), {
|
|
95
97
|
key: 0,
|
|
96
98
|
name: "exclamation-circle-filled",
|
|
97
99
|
size: 13,
|
|
98
100
|
class: "panel-exclamation-icon"
|
|
99
|
-
})) :
|
|
101
|
+
})) : c("v-if", !0)
|
|
100
102
|
]),
|
|
101
103
|
_: 1
|
|
102
104
|
/* STABLE */
|
|
103
105
|
}, 8, ["title"])
|
|
104
|
-
])) :
|
|
106
|
+
])) : c("v-if", !0)
|
|
105
107
|
],
|
|
106
108
|
2
|
|
107
109
|
/* CLASS */
|
|
@@ -110,5 +112,5 @@ const q = {
|
|
|
110
112
|
}
|
|
111
113
|
});
|
|
112
114
|
export {
|
|
113
|
-
|
|
115
|
+
_ as default
|
|
114
116
|
};
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as p, openBlock as u, createElementBlock as b, normalizeClass as y, unref as n, createElementVNode as e, createVNode as l, withCtx as h, renderSlot as v, toDisplayString as x } from "vue";
|
|
2
|
+
import A from "vuedraggable";
|
|
3
3
|
import "../../../index.mjs";
|
|
4
4
|
import "../../../internal.mjs";
|
|
5
5
|
import { message as C } from "ant-design-vue";
|
|
6
6
|
import { useInjectDesignContext as k } from "../../../context/design.mjs";
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import
|
|
9
|
-
|
|
7
|
+
import { useNamespace as D } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import { useDesignActions as _ } from "../../../hooks/use-actions.mjs";
|
|
9
|
+
import w from "../panel-item.vue.mjs";
|
|
10
|
+
const I = { class: "array-table-box" }, N = { class: "array-table-drag" }, $ = { class: "form-item" }, B = { class: "table-item" }, E = { class: "array-table-drag-header" }, S = { class: "array-table-drag-content" }, J = /* @__PURE__ */ p({
|
|
10
11
|
name: "ArrayTable",
|
|
11
12
|
__name: "array-table",
|
|
12
13
|
props: {
|
|
13
14
|
field: {}
|
|
14
15
|
},
|
|
15
16
|
setup(d) {
|
|
16
|
-
const s = k(), { b: c } =
|
|
17
|
+
const s = k(), { b: c } = D("array-table"), { dragAddAction: m } = _(s);
|
|
17
18
|
function f() {
|
|
18
|
-
const { shared:
|
|
19
|
+
const { shared: a } = s, { field: t } = a.draggedContext, i = {
|
|
19
20
|
source: t,
|
|
20
21
|
traget: d.field.children,
|
|
21
22
|
region: "k-array-card"
|
|
22
23
|
};
|
|
23
|
-
if (s.hooks.syncDragAdd.call(i), !s.dragAddResult.every((
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
if (s.hooks.syncDragAdd.call(i), !s.dragAddResult.every((r) => r)) {
|
|
25
|
+
const r = d.field.children.findIndex((g) => g.id === t.id);
|
|
26
|
+
r !== -1 && (d.field.children.splice(r, 1), C.warning("不能将该控件拖拽到列表容器中"));
|
|
26
27
|
}
|
|
27
|
-
const o = d.field.children.find((
|
|
28
|
+
const o = d.field.children.find((r) => r.id === t.id);
|
|
28
29
|
if (o) {
|
|
29
|
-
const
|
|
30
|
+
const r = o["x-decorator-props"] || {};
|
|
30
31
|
o["x-decorator-props"] = {
|
|
31
|
-
...
|
|
32
|
+
...r,
|
|
32
33
|
hideTitle: !0
|
|
33
34
|
};
|
|
34
35
|
}
|
|
36
|
+
m();
|
|
35
37
|
}
|
|
36
|
-
return (
|
|
38
|
+
return (a, t) => (u(), b(
|
|
37
39
|
"div",
|
|
38
40
|
{
|
|
39
|
-
class:
|
|
41
|
+
class: y(n(c)())
|
|
40
42
|
},
|
|
41
43
|
[
|
|
42
44
|
t[1] || (t[1] = e(
|
|
@@ -46,7 +48,7 @@ const D = { class: "array-table-box" }, w = { class: "array-table-drag" }, I = {
|
|
|
46
48
|
-1
|
|
47
49
|
/* CACHED */
|
|
48
50
|
)),
|
|
49
|
-
e("div",
|
|
51
|
+
e("div", I, [
|
|
50
52
|
t[0] || (t[0] = e(
|
|
51
53
|
"div",
|
|
52
54
|
{ class: "array-table-left" },
|
|
@@ -57,10 +59,10 @@ const D = { class: "array-table-box" }, w = { class: "array-table-drag" }, I = {
|
|
|
57
59
|
-1
|
|
58
60
|
/* CACHED */
|
|
59
61
|
)),
|
|
60
|
-
e("div",
|
|
61
|
-
n(
|
|
62
|
+
e("div", N, [
|
|
63
|
+
l(n(A), {
|
|
62
64
|
class: "widget-drag",
|
|
63
|
-
list:
|
|
65
|
+
list: a.field.children,
|
|
64
66
|
group: { name: "form", direction: "vertical", removeCloneOnHide: !1 },
|
|
65
67
|
animation: 300,
|
|
66
68
|
sort: !0,
|
|
@@ -68,21 +70,21 @@ const D = { class: "array-table-box" }, w = { class: "array-table-drag" }, I = {
|
|
|
68
70
|
"drag-class": "table-item-drag-class",
|
|
69
71
|
onAdd: f
|
|
70
72
|
}, {
|
|
71
|
-
item:
|
|
72
|
-
e("div",
|
|
73
|
-
|
|
74
|
-
e("div",
|
|
73
|
+
item: h(({ element: i }) => [
|
|
74
|
+
e("div", $, [
|
|
75
|
+
v(a.$slots, `panel-${i.key}`, {}, () => [
|
|
76
|
+
e("div", B, [
|
|
75
77
|
e(
|
|
76
78
|
"div",
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
E,
|
|
80
|
+
x(i.title),
|
|
79
81
|
1
|
|
80
82
|
/* TEXT */
|
|
81
83
|
),
|
|
82
|
-
e("div",
|
|
83
|
-
n(
|
|
84
|
+
e("div", S, [
|
|
85
|
+
l(n(w), {
|
|
84
86
|
field: i,
|
|
85
|
-
space:
|
|
87
|
+
space: a.field.children,
|
|
86
88
|
"hide-title": ""
|
|
87
89
|
}, null, 8, ["field", "space"])
|
|
88
90
|
])
|
|
@@ -109,5 +111,5 @@ const D = { class: "array-table-box" }, w = { class: "array-table-drag" }, I = {
|
|
|
109
111
|
}
|
|
110
112
|
});
|
|
111
113
|
export {
|
|
112
|
-
|
|
114
|
+
J as default
|
|
113
115
|
};
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { message as
|
|
1
|
+
import { defineComponent as A, toRaw as b, openBlock as l, createElementBlock as g, normalizeClass as p, unref as i, createElementVNode as c, toDisplayString as D, createVNode as m, mergeProps as v, withCtx as f, Fragment as S, renderList as I, createBlock as R, renderSlot as _ } from "vue";
|
|
2
|
+
import B from "vuedraggable";
|
|
3
|
+
import { message as N, Row as $, Col as u } from "ant-design-vue";
|
|
4
4
|
import "../../../index.mjs";
|
|
5
5
|
import "../../../internal.mjs";
|
|
6
6
|
import { useNamespace as h } from "../../../hooks/use-namespace/index.mjs";
|
|
7
|
-
import { useInjectDesignContext as
|
|
8
|
-
import
|
|
9
|
-
|
|
7
|
+
import { useInjectDesignContext as E } from "../../../context/design.mjs";
|
|
8
|
+
import { useDesignActions as V } from "../../../hooks/use-actions.mjs";
|
|
9
|
+
import j from "../panel-item.vue.mjs";
|
|
10
|
+
const z = { class: "form-item" }, O = /* @__PURE__ */ A({
|
|
10
11
|
__name: "grid",
|
|
11
12
|
props: {
|
|
12
13
|
field: {}
|
|
13
14
|
},
|
|
14
15
|
setup(a) {
|
|
15
|
-
const { b: x } = h("grid-widget"), { b: k } = h("panel-drag"),
|
|
16
|
-
function
|
|
17
|
-
const n = b(o), { oldIndex:
|
|
16
|
+
const { b: x } = h("grid-widget"), { b: k } = h("panel-drag"), s = E(), { dragAddAction: y } = V(s);
|
|
17
|
+
function C(o, r) {
|
|
18
|
+
const n = b(o), { oldIndex: d } = r, e = n[d];
|
|
18
19
|
if (e) {
|
|
19
|
-
const { shared: t } =
|
|
20
|
+
const { shared: t } = s;
|
|
20
21
|
t.draggedContext.key = e.key, t.draggedContext.field = e;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
const { shared: o } =
|
|
24
|
+
function w() {
|
|
25
|
+
const { shared: o } = s, { field: r } = o.draggedContext, n = {
|
|
25
26
|
source: r,
|
|
26
27
|
traget: a.field.children,
|
|
27
28
|
region: "k-grid"
|
|
28
29
|
};
|
|
29
|
-
if (
|
|
30
|
+
if (s.hooks.syncDragAdd.call(n), !s.dragAddResult.every((e) => e)) {
|
|
30
31
|
const e = a.field.children.findIndex((t) => t.id === r.id);
|
|
31
|
-
e !== -1 && (a.field.children.splice(e, 1),
|
|
32
|
+
e !== -1 && (a.field.children.splice(e, 1), N.warning("不能将该控件拖拽到明细表中"));
|
|
32
33
|
}
|
|
34
|
+
y();
|
|
33
35
|
}
|
|
34
36
|
return (o, r) => (l(), g(
|
|
35
37
|
"div",
|
|
@@ -40,27 +42,27 @@ const V = { class: "form-item" }, J = /* @__PURE__ */ w({
|
|
|
40
42
|
c(
|
|
41
43
|
"div",
|
|
42
44
|
null,
|
|
43
|
-
|
|
45
|
+
D(o.field.title),
|
|
44
46
|
1
|
|
45
47
|
/* TEXT */
|
|
46
48
|
),
|
|
47
|
-
|
|
48
|
-
i(
|
|
49
|
-
|
|
49
|
+
m(
|
|
50
|
+
i($),
|
|
51
|
+
v(i(u)["x-component-props"], { class: "grid-row" }),
|
|
50
52
|
{
|
|
51
|
-
default:
|
|
53
|
+
default: f(() => [
|
|
52
54
|
(l(!0), g(
|
|
53
55
|
S,
|
|
54
56
|
null,
|
|
55
|
-
|
|
57
|
+
I(o.field.children, (n, d) => {
|
|
56
58
|
var e;
|
|
57
|
-
return l(),
|
|
58
|
-
key:
|
|
59
|
+
return l(), R(i(u), {
|
|
60
|
+
key: d,
|
|
59
61
|
span: ((e = n["x-component-props"]) == null ? void 0 : e.span) || 12,
|
|
60
62
|
class: "grid-col"
|
|
61
63
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
64
|
+
default: f(() => [
|
|
65
|
+
m(i(B), {
|
|
64
66
|
list: n.children,
|
|
65
67
|
group: { name: "form" },
|
|
66
68
|
animation: 300,
|
|
@@ -68,13 +70,13 @@ const V = { class: "form-item" }, J = /* @__PURE__ */ w({
|
|
|
68
70
|
class: p(i(k)()),
|
|
69
71
|
"item-key": "id",
|
|
70
72
|
"chosen-class": "choose",
|
|
71
|
-
onStart: (t) =>
|
|
72
|
-
onAdd:
|
|
73
|
+
onStart: (t) => C(n.children, t),
|
|
74
|
+
onAdd: w
|
|
73
75
|
}, {
|
|
74
|
-
item:
|
|
75
|
-
c("div",
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
item: f(({ element: t }) => [
|
|
77
|
+
c("div", z, [
|
|
78
|
+
_(o.$slots, `panel-${t.key}`, {}, () => [
|
|
79
|
+
m(i(j), {
|
|
78
80
|
field: t,
|
|
79
81
|
space: n.children
|
|
80
82
|
}, null, 8, ["field", "space"])
|
|
@@ -113,5 +115,5 @@ const V = { class: "form-item" }, J = /* @__PURE__ */ w({
|
|
|
113
115
|
}
|
|
114
116
|
});
|
|
115
117
|
export {
|
|
116
|
-
|
|
118
|
+
O as default
|
|
117
119
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as u, toRaw as h, openBlock as A, 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
|
|
5
|
+
import { message as D } from "ant-design-vue";
|
|
6
6
|
import { useInjectDesignContext as w } from "../../../context/design.mjs";
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
import
|
|
9
|
-
|
|
7
|
+
import { useNamespace as I } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import { useDesignActions as S } from "../../../hooks/use-actions.mjs";
|
|
9
|
+
import j from "../panel-item.vue.mjs";
|
|
10
|
+
const N = { class: "form-item" }, H = /* @__PURE__ */ u({
|
|
10
11
|
inheritAttrs: !1,
|
|
11
12
|
__name: "object",
|
|
12
13
|
props: {
|
|
13
14
|
field: {}
|
|
14
15
|
},
|
|
15
16
|
setup(s) {
|
|
16
|
-
const i = w(), { b: f } =
|
|
17
|
-
function
|
|
18
|
-
const n =
|
|
17
|
+
const i = w(), { b: f } = I("panel-drag"), { dragAddAction: m } = S(i);
|
|
18
|
+
function g(e, t) {
|
|
19
|
+
const n = h(e), { oldIndex: a } = t, o = n[a];
|
|
19
20
|
if (o) {
|
|
20
21
|
const { shared: d } = i;
|
|
21
22
|
d.draggedContext.key = o.key, d.draggedContext.field = o;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function p() {
|
|
25
26
|
console.log("dragAdd");
|
|
26
27
|
const { shared: e } = i, { field: t } = e.draggedContext, n = {
|
|
27
28
|
source: t,
|
|
@@ -30,10 +31,11 @@ const S = { class: "form-item" }, q = /* @__PURE__ */ p({
|
|
|
30
31
|
};
|
|
31
32
|
if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((o) => o)) {
|
|
32
33
|
const o = s.field.children.findIndex((d) => d.id === t.id);
|
|
33
|
-
o !== -1 && (s.field.children.splice(o, 1),
|
|
34
|
+
o !== -1 && (s.field.children.splice(o, 1), D.warning("不能将该控件拖拽到对象容器中"));
|
|
34
35
|
}
|
|
36
|
+
m();
|
|
35
37
|
}
|
|
36
|
-
return (e, t) => (
|
|
38
|
+
return (e, t) => (A(), k("div", null, [
|
|
37
39
|
r(
|
|
38
40
|
"div",
|
|
39
41
|
null,
|
|
@@ -50,13 +52,13 @@ const S = { class: "form-item" }, q = /* @__PURE__ */ p({
|
|
|
50
52
|
sort: !0,
|
|
51
53
|
"item-key": "id",
|
|
52
54
|
"chosen-class": "choose",
|
|
53
|
-
onStart: t[0] || (t[0] = (n) =>
|
|
54
|
-
onAdd:
|
|
55
|
+
onStart: t[0] || (t[0] = (n) => g(e.field.children, n)),
|
|
56
|
+
onAdd: p
|
|
55
57
|
}, {
|
|
56
58
|
item: C(({ element: n }) => [
|
|
57
|
-
r("div",
|
|
59
|
+
r("div", N, [
|
|
58
60
|
b(e.$slots, `panel-${n.key}`, {}, () => [
|
|
59
|
-
c(l(
|
|
61
|
+
c(l(j), {
|
|
60
62
|
field: n,
|
|
61
63
|
space: e.field.children
|
|
62
64
|
}, null, 8, ["field", "space"])
|
|
@@ -78,5 +80,5 @@ const S = { class: "form-item" }, q = /* @__PURE__ */ p({
|
|
|
78
80
|
}
|
|
79
81
|
});
|
|
80
82
|
export {
|
|
81
|
-
|
|
83
|
+
H as default
|
|
82
84
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { valueTypeMap as e } from "../types.mjs";
|
|
2
|
-
const
|
|
2
|
+
const r = {
|
|
3
3
|
name: "布局组件",
|
|
4
4
|
key: "layout",
|
|
5
5
|
widget: [
|
|
@@ -15,7 +15,7 @@ const o = {
|
|
|
15
15
|
"x-decorator": "Void"
|
|
16
16
|
}
|
|
17
17
|
]
|
|
18
|
-
},
|
|
18
|
+
}, o = {
|
|
19
19
|
name: "基础组件",
|
|
20
20
|
key: "basic",
|
|
21
21
|
widget: [
|
|
@@ -202,6 +202,13 @@ const o = {
|
|
|
202
202
|
},
|
|
203
203
|
name: "date",
|
|
204
204
|
"x-component": "DateRange",
|
|
205
|
+
"x-validator": [
|
|
206
|
+
{
|
|
207
|
+
type: "array",
|
|
208
|
+
required: !0,
|
|
209
|
+
message: "请选择日期范围"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
205
212
|
"x-component-props": {
|
|
206
213
|
valueFormat: "YYYY-MM-DD HH:mm",
|
|
207
214
|
showTime: { format: "HH:mm", minuteStep: 30 },
|
|
@@ -217,8 +224,10 @@ const o = {
|
|
|
217
224
|
name: "hours",
|
|
218
225
|
"x-component": "HalfInputNumber",
|
|
219
226
|
"x-component-props": {
|
|
220
|
-
placeholder: "请输入"
|
|
227
|
+
placeholder: "请输入",
|
|
228
|
+
addonAfter: "小时"
|
|
221
229
|
},
|
|
230
|
+
required: !0,
|
|
222
231
|
"x-validator": [
|
|
223
232
|
{
|
|
224
233
|
validator: `{{const sourceValue = $parent.date
|
|
@@ -236,6 +245,11 @@ const o = {
|
|
|
236
245
|
return true
|
|
237
246
|
}
|
|
238
247
|
}}`
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
type: "number",
|
|
251
|
+
min: 0.5,
|
|
252
|
+
message: "必须大于0.5小时"
|
|
239
253
|
}
|
|
240
254
|
]
|
|
241
255
|
}
|
|
@@ -247,9 +261,17 @@ const o = {
|
|
|
247
261
|
name: "total",
|
|
248
262
|
"x-component": "HalfInputNumber",
|
|
249
263
|
"x-component-props": {
|
|
250
|
-
placeholder: "请输入"
|
|
264
|
+
placeholder: "请输入",
|
|
265
|
+
disabled: !0,
|
|
266
|
+
addonAfter: "小时"
|
|
251
267
|
},
|
|
252
|
-
|
|
268
|
+
"x-validator": [
|
|
269
|
+
{
|
|
270
|
+
type: "number",
|
|
271
|
+
min: 0.5,
|
|
272
|
+
message: "必须大于0.5小时"
|
|
273
|
+
}
|
|
274
|
+
],
|
|
253
275
|
"x-reactions": {
|
|
254
276
|
dependencies: [
|
|
255
277
|
{
|
|
@@ -425,8 +447,8 @@ const o = {
|
|
|
425
447
|
// }
|
|
426
448
|
];
|
|
427
449
|
export {
|
|
428
|
-
|
|
450
|
+
o as BaseSchema,
|
|
429
451
|
a as ExtendSchema,
|
|
430
|
-
|
|
452
|
+
r as LayoutSchema,
|
|
431
453
|
n as tempSchema
|
|
432
454
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { createEffectHook as
|
|
1
|
+
import { createEffectHook as D } from "./effective.mjs";
|
|
2
2
|
import { DesignEffectDict as e } from "./effect-dict.mjs";
|
|
3
|
-
function
|
|
4
|
-
return
|
|
5
|
-
i(...
|
|
3
|
+
function n(o) {
|
|
4
|
+
return D(o, (...t) => (i) => {
|
|
5
|
+
i(...t);
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const r = n(e.ON_DESIGN_INIT), E = n(e.on_DESIGN_CHANGE), s = n(e.ON_DESIGN_FIELD_CHANGE);
|
|
9
9
|
export {
|
|
10
|
-
E as
|
|
11
|
-
|
|
10
|
+
E as onDesignChange,
|
|
11
|
+
s as onDesignFieldChange,
|
|
12
|
+
r as onDesignInit
|
|
12
13
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { defaultNamespace as s, namespaceContextKey as
|
|
1
|
+
import { defaultNamespace as s, namespaceContextKey as t, useGetDerivedNamespace as m, useNamespace as o } from "./use-namespace/index.mjs";
|
|
2
|
+
import { useDesignActions as c } from "./use-actions.mjs";
|
|
2
3
|
export {
|
|
3
4
|
s as defaultNamespace,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
t as namespaceContextKey,
|
|
6
|
+
c as useDesignActions,
|
|
7
|
+
m as useGetDerivedNamespace,
|
|
8
|
+
o as useNamespace
|
|
7
9
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DesignEffectDict as t } from "../effects/effect-dict.mjs";
|
|
2
|
+
function s(n) {
|
|
3
|
+
const e = () => {
|
|
4
|
+
n.notify(t.on_DESIGN_CHANGE);
|
|
5
|
+
};
|
|
6
|
+
return {
|
|
7
|
+
dragAddAction: () => {
|
|
8
|
+
e();
|
|
9
|
+
},
|
|
10
|
+
deleteFieldAction: () => {
|
|
11
|
+
e();
|
|
12
|
+
},
|
|
13
|
+
clearFieldsAction: () => {
|
|
14
|
+
n.clearFields(), e();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
s as useDesignActions
|
|
20
|
+
};
|
package/dist/es/src/index.mjs
CHANGED
|
@@ -2,19 +2,20 @@ import "./components/base/Carousel.vue2.mjs";
|
|
|
2
2
|
import "./components/panel/panel-item.vue2.mjs";
|
|
3
3
|
import { useInjectDesignContext as i } from "./context/design.mjs";
|
|
4
4
|
import { default as p } from "./components/form-desgin.mjs";
|
|
5
|
-
import { CreateFormDesign as
|
|
5
|
+
import { CreateFormDesign as g } from "./core/index.mjs";
|
|
6
6
|
import "./components/index.mjs";
|
|
7
|
-
import { BaseSchema as
|
|
8
|
-
import { onDesignFieldChange as d, onDesignInit as u } from "./effects/onEffects.mjs";
|
|
7
|
+
import { BaseSchema as f, ExtendSchema as h, LayoutSchema as D, tempSchema as c } from "./config/index.mjs";
|
|
8
|
+
import { onDesignChange as S, onDesignFieldChange as d, onDesignInit as u } from "./effects/onEffects.mjs";
|
|
9
9
|
import "./utils/index.mjs";
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
f as BaseSchema,
|
|
12
|
+
g as CreateFormDesign,
|
|
13
|
+
h as ExtendSchema,
|
|
14
14
|
p as FormDesign,
|
|
15
|
-
|
|
15
|
+
D as LayoutSchema,
|
|
16
|
+
S as onDesignChange,
|
|
16
17
|
d as onDesignFieldChange,
|
|
17
18
|
u as onDesignInit,
|
|
18
|
-
|
|
19
|
+
c as tempSchema,
|
|
19
20
|
i as useInjectDesignContext
|
|
20
21
|
};
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./src/index.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./src/index.js");const t=require("./src/components/base/Carousel.vue.js"),r=require("./src/components/panel/panel-item.vue.js"),s=require("./src/context/design.js"),o=require("./src/components/form-desgin.js"),i=require("./src/core/index.js"),u=require("./src/components/props/form-config.vue.js"),a=require("./src/utils/schema.js"),e=require("./src/config/index.js"),n=require("./src/effects/onEffects.js");exports.Carousel=t.default;exports.FormPanelItem=r.default;exports.useInjectDesignContext=s.useInjectDesignContext;exports.FormDesign=o.default;exports.CreateFormDesign=i.CreateFormDesign;exports.FormConfig=u.default;exports.jsonToSchema=a.jsonToSchema;exports.BaseSchema=e.BaseSchema;exports.ExtendSchema=e.ExtendSchema;exports.LayoutSchema=e.LayoutSchema;exports.tempSchema=e.tempSchema;exports.onDesignChange=n.onDesignChange;exports.onDesignFieldChange=n.onDesignFieldChange;exports.onDesignInit=n.onDesignInit;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../internal.js");const
|
|
2
|
-
<FormIcon name="mobile" /> `)]),e.createElementVNode("div",
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../internal.js");const l=require("ant-design-vue"),w=require("vuedraggable"),f=require("../context/design.js");require("./panel/panel-item.vue2.js");const b=require("./base/json-preview.vue.js");require("./index.js");const q=require("../hooks/use-actions.js"),E=require("../hooks/use-namespace/index.js"),g=require("./form-icon.vue2.js"),S=require("./panel/panel-item.vue.js"),D={class:"left"},y={class:"right"},A={class:"content-panel"},z={key:0,class:"prompt"},F={class:"form-item"},I={class:"content-editor"},T=e.defineComponent({name:"FormPanel",__name:"form-panel",setup(j){const i=e.ref({}),{isDrag:p}=f.useInjectDragContext(),r=e.ref(!1),o=f.useInjectDesignContext(),{fields:s}=o,{dragAddAction:_,clearFieldsAction:v}=q.useDesignActions(o);function C(){r.value=!r.value,e.nextTick(()=>{i.value=o.getFormSchema()})}const{b:h,e:d,em:u}=E.useNamespace("panel");function N(a,t){const n=e.toRaw(a),{oldIndex:x}=t,c=n[x];if(c){const{shared:m}=o;m.draggedContext.key=c.key,m.draggedContext.field=c}}async function V(){const{shared:a}=o,{field:t}=a.draggedContext,n={source:t,traget:s.value,region:"form-panel"};o.hooks.syncDragAdd.call(n),o.setCheckedField(t),_()}function k(){l.Modal.confirm({title:"提示?",content:"确定要清空所有字段吗?",okText:"确定",cancelText:"取消",onOk(){v()},onCancel(){console.log("Cancel")}})}return(a,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(h)())},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("toolbar"))},[e.createElementVNode("div",D,[e.createVNode(e.unref(l.Tooltip),{placement:"bottom"},{title:e.withCtx(()=>t[1]||(t[1]=[e.createElementVNode("span",null,"全部删除",-1)])),default:e.withCtx(()=>[e.createVNode(e.unref(g.default),{name:"delete1",class:e.normalizeClass(e.unref(u)("toolbar","icon")),size:18,onClick:k},null,8,["class"])]),_:1}),e.createVNode(e.unref(l.Tooltip),{placement:"bottom"},{title:e.withCtx(()=>t[2]||(t[2]=[e.createElementVNode("span",null,"查看JSON Schema",-1)])),default:e.withCtx(()=>[e.createVNode(e.unref(g.default),{name:"code",class:e.normalizeClass(e.unref(u)("toolbar","icon")),size:18,onClick:C},null,8,["class"])]),_:1}),e.createCommentVNode(` <FormIcon name="desktop" />
|
|
2
|
+
<FormIcon name="mobile" /> `)]),e.createElementVNode("div",y,[e.renderSlot(a.$slots,"toolbar")])],2),e.createCommentVNode(' ref="contentTelRef" '),e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("content"))},[e.withDirectives(e.createElementVNode("div",A,[!e.unref(p)&&e.unref(s).length===0?(e.openBlock(),e.createElementBlock("div",z," 👈 请在左侧选择控件并拖至此处 ")):e.createCommentVNode("v-if",!0),e.createVNode(e.unref(l.Form),{autocomplete:"off",class:"design-from","label-align":"left"},{default:e.withCtx(()=>[e.createVNode(e.unref(w),{class:"drag-from",list:e.unref(s),group:{name:"form"},animation:300,sort:!0,"item-key":"id","chosen-class":"choose",onStart:t[0]||(t[0]=n=>N(e.unref(s),n)),onAdd:V},{item:e.withCtx(({element:n})=>[e.createElementVNode("div",F,[e.renderSlot(a.$slots,`panel-${n.key}`,{},()=>[e.createVNode(S.default,{field:n,space:e.unref(s)},null,8,["field","space"])])])]),_:3},8,["list"])]),_:3})],512),[[e.vShow,!r.value]]),e.withDirectives(e.createElementVNode("div",I,[e.createVNode(b.default,{data:i.value},null,8,["data"])],512),[[e.vShow,r.value]])],2)],2))}});exports.default=T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("ant-design-vue");require("../../internal.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("ant-design-vue");require("../../internal.js");const V=require("../../context/design.js");require("../index.js");require("../../hooks/index.js");const _=require("../../hooks/use-namespace/index.js"),c=require("../form-icon.vue2.js"),z=require("../../hooks/use-actions.js"),D={key:2,class:"icons"},I=e.defineComponent({__name:"panel-item",props:{field:{},space:{},hideTitle:{type:Boolean}},setup(C){const l=C,{b:y,e:d,m:u}=_.useNamespace("panel-item"),s=V.useInjectDesignContext(),{checkedField:r,shared:B}=s,{deleteFieldAction:h}=z.useDesignActions(s);function g(t,n={}){return Object.entries(t).forEach(([i,o])=>{typeof o=="function"?n[i]=e.defineAsyncComponent(o):n[i]=o}),n}const f=g(B.panelWidgets);function q(t){s.setCheckedField(t),h()}const a=e.computed(()=>{var n,i;return((i=(n=l.field["x-design-props"])==null?void 0:n.validate)==null?void 0:i.status)==="error"}),b=e.computed(()=>{var n;const t=[y()];return((n=r.value)==null?void 0:n.id)===l.field.id&&t.push(u("active")),a.value&&t.push(u("error")),t});function N(){if(!s.hooks.beforeDelete.call(l.field))return;const n=l.space.findIndex(i=>i.id===l.field.id);n!==-1&&l.space.splice(n,1)}return(t,n)=>{var i,o,p,m,k;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(b.value),onClick:n[0]||(n[0]=e.withModifiers(A=>q(t.field),["stop"]))},[e.unref(f)[t.field.key]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)[t.field.key]),{key:0,"hide-title":t.hideTitle,field:t.field},null,8,["hide-title","field"])):(e.openBlock(),e.createBlock(e.unref(v.FormItem),{key:1,class:e.normalizeClass(e.unref(d)("form")),label:t.field.title},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(d)("error"))}," 未定义组件 ",2)]),_:1},8,["class","label"])),((i=e.unref(r))==null?void 0:i.id)===t.field.id||a.value?(e.openBlock(),e.createElementBlock("div",D,[((o=e.unref(r))==null?void 0:o.id)===t.field.id?(e.openBlock(),e.createBlock(e.unref(c.default),{key:0,name:"copy",class:"panel-icon",size:15})):e.createCommentVNode("v-if",!0),((p=e.unref(r))==null?void 0:p.id)===t.field.id?(e.openBlock(),e.createBlock(e.unref(c.default),{key:1,name:"delete1",class:"panel-icon",size:15,onClick:N})):e.createCommentVNode("v-if",!0),e.createVNode(e.unref(v.Tooltip),{title:(k=(m=t.field["x-design-props"])==null?void 0:m.validate)==null?void 0:k.message,color:"pink"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(c.default),{key:0,name:"exclamation-circle-filled",size:13,class:"panel-exclamation-icon"})):e.createCommentVNode("v-if",!0)]),_:1},8,["title"])])):e.createCommentVNode("v-if",!0)],2)}}});exports.default=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("vuedraggable");require("../../../index.js");require("../../../internal.js");const f=require("ant-design-vue"),m=require("../../../context/design.js"),v=require("../../../hooks/use-namespace/index.js"),b=require("../../../hooks/use-actions.js"),y=require("../panel-item.vue.js"),p={class:"array-table-box"},h={class:"array-table-drag"},N={class:"form-item"},V={class:"table-item"},_={class:"array-table-drag-header"},E={class:"array-table-drag-content"},x=e.defineComponent({name:"ArrayTable",__name:"array-table",props:{field:{}},setup(n){const i=m.useInjectDesignContext(),{b:l}=v.useNamespace("array-table"),{dragAddAction:o}=b.useDesignActions(i);function c(){const{shared:a}=i,{field:t}=a.draggedContext,d={source:t,traget:n.field.children,region:"k-array-card"};if(i.hooks.syncDragAdd.call(d),!i.dragAddResult.every(r=>r)){const r=n.field.children.findIndex(u=>u.id===t.id);r!==-1&&(n.field.children.splice(r,1),f.message.warning("不能将该控件拖拽到列表容器中"))}const s=n.field.children.find(r=>r.id===t.id);if(s){const r=s["x-decorator-props"]||{};s["x-decorator-props"]={...r,hideTitle:!0}}o()}return(a,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l)())},[t[1]||(t[1]=e.createElementVNode("div",null,"明细列表",-1)),e.createElementVNode("div",p,[t[0]||(t[0]=e.createElementVNode("div",{class:"array-table-left"},[e.createElementVNode("div",{class:"array-table-drag-header"}," 表头 "),e.createElementVNode("div",{class:"array-table-drag-content"})],-1)),e.createElementVNode("div",h,[e.createVNode(e.unref(g),{class:"widget-drag",list:a.field.children,group:{name:"form",direction:"vertical",removeCloneOnHide:!1},animation:300,sort:!0,"item-key":"id","drag-class":"table-item-drag-class",onAdd:c},{item:e.withCtx(({element:d})=>[e.createElementVNode("div",N,[e.renderSlot(a.$slots,`panel-${d.key}`,{},()=>[e.createElementVNode("div",V,[e.createElementVNode("div",_,e.toDisplayString(d.title),1),e.createElementVNode("div",E,[e.createVNode(e.unref(y.default),{field:d,space:a.field.children,"hide-title":""},null,8,["field","space"])])])])])]),_:3},8,["list"])])]),t[2]||(t[2]=e.createElementVNode("div",{style:{color:"#c0bebe","text-align":"center",width:"90%",padding:"5px"}}," ☝ 拖拽控件到明细列表 ",-1))],2))}});exports.default=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vuedraggable"),a=require("ant-design-vue");require("../../../index.js");require("../../../internal.js");const c=require("../../../hooks/use-namespace/index.js"),x=require("../../../context/design.js"),k=require("../../../hooks/use-actions.js"),C=require("../panel-item.vue.js"),y={class:"form-item"},_=e.defineComponent({__name:"grid",props:{field:{}},setup(l){const{b:u}=c.useNamespace("grid-widget"),{b:g}=c.useNamespace("panel-drag"),o=x.useInjectDesignContext(),{dragAddAction:f}=k.useDesignActions(o);function m(s,i){const r=e.toRaw(s),{oldIndex:d}=i,t=r[d];if(t){const{shared:n}=o;n.draggedContext.key=t.key,n.draggedContext.field=t}}function p(){const{shared:s}=o,{field:i}=s.draggedContext,r={source:i,traget:l.field.children,region:"k-grid"};if(o.hooks.syncDragAdd.call(r),!o.dragAddResult.every(t=>t)){const t=l.field.children.findIndex(n=>n.id===i.id);t!==-1&&(l.field.children.splice(t,1),a.message.warning("不能将该控件拖拽到明细表中"))}f()}return(s,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(u)())},[e.createElementVNode("div",null,e.toDisplayString(s.field.title),1),e.createVNode(e.unref(a.Row),e.mergeProps(e.unref(a.Col)["x-component-props"],{class:"grid-row"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.field.children,(r,d)=>{var t;return e.openBlock(),e.createBlock(e.unref(a.Col),{key:d,span:((t=r["x-component-props"])==null?void 0:t.span)||12,class:"grid-col"},{default:e.withCtx(()=>[e.createVNode(e.unref(h),{list:r.children,group:{name:"form"},animation:300,sort:!0,class:e.normalizeClass(e.unref(g)()),"item-key":"id","chosen-class":"choose",onStart:n=>m(r.children,n),onAdd:p},{item:e.withCtx(({element:n})=>[e.createElementVNode("div",y,[e.renderSlot(s.$slots,`panel-${n.key}`,{},()=>[e.createVNode(e.unref(C.default),{field:n,space:r.children},null,8,["field","space"])])])]),_:2},1032,["list","class","onStart"])]),_:2},1032,["span"])}),128))]),_:3},16),i[0]||(i[0]=e.createElementVNode("div",{style:{color:"#c0bebe","text-align":"center",width:"90%",padding:"5px"}}," ☝ 拖拽控件到容器内部 ",-1))],2))}});exports.default=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("vuedraggable");require("../../../internal.js");require("../../../index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("vuedraggable");require("../../../internal.js");require("../../../index.js");const m=require("ant-design-vue"),p=require("../../../context/design.js"),h=require("../../../hooks/use-namespace/index.js"),v=require("../../../hooks/use-actions.js"),y=require("../panel-item.vue.js"),A={class:"form-item"},q=e.defineComponent({inheritAttrs:!1,__name:"object",props:{field:{}},setup(o){const s=p.useInjectDesignContext(),{b:a}=h.useNamespace("panel-drag"),{dragAddAction:c}=v.useDesignActions(s);function u(t,n){const i=e.toRaw(t),{oldIndex:l}=n,d=i[l];if(d){const{shared:r}=s;r.draggedContext.key=d.key,r.draggedContext.field=d}}function g(){console.log("dragAdd");const{shared:t}=s,{field:n}=t.draggedContext,i={source:n,traget:o.field.children,region:"k-object"};if(s.hooks.syncDragAdd.call(i),!s.dragAddResult.every(d=>d)){const d=o.field.children.findIndex(r=>r.id===n.id);d!==-1&&(o.field.children.splice(d,1),m.message.warning("不能将该控件拖拽到对象容器中"))}c()}return(t,n)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,e.toDisplayString(t.field.title),1),e.createElementVNode("div",null,[e.createVNode(e.unref(f),{list:t.field.children,class:e.normalizeClass(e.unref(a)()),group:{name:"form"},animation:300,sort:!0,"item-key":"id","chosen-class":"choose",onStart:n[0]||(n[0]=i=>u(t.field.children,i)),onAdd:g},{item:e.withCtx(({element:i})=>[e.createElementVNode("div",A,[e.renderSlot(t.$slots,`panel-${i.key}`,{},()=>[e.createVNode(e.unref(y.default),{field:i,space:t.field.children},null,8,["field","space"])])])]),_:3},8,["list","class"]),n[1]||(n[1]=e.createElementVNode("div",{style:{color:"#c0bebe","text-align":"center",width:"90%",padding:"5px"}}," ☝ 拖拽控件到布局容器内部 ",-1))])]))}});exports.default=q;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../types.js"),t={name:"布局组件",key:"layout",widget:[{title:"栅格布局",icon:"k-form-grid",key:"k-grid",type:e.valueTypeMap.void,"x-component":"FormGrid","x-component-props":{gutter:20},"x-decorator":"Void"}]},a={name:"基础组件",key:"basic",widget:[{title:"输入框",key:"k-input",type:e.valueTypeMap.string,icon:"form-input","x-component":"Input","x-component-props":{placeholder:"请输入"}},{title:"多文本输入框",key:"k-textarea",type:e.valueTypeMap.string,icon:"form-textarea","x-component":"Textarea","x-component-props":{placeholder:"请输入"}},{title:"数字输入框",key:"k-input-number",type:e.valueTypeMap.number,icon:"form-number","x-component":"InputNumber","x-component-props":{placeholder:"请输入",precision:0}},{title:"下拉选择框",key:"k-select",type:e.valueTypeMap.array,items:{type:e.valueTypeMap.string},icon:"form-select","x-component":"Select",enum:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}],"x-component-props":{placeholder:"请选择",allowClear:!0,mode:"multiple"},"x-decorator":"FormItem"},{title:"日期范围",key:"k-date-range",type:e.valueTypeMap.array,format:"date",items:{type:e.valueTypeMap.string,format:"date"},icon:"form-date","x-component":"DateRange","x-component-props":{valueFormat:"YYYY-MM-DD",placeholder:["开始日期","结束日期"]}},{title:"单个日期",key:"k-date-single",type:e.valueTypeMap.string,format:"date",icon:"form-date","x-component":"InputNumber","x-component-props":{placeholder:"请输入",formatData:"YYYY-MM-DD"}},{title:"地区选择",key:"k-form-area",type:e.valueTypeMap.object,icon:"form-area","x-component":"FormArea",children:[{type:e.valueTypeMap.string,name:"province"},{type:e.valueTypeMap.string,name:"city"}]}]},
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../types.js"),t={name:"布局组件",key:"layout",widget:[{title:"栅格布局",icon:"k-form-grid",key:"k-grid",type:e.valueTypeMap.void,"x-component":"FormGrid","x-component-props":{gutter:20},"x-decorator":"Void"}]},a={name:"基础组件",key:"basic",widget:[{title:"输入框",key:"k-input",type:e.valueTypeMap.string,icon:"form-input","x-component":"Input","x-component-props":{placeholder:"请输入"}},{title:"多文本输入框",key:"k-textarea",type:e.valueTypeMap.string,icon:"form-textarea","x-component":"Textarea","x-component-props":{placeholder:"请输入"}},{title:"数字输入框",key:"k-input-number",type:e.valueTypeMap.number,icon:"form-number","x-component":"InputNumber","x-component-props":{placeholder:"请输入",precision:0}},{title:"下拉选择框",key:"k-select",type:e.valueTypeMap.array,items:{type:e.valueTypeMap.string},icon:"form-select","x-component":"Select",enum:[{label:"选项1",value:"1"},{label:"选项2",value:"2"}],"x-component-props":{placeholder:"请选择",allowClear:!0,mode:"multiple"},"x-decorator":"FormItem"},{title:"日期范围",key:"k-date-range",type:e.valueTypeMap.array,format:"date",items:{type:e.valueTypeMap.string,format:"date"},icon:"form-date","x-component":"DateRange","x-component-props":{valueFormat:"YYYY-MM-DD",placeholder:["开始日期","结束日期"]}},{title:"单个日期",key:"k-date-single",type:e.valueTypeMap.string,format:"date",icon:"form-date","x-component":"InputNumber","x-component-props":{placeholder:"请输入",formatData:"YYYY-MM-DD"}},{title:"地区选择",key:"k-form-area",type:e.valueTypeMap.object,icon:"form-area","x-component":"FormArea",children:[{type:e.valueTypeMap.string,name:"province"},{type:e.valueTypeMap.string,name:"city"}]}]},r={name:"扩展组件",key:"extend",widget:[{title:"对象容器",key:"k-object",type:e.valueTypeMap.object,icon:"form-object",children:[]},{title:"列表容器",key:"k-array-card",type:e.valueTypeMap.array,icon:"form-list",children:[],"x-component":"ArrayCard","x-decorator":"Void"},{title:"明细表",key:"k-table",type:e.valueTypeMap.array,icon:"form-table","x-component":"ArrayTable",children:[],"x-decorator-props":{labelAlign:"top"}}]},o=[{name:"加班模版",key:"overtime",icon:"form-kit-overtime",schema:{title:"加班模版",key:"k-overtime",type:e.valueTypeMap.object,name:"overtime",id:"overtime","x-design-props":{validate:{status:"",message:""}},children:[{type:e.valueTypeMap.array,name:"details",title:"加班明细","x-component":"ArrayCard","x-decorator":"Void",children:[{type:e.valueTypeMap.array,title:"加班日期",items:{type:e.valueTypeMap.string,format:"date"},name:"date","x-component":"DateRange","x-validator":[{type:"array",required:!0,message:"请选择日期范围"}],"x-component-props":{valueFormat:"YYYY-MM-DD HH:mm",showTime:{format:"HH:mm",minuteStep:30},placeholder:["开始日期","结束日期"]}},{type:e.valueTypeMap.number,title:"加班时长",name:"hours","x-component":"HalfInputNumber","x-component-props":{placeholder:"请输入",addonAfter:"小时"},required:!0,"x-validator":[{validator:`{{const sourceValue = $parent.date
|
|
2
2
|
if (!sourceValue || !sourceValue.length) {
|
|
3
3
|
return true
|
|
4
4
|
}else{
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
}
|
|
13
13
|
return true
|
|
14
14
|
}
|
|
15
|
-
}}`}]}]},{type:e.valueTypeMap.number,title:"总时长",name:"total","x-component":"HalfInputNumber","x-component-props":{placeholder:"请输入"
|
|
15
|
+
}}`},{type:"number",min:.5,message:"必须大于0.5小时"}]}]},{type:e.valueTypeMap.number,title:"总时长",name:"total","x-component":"HalfInputNumber","x-component-props":{placeholder:"请输入",disabled:!0,addonAfter:"小时"},"x-validator":[{type:"number",min:.5,message:"必须大于0.5小时"}],"x-reactions":{dependencies:[{property:"value",type:"string",source:".details",name:"details"}],fulfill:{state:{value:"{{$deps.details.reduce((acc, cur) => acc + cur.hours, 0)}}"}}}}]}}];exports.BaseSchema=a;exports.ExtendSchema=r;exports.LayoutSchema=t;exports.tempSchema=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={ON_DESIGN_FIELD_CHANGE:"onDesignFieldChange",ON_DESIGN_INIT:"onDesignInit"};exports.DesignEffectDict=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={on_DESIGN_CHANGE:"onDesignChange",ON_DESIGN_FIELD_CHANGE:"onDesignFieldChange",ON_DESIGN_INIT:"onDesignInit"};exports.DesignEffectDict=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./effective.js"),e=require("./effect-dict.js");function t
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./effective.js"),e=require("./effect-dict.js");function n(t){return o.createEffectHook(t,(...i)=>c=>{c(...i)})}const D=n(e.DesignEffectDict.ON_DESIGN_INIT),s=n(e.DesignEffectDict.on_DESIGN_CHANGE),f=n(e.DesignEffectDict.ON_DESIGN_FIELD_CHANGE);exports.onDesignChange=s;exports.onDesignFieldChange=f;exports.onDesignInit=D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-namespace/index.js");exports.defaultNamespace=e.defaultNamespace;exports.namespaceContextKey=e.namespaceContextKey;exports.useGetDerivedNamespace=e.useGetDerivedNamespace;exports.useNamespace=e.useNamespace;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-namespace/index.js"),s=require("./use-actions.js");exports.defaultNamespace=e.defaultNamespace;exports.namespaceContextKey=e.namespaceContextKey;exports.useGetDerivedNamespace=e.useGetDerivedNamespace;exports.useNamespace=e.useNamespace;exports.useDesignActions=s.useDesignActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../effects/effect-dict.js");function i(t){const e=()=>{t.notify(n.DesignEffectDict.on_DESIGN_CHANGE)};return{dragAddAction:()=>{e()},deleteFieldAction:()=>{e()},clearFieldsAction:()=>{t.clearFields(),e()}}}exports.useDesignActions=i;
|
package/dist/lib/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./components/base/Carousel.vue2.js");require("./components/panel/panel-item.vue2.js");const i=require("./context/design.js"),t=require("./components/form-desgin.js"),r=require("./core/index.js");require("./components/index.js");const e=require("./config/index.js"),n=require("./effects/onEffects.js");require("./utils/index.js");exports.useInjectDesignContext=i.useInjectDesignContext;exports.FormDesign=t.default;exports.CreateFormDesign=r.CreateFormDesign;exports.BaseSchema=e.BaseSchema;exports.ExtendSchema=e.ExtendSchema;exports.LayoutSchema=e.LayoutSchema;exports.tempSchema=e.tempSchema;exports.onDesignFieldChange=n.onDesignFieldChange;exports.onDesignInit=n.onDesignInit;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./components/base/Carousel.vue2.js");require("./components/panel/panel-item.vue2.js");const i=require("./context/design.js"),t=require("./components/form-desgin.js"),r=require("./core/index.js");require("./components/index.js");const e=require("./config/index.js"),n=require("./effects/onEffects.js");require("./utils/index.js");exports.useInjectDesignContext=i.useInjectDesignContext;exports.FormDesign=t.default;exports.CreateFormDesign=r.CreateFormDesign;exports.BaseSchema=e.BaseSchema;exports.ExtendSchema=e.ExtendSchema;exports.LayoutSchema=e.LayoutSchema;exports.tempSchema=e.tempSchema;exports.onDesignChange=n.onDesignChange;exports.onDesignFieldChange=n.onDesignFieldChange;exports.onDesignInit=n.onDesignInit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@font-face{font-family:iconfont-design;src:url(fonts/iconfont.woff2?t=
|
|
1
|
+
@font-face{font-family:iconfont-design;src:url(fonts/iconfont.woff2?t=15796) format("woff2"),url(fonts/iconfont.woff?t=22739) format("woff"),url(fonts/iconfont.ttf?t=73534) format("truetype")}.k-design-icon{font-family:iconfont-design!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-from-design-exclamation-circle-filled:before{content:"\e670"}.icon-from-design-exclamation-circle:before{content:"\e660"}.icon-from-design-form-object:before{content:"\e666"}.icon-from-design-form-list:before{content:"\e667"}.icon-from-design-form-table:before{content:"\e66f"}.icon-from-design-copy:before{content:"\e65d"}.icon-from-design-form-radio:before{content:"\e698"}.icon-from-design-form-daterange:before{content:"\e699"}.icon-from-design-form-money:before{content:"\e69a"}.icon-from-design-form-kit-leave:before{content:"\e69b"}.icon-from-design-form-kit-reimbursement:before{content:"\e69c"}.icon-from-design-form-kit-out:before{content:"\e69d"}.icon-from-design-form-kit-replenish:before{content:"\e69e"}.icon-from-design-form-kit-overtime:before{content:"\e69f"}.icon-from-design-form-number:before{content:"\e6a0"}.icon-from-design-form-textarea:before{content:"\e6a1"}.icon-from-design-form-select:before{content:"\e6a2"}.icon-from-design-form-kit-transfer:before{content:"\e6a3"}.icon-from-design-form-right:before{content:"\e6a4"}.icon-from-design-form-checkbox:before{content:"\e687"}.icon-from-design-form-area:before{content:"\e688"}.icon-from-design-form-del:before{content:"\e689"}.icon-from-design-form-contact-person:before{content:"\e68a"}.icon-from-design-form-default:before{content:"\e68b"}.icon-from-design-form-date:before{content:"\e68c"}.icon-from-design-form-drag:before{content:"\e68d"}.icon-from-design-form-desctext:before{content:"\e68e"}.icon-from-design-form-fileupload:before{content:"\e68f"}.icon-from-design-form-input:before{content:"\e690"}.icon-from-design-form-grid:before{content:"\e691"}.icon-from-design-form-imgupload:before{content:"\e692"}.icon-from-design-form-hot-city:before{content:"\e693"}.icon-from-design-form-kit-leave-2:before{content:"\e694"}.icon-from-design-form-inputNumber:before{content:"\e695"}.icon-from-design-form-kit-business-trip:before{content:"\e696"}.icon-from-design-shouzhixiangyou:before{content:"\e615"}.icon-from-design-xiangzuohuangse:before{content:"\e60a"}.icon-from-design-code:before{content:"\e65a"}.icon-from-design-desktop:before{content:"\e65b"}.icon-from-design-delete1:before{content:"\e65c"}.icon-from-design-double-left:before{content:"\e65e"}.icon-from-design-double-right:before{content:"\e65f"}.icon-from-design-mobile:before{content:"\e668"}.icon-from-design-question-circle:before{content:"\e66c"}.icon-from-design-sound:before{content:"\e672"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";:root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-primary-light-3:#79bbff;--king-color-primary-light-5:#a0cfff;--king-color-primary-light-7:#c6e2ff;--king-color-primary-light-8:#d9ecff;--king-color-primary-light-9:#ecf5ff;--king-color-success:#67c23a;--king-color-success-light-3:#95d475;--king-color-success-light-5:#b3e19d;--king-color-success-light-7:#d1edc4;--king-color-success-light-8:#e1f3d8;--king-color-success-light-9:#f0f9eb;--king-color-warning:#e6a23c;--king-color-warning-light-3:#eebe77;--king-color-warning-light-5:#f3d19e;--king-color-warning-light-7:#f8e3c5;--king-color-warning-light-8:#faecd8;--king-color-warning-light-9:#fdf6ec;--king-color-danger:#f56c6c;--king-color-danger-light-3:#f89898;--king-color-danger-light-5:#fab6b6;--king-color-danger-light-7:#fcd3d3;--king-color-danger-light-8:#fde2e2;--king-color-danger-light-9:#fef0f0;--king-color-error:#f56c6c;--king-color-error-light-3:#f89898;--king-color-error-light-5:#fab6b6;--king-color-error-light-7:#fcd3d3;--king-color-error-light-8:#fde2e2;--king-color-error-light-9:#fef0f0;--king-color-info:#909399;--king-color-info-light-3:#b1b3b8;--king-color-info-light-5:#c8c9cc;--king-color-info-light-7:#dedfe0;--king-color-info-light-8:#e9e9eb;--king-color-info-light-9:#f4f4f5;--king-transition-duration:0.3s}.k-design-main{width:100%;height:100%;display:flex;background:#f8f8f8;overflow:hidden;overflow-x:auto;font-size:13px;text-align:initial}.k-design-main,.k-design-main *{box-sizing:border-box}.k-design-array-table .array-table-box{display:flex;background-color:#f5f6f6;border:1px dashed #cbcdd3;padding:10px;overflow:hidden;min-height:120px}.k-design-array-table .array-table-box .array-table-left{height:auto;display:flex;flex-direction:column;border:1px solid #cbcdd3}.k-design-array-table .array-table-box .array-table-drag{border:1px solid #cbcdd3;border-left:none;display:flex;justify-content:flex-start;flex:1;overflow:hidden}.k-design-array-table .array-table-box .array-table-drag .widget-drag{width:100%;display:flex;justify-self:start;overflow-x:auto;overflow-y:hidden}.k-design-array-table .array-table-box .array-table-drag .widget-drag .form-item{display:flex;flex-direction:column;height:100%;border-right:1px solid #cbcdd3;min-width:160px}.k-design-array-table .array-table-box .array-table-drag .widget-drag .table-item{height:100%;display:flex;flex-direction:column}.k-design-array-table .array-table-box .array-table-drag-header{min-height:36px;display:flex;align-items:center;justify-content:center;min-width:70px;border-bottom:1px solid #cbcdd3}.k-design-array-table .array-table-box .array-table-drag-content{flex:1;flex-direction:column;align-items:center;justify-content:center}.k-design-array-table .array-table-box .table-item-drag-class{border:1px solid #cbcdd3!important}.k-design-array-table .array-table-box .sortable-ghost{border-left:3px solid var(--king-color-primary);width:0;height:100%!important;overflow:hidden;min-width:0!important}.k-design-array-table .array-table-box .sortable-ghost *{display:none}.k-design-material{flex:0 0 320px;height:100%;border:1px solid var(--king-color-info-light-7);display:flex;flex-direction:column}.k-design-material .k-design-toolbar{height:50px;display:flex;justify-content:center;align-items:center}.k-design-material .k-design-toolbar .toolbar-button{width:120px;text-align:center}.k-design-material .k-design-widget{padding:0 10px;padding-bottom:10px;overflow:auto}.k-design-material .k-design-widget .widget-group-name{color:var(--king-color-info);font-size:14px;margin:10px 0}.k-design-material .k-design-widget .widget-list-drag{display:flex;flex-flow:row wrap;margin-left:-5px;margin-right:-5px;row-gap:10px}.k-design-material .k-design-widget .widget-col{padding-left:5px;padding-right:5px;width:50%}.k-design-material .k-design-widget .widget-col .widget-item{display:flex;align-items:center;padding:8px 10px;background:#fff;border:1px solid var(--king-color-info-light-8);border-radius:5px;cursor:pointer;font-size:13px}.k-design-material .k-design-widget .widget-item:hover{color:var(--king-color-primary);border-color:var(--king-color-primary-light-3)}.k-design-material .k-design-widget .widget-item-icon{margin-right:5px}.k-design-material .k-design-widget::-webkit-scrollbar{width:6px;height:6px}.k-design-material .k-design-widget::-webkit-scrollbar-track{background:0 0;border-radius:3px}.k-design-material .k-design-widget::-webkit-scrollbar-thumb{background:#d5d7db;border-radius:3px;-webkit-transition:background .2s ease;transition:background .2s ease}.k-design-material .k-design-widget::-webkit-scrollbar-corner{background:0 0}.k-design-material .k-design-temp .template-list-drag{padding:0 10px;padding-top:15px;display:flex;-moz-column-gap:5px;column-gap:5px;row-gap:10px}.k-design-material .k-design-temp .template-list-drag .template-item{padding:8px 10px;cursor:pointer;flex:1;display:flex;background:#fff;border:1px solid var(--king-color-info-light-8);border-radius:5px}.k-design-material .k-design-temp .template-list-drag .template-item .template-item-icon{margin-right:5px}.k-design-material .k-design-temp .template-list-drag .template-item .template-item-name{font-size:13px}.k-design-material .k-design-temp .template-list-drag .template-item:hover{color:var(--king-color-primary);border-color:var(--king-color-primary-light-3)}.k-design-setting{flex:0;height:100%;border:1px solid var(--king-color-info-light-7);position:relative;background:#fff}.k-design-setting .setting-aside{height:100%;width:320px}.k-design-setting .setting-aside .setting-empty{margin-top:50px}.k-design-setting .setting-collapse{position:absolute;left:-25px;top:8px;cursor:pointer;border-left:none}.form-design-collapse-enter-active,.form-design-collapse-leave-active{transition:var(--form-design-collapse-duration) max-width linear,var(--form-design-collapse-duration) padding-left linear,var(--form-design-collapse-duration) padding-right linear}:root{--form-design-collapse-duration:0.3s}.k-design-panel{flex:1;min-width:650px;border-top:1px solid var(--king-color-info-light-7);border-bottom:1px solid var(--king-color-info-light-7);display:flex;flex-direction:column}.k-design-panel .k-design-panel__toolbar{min-height:38px;background:#fff;display:flex;justify-content:space-between;align-items:center;padding:5px 10px;border-bottom:1px solid var(--king-color-info-light-9)}.k-design-panel .k-design-panel__toolbar .k-design-panel__toolbar--icon{cursor:pointer;margin-right:5px}.k-design-panel .k-design-panel__toolbar .right{padding-right:25px;display:flex;align-items:center}.k-design-panel .k-design-panel__content{flex:1;overflow:hidden;position:relative}.k-design-panel .k-design-panel__content .design-from{height:100%}.k-design-panel .k-design-panel__content .content-panel{height:100%;overflow:auto}.k-design-panel .k-design-panel__content .content-panel .prompt{margin:0 auto;width:65%;max-width:400px;padding:35px 20px;border-radius:10px;border:1px dashed rgba(25,31,37,.12);margin-top:50px;text-align:center;font-size:14px;color:#7a7a7a}.k-design-panel .k-design-panel__content .content-editor{height:100%;overflow:hidden}.k-design-panel .k-design-panel__content .drag-from{min-height:100%;padding-bottom:20px}.k-design-panel .k-design-panel__content .sortable-ghost{border-top:3px solid var(--king-color-primary);height:0;overflow:hidden}@font-face{font-family:iconfont-design;src:url(fonts/iconfont.woff2?t=75718) format("woff2"),url(fonts/iconfont.woff?t=6621) format("woff"),url(fonts/iconfont.ttf?t=49225) format("truetype")}.k-design-icon{font-family:iconfont-design!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-from-design-exclamation-circle-filled:before{content:"\e670"}.icon-from-design-exclamation-circle:before{content:"\e660"}.icon-from-design-form-object:before{content:"\e666"}.icon-from-design-form-list:before{content:"\e667"}.icon-from-design-form-table:before{content:"\e66f"}.icon-from-design-copy:before{content:"\e65d"}.icon-from-design-form-radio:before{content:"\e698"}.icon-from-design-form-daterange:before{content:"\e699"}.icon-from-design-form-money:before{content:"\e69a"}.icon-from-design-form-kit-leave:before{content:"\e69b"}.icon-from-design-form-kit-reimbursement:before{content:"\e69c"}.icon-from-design-form-kit-out:before{content:"\e69d"}.icon-from-design-form-kit-replenish:before{content:"\e69e"}.icon-from-design-form-kit-overtime:before{content:"\e69f"}.icon-from-design-form-number:before{content:"\e6a0"}.icon-from-design-form-textarea:before{content:"\e6a1"}.icon-from-design-form-select:before{content:"\e6a2"}.icon-from-design-form-kit-transfer:before{content:"\e6a3"}.icon-from-design-form-right:before{content:"\e6a4"}.icon-from-design-form-checkbox:before{content:"\e687"}.icon-from-design-form-area:before{content:"\e688"}.icon-from-design-form-del:before{content:"\e689"}.icon-from-design-form-contact-person:before{content:"\e68a"}.icon-from-design-form-default:before{content:"\e68b"}.icon-from-design-form-date:before{content:"\e68c"}.icon-from-design-form-drag:before{content:"\e68d"}.icon-from-design-form-desctext:before{content:"\e68e"}.icon-from-design-form-fileupload:before{content:"\e68f"}.icon-from-design-form-input:before{content:"\e690"}.icon-from-design-form-grid:before{content:"\e691"}.icon-from-design-form-imgupload:before{content:"\e692"}.icon-from-design-form-hot-city:before{content:"\e693"}.icon-from-design-form-kit-leave-2:before{content:"\e694"}.icon-from-design-form-inputNumber:before{content:"\e695"}.icon-from-design-form-kit-business-trip:before{content:"\e696"}.icon-from-design-shouzhixiangyou:before{content:"\e615"}.icon-from-design-xiangzuohuangse:before{content:"\e60a"}.icon-from-design-code:before{content:"\e65a"}.icon-from-design-desktop:before{content:"\e65b"}.icon-from-design-delete1:before{content:"\e65c"}.icon-from-design-double-left:before{content:"\e65e"}.icon-from-design-double-right:before{content:"\e65f"}.icon-from-design-mobile:before{content:"\e668"}.icon-from-design-question-circle:before{content:"\e66c"}.icon-from-design-sound:before{content:"\e672"}.k-design-panel-item{cursor:move;border:1px dashed transparent;padding:10px;background-color:#fff;margin-bottom:10px;position:relative}.k-design-panel-item .k-design-panel-item__form{margin-bottom:0;cursor:move}.k-design-panel-item .k-design-panel-item__form *{cursor:move}.k-design-panel-item .k-design-panel-item__error{color:var(--king-color-error)}.k-design-panel-item .icons{position:absolute;right:0;bottom:0;background-color:#fff;border:1px solid var(--king-color-primary);border-bottom:0;border-right:0;padding:0 7px;cursor:pointer;border-top-left-radius:10px}.k-design-panel-item .icons .panel-icon{color:var(--king-color-primary);cursor:pointer}.k-design-panel-item .icons .panel-icon{margin-right:5px}.k-design-panel-item .icons .panel-exclamation-icon{color:var(--king-color-error)}.k-design-panel-item:hover{border:1px dashed var(--king-color-primary)}.k-design-panel-item--active{border:1px dashed var(--king-color-primary);border-left:none}.k-design-panel-item--active:before{content:"";position:absolute;top:0;left:0;height:100%;border-color:var(--king-color-primary);border-left:4px solid var(--king-color-primary)}.k-design-panel-item--active:hover{border-left:none}.k-design-panel-item--error{border-color:var(--king-color-error)}.k-design-panel-item--error .icons{border-color:var(--king-color-error)}.k-design-panel-drag{min-height:60px;background-color:#f5f6f6;padding:10px 5px}.k-design-json-preview{border-radius:8px;background:#fff;height:100%;overflow:auto}.k-design-json-preview .code-container{position:relative;margin:8px;overflow:auto}.k-design-json-preview .hljs-ln{width:100%;border-collapse:collapse}.k-design-json-preview .hljs-ln td{vertical-align:top}.k-design-json-preview .hljs-ln td.hljs-ln-numbers{-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:right;color:#237893;border-right:1px solid #e5e7eb;padding:0 10px;width:1%}.k-design-json-preview .hljs-ln td.hljs-ln-code{padding:0 0 0 8px;display:flex;gap:6px;align-items:baseline;white-space:pre}.k-design-json-preview .indent-guides{display:inline-flex;pointer-events:none}.k-design-json-preview .indent-guide{display:inline-block;width:calc(var(--indent-char,1ch) * var(--indent-size));border-left:1px solid #e5e7eb;opacity:.6}.k-design-json-preview .hljs-ln .line-content{display:inline-block}.k-design-json-preview .hljs-ln .hljs-ln-n::before{content:attr(data-line-number)}.k-design-json-preview .fold-toggle{display:inline-block;width:1em;color:#6b7280;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-design-json-preview .fold-toggle:hover{color:#374151}.k-design-json-preview pre.hljs{margin:0;padding:12px 0}.k-design-json-preview .fold-gutter{display:inline-block;width:8px;flex:0 0 8px}.k-design-json-preview .hljs-ln .line-content{position:relative;display:inline-block}.k-design-json-preview .indent-guides{position:absolute;left:0;top:0;bottom:0;pointer-events:none;display:block}.k-design-json-preview .indent-guide{position:absolute;left:var(--guide-left);top:0;bottom:0;border-left:1px solid #e5e7eb;opacity:.4}.k-design-json-preview .fold-ellipsis{color:#9ca3af;font-style:italic}.k-design-json-preview .hljs-ln .hljs-ln-line.selected td{background-color:var(--selected-line-bg,rgba(99,102,241,.14))}.k-design-json-preview .indent-guide.active-guide{left:calc(var(--guide-left) + var(--indent-char,1ch) * var(--indent-size));border-left-color:#c1c0c0!important;opacity:1!important}:root{--hljs-background:#ffffff;--hljs-fg:#ffffff;--hljs-key:#a31515;--hljs-string:#0451a5;--hljs-number:#059669;--hljs-literal:#b45309;--hljs-punctuation:#000000}.hljs{background:var(--hljs-background);color:var(--hljs-fg)}.hljs-attr{color:var(--hljs-key)}.hljs-string{color:var(--hljs-string)}.hljs-number{color:var(--hljs-number)}.hljs-literal{color:var(--hljs-literal)}.hljs-operator,.hljs-punctuation{color:var(--hljs-punctuation)}.hljs-symbol{color:var(--hljs-literal)}.hljs-quote{color:var(--hljs-string)}.hljs-title{color:var(--hljs-key)}.k-design-carousel{width:100%;height:100%;overflow:hidden;position:relative}.k-design-carousel .carousel-track{display:flex;width:100%;height:100%}.k-design-carousel .carousel-track>*{flex:0 0 100%;width:100%;height:100%}.k-design-kit-panel{background-color:#f5f6f6;padding:10px 5px}.k-design-kit-panel .details{margin-bottom:10px;background-color:#fff;padding:10px}.k-design-kit-panel .detail-content{padding:10px 5px;background-color:#f5f6f6}.k-design-kit-panel .kit-item{margin-bottom:10px;background-color:#fff;padding:10px}.k-design-kit-panel .kit-item:last-child{margin-bottom:0}.k-design-form-config{height:100%;overflow:auto}.k-design-form-config .setting-tabs{height:100%}.k-design-form-config .setting-tabs .ant-tabs-content{height:100%;overflow:auto}.k-design-form-config .ant-collapse{border-radius:0;border-left:none;border-right:none}.k-design-form-config .ant-collapse-header{padding:5px 10px!important}.k-design-form-config .ant-collapse-item{border-radius:0!important}.k-design-form-config .ant-collapse-item-active:last-child{border-bottom:0!important}.k-design-grid-widget .grid-row{width:100%}.k-design-grid-widget .grid-col{border:1px dashed #cbcdd3;padding:5px}.k-design-grid-props .col-item{display:flex;margin-bottom:10px}.k-design-grid-props .col-item .close-icon{margin-left:10px;font-size:18px;cursor:pointer;transition:all linear .1s;color:var(--king-color-danger)}.k-design-grid-props .col-item .close-icon:hover{transform:scale(1.2)}
|
|
1
|
+
@charset "UTF-8";:root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-primary-light-3:#79bbff;--king-color-primary-light-5:#a0cfff;--king-color-primary-light-7:#c6e2ff;--king-color-primary-light-8:#d9ecff;--king-color-primary-light-9:#ecf5ff;--king-color-success:#67c23a;--king-color-success-light-3:#95d475;--king-color-success-light-5:#b3e19d;--king-color-success-light-7:#d1edc4;--king-color-success-light-8:#e1f3d8;--king-color-success-light-9:#f0f9eb;--king-color-warning:#e6a23c;--king-color-warning-light-3:#eebe77;--king-color-warning-light-5:#f3d19e;--king-color-warning-light-7:#f8e3c5;--king-color-warning-light-8:#faecd8;--king-color-warning-light-9:#fdf6ec;--king-color-danger:#f56c6c;--king-color-danger-light-3:#f89898;--king-color-danger-light-5:#fab6b6;--king-color-danger-light-7:#fcd3d3;--king-color-danger-light-8:#fde2e2;--king-color-danger-light-9:#fef0f0;--king-color-error:#f56c6c;--king-color-error-light-3:#f89898;--king-color-error-light-5:#fab6b6;--king-color-error-light-7:#fcd3d3;--king-color-error-light-8:#fde2e2;--king-color-error-light-9:#fef0f0;--king-color-info:#909399;--king-color-info-light-3:#b1b3b8;--king-color-info-light-5:#c8c9cc;--king-color-info-light-7:#dedfe0;--king-color-info-light-8:#e9e9eb;--king-color-info-light-9:#f4f4f5;--king-transition-duration:0.3s}.k-design-main{width:100%;height:100%;display:flex;background:#f8f8f8;overflow:hidden;overflow-x:auto;font-size:13px;text-align:initial}.k-design-main,.k-design-main *{box-sizing:border-box}.k-design-array-table .array-table-box{display:flex;background-color:#f5f6f6;border:1px dashed #cbcdd3;padding:10px;overflow:hidden;min-height:120px}.k-design-array-table .array-table-box .array-table-left{height:auto;display:flex;flex-direction:column;border:1px solid #cbcdd3}.k-design-array-table .array-table-box .array-table-drag{border:1px solid #cbcdd3;border-left:none;display:flex;justify-content:flex-start;flex:1;overflow:hidden}.k-design-array-table .array-table-box .array-table-drag .widget-drag{width:100%;display:flex;justify-self:start;overflow-x:auto;overflow-y:hidden}.k-design-array-table .array-table-box .array-table-drag .widget-drag .form-item{display:flex;flex-direction:column;height:100%;border-right:1px solid #cbcdd3;min-width:160px}.k-design-array-table .array-table-box .array-table-drag .widget-drag .table-item{height:100%;display:flex;flex-direction:column}.k-design-array-table .array-table-box .array-table-drag-header{min-height:36px;display:flex;align-items:center;justify-content:center;min-width:70px;border-bottom:1px solid #cbcdd3}.k-design-array-table .array-table-box .array-table-drag-content{flex:1;flex-direction:column;align-items:center;justify-content:center}.k-design-array-table .array-table-box .table-item-drag-class{border:1px solid #cbcdd3!important}.k-design-array-table .array-table-box .sortable-ghost{border-left:3px solid var(--king-color-primary);width:0;height:100%!important;overflow:hidden;min-width:0!important}.k-design-array-table .array-table-box .sortable-ghost *{display:none}.k-design-material{flex:0 0 320px;height:100%;border:1px solid var(--king-color-info-light-7);display:flex;flex-direction:column}.k-design-material .k-design-toolbar{height:50px;display:flex;justify-content:center;align-items:center}.k-design-material .k-design-toolbar .toolbar-button{width:120px;text-align:center}.k-design-material .k-design-widget{padding:0 10px;padding-bottom:10px;overflow:auto}.k-design-material .k-design-widget .widget-group-name{color:var(--king-color-info);font-size:14px;margin:10px 0}.k-design-material .k-design-widget .widget-list-drag{display:flex;flex-flow:row wrap;margin-left:-5px;margin-right:-5px;row-gap:10px}.k-design-material .k-design-widget .widget-col{padding-left:5px;padding-right:5px;width:50%}.k-design-material .k-design-widget .widget-col .widget-item{display:flex;align-items:center;padding:8px 10px;background:#fff;border:1px solid var(--king-color-info-light-8);border-radius:5px;cursor:pointer;font-size:13px}.k-design-material .k-design-widget .widget-item:hover{color:var(--king-color-primary);border-color:var(--king-color-primary-light-3)}.k-design-material .k-design-widget .widget-item-icon{margin-right:5px}.k-design-material .k-design-widget::-webkit-scrollbar{width:6px;height:6px}.k-design-material .k-design-widget::-webkit-scrollbar-track{background:0 0;border-radius:3px}.k-design-material .k-design-widget::-webkit-scrollbar-thumb{background:#d5d7db;border-radius:3px;-webkit-transition:background .2s ease;transition:background .2s ease}.k-design-material .k-design-widget::-webkit-scrollbar-corner{background:0 0}.k-design-material .k-design-temp .template-list-drag{padding:0 10px;padding-top:15px;display:flex;-moz-column-gap:5px;column-gap:5px;row-gap:10px}.k-design-material .k-design-temp .template-list-drag .template-item{padding:8px 10px;cursor:pointer;flex:1;display:flex;background:#fff;border:1px solid var(--king-color-info-light-8);border-radius:5px}.k-design-material .k-design-temp .template-list-drag .template-item .template-item-icon{margin-right:5px}.k-design-material .k-design-temp .template-list-drag .template-item .template-item-name{font-size:13px}.k-design-material .k-design-temp .template-list-drag .template-item:hover{color:var(--king-color-primary);border-color:var(--king-color-primary-light-3)}.k-design-setting{flex:0;height:100%;border:1px solid var(--king-color-info-light-7);position:relative;background:#fff}.k-design-setting .setting-aside{height:100%;width:320px}.k-design-setting .setting-aside .setting-empty{margin-top:50px}.k-design-setting .setting-collapse{position:absolute;left:-25px;top:8px;cursor:pointer;border-left:none}.form-design-collapse-enter-active,.form-design-collapse-leave-active{transition:var(--form-design-collapse-duration) max-width linear,var(--form-design-collapse-duration) padding-left linear,var(--form-design-collapse-duration) padding-right linear}:root{--form-design-collapse-duration:0.3s}.k-design-panel{flex:1;min-width:650px;border-top:1px solid var(--king-color-info-light-7);border-bottom:1px solid var(--king-color-info-light-7);display:flex;flex-direction:column}.k-design-panel .k-design-panel__toolbar{min-height:38px;background:#fff;display:flex;justify-content:space-between;align-items:center;padding:5px 10px;border-bottom:1px solid var(--king-color-info-light-9)}.k-design-panel .k-design-panel__toolbar .k-design-panel__toolbar--icon{cursor:pointer;margin-right:5px}.k-design-panel .k-design-panel__toolbar .right{padding-right:25px;display:flex;align-items:center}.k-design-panel .k-design-panel__content{flex:1;overflow:hidden;position:relative}.k-design-panel .k-design-panel__content .design-from{height:100%}.k-design-panel .k-design-panel__content .content-panel{height:100%;overflow:auto}.k-design-panel .k-design-panel__content .content-panel .prompt{margin:0 auto;width:65%;max-width:400px;padding:35px 20px;border-radius:10px;border:1px dashed rgba(25,31,37,.12);margin-top:50px;text-align:center;font-size:14px;color:#7a7a7a}.k-design-panel .k-design-panel__content .content-editor{height:100%;overflow:hidden}.k-design-panel .k-design-panel__content .drag-from{min-height:100%;padding-bottom:20px}.k-design-panel .k-design-panel__content .sortable-ghost{border-top:3px solid var(--king-color-primary);height:0;overflow:hidden}@font-face{font-family:iconfont-design;src:url(fonts/iconfont.woff2?t=44721) format("woff2"),url(fonts/iconfont.woff?t=53049) format("woff"),url(fonts/iconfont.ttf?t=3109) format("truetype")}.k-design-icon{font-family:iconfont-design!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-from-design-exclamation-circle-filled:before{content:"\e670"}.icon-from-design-exclamation-circle:before{content:"\e660"}.icon-from-design-form-object:before{content:"\e666"}.icon-from-design-form-list:before{content:"\e667"}.icon-from-design-form-table:before{content:"\e66f"}.icon-from-design-copy:before{content:"\e65d"}.icon-from-design-form-radio:before{content:"\e698"}.icon-from-design-form-daterange:before{content:"\e699"}.icon-from-design-form-money:before{content:"\e69a"}.icon-from-design-form-kit-leave:before{content:"\e69b"}.icon-from-design-form-kit-reimbursement:before{content:"\e69c"}.icon-from-design-form-kit-out:before{content:"\e69d"}.icon-from-design-form-kit-replenish:before{content:"\e69e"}.icon-from-design-form-kit-overtime:before{content:"\e69f"}.icon-from-design-form-number:before{content:"\e6a0"}.icon-from-design-form-textarea:before{content:"\e6a1"}.icon-from-design-form-select:before{content:"\e6a2"}.icon-from-design-form-kit-transfer:before{content:"\e6a3"}.icon-from-design-form-right:before{content:"\e6a4"}.icon-from-design-form-checkbox:before{content:"\e687"}.icon-from-design-form-area:before{content:"\e688"}.icon-from-design-form-del:before{content:"\e689"}.icon-from-design-form-contact-person:before{content:"\e68a"}.icon-from-design-form-default:before{content:"\e68b"}.icon-from-design-form-date:before{content:"\e68c"}.icon-from-design-form-drag:before{content:"\e68d"}.icon-from-design-form-desctext:before{content:"\e68e"}.icon-from-design-form-fileupload:before{content:"\e68f"}.icon-from-design-form-input:before{content:"\e690"}.icon-from-design-form-grid:before{content:"\e691"}.icon-from-design-form-imgupload:before{content:"\e692"}.icon-from-design-form-hot-city:before{content:"\e693"}.icon-from-design-form-kit-leave-2:before{content:"\e694"}.icon-from-design-form-inputNumber:before{content:"\e695"}.icon-from-design-form-kit-business-trip:before{content:"\e696"}.icon-from-design-shouzhixiangyou:before{content:"\e615"}.icon-from-design-xiangzuohuangse:before{content:"\e60a"}.icon-from-design-code:before{content:"\e65a"}.icon-from-design-desktop:before{content:"\e65b"}.icon-from-design-delete1:before{content:"\e65c"}.icon-from-design-double-left:before{content:"\e65e"}.icon-from-design-double-right:before{content:"\e65f"}.icon-from-design-mobile:before{content:"\e668"}.icon-from-design-question-circle:before{content:"\e66c"}.icon-from-design-sound:before{content:"\e672"}.k-design-panel-item{cursor:move;border:1px dashed transparent;padding:10px;background-color:#fff;margin-bottom:10px;position:relative}.k-design-panel-item .k-design-panel-item__form{margin-bottom:0;cursor:move}.k-design-panel-item .k-design-panel-item__form *{cursor:move}.k-design-panel-item .k-design-panel-item__error{color:var(--king-color-error)}.k-design-panel-item .icons{position:absolute;right:0;bottom:0;background-color:#fff;border:1px solid var(--king-color-primary);border-bottom:0;border-right:0;padding:0 7px;cursor:pointer;border-top-left-radius:10px}.k-design-panel-item .icons .panel-icon{color:var(--king-color-primary);cursor:pointer}.k-design-panel-item .icons .panel-icon{margin-right:5px}.k-design-panel-item .icons .panel-exclamation-icon{color:var(--king-color-error)}.k-design-panel-item:hover{border:1px dashed var(--king-color-primary)}.k-design-panel-item--active{border:1px dashed var(--king-color-primary);border-left:none}.k-design-panel-item--active:before{content:"";position:absolute;top:0;left:0;height:100%;border-color:var(--king-color-primary);border-left:4px solid var(--king-color-primary)}.k-design-panel-item--active:hover{border-left:none}.k-design-panel-item--error{border-color:var(--king-color-error)}.k-design-panel-item--error .icons{border-color:var(--king-color-error)}.k-design-panel-drag{min-height:60px;background-color:#f5f6f6;padding:10px 5px}.k-design-json-preview{border-radius:8px;background:#fff;height:100%;overflow:auto}.k-design-json-preview .code-container{position:relative;margin:8px;overflow:auto}.k-design-json-preview .hljs-ln{width:100%;border-collapse:collapse}.k-design-json-preview .hljs-ln td{vertical-align:top}.k-design-json-preview .hljs-ln td.hljs-ln-numbers{-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:right;color:#237893;border-right:1px solid #e5e7eb;padding:0 10px;width:1%}.k-design-json-preview .hljs-ln td.hljs-ln-code{padding:0 0 0 8px;display:flex;gap:6px;align-items:baseline;white-space:pre}.k-design-json-preview .indent-guides{display:inline-flex;pointer-events:none}.k-design-json-preview .indent-guide{display:inline-block;width:calc(var(--indent-char,1ch) * var(--indent-size));border-left:1px solid #e5e7eb;opacity:.6}.k-design-json-preview .hljs-ln .line-content{display:inline-block}.k-design-json-preview .hljs-ln .hljs-ln-n::before{content:attr(data-line-number)}.k-design-json-preview .fold-toggle{display:inline-block;width:1em;color:#6b7280;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.k-design-json-preview .fold-toggle:hover{color:#374151}.k-design-json-preview pre.hljs{margin:0;padding:12px 0}.k-design-json-preview .fold-gutter{display:inline-block;width:8px;flex:0 0 8px}.k-design-json-preview .hljs-ln .line-content{position:relative;display:inline-block}.k-design-json-preview .indent-guides{position:absolute;left:0;top:0;bottom:0;pointer-events:none;display:block}.k-design-json-preview .indent-guide{position:absolute;left:var(--guide-left);top:0;bottom:0;border-left:1px solid #e5e7eb;opacity:.4}.k-design-json-preview .fold-ellipsis{color:#9ca3af;font-style:italic}.k-design-json-preview .hljs-ln .hljs-ln-line.selected td{background-color:var(--selected-line-bg,rgba(99,102,241,.14))}.k-design-json-preview .indent-guide.active-guide{left:calc(var(--guide-left) + var(--indent-char,1ch) * var(--indent-size));border-left-color:#c1c0c0!important;opacity:1!important}:root{--hljs-background:#ffffff;--hljs-fg:#ffffff;--hljs-key:#a31515;--hljs-string:#0451a5;--hljs-number:#059669;--hljs-literal:#b45309;--hljs-punctuation:#000000}.hljs{background:var(--hljs-background);color:var(--hljs-fg)}.hljs-attr{color:var(--hljs-key)}.hljs-string{color:var(--hljs-string)}.hljs-number{color:var(--hljs-number)}.hljs-literal{color:var(--hljs-literal)}.hljs-operator,.hljs-punctuation{color:var(--hljs-punctuation)}.hljs-symbol{color:var(--hljs-literal)}.hljs-quote{color:var(--hljs-string)}.hljs-title{color:var(--hljs-key)}.k-design-carousel{width:100%;height:100%;overflow:hidden;position:relative}.k-design-carousel .carousel-track{display:flex;width:100%;height:100%}.k-design-carousel .carousel-track>*{flex:0 0 100%;width:100%;height:100%}.k-design-kit-panel{background-color:#f5f6f6;padding:10px 5px}.k-design-kit-panel .details{margin-bottom:10px;background-color:#fff;padding:10px}.k-design-kit-panel .detail-content{padding:10px 5px;background-color:#f5f6f6}.k-design-kit-panel .kit-item{margin-bottom:10px;background-color:#fff;padding:10px}.k-design-kit-panel .kit-item:last-child{margin-bottom:0}.k-design-form-config{height:100%;overflow:auto}.k-design-form-config .setting-tabs{height:100%}.k-design-form-config .setting-tabs .ant-tabs-content{height:100%;overflow:auto}.k-design-form-config .ant-collapse{border-radius:0;border-left:none;border-right:none}.k-design-form-config .ant-collapse-header{padding:5px 10px!important}.k-design-form-config .ant-collapse-item{border-radius:0!important}.k-design-form-config .ant-collapse-item-active:last-child{border-bottom:0!important}.k-design-grid-widget .grid-row{width:100%}.k-design-grid-widget .grid-col{border:1px dashed #cbcdd3;padding:5px}.k-design-grid-props .col-item{display:flex;margin-bottom:10px}.k-design-grid-props .col-item .close-icon{margin-left:10px;font-size:18px;cursor:pointer;transition:all linear .1s;color:var(--king-color-danger)}.k-design-grid-props .col-item .close-icon:hover{transform:scale(1.2)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FieldSchema, FormDesignInstance } from '../types';
|
|
2
2
|
type EffectFn<T extends any[]> = (callback: (...args: T & any[]) => void) => void;
|
|
3
3
|
export declare const onDesignInit: EffectFn<[FormDesignInstance]>;
|
|
4
|
+
export declare const onDesignChange: EffectFn<[FormDesignInstance]>;
|
|
4
5
|
export declare const onDesignFieldChange: EffectFn<[FieldSchema, FormDesignInstance]>;
|
|
5
6
|
export {};
|