@king-one/form-antdv 0.0.11 → 0.0.13
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 +16 -0
- package/dist/es/src/components/ArrayCard/array-card.vue2.mjs +51 -44
- package/dist/es/src/components/ArrayTable/array-table.vue2.mjs +40 -43
- package/dist/es/src/components/FormGrid/form-grid-column.vue.mjs +4 -0
- package/dist/es/src/components/FormGrid/form-grid-column.vue2.mjs +37 -0
- package/dist/es/src/components/FormGrid/form-grid.vue.mjs +4 -0
- package/dist/es/src/components/FormGrid/form-grid.vue2.mjs +39 -0
- package/dist/es/src/components/FormGrid/index.mjs +11 -0
- package/dist/es/src/components/Textarea/index.mjs +10 -0
- package/dist/es/src/index.mjs +12 -7
- package/dist/es/src/internal.mjs +5 -4
- package/dist/lib/src/components/ArrayCard/array-card.vue2.js +1 -1
- package/dist/lib/src/components/ArrayTable/array-table.vue2.js +1 -1
- package/dist/lib/src/components/FormGrid/form-grid-column.vue.js +1 -0
- package/dist/lib/src/components/FormGrid/form-grid-column.vue2.js +3 -0
- package/dist/lib/src/components/FormGrid/form-grid.vue.js +1 -0
- package/dist/lib/src/components/FormGrid/form-grid.vue2.js +3 -0
- package/dist/lib/src/components/FormGrid/index.js +1 -0
- package/dist/lib/src/components/Textarea/index.js +1 -0
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/internal.js +1 -1
- package/dist/theme-chalk/form-antdv.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/src/components/FormGrid/form-grid-column.vue.d.ts +7 -0
- package/dist/types/src/components/FormGrid/form-grid.vue.d.ts +7 -0
- package/dist/types/src/components/FormGrid/index.d.ts +7 -0
- package/dist/types/src/components/Textarea/index.d.ts +7 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/internal.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @king-one/form-antdv
|
|
2
2
|
|
|
3
|
+
## 0.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat:增加一大波功能,主要为void类型的解析
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @king-one/form-render@0.0.10
|
|
10
|
+
|
|
11
|
+
## 0.0.12
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- feat:Array类型增加删除方法
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @king-one/form-render@0.0.9
|
|
18
|
+
|
|
3
19
|
## 0.0.10
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Card as
|
|
1
|
+
import { defineComponent as B, mergeModels as E, useModel as N, computed as y, toRaw as F, openBlock as a, createElementBlock as p, normalizeClass as M, unref as n, createBlock as v, withCtx as o, createElementVNode as s, toDisplayString as h, createVNode as k, Fragment as _, renderList as g, createTextVNode as S } from "vue";
|
|
2
|
+
import { Card as C, Empty as V, Button as j } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { useNamespace as
|
|
5
|
-
import { useInjectFieldContext as
|
|
6
|
-
const
|
|
4
|
+
import { useNamespace as A } from "../../hooks/use-namespace/index.mjs";
|
|
5
|
+
import { useInjectFieldContext as D, RecursionField as I } from "@king-one/form-render";
|
|
6
|
+
const R = { class: "title-box" }, z = ["onClick"], H = /* @__PURE__ */ B({
|
|
7
7
|
__name: "array-card",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ E({
|
|
9
9
|
title: {
|
|
10
10
|
type: String,
|
|
11
11
|
default: "默认标题"
|
|
@@ -15,58 +15,65 @@ const T = /* @__PURE__ */ w({
|
|
|
15
15
|
valueModifiers: {}
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:value"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
18
|
+
setup(m) {
|
|
19
|
+
const b = A("ArrayCard"), e = D(), l = N(m, "value"), f = y(() => {
|
|
20
20
|
var t;
|
|
21
21
|
return ((t = e == null ? void 0 : e.path) == null ? void 0 : t.toString()) || "";
|
|
22
|
-
}),
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
22
|
+
}), d = y(() => (e == null ? void 0 : e.schema.items.properties) || {});
|
|
23
|
+
function $() {
|
|
24
|
+
if (l.value) {
|
|
25
25
|
const t = {};
|
|
26
|
-
Object.keys(
|
|
27
|
-
const
|
|
28
|
-
t[
|
|
29
|
-
}),
|
|
26
|
+
Object.keys(d.value).forEach((r) => {
|
|
27
|
+
const u = d.value[r].type || "string";
|
|
28
|
+
t[r] = u === "number" ? 0 : "";
|
|
29
|
+
}), l.value = [...F(l.value || []), t];
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
function x(t) {
|
|
33
|
+
e && (e == null || e.remove(t));
|
|
34
|
+
}
|
|
35
|
+
return (t, r) => {
|
|
36
|
+
var u;
|
|
34
37
|
return a(), p(
|
|
35
38
|
"div",
|
|
36
39
|
{
|
|
37
|
-
class:
|
|
40
|
+
class: M(n(b).b())
|
|
38
41
|
},
|
|
39
42
|
[
|
|
40
|
-
(
|
|
41
|
-
|
|
43
|
+
(u = l.value) != null && u.length ? (a(!0), p(
|
|
44
|
+
_,
|
|
42
45
|
{ key: 1 },
|
|
43
|
-
|
|
44
|
-
n(
|
|
46
|
+
g(l.value, (L, i) => (a(), v(
|
|
47
|
+
n(C),
|
|
45
48
|
{
|
|
46
|
-
key:
|
|
49
|
+
key: i,
|
|
47
50
|
style: { "margin-bottom": "12px" }
|
|
48
51
|
},
|
|
49
52
|
{
|
|
50
|
-
title:
|
|
51
|
-
s("div",
|
|
53
|
+
title: o(() => [
|
|
54
|
+
s("div", R, [
|
|
52
55
|
s(
|
|
53
56
|
"span",
|
|
54
57
|
null,
|
|
55
|
-
"#" +
|
|
58
|
+
"#" + h(i + 1) + " " + h(m.title),
|
|
56
59
|
1
|
|
57
60
|
/* TEXT */
|
|
58
|
-
)
|
|
61
|
+
),
|
|
62
|
+
s("span", {
|
|
63
|
+
class: "delete-btn",
|
|
64
|
+
onClick: (c) => x(i)
|
|
65
|
+
}, "删除", 8, z)
|
|
59
66
|
])
|
|
60
67
|
]),
|
|
61
|
-
default:
|
|
68
|
+
default: o(() => [
|
|
62
69
|
(a(!0), p(
|
|
63
|
-
|
|
70
|
+
_,
|
|
64
71
|
null,
|
|
65
|
-
|
|
66
|
-
key: `${
|
|
67
|
-
schema:
|
|
68
|
-
name:
|
|
69
|
-
"base-path": `${
|
|
72
|
+
g(d.value, (c, w) => (a(), v(n(I), {
|
|
73
|
+
key: `${f.value}.${w}.${c.name}`,
|
|
74
|
+
schema: c,
|
|
75
|
+
name: c.name,
|
|
76
|
+
"base-path": `${f.value}.${i}`
|
|
70
77
|
}, null, 8, ["schema", "name", "base-path"]))),
|
|
71
78
|
128
|
|
72
79
|
/* KEYED_FRAGMENT */
|
|
@@ -80,31 +87,31 @@ const T = /* @__PURE__ */ w({
|
|
|
80
87
|
))),
|
|
81
88
|
128
|
|
82
89
|
/* KEYED_FRAGMENT */
|
|
83
|
-
)) : (a(), v(n(
|
|
84
|
-
title:
|
|
90
|
+
)) : (a(), v(n(C), { key: 0 }, {
|
|
91
|
+
title: o(() => [
|
|
85
92
|
s("div", null, [
|
|
86
93
|
s(
|
|
87
94
|
"span",
|
|
88
95
|
null,
|
|
89
|
-
|
|
96
|
+
h(m.title),
|
|
90
97
|
1
|
|
91
98
|
/* TEXT */
|
|
92
99
|
)
|
|
93
100
|
])
|
|
94
101
|
]),
|
|
95
|
-
default:
|
|
96
|
-
|
|
102
|
+
default: o(() => [
|
|
103
|
+
k(n(V), { description: "暂无数据" })
|
|
97
104
|
]),
|
|
98
105
|
_: 1
|
|
99
106
|
/* STABLE */
|
|
100
107
|
})),
|
|
101
|
-
|
|
108
|
+
k(n(j), {
|
|
102
109
|
type: "dashed",
|
|
103
110
|
style: { "margin-top": "10px", width: "100%" },
|
|
104
|
-
onClick:
|
|
111
|
+
onClick: $
|
|
105
112
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
|
|
113
|
+
default: o(() => r[0] || (r[0] = [
|
|
114
|
+
S(" 添加 ")
|
|
108
115
|
])),
|
|
109
116
|
_: 1,
|
|
110
117
|
__: [0]
|
|
@@ -117,5 +124,5 @@ const T = /* @__PURE__ */ w({
|
|
|
117
124
|
}
|
|
118
125
|
});
|
|
119
126
|
export {
|
|
120
|
-
|
|
127
|
+
H as default
|
|
121
128
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Table as M, TableColumn as
|
|
1
|
+
import { defineComponent as k, mergeModels as C, computed as d, useModel as y, toRaw as w, openBlock as u, createElementBlock as m, normalizeClass as B, unref as a, createVNode as l, withCtx as r, Fragment as T, renderList as $, createBlock as F, createTextVNode as c } from "vue";
|
|
2
|
+
import { Table as M, TableColumn as p, Button as f } from "ant-design-vue";
|
|
3
3
|
import "../../internal.mjs";
|
|
4
|
-
import { useInjectFieldContext as N, RecursionField as
|
|
5
|
-
import { useNamespace as
|
|
6
|
-
const E = /* @__PURE__ */
|
|
4
|
+
import { useInjectFieldContext as N, RecursionField as z } from "@king-one/form-render";
|
|
5
|
+
import { useNamespace as A } from "../../hooks/use-namespace/index.mjs";
|
|
6
|
+
const E = /* @__PURE__ */ k({
|
|
7
7
|
__name: "array-table",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ C({
|
|
9
9
|
title: {
|
|
10
10
|
type: String,
|
|
11
11
|
default: "默认标题"
|
|
@@ -15,47 +15,44 @@ const E = /* @__PURE__ */ C({
|
|
|
15
15
|
valueModifiers: {}
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:value"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
var
|
|
21
|
-
return ((
|
|
22
|
-
}),
|
|
23
|
-
function
|
|
24
|
-
|
|
18
|
+
setup(v) {
|
|
19
|
+
const e = N(), _ = A("ArrayTable"), h = d(() => {
|
|
20
|
+
var n;
|
|
21
|
+
return ((n = e == null ? void 0 : e.path) == null ? void 0 : n.toString()) || "";
|
|
22
|
+
}), i = y(v, "value"), x = d(() => (e == null ? void 0 : e.schema.items.properties) || {});
|
|
23
|
+
function b() {
|
|
24
|
+
i.value && (i.value = [...w(i.value || []), {}]);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
const t = m(e.value);
|
|
29
|
-
t.splice(i, 1), e.value = t;
|
|
30
|
-
}
|
|
26
|
+
function g(n) {
|
|
27
|
+
e && e.remove(n);
|
|
31
28
|
}
|
|
32
|
-
return (
|
|
29
|
+
return (n, o) => (u(), m(
|
|
33
30
|
"div",
|
|
34
31
|
{
|
|
35
|
-
class: B(
|
|
32
|
+
class: B(a(_).b())
|
|
36
33
|
},
|
|
37
34
|
[
|
|
38
|
-
|
|
39
|
-
"data-source":
|
|
35
|
+
l(a(M), {
|
|
36
|
+
"data-source": i.value,
|
|
40
37
|
pagination: !1,
|
|
41
38
|
bordered: "",
|
|
42
39
|
size: "middle"
|
|
43
40
|
}, {
|
|
44
|
-
default:
|
|
45
|
-
(u(!0),
|
|
41
|
+
default: r(() => [
|
|
42
|
+
(u(!0), m(
|
|
46
43
|
T,
|
|
47
44
|
null,
|
|
48
|
-
$(
|
|
49
|
-
key: `${
|
|
45
|
+
$(x.value, (t) => (u(), F(a(p), {
|
|
46
|
+
key: `${t.name}`,
|
|
50
47
|
align: "center",
|
|
51
|
-
title:
|
|
52
|
-
"data-index":
|
|
48
|
+
title: t.title,
|
|
49
|
+
"data-index": t.name
|
|
53
50
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
56
|
-
schema:
|
|
57
|
-
name:
|
|
58
|
-
"base-path": `${
|
|
51
|
+
default: r(({ index: s }) => [
|
|
52
|
+
l(a(z), {
|
|
53
|
+
schema: t,
|
|
54
|
+
name: t.name,
|
|
55
|
+
"base-path": `${h.value}.${s}`
|
|
59
56
|
}, null, 8, ["schema", "name", "base-path"])
|
|
60
57
|
]),
|
|
61
58
|
_: 2
|
|
@@ -64,19 +61,19 @@ const E = /* @__PURE__ */ C({
|
|
|
64
61
|
128
|
|
65
62
|
/* KEYED_FRAGMENT */
|
|
66
63
|
)),
|
|
67
|
-
|
|
64
|
+
l(a(p), {
|
|
68
65
|
title: "操作",
|
|
69
66
|
"data-index": "action",
|
|
70
67
|
align: "center",
|
|
71
68
|
width: "100px"
|
|
72
69
|
}, {
|
|
73
|
-
default:
|
|
74
|
-
|
|
70
|
+
default: r(({ index: t }) => [
|
|
71
|
+
l(a(f), {
|
|
75
72
|
type: "link",
|
|
76
|
-
onClick: (s) =>
|
|
73
|
+
onClick: (s) => g(t)
|
|
77
74
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
75
|
+
default: r(() => o[0] || (o[0] = [
|
|
76
|
+
c(" 删除 ")
|
|
80
77
|
])),
|
|
81
78
|
_: 2,
|
|
82
79
|
__: [0]
|
|
@@ -89,13 +86,13 @@ const E = /* @__PURE__ */ C({
|
|
|
89
86
|
_: 1
|
|
90
87
|
/* STABLE */
|
|
91
88
|
}, 8, ["data-source"]),
|
|
92
|
-
|
|
89
|
+
l(a(f), {
|
|
93
90
|
type: "dashed",
|
|
94
91
|
style: { "margin-top": "10px", width: "100%" },
|
|
95
|
-
onClick:
|
|
92
|
+
onClick: b
|
|
96
93
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
94
|
+
default: r(() => o[1] || (o[1] = [
|
|
95
|
+
c(" 添加 ")
|
|
99
96
|
])),
|
|
100
97
|
_: 1,
|
|
101
98
|
__: [1]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as m, openBlock as r, createBlock as a, unref as n, withCtx as c, createElementBlock as i, Fragment as l, renderList as u, createCommentVNode as h } from "vue";
|
|
2
|
+
import { Col as d } from "ant-design-vue";
|
|
3
|
+
import "../../internal.mjs";
|
|
4
|
+
import { useInjectFieldContext as _, RecursionField as f } from "@king-one/form-render";
|
|
5
|
+
const P = /* @__PURE__ */ m({
|
|
6
|
+
__name: "form-grid-column",
|
|
7
|
+
props: {
|
|
8
|
+
span: {}
|
|
9
|
+
},
|
|
10
|
+
setup(C) {
|
|
11
|
+
const e = _(), o = (e == null ? void 0 : e.schema.properties) || {}, p = (e == null ? void 0 : e.parentPath) || "";
|
|
12
|
+
return (s, k) => (r(), a(n(d), { span: s.span }, {
|
|
13
|
+
default: c(() => [
|
|
14
|
+
(r(!0), i(
|
|
15
|
+
l,
|
|
16
|
+
null,
|
|
17
|
+
u(n(o), (t) => (r(), a(n(f), {
|
|
18
|
+
key: t.id,
|
|
19
|
+
schema: t,
|
|
20
|
+
name: t.name,
|
|
21
|
+
"base-path": n(p)
|
|
22
|
+
}, null, 8, ["schema", "name", "base-path"]))),
|
|
23
|
+
128
|
|
24
|
+
/* KEYED_FRAGMENT */
|
|
25
|
+
)),
|
|
26
|
+
h(` <Col v-for="(prop, index) in properties" :key="index" :span="12">
|
|
27
|
+
<RecursionField :schema="prop" :name="prop.name" :base-path="parentPath" />
|
|
28
|
+
</Col> `)
|
|
29
|
+
]),
|
|
30
|
+
_: 1
|
|
31
|
+
/* STABLE */
|
|
32
|
+
}, 8, ["span"]));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
P as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as m, openBlock as n, createElementBlock as o, createVNode as c, unref as t, withCtx as i, Fragment as u, renderList as d, createBlock as h, createCommentVNode as l } from "vue";
|
|
2
|
+
import { Row as _ } from "ant-design-vue";
|
|
3
|
+
import "../../internal.mjs";
|
|
4
|
+
import { useInjectFieldContext as f, RecursionField as g } from "@king-one/form-render";
|
|
5
|
+
const C = { class: "form-grid" }, R = /* @__PURE__ */ m({
|
|
6
|
+
__name: "form-grid",
|
|
7
|
+
props: {
|
|
8
|
+
gutter: {}
|
|
9
|
+
},
|
|
10
|
+
setup(k) {
|
|
11
|
+
const e = f(), a = (e == null ? void 0 : e.schema.properties) || {}, s = (e == null ? void 0 : e.parentPath) || "";
|
|
12
|
+
return (p, x) => (n(), o("div", C, [
|
|
13
|
+
c(t(_), { gutter: p.gutter }, {
|
|
14
|
+
default: i(() => [
|
|
15
|
+
(n(!0), o(
|
|
16
|
+
u,
|
|
17
|
+
null,
|
|
18
|
+
d(t(a), (r) => (n(), h(t(g), {
|
|
19
|
+
key: r.id,
|
|
20
|
+
schema: r,
|
|
21
|
+
name: r.name,
|
|
22
|
+
"base-path": t(s)
|
|
23
|
+
}, null, 8, ["schema", "name", "base-path"]))),
|
|
24
|
+
128
|
|
25
|
+
/* KEYED_FRAGMENT */
|
|
26
|
+
)),
|
|
27
|
+
l(` <Col v-for="(prop, index) in properties" :key="index" :span="12">
|
|
28
|
+
<RecursionField :schema="prop" :name="prop.name" :base-path="parentPath" />
|
|
29
|
+
</Col> `)
|
|
30
|
+
]),
|
|
31
|
+
_: 1
|
|
32
|
+
/* STABLE */
|
|
33
|
+
}, 8, ["gutter"])
|
|
34
|
+
]));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
R as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../../internal.mjs";
|
|
2
|
+
import "./form-grid-column.vue.mjs";
|
|
3
|
+
import "./form-grid.vue.mjs";
|
|
4
|
+
import { connect as o, mapProps as m } from "@king-one/form-render";
|
|
5
|
+
import r from "./form-grid.vue2.mjs";
|
|
6
|
+
import i from "./form-grid-column.vue2.mjs";
|
|
7
|
+
const _ = o(r, m()), a = o(i, m());
|
|
8
|
+
export {
|
|
9
|
+
_ as FormGrid,
|
|
10
|
+
a as GridColumn
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Textarea as a } from "ant-design-vue";
|
|
2
|
+
import "../../internal.mjs";
|
|
3
|
+
import { transformComponent as r, connect as e, mapProps as o } from "@king-one/form-render";
|
|
4
|
+
const t = r(a, {
|
|
5
|
+
change: "update:value"
|
|
6
|
+
}), s = e(t, o());
|
|
7
|
+
export {
|
|
8
|
+
s as Textarea,
|
|
9
|
+
t as TransformTextarea
|
|
10
|
+
};
|
package/dist/es/src/index.mjs
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import "./style/index.mjs";
|
|
2
2
|
import { Input as t } from "./components/Input/index.mjs";
|
|
3
3
|
import { ArrayCard as p } from "./components/ArrayCard/index.mjs";
|
|
4
|
-
import { InputNumber as
|
|
4
|
+
import { InputNumber as a } from "./components/InputNumber/index.mjs";
|
|
5
5
|
import { Select as n } from "./components/Select/index.mjs";
|
|
6
|
-
import { FormArea as
|
|
6
|
+
import { FormArea as d } from "./components/FormArea/index.mjs";
|
|
7
7
|
import { DateRange as l } from "./components/DateRange/index.mjs";
|
|
8
|
-
import { ArrayTable as
|
|
8
|
+
import { ArrayTable as b } from "./components/ArrayTable/index.mjs";
|
|
9
|
+
import { Textarea as C } from "./components/Textarea/index.mjs";
|
|
10
|
+
import { FormGrid as G, GridColumn as I } from "./components/FormGrid/index.mjs";
|
|
9
11
|
export {
|
|
10
12
|
p as ArrayCard,
|
|
11
|
-
|
|
13
|
+
b as ArrayTable,
|
|
12
14
|
l as DateRange,
|
|
13
|
-
|
|
15
|
+
d as FormArea,
|
|
16
|
+
G as FormGrid,
|
|
17
|
+
I as GridColumn,
|
|
14
18
|
t as Input,
|
|
15
|
-
|
|
16
|
-
n as Select
|
|
19
|
+
a as InputNumber,
|
|
20
|
+
n as Select,
|
|
21
|
+
C as Textarea
|
|
17
22
|
};
|
package/dist/es/src/internal.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { RecursionField as
|
|
1
|
+
import { RecursionField as n, connect as r, mapProps as m, transformComponent as c, useInjectFieldContext as p, useInjectFormContext as s } from "@king-one/form-render";
|
|
2
2
|
import "./hooks/index.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
n as RecursionField,
|
|
5
5
|
r as connect,
|
|
6
6
|
m as mapProps,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
c as transformComponent,
|
|
8
|
+
p as useInjectFieldContext,
|
|
9
|
+
s as useInjectFormContext
|
|
9
10
|
};
|
|
@@ -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"),c=require("ant-design-vue");require("../../internal.js");const f=require("../../hooks/use-namespace/index.js"),m=require("@king-one/form-render"),y={class:"title-box"},g=["onClick"],C=e.defineComponent({__name:"array-card",props:e.mergeModels({title:{type:String,default:"默认标题"}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(s){const p=f.useNamespace("ArrayCard"),t=m.useInjectFieldContext(),a=e.useModel(s,"value"),d=e.computed(()=>{var n;return((n=t==null?void 0:t.path)==null?void 0:n.toString())||""}),i=e.computed(()=>(t==null?void 0:t.schema.items.properties)||{});function v(){if(a.value){const n={};Object.keys(i.value).forEach(r=>{const l=i.value[r].type||"string";n[r]=l==="number"?0:""}),a.value=[...e.toRaw(a.value||[]),n]}}function h(n){t&&(t==null||t.remove(n))}return(n,r)=>{var l;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(p).b())},[(l=a.value)!=null&&l.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.value,(B,o)=>(e.openBlock(),e.createBlock(e.unref(c.Card),{key:o,style:{"margin-bottom":"12px"}},{title:e.withCtx(()=>[e.createElementVNode("div",y,[e.createElementVNode("span",null,"#"+e.toDisplayString(o+1)+" "+e.toDisplayString(s.title),1),e.createElementVNode("span",{class:"delete-btn",onClick:u=>h(o)},"删除",8,g)])]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(u,k)=>(e.openBlock(),e.createBlock(e.unref(m.RecursionField),{key:`${d.value}.${k}.${u.name}`,schema:u,name:u.name,"base-path":`${d.value}.${o}`},null,8,["schema","name","base-path"]))),128))]),_:2},1024))),128)):(e.openBlock(),e.createBlock(e.unref(c.Card),{key:0},{title:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(s.title),1)])]),default:e.withCtx(()=>[e.createVNode(e.unref(c.Empty),{description:"暂无数据"})]),_:1})),e.createVNode(e.unref(c.Button),{type:"dashed",style:{"margin-top":"10px",width:"100%"},onClick:v},{default:e.withCtx(()=>r[0]||(r[0]=[e.createTextVNode(" 添加 ")])),_:1,__:[0]})],2)}}});exports.default=C;
|
|
@@ -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"),r=require("ant-design-vue");require("../../internal.js");const i=require("@king-one/form-render"),v=require("../../hooks/use-namespace/index.js"),x=e.defineComponent({__name:"array-table",props:e.mergeModels({title:{type:String,default:"默认标题"}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(d){const t=i.useInjectFieldContext(),s=v.useNamespace("ArrayTable"),c=e.computed(()=>{var n;return((n=t==null?void 0:t.path)==null?void 0:n.toString())||""}),l=e.useModel(d,"value"),m=e.computed(()=>(t==null?void 0:t.schema.items.properties)||{});function f(){l.value&&(l.value=[...e.toRaw(l.value||[]),{}])}function p(n){t&&t.remove(n)}return(n,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(s).b())},[e.createVNode(e.unref(r.Table),{"data-source":l.value,pagination:!1,bordered:"",size:"middle"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,a=>(e.openBlock(),e.createBlock(e.unref(r.TableColumn),{key:`${a.name}`,align:"center",title:a.title,"data-index":a.name},{default:e.withCtx(({index:o})=>[e.createVNode(e.unref(i.RecursionField),{schema:a,name:a.name,"base-path":`${c.value}.${o}`},null,8,["schema","name","base-path"])]),_:2},1032,["title","data-index"]))),128)),e.createVNode(e.unref(r.TableColumn),{title:"操作","data-index":"action",align:"center",width:"100px"},{default:e.withCtx(({index:a})=>[e.createVNode(e.unref(r.Button),{type:"link",onClick:o=>p(a)},{default:e.withCtx(()=>u[0]||(u[0]=[e.createTextVNode(" 删除 ")])),_:2,__:[0]},1032,["onClick"])]),_:1})]),_:1},8,["data-source"]),e.createVNode(e.unref(r.Button),{type:"dashed",style:{"margin-top":"10px",width:"100%"},onClick:f},{default:e.withCtx(()=>u[1]||(u[1]=[e.createTextVNode(" 添加 ")])),_:1,__:[1]})],2))}});exports.default=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./form-grid-column.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("ant-design-vue");require("../../internal.js");const t=require("@king-one/form-render"),p=e.defineComponent({__name:"form-grid-column",props:{span:{}},setup(u){const n=t.useInjectFieldContext(),o=(n==null?void 0:n.schema.properties)||{},a=(n==null?void 0:n.parentPath)||"";return(s,i)=>(e.openBlock(),e.createBlock(e.unref(c.Col),{span:s.span},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),r=>(e.openBlock(),e.createBlock(e.unref(t.RecursionField),{key:r.id,schema:r,name:r.name,"base-path":e.unref(a)},null,8,["schema","name","base-path"]))),128)),e.createCommentVNode(` <Col v-for="(prop, index) in properties" :key="index" :span="12">
|
|
2
|
+
<RecursionField :schema="prop" :name="prop.name" :base-path="parentPath" />
|
|
3
|
+
</Col> `)]),_:1},8,["span"]))}});exports.default=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./form-grid.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("ant-design-vue");require("../../internal.js");const n=require("@king-one/form-render"),u={class:"form-grid"},i=e.defineComponent({__name:"form-grid",props:{gutter:{}},setup(p){const t=n.useInjectFieldContext(),o=(t==null?void 0:t.schema.properties)||{},a=(t==null?void 0:t.parentPath)||"";return(s,l)=>(e.openBlock(),e.createElementBlock("div",u,[e.createVNode(e.unref(c.Row),{gutter:s.gutter},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),r=>(e.openBlock(),e.createBlock(e.unref(n.RecursionField),{key:r.id,schema:r,name:r.name,"base-path":e.unref(a)},null,8,["schema","name","base-path"]))),128)),e.createCommentVNode(` <Col v-for="(prop, index) in properties" :key="index" :span="12">
|
|
2
|
+
<RecursionField :schema="prop" :name="prop.name" :base-path="parentPath" />
|
|
3
|
+
</Col> `)]),_:1},8,["gutter"])]))}});exports.default=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../internal.js");require("./form-grid-column.vue.js");require("./form-grid.vue.js");const e=require("@king-one/form-render"),r=require("./form-grid.vue2.js"),t=require("./form-grid-column.vue2.js"),u=e.connect(r.default,e.mapProps()),o=e.connect(t.default,e.mapProps());exports.FormGrid=u;exports.GridColumn=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("ant-design-vue");require("../../internal.js");const e=require("@king-one/form-render"),r=e.transformComponent(a.Textarea,{change:"update:value"}),t=e.connect(r,e.mapProps());exports.Textarea=t;exports.TransformTextarea=r;
|
package/dist/lib/src/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./style/index.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./style/index.js");const r=require("./components/Input/index.js"),n=require("./components/ArrayCard/index.js"),i=require("./components/InputNumber/index.js"),t=require("./components/Select/index.js"),u=require("./components/FormArea/index.js"),a=require("./components/DateRange/index.js"),o=require("./components/ArrayTable/index.js"),d=require("./components/Textarea/index.js"),e=require("./components/FormGrid/index.js");exports.Input=r.Input;exports.ArrayCard=n.ArrayCard;exports.InputNumber=i.InputNumber;exports.Select=t.Select;exports.FormArea=u.FormArea;exports.DateRange=a.DateRange;exports.ArrayTable=o.ArrayTable;exports.Textarea=d.Textarea;exports.FormGrid=e.FormGrid;exports.GridColumn=e.GridColumn;
|
package/dist/lib/src/internal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@king-one/form-render");require("./hooks/index.js");Object.defineProperty(exports,"RecursionField",{enumerable:!0,get:()=>e.RecursionField});Object.defineProperty(exports,"connect",{enumerable:!0,get:()=>e.connect});Object.defineProperty(exports,"mapProps",{enumerable:!0,get:()=>e.mapProps});Object.defineProperty(exports,"transformComponent",{enumerable:!0,get:()=>e.transformComponent});Object.defineProperty(exports,"useInjectFieldContext",{enumerable:!0,get:()=>e.useInjectFieldContext});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@king-one/form-render");require("./hooks/index.js");Object.defineProperty(exports,"RecursionField",{enumerable:!0,get:()=>e.RecursionField});Object.defineProperty(exports,"connect",{enumerable:!0,get:()=>e.connect});Object.defineProperty(exports,"mapProps",{enumerable:!0,get:()=>e.mapProps});Object.defineProperty(exports,"transformComponent",{enumerable:!0,get:()=>e.transformComponent});Object.defineProperty(exports,"useInjectFieldContext",{enumerable:!0,get:()=>e.useInjectFieldContext});Object.defineProperty(exports,"useInjectFormContext",{enumerable:!0,get:()=>e.useInjectFormContext});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.kr-antdv-ArrayCard{
|
|
1
|
+
.kr-antdv-ArrayCard .title-box{display:flex;justify-content:space-between;align-items:center;height:32px}.kr-antdv-ArrayCard .title-box .delete-btn{padding:2px 12px;color:var(--king-color-danger);font-size:14px;cursor:pointer;border:1px solid var(--king-color-danger);border-radius:4px;transition:all .3s ease}.kr-antdv-ArrayCard .title-box .delete-btn:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(255,77,79,.3)}.kr-antdv-ArrayTable .ant-table-row .ant-table-cell{padding:0 8px!important}.k-render-form-provider .ant-input-number{width:100%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
: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}.kr-antdv-ArrayCard{
|
|
1
|
+
: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}.kr-antdv-ArrayCard .title-box{display:flex;justify-content:space-between;align-items:center;height:32px}.kr-antdv-ArrayCard .title-box .delete-btn{padding:2px 12px;color:var(--king-color-danger);font-size:14px;cursor:pointer;border:1px solid var(--king-color-danger);border-radius:4px;transition:all .3s ease}.kr-antdv-ArrayCard .title-box .delete-btn:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(255,77,79,.3)}.kr-antdv-ArrayTable .ant-table-row .ant-table-cell{padding:0 8px!important}.k-render-form-provider .ant-input-number{width:100%}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{
|
|
3
|
+
span: number;
|
|
4
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
5
|
+
span: number;
|
|
6
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
declare const _default: DefineComponent<{
|
|
3
|
+
gutter: number;
|
|
4
|
+
}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
|
|
5
|
+
gutter: number;
|
|
6
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
export declare const FormGrid: DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
export declare const GridColumn: DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DefineComponent, VNode, RendererNode, RendererElement, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
export declare const TransformTextarea: DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
5
|
+
export declare const Textarea: DefineComponent<{}, () => VNode<RendererNode, RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -5,3 +5,6 @@ export { Select } from './components/Select';
|
|
|
5
5
|
export { FormArea } from './components/FormArea';
|
|
6
6
|
export { DateRange } from './components/DateRange';
|
|
7
7
|
export { ArrayTable } from './components/ArrayTable';
|
|
8
|
+
export { Textarea } from './components/Textarea';
|
|
9
|
+
export { FormGrid } from './components/FormGrid';
|
|
10
|
+
export { GridColumn } from './components/FormGrid';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformComponent, connect, mapProps, RecursionField, useInjectFieldContext } from '@king-one/form-render';
|
|
1
|
+
export { transformComponent, connect, mapProps, RecursionField, useInjectFieldContext, useInjectFormContext, type ArrayFieldInstance } from '@king-one/form-render';
|
|
2
2
|
export { useNamespace } from './hooks';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-one/form-antdv",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"description": "@king-one 表单渲染器 - ant-design-vue 组件库",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@king-one/theme": "^1.0.1",
|
|
44
44
|
"ant-design-vue": "^4.2.6",
|
|
45
45
|
"vue": "^3.5.13",
|
|
46
|
-
"@king-one/form-render": "^0.0.
|
|
46
|
+
"@king-one/form-render": "^0.0.10"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public",
|