@king-one/form-design 0.0.18 → 0.0.19
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/src/components/form-material.vue.mjs +53 -51
- package/dist/es/src/components/form-panel.vue.mjs +69 -70
- package/dist/es/src/components/panel/index.mjs +12 -9
- package/dist/es/src/components/panel/panel-item.vue.mjs +28 -28
- package/dist/es/src/components/panel/panel-wrapper.mjs +25 -15
- package/dist/es/src/components/panel/widget/array-card.vue2.mjs +39 -26
- package/dist/es/src/components/panel/widget/array-table.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/array-table.vue2.mjs +105 -0
- package/dist/es/src/components/panel/widget/date-range.vue2.mjs +10 -10
- package/dist/es/src/components/panel/widget/object.vue2.mjs +40 -29
- package/dist/es/src/config/index.mjs +90 -21
- package/dist/es/src/core/Design.mjs +15 -12
- package/dist/es/src/core/FormSchema.mjs +1 -1
- package/dist/es/src/internal.mjs +5 -4
- package/dist/es/src/plugins/index.mjs +23 -11
- package/dist/es/src/plugins/modules/drag-add.mjs +23 -0
- package/dist/lib/src/components/form-material.vue.js +1 -1
- package/dist/lib/src/components/form-panel.vue.js +2 -2
- package/dist/lib/src/components/panel/index.js +1 -1
- package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
- package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
- package/dist/lib/src/components/panel/widget/array-card.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/array-table.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/array-table.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
- package/dist/lib/src/config/index.js +1 -1
- package/dist/lib/src/core/Design.js +1 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/internal.js +1 -1
- package/dist/lib/src/plugins/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-add.js +1 -0
- package/dist/theme-chalk/array-table.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/panel-item.css +1 -1
- package/dist/theme-chalk/panel.css +1 -1
- package/dist/types/src/components/base/Carousel.vue.d.ts +1 -1
- package/dist/types/src/components/panel/panel-item.vue.d.ts +2 -0
- package/dist/types/src/components/panel/panel-wrapper.d.ts +11 -1
- package/dist/types/src/components/panel/widget/array-table.vue.d.ts +20 -0
- package/dist/types/src/core/Design.d.ts +3 -2
- package/dist/types/src/internal.d.ts +1 -0
- package/dist/types/src/plugins/index.d.ts +3 -2
- package/dist/types/src/plugins/modules/{drag-put.d.ts → drag-add.d.ts} +2 -1
- package/dist/types/src/types.d.ts +3 -3
- package/package.json +1 -1
- package/dist/es/src/plugins/modules/drag-put.mjs +0 -14
- package/dist/lib/src/plugins/modules/drag-put.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as O, ref as b, openBlock as l, createElementBlock as d, normalizeClass as
|
|
1
|
+
import { defineComponent as O, ref as b, openBlock as l, createElementBlock as d, normalizeClass as u, unref as o, createElementVNode as i, createVNode as a, withCtx as r, createTextVNode as x, Fragment as z, renderList as F, toDisplayString as v, createBlock as J, createCommentVNode as p } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
3
|
import { RadioGroup as T, RadioButton as w } from "ant-design-vue";
|
|
4
|
-
import
|
|
4
|
+
import h from "vuedraggable";
|
|
5
5
|
import { uid as W } from "@king-one/utils";
|
|
6
6
|
import { useInjectDragContext as G, useInjectDesignContext as K } from "../context/design.mjs";
|
|
7
7
|
import "./base/Carousel.vue2.mjs";
|
|
8
|
-
import
|
|
9
|
-
import { useNamespace as
|
|
8
|
+
import N from "./base/widget-icon.mjs";
|
|
9
|
+
import { useNamespace as g } from "../hooks/use-namespace/index.mjs";
|
|
10
10
|
import L from "./base/Carousel.vue.mjs";
|
|
11
11
|
const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { class: "widget-item" }, A = {
|
|
12
12
|
key: 0,
|
|
@@ -18,10 +18,10 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
18
18
|
name: "FormMaterial",
|
|
19
19
|
__name: "form-material",
|
|
20
20
|
setup(Y) {
|
|
21
|
-
const
|
|
22
|
-
function
|
|
23
|
-
const { icon: e, ...t } =
|
|
24
|
-
...
|
|
21
|
+
const y = b(), { updateDrag: m } = G(), { b: S } = g("material"), { b: D } = g("toolbar"), { b: $ } = g("widget"), { b: j } = g("temp"), f = K(), { schema: B, tempSchema: E } = f, _ = b("1");
|
|
22
|
+
function I(s) {
|
|
23
|
+
const { icon: e, ...t } = s, n = JSON.parse(JSON.stringify(t)), k = W(), c = {
|
|
24
|
+
...n,
|
|
25
25
|
name: k,
|
|
26
26
|
id: k,
|
|
27
27
|
"x-design-props": Object.assign({
|
|
@@ -29,36 +29,38 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
29
29
|
status: "",
|
|
30
30
|
message: ""
|
|
31
31
|
}
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
|
|
32
|
+
}, s["x-design-props"] || {})
|
|
33
|
+
};
|
|
34
|
+
(n.type === "array" || n.type === "object") && (c.children = []);
|
|
35
|
+
const { shared: C } = f;
|
|
36
|
+
return C.draggedContext.field = c, C.draggedContext.key = c.key, c;
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
const { schema: e } =
|
|
38
|
+
function R(s) {
|
|
39
|
+
const { schema: e } = s, { shared: t } = f;
|
|
38
40
|
return t.draggedContext.field = e, t.draggedContext.key = e.key, e;
|
|
39
41
|
}
|
|
40
|
-
function
|
|
42
|
+
function V(s) {
|
|
41
43
|
var e;
|
|
42
|
-
(e =
|
|
44
|
+
(e = y.value) == null || e.goTo(Number(s.target.value) - 1);
|
|
43
45
|
}
|
|
44
|
-
return (
|
|
46
|
+
return (s, e) => (l(), d(
|
|
45
47
|
"div",
|
|
46
48
|
{
|
|
47
|
-
class:
|
|
49
|
+
class: u(o(S)())
|
|
48
50
|
},
|
|
49
51
|
[
|
|
50
|
-
|
|
52
|
+
i(
|
|
51
53
|
"div",
|
|
52
54
|
{
|
|
53
|
-
class:
|
|
55
|
+
class: u(o(D)())
|
|
54
56
|
},
|
|
55
57
|
[
|
|
56
58
|
a(o(T), {
|
|
57
|
-
value:
|
|
58
|
-
"onUpdate:value": e[0] || (e[0] = (t) =>
|
|
59
|
+
value: _.value,
|
|
60
|
+
"onUpdate:value": e[0] || (e[0] = (t) => _.value = t),
|
|
59
61
|
"button-style": "solid",
|
|
60
62
|
size: "default",
|
|
61
|
-
onChange:
|
|
63
|
+
onChange: V
|
|
62
64
|
}, {
|
|
63
65
|
default: r(() => [
|
|
64
66
|
a(o(w), {
|
|
@@ -93,32 +95,32 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
93
95
|
L,
|
|
94
96
|
{
|
|
95
97
|
ref_key: "carouselRef",
|
|
96
|
-
ref:
|
|
98
|
+
ref: y,
|
|
97
99
|
"model-value": 0
|
|
98
100
|
},
|
|
99
101
|
{
|
|
100
102
|
default: r(() => [
|
|
101
|
-
|
|
103
|
+
i(
|
|
102
104
|
"div",
|
|
103
105
|
{
|
|
104
|
-
class:
|
|
106
|
+
class: u(o($)())
|
|
105
107
|
},
|
|
106
108
|
[
|
|
107
109
|
(l(!0), d(
|
|
108
110
|
z,
|
|
109
111
|
null,
|
|
110
|
-
F(o(
|
|
112
|
+
F(o(B), (t) => (l(), d("div", {
|
|
111
113
|
key: t.key,
|
|
112
114
|
class: "widget-group"
|
|
113
115
|
}, [
|
|
114
|
-
|
|
116
|
+
i(
|
|
115
117
|
"div",
|
|
116
118
|
M,
|
|
117
119
|
v(t.name),
|
|
118
120
|
1
|
|
119
121
|
/* TEXT */
|
|
120
122
|
),
|
|
121
|
-
t.widget ? (l(), J(o(
|
|
123
|
+
t.widget ? (l(), J(o(h), {
|
|
122
124
|
key: 0,
|
|
123
125
|
list: t.widget,
|
|
124
126
|
class: "widget-list-drag",
|
|
@@ -126,22 +128,22 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
126
128
|
group: { name: "form", pull: "clone", put: !1 },
|
|
127
129
|
sort: !1,
|
|
128
130
|
options: { animation: 150 },
|
|
129
|
-
clone:
|
|
130
|
-
onStart: e[1] || (e[1] = (
|
|
131
|
-
onEnd: e[2] || (e[2] = (
|
|
131
|
+
clone: I,
|
|
132
|
+
onStart: e[1] || (e[1] = (n) => o(m)(!0)),
|
|
133
|
+
onEnd: e[2] || (e[2] = (n) => o(m)(!1))
|
|
132
134
|
}, {
|
|
133
|
-
item: r(({ element:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
a(o(
|
|
138
|
-
icon:
|
|
135
|
+
item: r(({ element: n }) => [
|
|
136
|
+
i("div", U, [
|
|
137
|
+
i("div", q, [
|
|
138
|
+
n.icon ? (l(), d("div", A, [
|
|
139
|
+
a(o(N), {
|
|
140
|
+
icon: n.icon
|
|
139
141
|
}, null, 8, ["icon"])
|
|
140
|
-
])) :
|
|
141
|
-
|
|
142
|
+
])) : p("v-if", !0),
|
|
143
|
+
i(
|
|
142
144
|
"div",
|
|
143
145
|
H,
|
|
144
|
-
v(
|
|
146
|
+
v(n.title),
|
|
145
147
|
1
|
|
146
148
|
/* TEXT */
|
|
147
149
|
)
|
|
@@ -150,7 +152,7 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
150
152
|
]),
|
|
151
153
|
_: 2
|
|
152
154
|
/* DYNAMIC */
|
|
153
|
-
}, 1032, ["list"])) :
|
|
155
|
+
}, 1032, ["list"])) : p("v-if", !0)
|
|
154
156
|
]))),
|
|
155
157
|
128
|
|
156
158
|
/* KEYED_FRAGMENT */
|
|
@@ -159,31 +161,31 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
159
161
|
2
|
|
160
162
|
/* CLASS */
|
|
161
163
|
),
|
|
162
|
-
|
|
164
|
+
i(
|
|
163
165
|
"div",
|
|
164
166
|
{
|
|
165
|
-
class:
|
|
167
|
+
class: u(o(j)())
|
|
166
168
|
},
|
|
167
169
|
[
|
|
168
|
-
a(o(
|
|
169
|
-
list: o(
|
|
170
|
+
a(o(h), {
|
|
171
|
+
list: o(E),
|
|
170
172
|
class: "template-list-drag",
|
|
171
173
|
"item-key": "key",
|
|
172
174
|
group: { name: "form", pull: "clone", put: !1 },
|
|
173
175
|
sort: !1,
|
|
174
176
|
options: { animation: 150 },
|
|
175
|
-
clone:
|
|
177
|
+
clone: R,
|
|
176
178
|
onStart: e[3] || (e[3] = (t) => o(m)(!0)),
|
|
177
179
|
onEnd: e[4] || (e[4] = (t) => o(m)(!1))
|
|
178
180
|
}, {
|
|
179
181
|
item: r(({ element: t }) => [
|
|
180
|
-
|
|
182
|
+
i("div", P, [
|
|
181
183
|
t.icon ? (l(), d("div", Q, [
|
|
182
|
-
a(o(
|
|
184
|
+
a(o(N), {
|
|
183
185
|
icon: t.icon
|
|
184
186
|
}, null, 8, ["icon"])
|
|
185
|
-
])) :
|
|
186
|
-
|
|
187
|
+
])) : p("v-if", !0),
|
|
188
|
+
i(
|
|
187
189
|
"div",
|
|
188
190
|
X,
|
|
189
191
|
v(t.name),
|
|
@@ -195,7 +197,7 @@ const M = { class: "widget-group-name" }, U = { class: "widget-col" }, q = { cla
|
|
|
195
197
|
_: 1
|
|
196
198
|
/* STABLE */
|
|
197
199
|
}, 8, ["list"]),
|
|
198
|
-
|
|
200
|
+
p(` <div class="template-list">
|
|
199
201
|
<div v-for="g in tempSchema" :key="g.key" class="template-item">
|
|
200
202
|
<div v-if="g.icon" class="template-item-icon">
|
|
201
203
|
<WidgetIcon :icon="g.icon" />
|
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as z, ref as v, nextTick as A, toRaw as E, openBlock as h, createElementBlock as k, normalizeClass as c, unref as e, createElementVNode as o, createVNode as s, withCtx as i, createCommentVNode as f, renderSlot as C, withDirectives as b, vShow as x } from "vue";
|
|
2
2
|
import "../internal.mjs";
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import
|
|
5
|
-
import { useInjectDragContext as
|
|
6
|
-
import "../utils/index.mjs";
|
|
3
|
+
import { Tooltip as D, Form as R } from "ant-design-vue";
|
|
4
|
+
import T from "vuedraggable";
|
|
5
|
+
import { useInjectDragContext as j, useInjectDesignContext as B } from "../context/design.mjs";
|
|
7
6
|
import "./panel/panel-item.vue2.mjs";
|
|
8
|
-
import
|
|
7
|
+
import J from "./base/json-preview.vue.mjs";
|
|
9
8
|
import "./index.mjs";
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel" }, M = {
|
|
9
|
+
import { useNamespace as O } from "../hooks/use-namespace/index.mjs";
|
|
10
|
+
import S from "./form-icon.vue2.mjs";
|
|
11
|
+
import P from "./panel/panel-item.vue.mjs";
|
|
12
|
+
const q = { class: "left" }, G = { class: "right" }, H = { class: "content-panel" }, K = {
|
|
15
13
|
key: 0,
|
|
16
14
|
class: "prompt"
|
|
17
|
-
},
|
|
15
|
+
}, L = { class: "form-item" }, M = { class: "content-editor" }, le = /* @__PURE__ */ z({
|
|
18
16
|
name: "FormPanel",
|
|
19
17
|
__name: "form-panel",
|
|
20
|
-
setup(
|
|
21
|
-
const p =
|
|
22
|
-
function
|
|
23
|
-
|
|
18
|
+
setup(Q) {
|
|
19
|
+
const p = v({}), { isDrag: w } = j(), d = v(!1), a = B(), { fields: r } = a;
|
|
20
|
+
function y() {
|
|
21
|
+
d.value = !d.value, A(() => {
|
|
24
22
|
p.value = a.getFormSchema();
|
|
25
23
|
});
|
|
26
24
|
}
|
|
27
|
-
function
|
|
28
|
-
}
|
|
29
|
-
const { b: $, e: u, em: g } = q("panel"), I = A(N, 200);
|
|
30
|
-
function N() {
|
|
31
|
-
const { shared: l } = a, { key: t, field: o } = l.draggedContext, d = a.hooks.dragPut.call({
|
|
32
|
-
key: t,
|
|
33
|
-
field: o,
|
|
34
|
-
region: "form-panel"
|
|
35
|
-
});
|
|
36
|
-
return a.setCheckedField(o), d;
|
|
25
|
+
function F() {
|
|
37
26
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
const { b: $, e: u, em: g } = O("panel");
|
|
28
|
+
function I(l, t) {
|
|
29
|
+
const n = E(l), { oldIndex: V } = t, m = n[V];
|
|
30
|
+
if (m) {
|
|
31
|
+
const { shared: _ } = a;
|
|
32
|
+
_.draggedContext.key = m.key, _.draggedContext.field = m;
|
|
43
33
|
}
|
|
44
34
|
}
|
|
45
|
-
|
|
35
|
+
async function N() {
|
|
36
|
+
const { shared: l } = a, { field: t } = l.draggedContext, n = {
|
|
37
|
+
source: t,
|
|
38
|
+
traget: r.value,
|
|
39
|
+
region: "form-panel"
|
|
40
|
+
};
|
|
41
|
+
a.hooks.syncDragAdd.call(n), a.setCheckedField(t);
|
|
42
|
+
}
|
|
43
|
+
return (l, t) => (h(), k(
|
|
46
44
|
"div",
|
|
47
45
|
{
|
|
48
|
-
class:
|
|
46
|
+
class: c(e($)())
|
|
49
47
|
},
|
|
50
48
|
[
|
|
51
|
-
|
|
49
|
+
o(
|
|
52
50
|
"div",
|
|
53
51
|
{
|
|
54
|
-
class:
|
|
52
|
+
class: c(e(u)("toolbar"))
|
|
55
53
|
},
|
|
56
54
|
[
|
|
57
|
-
|
|
58
|
-
s(e(
|
|
55
|
+
o("div", q, [
|
|
56
|
+
s(e(D), { placement: "bottom" }, {
|
|
59
57
|
title: i(() => t[1] || (t[1] = [
|
|
60
|
-
|
|
58
|
+
o(
|
|
61
59
|
"span",
|
|
62
60
|
null,
|
|
63
61
|
"全部删除",
|
|
@@ -66,19 +64,19 @@ const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel
|
|
|
66
64
|
)
|
|
67
65
|
])),
|
|
68
66
|
default: i(() => [
|
|
69
|
-
s(e(
|
|
67
|
+
s(e(S), {
|
|
70
68
|
name: "delete1",
|
|
71
|
-
class:
|
|
69
|
+
class: c(e(g)("toolbar", "icon")),
|
|
72
70
|
size: 18,
|
|
73
|
-
onClick:
|
|
71
|
+
onClick: F
|
|
74
72
|
}, null, 8, ["class"])
|
|
75
73
|
]),
|
|
76
74
|
_: 1
|
|
77
75
|
/* STABLE */
|
|
78
76
|
}),
|
|
79
|
-
s(e(
|
|
77
|
+
s(e(D), { placement: "bottom" }, {
|
|
80
78
|
title: i(() => t[2] || (t[2] = [
|
|
81
|
-
|
|
79
|
+
o(
|
|
82
80
|
"span",
|
|
83
81
|
null,
|
|
84
82
|
"查看JSON Schema",
|
|
@@ -87,11 +85,11 @@ const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel
|
|
|
87
85
|
)
|
|
88
86
|
])),
|
|
89
87
|
default: i(() => [
|
|
90
|
-
s(e(
|
|
88
|
+
s(e(S), {
|
|
91
89
|
name: "code",
|
|
92
|
-
class:
|
|
90
|
+
class: c(e(g)("toolbar", "icon")),
|
|
93
91
|
size: 18,
|
|
94
|
-
onClick:
|
|
92
|
+
onClick: y
|
|
95
93
|
}, null, 8, ["class"])
|
|
96
94
|
]),
|
|
97
95
|
_: 1
|
|
@@ -100,7 +98,7 @@ const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel
|
|
|
100
98
|
f(` <FormIcon name="desktop" />
|
|
101
99
|
<FormIcon name="mobile" /> `)
|
|
102
100
|
]),
|
|
103
|
-
|
|
101
|
+
o("div", G, [
|
|
104
102
|
C(l.$slots, "toolbar")
|
|
105
103
|
])
|
|
106
104
|
],
|
|
@@ -108,46 +106,47 @@ const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel
|
|
|
108
106
|
/* CLASS */
|
|
109
107
|
),
|
|
110
108
|
f(' ref="contentTelRef" '),
|
|
111
|
-
|
|
109
|
+
o(
|
|
112
110
|
"div",
|
|
113
111
|
{
|
|
114
|
-
class:
|
|
112
|
+
class: c(e(u)("content"))
|
|
115
113
|
},
|
|
116
114
|
[
|
|
117
|
-
b(
|
|
115
|
+
b(o(
|
|
118
116
|
"div",
|
|
119
|
-
|
|
117
|
+
H,
|
|
120
118
|
[
|
|
121
|
-
!e(
|
|
122
|
-
s(e(
|
|
119
|
+
!e(w) && e(r).length === 0 ? (h(), k("div", K, " 👈 请在左侧选择控件并拖至此处 ")) : f("v-if", !0),
|
|
120
|
+
s(e(R), {
|
|
123
121
|
autocomplete: "off",
|
|
124
122
|
class: "design-from",
|
|
125
123
|
"label-align": "left"
|
|
126
124
|
}, {
|
|
127
125
|
default: i(() => [
|
|
128
|
-
s(e(
|
|
126
|
+
s(e(T), {
|
|
129
127
|
class: "drag-from",
|
|
130
|
-
list: e(
|
|
131
|
-
group: { name: "form"
|
|
128
|
+
list: e(r),
|
|
129
|
+
group: { name: "form" },
|
|
132
130
|
animation: 300,
|
|
133
131
|
sort: !0,
|
|
134
132
|
"item-key": "id",
|
|
135
133
|
"chosen-class": "choose",
|
|
136
|
-
onStart: t[0] || (t[0] = (
|
|
134
|
+
onStart: t[0] || (t[0] = (n) => I(e(r), n)),
|
|
135
|
+
onAdd: N
|
|
137
136
|
}, {
|
|
138
|
-
item: i(({ element:
|
|
139
|
-
|
|
140
|
-
C(l.$slots, `panel-${
|
|
141
|
-
s(
|
|
142
|
-
field:
|
|
143
|
-
space: e(
|
|
137
|
+
item: i(({ element: n }) => [
|
|
138
|
+
o("div", L, [
|
|
139
|
+
C(l.$slots, `panel-${n.key}`, {}, () => [
|
|
140
|
+
s(P, {
|
|
141
|
+
field: n,
|
|
142
|
+
space: e(r)
|
|
144
143
|
}, null, 8, ["field", "space"])
|
|
145
144
|
])
|
|
146
145
|
])
|
|
147
146
|
]),
|
|
148
147
|
_: 3
|
|
149
148
|
/* FORWARDED */
|
|
150
|
-
}, 8, ["list"
|
|
149
|
+
}, 8, ["list"])
|
|
151
150
|
]),
|
|
152
151
|
_: 3
|
|
153
152
|
/* FORWARDED */
|
|
@@ -156,18 +155,18 @@ const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel
|
|
|
156
155
|
512
|
|
157
156
|
/* NEED_PATCH */
|
|
158
157
|
), [
|
|
159
|
-
[x, !
|
|
158
|
+
[x, !d.value]
|
|
160
159
|
]),
|
|
161
|
-
b(
|
|
160
|
+
b(o(
|
|
162
161
|
"div",
|
|
163
|
-
|
|
162
|
+
M,
|
|
164
163
|
[
|
|
165
|
-
s(
|
|
164
|
+
s(J, { data: p.value }, null, 8, ["data"])
|
|
166
165
|
],
|
|
167
166
|
512
|
|
168
167
|
/* NEED_PATCH */
|
|
169
168
|
), [
|
|
170
|
-
[x,
|
|
169
|
+
[x, d.value]
|
|
171
170
|
])
|
|
172
171
|
],
|
|
173
172
|
2
|
|
@@ -180,5 +179,5 @@ const H = { class: "left" }, K = { class: "right" }, L = { class: "content-panel
|
|
|
180
179
|
}
|
|
181
180
|
});
|
|
182
181
|
export {
|
|
183
|
-
|
|
182
|
+
le as default
|
|
184
183
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Input as m, Textarea as o, InputNumber as
|
|
1
|
+
import { Input as m, 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";
|
|
@@ -6,24 +6,27 @@ import "./widget/array-card.vue.mjs";
|
|
|
6
6
|
import "./widget/date-range.vue.mjs";
|
|
7
7
|
import "./widget/date-single.vue.mjs";
|
|
8
8
|
import "./widget/kit.vue.mjs";
|
|
9
|
-
import
|
|
9
|
+
import "./widget/array-table.vue.mjs";
|
|
10
|
+
import e from "./widget/select.vue2.mjs";
|
|
10
11
|
import p from "./widget/object.vue2.mjs";
|
|
11
12
|
import a from "./widget/date-range.vue2.mjs";
|
|
12
13
|
import n from "./widget/date-single.vue2.mjs";
|
|
13
14
|
import f from "./widget/array-card.vue2.mjs";
|
|
14
15
|
import t from "./widget/kit.vue2.mjs";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"k-
|
|
18
|
-
"k-
|
|
19
|
-
"k-
|
|
16
|
+
import c from "./widget/array-table.vue2.mjs";
|
|
17
|
+
const s = r(m), _ = r(o), k = r(i), W = {
|
|
18
|
+
"k-input": s,
|
|
19
|
+
"k-textarea": _,
|
|
20
|
+
"k-input-number": k,
|
|
21
|
+
"k-select": e,
|
|
20
22
|
"k-object": p,
|
|
21
23
|
"k-date-range": a,
|
|
22
24
|
"k-date-single": n,
|
|
23
25
|
"k-array-card": f,
|
|
24
26
|
"k-overtime": t,
|
|
25
|
-
"k-leave": t
|
|
27
|
+
"k-leave": t,
|
|
28
|
+
"k-table": c
|
|
26
29
|
};
|
|
27
30
|
export {
|
|
28
|
-
|
|
31
|
+
W as widgetPanels
|
|
29
32
|
};
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { defineComponent as V, computed as g, openBlock as n, createElementBlock as b, normalizeClass as p, withModifiers as j, unref as t, createBlock as a, resolveDynamicComponent as
|
|
2
|
-
import { FormItem as
|
|
1
|
+
import { defineComponent as V, computed as g, openBlock as n, createElementBlock as b, normalizeClass as p, withModifiers as j, unref as t, createBlock as a, resolveDynamicComponent as w, withCtx as z, createElementVNode as $, createCommentVNode as r, createVNode as x, defineAsyncComponent as A } from "vue";
|
|
2
|
+
import { FormItem as M, Tooltip as O } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { useInjectDesignContext as
|
|
4
|
+
import { useInjectDesignContext as S } from "../../context/design.mjs";
|
|
5
5
|
import "../index.mjs";
|
|
6
6
|
import { useNamespace as W } from "../../hooks/use-namespace/index.mjs";
|
|
7
7
|
import m from "../form-icon.vue2.mjs";
|
|
8
|
-
const
|
|
8
|
+
const q = {
|
|
9
9
|
key: 2,
|
|
10
10
|
class: "icons"
|
|
11
|
-
},
|
|
11
|
+
}, U = /* @__PURE__ */ V({
|
|
12
12
|
__name: "panel-item",
|
|
13
13
|
props: {
|
|
14
14
|
field: {},
|
|
15
|
-
space: {}
|
|
15
|
+
space: {},
|
|
16
|
+
hideTitle: { type: Boolean }
|
|
16
17
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const o =
|
|
19
|
-
function
|
|
18
|
+
setup(B) {
|
|
19
|
+
const o = B, { b: D, e: u, m: v } = W("panel-item"), c = S(), { checkedField: d, shared: I } = c;
|
|
20
|
+
function N(e, i = {}) {
|
|
20
21
|
return Object.entries(e).forEach(([l, s]) => {
|
|
21
|
-
typeof s == "function" ? i[l] =
|
|
22
|
+
typeof s == "function" ? i[l] = A(s) : i[l] = s;
|
|
22
23
|
}), i;
|
|
23
24
|
}
|
|
24
|
-
const k =
|
|
25
|
-
function
|
|
25
|
+
const k = N(I.panelWidgets);
|
|
26
|
+
function E(e) {
|
|
26
27
|
c.setCheckedField(e);
|
|
27
28
|
}
|
|
28
29
|
const f = g(() => {
|
|
29
30
|
var i, l;
|
|
30
31
|
return ((l = (i = o.field["x-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
|
|
31
|
-
}),
|
|
32
|
+
}), F = g(() => {
|
|
32
33
|
var i;
|
|
33
|
-
const e = [
|
|
34
|
+
const e = [D()];
|
|
34
35
|
return ((i = d.value) == null ? void 0 : i.id) === o.field.id && e.push(v("active")), f.value && e.push(v("error")), e;
|
|
35
36
|
});
|
|
36
|
-
function
|
|
37
|
+
function T() {
|
|
37
38
|
if (!c.hooks.beforeDelete.call(o.field))
|
|
38
39
|
return;
|
|
39
40
|
const i = o.space.findIndex((l) => l.id === o.field.id);
|
|
40
41
|
i !== -1 && o.space.splice(i, 1);
|
|
41
42
|
}
|
|
42
43
|
return (e, i) => {
|
|
43
|
-
var l, s,
|
|
44
|
+
var l, s, C, h, y;
|
|
44
45
|
return n(), b(
|
|
45
46
|
"div",
|
|
46
47
|
{
|
|
47
|
-
class: p(
|
|
48
|
-
onClick: i[0] || (i[0] = j((
|
|
48
|
+
class: p(F.value),
|
|
49
|
+
onClick: i[0] || (i[0] = j((G) => E(e.field), ["stop"]))
|
|
49
50
|
},
|
|
50
51
|
[
|
|
51
|
-
t(k)[e.field.key] ? (n(), a(
|
|
52
|
+
t(k)[e.field.key] ? (n(), a(w(t(k)[e.field.key]), {
|
|
52
53
|
key: 0,
|
|
53
|
-
|
|
54
|
-
readonly: "",
|
|
54
|
+
"hide-title": e.hideTitle,
|
|
55
55
|
field: e.field
|
|
56
|
-
}, null, 8, ["field"])) : (n(), a(t(
|
|
56
|
+
}, null, 8, ["hide-title", "field"])) : (n(), a(t(M), {
|
|
57
57
|
key: 1,
|
|
58
58
|
class: p(t(u)("form")),
|
|
59
59
|
label: e.field.title
|
|
@@ -72,22 +72,22 @@ const _ = {
|
|
|
72
72
|
_: 1
|
|
73
73
|
/* STABLE */
|
|
74
74
|
}, 8, ["class", "label"])),
|
|
75
|
-
((l = t(d)) == null ? void 0 : l.id) === e.field.id || f.value ? (n(), b("div",
|
|
75
|
+
((l = t(d)) == null ? void 0 : l.id) === e.field.id || f.value ? (n(), b("div", q, [
|
|
76
76
|
((s = t(d)) == null ? void 0 : s.id) === e.field.id ? (n(), a(t(m), {
|
|
77
77
|
key: 0,
|
|
78
78
|
name: "copy",
|
|
79
79
|
class: "panel-icon",
|
|
80
80
|
size: 15
|
|
81
81
|
})) : r("v-if", !0),
|
|
82
|
-
((
|
|
82
|
+
((C = t(d)) == null ? void 0 : C.id) === e.field.id ? (n(), a(t(m), {
|
|
83
83
|
key: 1,
|
|
84
84
|
name: "delete1",
|
|
85
85
|
class: "panel-icon",
|
|
86
86
|
size: 15,
|
|
87
|
-
onClick:
|
|
87
|
+
onClick: T
|
|
88
88
|
})) : r("v-if", !0),
|
|
89
|
-
|
|
90
|
-
title: (
|
|
89
|
+
x(t(O), {
|
|
90
|
+
title: (y = (h = e.field["x-design-props"]) == null ? void 0 : h.validate) == null ? void 0 : y.message,
|
|
91
91
|
color: "pink"
|
|
92
92
|
}, {
|
|
93
93
|
default: z(() => [
|
|
@@ -110,5 +110,5 @@ const _ = {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
U as default
|
|
114
114
|
};
|