@king-one/form-design 0.0.17 → 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 +12 -0
- package/dist/es/index.mjs +16 -13
- package/dist/es/src/components/base/Carousel.vue.mjs +92 -0
- package/dist/es/src/components/base/Carousel.vue2.mjs +4 -0
- package/dist/es/src/components/base/json-preview.vue.mjs +215 -151
- package/dist/es/src/components/form-material.vue.mjs +168 -94
- package/dist/es/src/components/form-panel.vue.mjs +65 -60
- package/dist/es/src/components/panel/index.mjs +26 -13
- package/dist/es/src/components/panel/panel-item.vue.mjs +39 -39
- 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.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/date-range.vue2.mjs +28 -0
- package/dist/es/src/components/panel/widget/date-single.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/date-single.vue2.mjs +28 -0
- package/dist/es/src/components/panel/widget/kit.vue.mjs +4 -0
- package/dist/es/src/components/panel/widget/kit.vue2.mjs +48 -0
- package/dist/es/src/components/panel/widget/object.vue2.mjs +41 -30
- package/dist/es/src/components/panel/widget/select.vue2.mjs +3 -3
- package/dist/es/src/components/props/form-config.vue.mjs +1 -1
- package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +31 -46
- package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +94 -109
- package/dist/es/src/components/props/widget/InputProps.vue2.mjs +49 -64
- package/dist/es/src/components/props/widget/OvertimeProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/OvertimeProps.vue2.mjs +17 -0
- package/dist/es/src/components/props/widget/PropsDecorator.mjs +34 -0
- package/dist/es/src/components/props/widget/SelectProps.vue.mjs +4 -0
- package/dist/es/src/components/props/widget/SelectProps.vue2.mjs +88 -0
- package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +48 -63
- package/dist/es/src/components/props/widget/index.mjs +44 -36
- package/dist/es/src/config/index.mjs +235 -16
- package/dist/es/src/core/Design.mjs +24 -16
- package/dist/es/src/core/Field.mjs +1 -1
- package/dist/es/src/core/FormSchema.mjs +29 -27
- package/dist/es/src/index.mjs +15 -13
- package/dist/es/src/internal.mjs +5 -4
- package/dist/es/src/plugins/index.mjs +23 -8
- package/dist/es/src/plugins/modules/drag-add.mjs +23 -0
- package/dist/es/src/utils/debounce.mjs +16 -0
- package/dist/es/src/utils/index.mjs +15 -13
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/base/Carousel.vue.js +1 -0
- package/dist/lib/src/components/base/Carousel.vue2.js +1 -0
- package/dist/lib/src/components/base/json-preview.vue.js +6 -6
- package/dist/lib/src/components/form-material.vue.js +10 -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.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/date-single.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/date-single.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/kit.vue.js +1 -0
- package/dist/lib/src/components/panel/widget/kit.vue2.js +1 -0
- package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
- package/dist/lib/src/components/panel/widget/select.vue2.js +1 -1
- package/dist/lib/src/components/props/form-config.vue.js +1 -1
- package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/OvertimeProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/OvertimeProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/PropsDecorator.js +1 -0
- package/dist/lib/src/components/props/widget/SelectProps.vue.js +1 -0
- package/dist/lib/src/components/props/widget/SelectProps.vue2.js +1 -0
- package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/index.js +1 -1
- package/dist/lib/src/config/index.js +1 -1
- package/dist/lib/src/core/Design.js +1 -1
- package/dist/lib/src/core/Field.js +1 -1
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/index.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/lib/src/utils/debounce.js +1 -0
- package/dist/lib/src/utils/index.js +1 -1
- package/dist/theme-chalk/array-table.css +1 -0
- package/dist/theme-chalk/carousel.css +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/theme-chalk/json-preview.css +1 -1
- package/dist/theme-chalk/kit-panel.css +1 -0
- package/dist/theme-chalk/material.css +1 -1
- package/dist/theme-chalk/panel-item.css +1 -1
- package/dist/theme-chalk/panel.css +1 -1
- package/dist/types/src/components/base/Carousel.vue.d.ts +65 -0
- 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/components/panel/widget/date-range.vue.d.ts +8 -0
- package/dist/types/src/components/panel/widget/date-single.vue.d.ts +8 -0
- package/dist/types/src/components/panel/widget/kit.vue.d.ts +8 -0
- package/dist/types/src/components/props/widget/OvertimeProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/PropsDecorator.d.ts +3 -0
- package/dist/types/src/components/props/widget/SelectProps.vue.d.ts +3 -0
- package/dist/types/src/components/props/widget/index.d.ts +1 -9
- package/dist/types/src/components/types.d.ts +4 -3
- package/dist/types/src/config/index.d.ts +2 -1
- package/dist/types/src/core/Design.d.ts +95 -42
- package/dist/types/src/core/FormSchema.d.ts +22 -10
- package/dist/types/src/hooks/usePolling.d.ts +5 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/internal.d.ts +1 -0
- package/dist/types/src/plugins/index.d.ts +5 -2
- package/dist/types/src/plugins/modules/drag-add.d.ts +6 -0
- package/dist/types/src/types.d.ts +29 -6
- package/dist/types/src/utils/debounce.d.ts +10 -0
- package/dist/types/src/utils/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { defineComponent 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
|
-
import { useNamespace as
|
|
7
|
-
import
|
|
6
|
+
import { useNamespace as W } from "../../hooks/use-namespace/index.mjs";
|
|
7
|
+
import m from "../form-icon.vue2.mjs";
|
|
8
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
|
|
26
|
-
|
|
25
|
+
const k = N(I.panelWidgets);
|
|
26
|
+
function E(e) {
|
|
27
|
+
c.setCheckedField(e);
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
+
const f = g(() => {
|
|
29
30
|
var i, l;
|
|
30
|
-
return ((l = (i = o.field["
|
|
31
|
-
}),
|
|
31
|
+
return ((l = (i = o.field["x-design-props"]) == null ? void 0 : i.validate) == null ? void 0 : l.status) === "error";
|
|
32
|
+
}), F = g(() => {
|
|
32
33
|
var i;
|
|
33
|
-
const e = [
|
|
34
|
-
return ((i =
|
|
34
|
+
const e = [D()];
|
|
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
|
-
if (!
|
|
37
|
+
function T() {
|
|
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:
|
|
48
|
-
onClick: i[0] || (i[0] =
|
|
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(),
|
|
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(),
|
|
56
|
+
}, null, 8, ["hide-title", "field"])) : (n(), a(t(M), {
|
|
57
57
|
key: 1,
|
|
58
|
-
class:
|
|
58
|
+
class: p(t(u)("form")),
|
|
59
59
|
label: e.field.title
|
|
60
60
|
}, {
|
|
61
61
|
default: z(() => [
|
|
62
|
-
|
|
62
|
+
$(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
class:
|
|
65
|
+
class: p(t(u)("error"))
|
|
66
66
|
},
|
|
67
67
|
" 未定义组件 ",
|
|
68
68
|
2
|
|
@@ -72,26 +72,26 @@ const q = {
|
|
|
72
72
|
_: 1
|
|
73
73
|
/* STABLE */
|
|
74
74
|
}, 8, ["class", "label"])),
|
|
75
|
-
((l = t(
|
|
76
|
-
((s = t(
|
|
75
|
+
((l = t(d)) == null ? void 0 : l.id) === e.field.id || f.value ? (n(), b("div", q, [
|
|
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(() => [
|
|
94
|
-
|
|
94
|
+
f.value ? (n(), a(t(m), {
|
|
95
95
|
key: 0,
|
|
96
96
|
name: "exclamation-circle-filled",
|
|
97
97
|
size: 13,
|
|
@@ -110,5 +110,5 @@ const q = {
|
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
U as default
|
|
114
114
|
};
|
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { FormItem as
|
|
1
|
+
import { defineComponent as a, createVNode as n, h as p } from "vue";
|
|
2
|
+
import { FormItem as i } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { defaultNamespace as
|
|
5
|
-
function s(
|
|
6
|
-
return /* @__PURE__ */
|
|
4
|
+
import { defaultNamespace as m } from "../../hooks/use-namespace/index.mjs";
|
|
5
|
+
function s(t) {
|
|
6
|
+
return /* @__PURE__ */ a({
|
|
7
7
|
name: "panelWarpper",
|
|
8
8
|
props: {
|
|
9
9
|
field: {
|
|
10
10
|
type: Object
|
|
11
|
+
},
|
|
12
|
+
hideTitle: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
setup(e) {
|
|
14
|
-
var
|
|
15
|
-
const
|
|
18
|
+
var l;
|
|
19
|
+
const r = (l = e.field) == null ? void 0 : l["x-component-props"];
|
|
16
20
|
return () => {
|
|
17
|
-
var
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
var o;
|
|
22
|
+
return n("div", null, [e.hideTitle ? p(t, {
|
|
23
|
+
...r,
|
|
24
|
+
readonly: !0
|
|
25
|
+
}) : n(i, {
|
|
26
|
+
class: [`${m}-panel-item__form`],
|
|
27
|
+
label: (o = e.field) == null ? void 0 : o.title
|
|
21
28
|
}, {
|
|
22
|
-
default: () =>
|
|
23
|
-
...
|
|
24
|
-
readonly: !0
|
|
29
|
+
default: () => p(t, {
|
|
30
|
+
...r,
|
|
31
|
+
readonly: !0,
|
|
32
|
+
style: {
|
|
33
|
+
width: "100%"
|
|
34
|
+
}
|
|
25
35
|
}),
|
|
26
36
|
_: 1
|
|
27
|
-
}, 8, ["label"]);
|
|
37
|
+
}, 8, ["label"])]);
|
|
28
38
|
};
|
|
29
39
|
}
|
|
30
40
|
});
|
|
@@ -1,52 +1,65 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as p, toRaw as h, openBlock as y, createElementBlock as k, createElementVNode as o, toDisplayString as x, createVNode as c, unref as a, normalizeClass as C, withCtx as v, renderSlot as w } from "vue";
|
|
2
|
+
import A from "vuedraggable";
|
|
3
3
|
import "../../../internal.mjs";
|
|
4
|
+
import { message as D } from "ant-design-vue";
|
|
4
5
|
import "../../../index.mjs";
|
|
5
|
-
import { useInjectDesignContext as
|
|
6
|
-
import { useNamespace as
|
|
7
|
-
import
|
|
8
|
-
const N = { class: "form-item" },
|
|
6
|
+
import { useInjectDesignContext as b } from "../../../context/design.mjs";
|
|
7
|
+
import { useNamespace as I } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import S from "../panel-item.vue.mjs";
|
|
9
|
+
const N = { class: "form-item" }, F = /* @__PURE__ */ p({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "array-card",
|
|
11
12
|
props: {
|
|
12
13
|
field: {}
|
|
13
14
|
},
|
|
14
15
|
setup(s) {
|
|
15
|
-
const
|
|
16
|
+
const i = b(), { b: f } = I("panel-drag");
|
|
16
17
|
function m() {
|
|
17
18
|
return !0;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const { shared:
|
|
23
|
-
|
|
20
|
+
function g(e, t) {
|
|
21
|
+
const n = h(e), { oldIndex: l } = t, r = n[l];
|
|
22
|
+
if (r) {
|
|
23
|
+
const { shared: d } = i;
|
|
24
|
+
d.draggedContext.key = r.key, d.draggedContext.field = r;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
n
|
|
27
|
+
function u() {
|
|
28
|
+
const { shared: e } = i, { field: t } = e.draggedContext, n = {
|
|
29
|
+
source: t,
|
|
30
|
+
traget: s.field.children,
|
|
31
|
+
region: "k-array-card"
|
|
32
|
+
};
|
|
33
|
+
if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((r) => r)) {
|
|
34
|
+
const r = s.field.children.findIndex((d) => d.id === t.id);
|
|
35
|
+
r !== -1 && (s.field.children.splice(r, 1), D.warning("不能将该控件拖拽到列表容器中"));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return (e, t) => (y(), k("div", null, [
|
|
39
|
+
o(
|
|
28
40
|
"div",
|
|
29
41
|
null,
|
|
30
|
-
|
|
42
|
+
x(e.field.title),
|
|
31
43
|
1
|
|
32
44
|
/* TEXT */
|
|
33
45
|
),
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
o("div", null, [
|
|
47
|
+
c(a(A), {
|
|
36
48
|
list: e.field.children,
|
|
37
|
-
class: C(
|
|
49
|
+
class: C(a(f)()),
|
|
38
50
|
group: { name: "form", put: m },
|
|
39
51
|
animation: 300,
|
|
40
52
|
sort: !0,
|
|
41
53
|
"item-key": "id",
|
|
42
54
|
"chosen-class": "choose",
|
|
43
|
-
onStart: t[0] || (t[0] = (
|
|
55
|
+
onStart: t[0] || (t[0] = (n) => g(e.field.children, n)),
|
|
56
|
+
onAdd: u
|
|
44
57
|
}, {
|
|
45
|
-
item: v(({ element:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
field:
|
|
58
|
+
item: v(({ element: n }) => [
|
|
59
|
+
o("div", N, [
|
|
60
|
+
w(e.$slots, `panel-${n.key}`, {}, () => [
|
|
61
|
+
c(a(S), {
|
|
62
|
+
field: n,
|
|
50
63
|
space: e.field.children
|
|
51
64
|
}, null, 8, ["field", "space"])
|
|
52
65
|
])
|
|
@@ -55,7 +68,7 @@ const N = { class: "form-item" }, j = /* @__PURE__ */ u({
|
|
|
55
68
|
_: 3
|
|
56
69
|
/* FORWARDED */
|
|
57
70
|
}, 8, ["list", "class", "group"]),
|
|
58
|
-
t[1] || (t[1] =
|
|
71
|
+
t[1] || (t[1] = o(
|
|
59
72
|
"div",
|
|
60
73
|
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
61
74
|
" ☝ 拖拽控件到容器内部 ",
|
|
@@ -67,5 +80,5 @@ const N = { class: "form-item" }, j = /* @__PURE__ */ u({
|
|
|
67
80
|
}
|
|
68
81
|
});
|
|
69
82
|
export {
|
|
70
|
-
|
|
83
|
+
F as default
|
|
71
84
|
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineComponent as f, openBlock as g, createElementBlock as p, normalizeClass as b, unref as l, createElementVNode as e, createVNode as o, withCtx as y, renderSlot as u, toDisplayString as v } from "vue";
|
|
2
|
+
import h from "vuedraggable";
|
|
3
|
+
import "../../../index.mjs";
|
|
4
|
+
import "../../../internal.mjs";
|
|
5
|
+
import { message as x } from "ant-design-vue";
|
|
6
|
+
import { useInjectDesignContext as _ } from "../../../context/design.mjs";
|
|
7
|
+
import { useNamespace as C } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import k from "../panel-item.vue.mjs";
|
|
9
|
+
const A = { class: "array-table-box" }, D = { class: "array-table-drag" }, w = { class: "form-item" }, I = { class: "table-item" }, N = { class: "array-table-drag-header" }, $ = { class: "array-table-drag-content" }, T = /* @__PURE__ */ f({
|
|
10
|
+
name: "ArrayTable",
|
|
11
|
+
__name: "array-table",
|
|
12
|
+
props: {
|
|
13
|
+
field: {}
|
|
14
|
+
},
|
|
15
|
+
setup(s) {
|
|
16
|
+
const d = _(), { b: n } = C("array-table");
|
|
17
|
+
function c() {
|
|
18
|
+
const { shared: a } = d, { field: t } = a.draggedContext, r = {
|
|
19
|
+
source: t,
|
|
20
|
+
traget: s.field.children,
|
|
21
|
+
region: "k-array-card"
|
|
22
|
+
};
|
|
23
|
+
if (d.hooks.syncDragAdd.call(r), !d.dragAddResult.every((i) => i)) {
|
|
24
|
+
const i = s.field.children.findIndex((m) => m.id === t.id);
|
|
25
|
+
i !== -1 && (s.field.children.splice(i, 1), x.warning("不能将该控件拖拽到列表容器中"));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return (a, t) => (g(), p(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
class: b(l(n)())
|
|
32
|
+
},
|
|
33
|
+
[
|
|
34
|
+
t[1] || (t[1] = e(
|
|
35
|
+
"div",
|
|
36
|
+
null,
|
|
37
|
+
"明细列表",
|
|
38
|
+
-1
|
|
39
|
+
/* CACHED */
|
|
40
|
+
)),
|
|
41
|
+
e("div", A, [
|
|
42
|
+
t[0] || (t[0] = e(
|
|
43
|
+
"div",
|
|
44
|
+
{ class: "array-table-left" },
|
|
45
|
+
[
|
|
46
|
+
e("div", { class: "array-table-drag-header" }, " 表头 "),
|
|
47
|
+
e("div", { class: "array-table-drag-content" })
|
|
48
|
+
],
|
|
49
|
+
-1
|
|
50
|
+
/* CACHED */
|
|
51
|
+
)),
|
|
52
|
+
e("div", D, [
|
|
53
|
+
o(l(h), {
|
|
54
|
+
class: "widget-drag",
|
|
55
|
+
list: a.field.children,
|
|
56
|
+
group: { name: "form", direction: "vertical", removeCloneOnHide: !1 },
|
|
57
|
+
animation: 300,
|
|
58
|
+
sort: !0,
|
|
59
|
+
"item-key": "id",
|
|
60
|
+
"drag-class": "table-item-drag-class",
|
|
61
|
+
onAdd: c
|
|
62
|
+
}, {
|
|
63
|
+
item: y(({ element: r }) => [
|
|
64
|
+
e("div", w, [
|
|
65
|
+
u(a.$slots, `panel-${r.key}`, {}, () => [
|
|
66
|
+
e("div", I, [
|
|
67
|
+
e(
|
|
68
|
+
"div",
|
|
69
|
+
N,
|
|
70
|
+
v(r.title),
|
|
71
|
+
1
|
|
72
|
+
/* TEXT */
|
|
73
|
+
),
|
|
74
|
+
e("div", $, [
|
|
75
|
+
o(l(k), {
|
|
76
|
+
field: r,
|
|
77
|
+
space: a.field.children,
|
|
78
|
+
"hide-title": ""
|
|
79
|
+
}, null, 8, ["field", "space"])
|
|
80
|
+
])
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
])
|
|
84
|
+
]),
|
|
85
|
+
_: 3
|
|
86
|
+
/* FORWARDED */
|
|
87
|
+
}, 8, ["list"])
|
|
88
|
+
])
|
|
89
|
+
]),
|
|
90
|
+
t[2] || (t[2] = e(
|
|
91
|
+
"div",
|
|
92
|
+
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
93
|
+
" ☝ 拖拽控件到明细列表 ",
|
|
94
|
+
-1
|
|
95
|
+
/* CACHED */
|
|
96
|
+
))
|
|
97
|
+
],
|
|
98
|
+
2
|
|
99
|
+
/* CLASS */
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
export {
|
|
104
|
+
T as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as t, createBlock as n, unref as o, withCtx as l, createVNode as p, mergeProps as a } from "vue";
|
|
2
|
+
import { FormItem as f, RangePicker as m } from "ant-design-vue";
|
|
3
|
+
const u = /* @__PURE__ */ r({
|
|
4
|
+
__name: "date-range",
|
|
5
|
+
props: {
|
|
6
|
+
field: {}
|
|
7
|
+
},
|
|
8
|
+
setup(i) {
|
|
9
|
+
return (e, c) => (t(), n(o(f), {
|
|
10
|
+
label: e.field.title
|
|
11
|
+
}, {
|
|
12
|
+
default: l(() => [
|
|
13
|
+
p(
|
|
14
|
+
o(m),
|
|
15
|
+
a(e.field["x-component-props"], { open: !1 }),
|
|
16
|
+
null,
|
|
17
|
+
16
|
|
18
|
+
/* FULL_PROPS */
|
|
19
|
+
)
|
|
20
|
+
]),
|
|
21
|
+
_: 1
|
|
22
|
+
/* STABLE */
|
|
23
|
+
}, 8, ["label"]));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
u as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as t, createBlock as l, unref as o, withCtx as a, createVNode as n, normalizeProps as p, guardReactiveProps as i } from "vue";
|
|
2
|
+
import { FormItem as m, DatePicker as c } from "ant-design-vue";
|
|
3
|
+
const _ = /* @__PURE__ */ r({
|
|
4
|
+
__name: "date-single",
|
|
5
|
+
props: {
|
|
6
|
+
field: {}
|
|
7
|
+
},
|
|
8
|
+
setup(f) {
|
|
9
|
+
return (e, s) => (t(), l(o(m), {
|
|
10
|
+
label: e.field.title
|
|
11
|
+
}, {
|
|
12
|
+
default: a(() => [
|
|
13
|
+
n(
|
|
14
|
+
o(c),
|
|
15
|
+
p(i(e.field["x-component-props"])),
|
|
16
|
+
null,
|
|
17
|
+
16
|
|
18
|
+
/* FULL_PROPS */
|
|
19
|
+
)
|
|
20
|
+
]),
|
|
21
|
+
_: 1
|
|
22
|
+
/* STABLE */
|
|
23
|
+
}, 8, ["label"]));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
_ as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as f, defineAsyncComponent as m, openBlock as t, createElementBlock as s, normalizeClass as u, unref as i, Fragment as C, renderList as k, createBlock as y, resolveDynamicComponent as _ } from "vue";
|
|
2
|
+
import "../../../internal.mjs";
|
|
3
|
+
import { useInjectDesignContext as g } from "../../../context/design.mjs";
|
|
4
|
+
import { useNamespace as h } from "../../../hooks/use-namespace/index.mjs";
|
|
5
|
+
const D = /* @__PURE__ */ f({
|
|
6
|
+
__name: "kit",
|
|
7
|
+
props: {
|
|
8
|
+
field: {}
|
|
9
|
+
},
|
|
10
|
+
setup(v) {
|
|
11
|
+
const { b: l } = h("kit-panel"), c = g(), { shared: a } = c;
|
|
12
|
+
function d(o, n = {}) {
|
|
13
|
+
return Object.entries(o).forEach(([e, r]) => {
|
|
14
|
+
typeof r == "function" ? n[e] = m(r) : n[e] = r;
|
|
15
|
+
}), n;
|
|
16
|
+
}
|
|
17
|
+
const p = d(a.panelWidgets);
|
|
18
|
+
return (o, n) => (t(), s(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
class: u(i(l)())
|
|
22
|
+
},
|
|
23
|
+
[
|
|
24
|
+
(t(!0), s(
|
|
25
|
+
C,
|
|
26
|
+
null,
|
|
27
|
+
k(o.field.children, (e) => (t(), s("div", {
|
|
28
|
+
key: e.id,
|
|
29
|
+
class: "kit-item"
|
|
30
|
+
}, [
|
|
31
|
+
(t(), y(_(i(p)[e.key]), {
|
|
32
|
+
style: { width: "100%" },
|
|
33
|
+
readonly: "",
|
|
34
|
+
field: e
|
|
35
|
+
}, null, 8, ["field"]))
|
|
36
|
+
]))),
|
|
37
|
+
128
|
|
38
|
+
/* KEYED_FRAGMENT */
|
|
39
|
+
))
|
|
40
|
+
],
|
|
41
|
+
2
|
|
42
|
+
/* CLASS */
|
|
43
|
+
));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
D as default
|
|
48
|
+
};
|
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as p, toRaw as u, openBlock as h, 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
|
+
import v from "vuedraggable";
|
|
3
3
|
import "../../../internal.mjs";
|
|
4
4
|
import "../../../index.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import D from "
|
|
8
|
-
|
|
5
|
+
import { message as A } from "ant-design-vue";
|
|
6
|
+
import { useInjectDesignContext as w } from "../../../context/design.mjs";
|
|
7
|
+
import { useNamespace as D } from "../../../hooks/use-namespace/index.mjs";
|
|
8
|
+
import I from "../panel-item.vue.mjs";
|
|
9
|
+
const S = { class: "form-item" }, q = /* @__PURE__ */ p({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "object",
|
|
11
12
|
props: {
|
|
12
13
|
field: {}
|
|
13
14
|
},
|
|
14
15
|
setup(s) {
|
|
15
|
-
const
|
|
16
|
-
function m() {
|
|
17
|
-
|
|
16
|
+
const i = w(), { b: f } = D("panel-drag");
|
|
17
|
+
function m(e, t) {
|
|
18
|
+
const n = u(e), { oldIndex: a } = t, o = n[a];
|
|
19
|
+
if (o) {
|
|
20
|
+
const { shared: d } = i;
|
|
21
|
+
d.draggedContext.key = o.key, d.draggedContext.field = o;
|
|
22
|
+
}
|
|
18
23
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
function g() {
|
|
25
|
+
console.log("dragAdd");
|
|
26
|
+
const { shared: e } = i, { field: t } = e.draggedContext, n = {
|
|
27
|
+
source: t,
|
|
28
|
+
traget: s.field.children,
|
|
29
|
+
region: "k-object"
|
|
30
|
+
};
|
|
31
|
+
if (i.hooks.syncDragAdd.call(n), !i.dragAddResult.every((o) => o)) {
|
|
32
|
+
const o = s.field.children.findIndex((d) => d.id === t.id);
|
|
33
|
+
o !== -1 && (s.field.children.splice(o, 1), A.warning("不能将该控件拖拽到对象容器中"));
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
|
-
return
|
|
27
|
-
|
|
36
|
+
return (e, t) => (h(), k("div", null, [
|
|
37
|
+
r(
|
|
28
38
|
"div",
|
|
29
39
|
null,
|
|
30
|
-
|
|
40
|
+
x(e.field.title),
|
|
31
41
|
1
|
|
32
42
|
/* TEXT */
|
|
33
43
|
),
|
|
34
|
-
|
|
35
|
-
l(
|
|
44
|
+
r("div", null, [
|
|
45
|
+
c(l(v), {
|
|
36
46
|
list: e.field.children,
|
|
37
|
-
class:
|
|
38
|
-
group: { name: "form"
|
|
47
|
+
class: y(l(f)()),
|
|
48
|
+
group: { name: "form" },
|
|
39
49
|
animation: 300,
|
|
40
50
|
sort: !0,
|
|
41
51
|
"item-key": "id",
|
|
42
52
|
"chosen-class": "choose",
|
|
43
|
-
onStart: t[0] || (t[0] = (
|
|
53
|
+
onStart: t[0] || (t[0] = (n) => m(e.field.children, n)),
|
|
54
|
+
onAdd: g
|
|
44
55
|
}, {
|
|
45
|
-
item:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
l(
|
|
49
|
-
field:
|
|
56
|
+
item: C(({ element: n }) => [
|
|
57
|
+
r("div", S, [
|
|
58
|
+
b(e.$slots, `panel-${n.key}`, {}, () => [
|
|
59
|
+
c(l(I), {
|
|
60
|
+
field: n,
|
|
50
61
|
space: e.field.children
|
|
51
62
|
}, null, 8, ["field", "space"])
|
|
52
63
|
])
|
|
@@ -54,8 +65,8 @@ const N = { class: "form-item" }, _ = /* @__PURE__ */ u({
|
|
|
54
65
|
]),
|
|
55
66
|
_: 3
|
|
56
67
|
/* FORWARDED */
|
|
57
|
-
}, 8, ["list", "class"
|
|
58
|
-
t[1] || (t[1] =
|
|
68
|
+
}, 8, ["list", "class"]),
|
|
69
|
+
t[1] || (t[1] = r(
|
|
59
70
|
"div",
|
|
60
71
|
{ style: { color: "#c0bebe", "text-align": "center", width: "90%", padding: "5px" } },
|
|
61
72
|
" ☝ 拖拽控件到布局容器内部 ",
|
|
@@ -67,5 +78,5 @@ const N = { class: "form-item" }, _ = /* @__PURE__ */ u({
|
|
|
67
78
|
}
|
|
68
79
|
});
|
|
69
80
|
export {
|
|
70
|
-
|
|
81
|
+
q as default
|
|
71
82
|
};
|