@king-one/form-design 0.0.16 → 0.0.18
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 -96
- package/dist/es/src/components/form-panel.vue.mjs +71 -65
- package/dist/es/src/components/panel/index.mjs +23 -13
- package/dist/es/src/components/panel/panel-item.vue.mjs +29 -29
- package/dist/es/src/components/panel/panel-wrapper.mjs +1 -1
- 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 +25 -25
- 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 +165 -15
- package/dist/es/src/core/Design.mjs +24 -19
- package/dist/es/src/core/Field.mjs +1 -1
- package/dist/es/src/core/FormSchema.mjs +28 -26
- package/dist/es/src/index.mjs +15 -13
- package/dist/es/src/plugins/index.mjs +10 -7
- package/dist/es/src/plugins/modules/drag-put.mjs +14 -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/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/plugins/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-put.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/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.css +1 -1
- package/dist/types/src/components/base/Carousel.vue.d.ts +65 -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 +93 -41
- 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/plugins/index.d.ts +3 -1
- package/dist/types/src/plugins/modules/drag-put.d.ts +5 -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,54 +1,62 @@
|
|
|
1
|
-
import { defineComponent as u, h as i } from "vue";
|
|
2
|
-
import { Collapse as d } from "ant-design-vue";
|
|
3
1
|
import "./InputProps.vue.mjs";
|
|
4
2
|
import "./TextareaProps.vue.mjs";
|
|
5
3
|
import "./InputNumberProps.vue.mjs";
|
|
6
4
|
import "./BaseProps.vue.mjs";
|
|
5
|
+
import "./SelectProps.vue.mjs";
|
|
6
|
+
import "./OvertimeProps.vue.mjs";
|
|
7
|
+
import { propsWidgetDecorator as a } from "./PropsDecorator.mjs";
|
|
8
|
+
import o from "./BaseProps.vue2.mjs";
|
|
7
9
|
import s from "./InputProps.vue2.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"k-textarea": c,
|
|
14
|
-
"k-input-number": a
|
|
15
|
-
}, _ = {
|
|
10
|
+
import d from "./TextareaProps.vue2.mjs";
|
|
11
|
+
import f from "./InputNumberProps.vue2.mjs";
|
|
12
|
+
import h from "./SelectProps.vue2.mjs";
|
|
13
|
+
import g from "./OvertimeProps.vue2.mjs";
|
|
14
|
+
const _ = {
|
|
16
15
|
"k-input": {
|
|
17
|
-
component: [
|
|
16
|
+
component: [
|
|
17
|
+
{ header: "基础设置", widget: o },
|
|
18
|
+
{ header: "组件属性", widget: s }
|
|
19
|
+
]
|
|
18
20
|
},
|
|
19
21
|
"k-textarea": {
|
|
20
|
-
component: [
|
|
22
|
+
component: [
|
|
23
|
+
{ header: "基础设置", widget: o },
|
|
24
|
+
{ header: "组件属性", widget: d }
|
|
25
|
+
]
|
|
21
26
|
},
|
|
22
27
|
"k-input-number": {
|
|
23
|
-
component: [
|
|
28
|
+
component: [
|
|
29
|
+
{ header: "基础设置", widget: o },
|
|
30
|
+
{ header: "组件属性", widget: f }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"k-select": {
|
|
34
|
+
component: [
|
|
35
|
+
{ header: "基础设置", widget: o },
|
|
36
|
+
{ header: "组件属性", widget: h }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"k-overtime": {
|
|
40
|
+
component: [
|
|
41
|
+
{ header: "组件属性", widget: g }
|
|
42
|
+
]
|
|
24
43
|
}
|
|
25
44
|
};
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
for (const [
|
|
29
|
-
const
|
|
30
|
-
for (const m of
|
|
31
|
-
const { keys: r } = m;
|
|
32
|
-
(Array.isArray(
|
|
45
|
+
function T(c = []) {
|
|
46
|
+
const i = {};
|
|
47
|
+
for (const [e, p] of Object.entries(_)) {
|
|
48
|
+
const n = [...p.component];
|
|
49
|
+
for (const m of c) {
|
|
50
|
+
const { keys: r, exclude: t } = m;
|
|
51
|
+
if (t && (Array.isArray(t) ? t.includes(e) : t.test(e)))
|
|
52
|
+
continue;
|
|
53
|
+
(Array.isArray(r) ? r.includes(e) : r.test(e)) && n.push(m.component);
|
|
33
54
|
}
|
|
34
|
-
|
|
55
|
+
i[e] = a(e, n);
|
|
35
56
|
}
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
function k(n, o) {
|
|
39
|
-
return u({
|
|
40
|
-
name: `${n}-props`,
|
|
41
|
-
inheritAttrs: !1,
|
|
42
|
-
setup() {
|
|
43
|
-
return () => i(d, null, {
|
|
44
|
-
default: () => o.map((t) => i(t))
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
57
|
+
return i;
|
|
48
58
|
}
|
|
49
59
|
export {
|
|
50
|
-
|
|
51
|
-
D as expandProps,
|
|
52
|
-
k as propsWidgetDecorator,
|
|
60
|
+
T as expandProps,
|
|
53
61
|
_ as widgetProps
|
|
54
62
|
};
|
|
@@ -7,7 +7,7 @@ const e = {
|
|
|
7
7
|
icon: "k-form-grid",
|
|
8
8
|
key: "form-layout",
|
|
9
9
|
type: "void",
|
|
10
|
-
"
|
|
10
|
+
"x-component": "FormLayout"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}, t = {
|
|
@@ -19,8 +19,8 @@ const e = {
|
|
|
19
19
|
key: "k-input",
|
|
20
20
|
type: "string",
|
|
21
21
|
icon: "form-input",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"x-component": "Input",
|
|
23
|
+
"x-component-props": {
|
|
24
24
|
placeholder: "请输入"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -29,8 +29,8 @@ const e = {
|
|
|
29
29
|
key: "k-textarea",
|
|
30
30
|
type: "string",
|
|
31
31
|
icon: "form-textarea",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"x-component": "Textarea",
|
|
33
|
+
"x-component-props": {
|
|
34
34
|
placeholder: "请输入"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -39,17 +39,20 @@ const e = {
|
|
|
39
39
|
key: "k-input-number",
|
|
40
40
|
type: "number",
|
|
41
41
|
icon: "form-number",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"x-component": "InputNumber",
|
|
43
|
+
"x-component-props": {
|
|
44
44
|
placeholder: "请输入"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
title: "下拉选择框",
|
|
49
49
|
key: "k-select",
|
|
50
|
-
type: "
|
|
50
|
+
type: "array",
|
|
51
|
+
items: {
|
|
52
|
+
type: "string"
|
|
53
|
+
},
|
|
51
54
|
icon: "form-select",
|
|
52
|
-
"
|
|
55
|
+
"x-component": "Select",
|
|
53
56
|
enum: [
|
|
54
57
|
{
|
|
55
58
|
label: "选项1",
|
|
@@ -60,9 +63,46 @@ const e = {
|
|
|
60
63
|
value: "2"
|
|
61
64
|
}
|
|
62
65
|
],
|
|
63
|
-
"
|
|
64
|
-
placeholder: "请选择"
|
|
66
|
+
"x-component-props": {
|
|
67
|
+
placeholder: "请选择",
|
|
68
|
+
allowClear: !0,
|
|
69
|
+
mode: "multiple"
|
|
70
|
+
},
|
|
71
|
+
"x-decorator": "FormItem"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: "日期范围",
|
|
75
|
+
key: "k-date-range",
|
|
76
|
+
type: "array",
|
|
77
|
+
format: "date",
|
|
78
|
+
items: {
|
|
79
|
+
type: "string"
|
|
80
|
+
},
|
|
81
|
+
icon: "form-date",
|
|
82
|
+
"x-component": "InputNumber",
|
|
83
|
+
"x-component-props": {
|
|
84
|
+
placeholder: "请输入",
|
|
85
|
+
formatData: "YYYY-MM-DD"
|
|
65
86
|
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: "单个日期",
|
|
90
|
+
key: "k-date-single",
|
|
91
|
+
type: "string",
|
|
92
|
+
format: "date",
|
|
93
|
+
icon: "form-date",
|
|
94
|
+
"x-component": "InputNumber",
|
|
95
|
+
"x-component-props": {
|
|
96
|
+
placeholder: "请输入",
|
|
97
|
+
formatData: "YYYY-MM-DD"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
title: "地区选择",
|
|
102
|
+
key: "k-form-area",
|
|
103
|
+
type: "object",
|
|
104
|
+
icon: "form-area",
|
|
105
|
+
"x-component": "FormArea"
|
|
66
106
|
}
|
|
67
107
|
]
|
|
68
108
|
}, o = {
|
|
@@ -82,19 +122,129 @@ const e = {
|
|
|
82
122
|
type: "array",
|
|
83
123
|
icon: "form-list",
|
|
84
124
|
children: [],
|
|
85
|
-
"
|
|
125
|
+
"x-component": "ArrayCard",
|
|
126
|
+
"x-decorator": "Void"
|
|
86
127
|
},
|
|
87
128
|
{
|
|
88
129
|
title: "明细表",
|
|
89
130
|
key: "k-table",
|
|
90
131
|
type: "array",
|
|
91
132
|
icon: "form-table",
|
|
92
|
-
"
|
|
133
|
+
"x-component": "FormLayout"
|
|
93
134
|
}
|
|
94
135
|
]
|
|
95
|
-
}
|
|
136
|
+
}, a = [
|
|
137
|
+
{
|
|
138
|
+
name: "加班模版",
|
|
139
|
+
key: "overtime",
|
|
140
|
+
icon: "form-kit-overtime",
|
|
141
|
+
schema: {
|
|
142
|
+
title: "加班模版",
|
|
143
|
+
key: "k-overtime",
|
|
144
|
+
type: "object",
|
|
145
|
+
name: "overtime",
|
|
146
|
+
id: "overtime",
|
|
147
|
+
"x-design-props": {
|
|
148
|
+
validate: {
|
|
149
|
+
status: "",
|
|
150
|
+
message: ""
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
children: [
|
|
154
|
+
{
|
|
155
|
+
title: "加班人",
|
|
156
|
+
key: "k-input",
|
|
157
|
+
type: "string",
|
|
158
|
+
"x-component": "Input",
|
|
159
|
+
"x-component-props": {
|
|
160
|
+
placeholder: "请输入"
|
|
161
|
+
},
|
|
162
|
+
name: "vzhax44q5mg",
|
|
163
|
+
id: "vzhax44q5mg",
|
|
164
|
+
"x-design-props": {
|
|
165
|
+
validate: {
|
|
166
|
+
status: "",
|
|
167
|
+
message: ""
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
title: "加班时长",
|
|
173
|
+
key: "k-input-number",
|
|
174
|
+
type: "number",
|
|
175
|
+
"x-component": "InputNumber",
|
|
176
|
+
"x-component-props": {
|
|
177
|
+
placeholder: "请输入"
|
|
178
|
+
},
|
|
179
|
+
name: "aaaa",
|
|
180
|
+
id: "aaaa",
|
|
181
|
+
"x-design-props": {
|
|
182
|
+
validate: {
|
|
183
|
+
status: "",
|
|
184
|
+
message: ""
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "请假模版",
|
|
193
|
+
key: "leave",
|
|
194
|
+
icon: "form-kit-out",
|
|
195
|
+
schema: {
|
|
196
|
+
title: "请假模版",
|
|
197
|
+
key: "k-leave",
|
|
198
|
+
type: "object",
|
|
199
|
+
name: "leave",
|
|
200
|
+
id: "leave",
|
|
201
|
+
"x-design-props": {
|
|
202
|
+
validate: {
|
|
203
|
+
status: "",
|
|
204
|
+
message: ""
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
children: [
|
|
208
|
+
{
|
|
209
|
+
title: "下拉选择框",
|
|
210
|
+
key: "k-select",
|
|
211
|
+
type: "array",
|
|
212
|
+
items: {
|
|
213
|
+
type: "string"
|
|
214
|
+
},
|
|
215
|
+
"x-component": "Select",
|
|
216
|
+
enum: [
|
|
217
|
+
{
|
|
218
|
+
label: "选项1",
|
|
219
|
+
value: "1"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
label: "选项2",
|
|
223
|
+
value: "2"
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"x-component-props": {
|
|
227
|
+
placeholder: "请选择",
|
|
228
|
+
allowClear: !0,
|
|
229
|
+
mode: "multiple"
|
|
230
|
+
},
|
|
231
|
+
"x-decorator": "FormItem",
|
|
232
|
+
name: "uvvs3k1v39k",
|
|
233
|
+
id: "uvvs3k1v39k",
|
|
234
|
+
"x-design-props": {
|
|
235
|
+
validate: {
|
|
236
|
+
status: "",
|
|
237
|
+
message: ""
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
];
|
|
96
245
|
export {
|
|
97
246
|
t as BaseSchema,
|
|
98
247
|
o as ExtendSchema,
|
|
99
|
-
e as LayoutSchema
|
|
248
|
+
e as LayoutSchema,
|
|
249
|
+
a as tempSchema
|
|
100
250
|
};
|
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
|
-
var p = (
|
|
3
|
-
var t = (
|
|
4
|
-
import { ref as
|
|
2
|
+
var p = (r, e, s) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
|
|
3
|
+
var t = (r, e, s) => p(r, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { ref as c } from "vue";
|
|
5
5
|
import "../effects/index.mjs";
|
|
6
|
-
import { widgetPanels as
|
|
6
|
+
import { widgetPanels as n } from "../components/panel/index.mjs";
|
|
7
7
|
import "../components/props/index.mjs";
|
|
8
|
-
import { Plugin as
|
|
8
|
+
import { Plugin as l } from "../plugins/index.mjs";
|
|
9
9
|
import { Heart as d } from "./Heart.mjs";
|
|
10
|
-
import { FormSchema as
|
|
11
|
-
import { widgetProps as
|
|
10
|
+
import { FormSchema as a } from "./FormSchema.mjs";
|
|
11
|
+
import { widgetProps as g } from "../components/props/widget/index.mjs";
|
|
12
12
|
import { runEffects as f } from "../effects/effective.mjs";
|
|
13
|
-
class
|
|
13
|
+
class L {
|
|
14
14
|
constructor(e) {
|
|
15
15
|
t(this, "schema");
|
|
16
|
+
t(this, "tempSchema");
|
|
16
17
|
t(this, "heart");
|
|
17
18
|
t(this, "plugin");
|
|
18
|
-
t(this, "FormSchema", new
|
|
19
|
+
t(this, "FormSchema", new a());
|
|
19
20
|
t(this, "props");
|
|
20
|
-
t(this, "checkedField",
|
|
21
|
+
t(this, "checkedField", c({}));
|
|
21
22
|
t(this, "shared", {
|
|
22
23
|
draggedContext: {
|
|
23
|
-
key: ""
|
|
24
|
+
key: "",
|
|
25
|
+
field: null
|
|
24
26
|
},
|
|
25
27
|
panelWidgets: {},
|
|
26
28
|
propsWidgets: {}
|
|
27
29
|
});
|
|
28
30
|
t(this, "extendFormProps", []);
|
|
29
|
-
t(this, "notify", (e, ...
|
|
30
|
-
this.heart.publish(e, ...
|
|
31
|
+
t(this, "notify", (e, ...s) => {
|
|
32
|
+
this.heart.publish(e, ...s);
|
|
31
33
|
});
|
|
32
|
-
const { extendFormProps:
|
|
34
|
+
const { extendFormProps: s = [], propsWidgets: i = {}, panelWidgets: o = {}, ...h } = e;
|
|
33
35
|
this.shared.panelWidgets = {
|
|
34
|
-
...
|
|
36
|
+
...n,
|
|
35
37
|
...o
|
|
36
38
|
}, this.shared.propsWidgets = {
|
|
37
|
-
...
|
|
39
|
+
...g,
|
|
38
40
|
...i
|
|
39
|
-
}, this.props = { ...h }, this.schema = e.schema, this.plugin = new
|
|
41
|
+
}, this.props = { ...h }, this.schema = e.schema, this.tempSchema = e.tempSchema || [], this.plugin = new l(), this.heart = new d({
|
|
40
42
|
lifecycles: this.lifecycles,
|
|
41
43
|
context: this
|
|
42
|
-
}), this.extendFormProps =
|
|
44
|
+
}), this.extendFormProps = s;
|
|
43
45
|
}
|
|
44
46
|
use(e) {
|
|
45
47
|
this.plugin.use(e);
|
|
@@ -50,6 +52,9 @@ class b {
|
|
|
50
52
|
getFieldList() {
|
|
51
53
|
return this.FormSchema.getFieldList();
|
|
52
54
|
}
|
|
55
|
+
setCheckedField(e) {
|
|
56
|
+
this.checkedField.value = e;
|
|
57
|
+
}
|
|
53
58
|
get lifecycles() {
|
|
54
59
|
return this.props.effects ? f(this, this.props.effects) : [];
|
|
55
60
|
}
|
|
@@ -61,5 +66,5 @@ class b {
|
|
|
61
66
|
}
|
|
62
67
|
}
|
|
63
68
|
export {
|
|
64
|
-
|
|
69
|
+
L as FormDesign
|
|
65
70
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
var n = Object.defineProperty;
|
|
2
|
-
var a = (
|
|
3
|
-
var i = (
|
|
4
|
-
import { ref as
|
|
5
|
-
import { uid as
|
|
6
|
-
import { Field as
|
|
2
|
+
var a = (s, e, o) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
|
|
3
|
+
var i = (s, e, o) => a(s, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { ref as c, toRaw as h } from "vue";
|
|
5
|
+
import { uid as l } from "@king-one/utils";
|
|
6
|
+
import { Field as m } from "./Field.mjs";
|
|
7
7
|
class j {
|
|
8
8
|
constructor() {
|
|
9
9
|
i(this, "version", "1.0.0");
|
|
10
|
-
i(this, "fields",
|
|
10
|
+
i(this, "fields", c([]));
|
|
11
11
|
}
|
|
12
12
|
getSchema() {
|
|
13
|
-
const e =
|
|
13
|
+
const e = h(this.fields.value);
|
|
14
|
+
console.log(e, "s");
|
|
15
|
+
const o = this.jsonToschema(e);
|
|
14
16
|
return {
|
|
15
17
|
version: this.version,
|
|
16
18
|
form: {
|
|
17
|
-
schema:
|
|
19
|
+
schema: o
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
getFieldList() {
|
|
22
|
-
return this.fields.value.map((e) => new
|
|
24
|
+
return this.fields.value.map((e) => new m(e));
|
|
23
25
|
}
|
|
24
|
-
jsonToschema(e,
|
|
25
|
-
return e.forEach((
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
...
|
|
29
|
-
properties: this.jsonToschema(
|
|
30
|
-
} :
|
|
31
|
-
...
|
|
26
|
+
jsonToschema(e, o = {}) {
|
|
27
|
+
return e.forEach((r) => {
|
|
28
|
+
const t = this.omit(r, ["children"]);
|
|
29
|
+
t.type === "object" || t.type === "void" ? o[t.name] = {
|
|
30
|
+
...t,
|
|
31
|
+
properties: this.jsonToschema(r.children)
|
|
32
|
+
} : t.type === "array" && r.children ? o[t.name] = {
|
|
33
|
+
...t,
|
|
32
34
|
items: {
|
|
33
35
|
type: "object",
|
|
34
|
-
id:
|
|
35
|
-
properties: this.jsonToschema(
|
|
36
|
+
id: l(),
|
|
37
|
+
properties: this.jsonToschema(r.children)
|
|
36
38
|
}
|
|
37
|
-
} : t
|
|
38
|
-
}),
|
|
39
|
+
} : o[t.name] = t;
|
|
40
|
+
}), o;
|
|
39
41
|
}
|
|
40
|
-
omit(e,
|
|
41
|
-
const
|
|
42
|
-
return
|
|
43
|
-
delete
|
|
44
|
-
}),
|
|
42
|
+
omit(e, o) {
|
|
43
|
+
const r = { ...e };
|
|
44
|
+
return o.forEach((t) => {
|
|
45
|
+
delete r[t];
|
|
46
|
+
}), r;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
export {
|
package/dist/es/src/index.mjs
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import "./style/index.mjs";
|
|
2
|
+
import "./components/base/Carousel.vue2.mjs";
|
|
2
3
|
import "./components/panel/panel-item.vue2.mjs";
|
|
3
|
-
import { useInjectDesignContext as
|
|
4
|
-
import { default as
|
|
5
|
-
import { CreateFormDesign as
|
|
4
|
+
import { useInjectDesignContext as i } from "./context/design.mjs";
|
|
5
|
+
import { default as p } from "./components/form-desgin.mjs";
|
|
6
|
+
import { CreateFormDesign as x } from "./core/index.mjs";
|
|
6
7
|
import "./components/index.mjs";
|
|
7
|
-
import { BaseSchema as
|
|
8
|
-
import { onDesignFieldChange as
|
|
8
|
+
import { BaseSchema as g, ExtendSchema as c, LayoutSchema as h, tempSchema as D } from "./config/index.mjs";
|
|
9
|
+
import { onDesignFieldChange as d, onDesignInit as u } from "./effects/onEffects.mjs";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
g as BaseSchema,
|
|
12
|
+
x as CreateFormDesign,
|
|
13
|
+
c as ExtendSchema,
|
|
14
|
+
p as FormDesign,
|
|
15
|
+
h as LayoutSchema,
|
|
16
|
+
d as onDesignFieldChange,
|
|
17
|
+
u as onDesignInit,
|
|
18
|
+
D as tempSchema,
|
|
19
|
+
i as useInjectDesignContext
|
|
18
20
|
};
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
|
-
var a = (
|
|
3
|
-
var
|
|
4
|
-
import { SyncBailHook as
|
|
5
|
-
|
|
2
|
+
var a = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var l = (o, e, t) => a(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { SyncBailHook as r } from "@king-one/tapable";
|
|
5
|
+
import { BaseDragPut as i } from "./modules/drag-put.mjs";
|
|
6
|
+
class m {
|
|
6
7
|
constructor() {
|
|
7
|
-
|
|
8
|
-
beforeDelete: new
|
|
8
|
+
l(this, "hooks", {
|
|
9
|
+
beforeDelete: new r(["value"]),
|
|
10
|
+
dragPut: new r(["value"])
|
|
9
11
|
});
|
|
12
|
+
this.use(new i());
|
|
10
13
|
}
|
|
11
14
|
use(e) {
|
|
12
15
|
e.install.call(void 0, this);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
export {
|
|
16
|
-
|
|
19
|
+
m as Plugin
|
|
17
20
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var n = (a, e, r) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
|
|
3
|
+
var t = (a, e, r) => n(a, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
class l {
|
|
5
|
+
constructor() {
|
|
6
|
+
t(this, "name", "baseDragPut");
|
|
7
|
+
}
|
|
8
|
+
install(e) {
|
|
9
|
+
e.hooks.dragPut.tap("baseDragPut", (r) => r.region === "form-panel" ? !0 : r.region === "form-material");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
l as BaseDragPut
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function s(t, u, o = !1) {
|
|
2
|
+
let e = null, l = !1;
|
|
3
|
+
const i = function(...n) {
|
|
4
|
+
e && (clearTimeout(e), e = null), o ? (l || (t.apply(this, n), l = !0), e = setTimeout(() => {
|
|
5
|
+
l = !1, e = null;
|
|
6
|
+
}, u)) : e = setTimeout(() => {
|
|
7
|
+
t.apply(this, n), e = null, l = !1;
|
|
8
|
+
}, u);
|
|
9
|
+
};
|
|
10
|
+
return i.cancel = () => {
|
|
11
|
+
e && (clearTimeout(e), e = null), l = !1;
|
|
12
|
+
}, i;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
s as debounce
|
|
16
|
+
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { getType as s, isArr as t, isBool as
|
|
1
|
+
import { getType as s, isArr as t, isBool as r, isFn as o, isHTMLElement as a, isMap as m, isNum as p, isNumberLike as n, isObj as b, isPlainObj as l, isReactElement as k, isRegExp as u, isSet as x, isStr as E, isWeakMap as M, isWeakSet as S } from "./checkers.mjs";
|
|
2
|
+
import { debounce as f } from "./debounce.mjs";
|
|
2
3
|
export {
|
|
4
|
+
f as debounce,
|
|
3
5
|
s as getType,
|
|
4
6
|
t as isArr,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
r as isBool,
|
|
8
|
+
o as isFn,
|
|
9
|
+
a as isHTMLElement,
|
|
10
|
+
m as isMap,
|
|
11
|
+
p as isNum,
|
|
10
12
|
n as isNumberLike,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
b as isObj,
|
|
14
|
+
l as isPlainObj,
|
|
13
15
|
k as isReactElement,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
u as isRegExp,
|
|
17
|
+
x as isSet,
|
|
18
|
+
E as isStr,
|
|
19
|
+
M as isWeakMap,
|
|
20
|
+
S as isWeakSet
|
|
19
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 n=require("./src/components/base/Carousel.vue.js"),r=require("./src/components/panel/panel-item.vue.js"),i=require("./src/context/design.js"),s=require("./src/components/form-desgin.js"),u=require("./src/core/index.js"),o=require("./src/components/props/form-config.vue.js"),e=require("./src/config/index.js"),t=require("./src/effects/onEffects.js");exports.Carousel=n.default;exports.FormPanelItem=r.default;exports.useInjectDesignContext=i.useInjectDesignContext;exports.FormDesign=s.default;exports.CreateFormDesign=u.CreateFormDesign;exports.FormConfig=o.default;exports.BaseSchema=e.BaseSchema;exports.ExtendSchema=e.ExtendSchema;exports.LayoutSchema=e.LayoutSchema;exports.tempSchema=e.tempSchema;exports.onDesignFieldChange=t.onDesignFieldChange;exports.onDesignInit=t.onDesignInit;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../internal.js");const y=require("../../hooks/use-namespace/index.js"),_=e.defineComponent({__name:"Carousel",props:{modelValue:{type:Number,default:0},isAnimating:{type:Boolean,default:!0},direction:{type:String,default:"horizontal",validator:r=>["horizontal","vertical"].includes(r)}},emits:["update:modelValue","afterChange"],setup(r,{expose:c,emit:f}){const a=r,l=f,{b:d}=y.useNamespace("carousel"),u=e.ref(),n=e.ref(a.modelValue),i=e.ref(0);function o(){u.value&&(i.value=u.value.children.length)}e.watch(()=>a.modelValue,t=>{t!==n.value&&(n.value=t)});function s(t){t<0||t>=i.value||(n.value=t,l("update:modelValue",t),a.isAnimating||l("afterChange",t))}function m(t){s(t)}function v(){e.nextTick(()=>{o(),n.value<i.value-1&&s(n.value+1)})}function p(){e.nextTick(()=>{o(),n.value>0&&s(n.value-1)})}function g(){l("afterChange",n.value)}const h=e.computed(()=>{const t=-n.value*100;return{transform:a.direction==="horizontal"?`translateX(${t}%)`:`translateY(${t}%)`,transition:a.isAnimating?"transform 0.3s ease-in-out":"none",flexDirection:a.direction==="horizontal"?"row":"column"}});return c({next:v,prev:p,goTo:m,currentIndex:n}),e.onMounted(o),e.onUpdated(o),(t,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(d)())},[e.createElementVNode("div",{ref_key:"trackRef",ref:u,class:"carousel-track",style:e.normalizeStyle(h.value),onTransitionend:g},[e.renderSlot(t.$slots,"default")],36)],2))}});exports.default=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Carousel.vue.js");exports.default=e.default;
|