@cuvp1225/antd 0.1.12-beta.5 → 0.1.12-beta.7
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/dist/designer.js +22 -11
- package/dist/index.js +5 -5
- package/lib/cjs/components/index.d.ts +1 -1
- package/lib/cjs/components/index.js +3 -2
- package/lib/cjs/components/result3.d.ts +9 -0
- package/lib/cjs/components/result3.js +17 -0
- package/lib/cjs/prototypes/form.js +126 -6
- package/lib/esm/components/index.d.ts +1 -1
- package/lib/esm/components/index.js +2 -1
- package/lib/esm/components/result3.d.ts +9 -0
- package/lib/esm/components/result3.js +13 -0
- package/lib/esm/prototypes/form.js +123 -4
- package/package.json +2 -2
@@ -1,16 +1,18 @@
|
|
1
1
|
import { Input, Password, TextArea } from './input';
|
2
2
|
import { InputNumber } from './input-number';
|
3
|
-
import { Switch } from '
|
3
|
+
import { Switch } from 'antd';
|
4
4
|
import { RadioGroup } from './radio';
|
5
5
|
import { Checkbox, CheckboxGroup } from './checkbox';
|
6
|
-
import { Select } from '
|
6
|
+
import { Select } from 'antd';
|
7
7
|
import { Cascader } from './cascader';
|
8
8
|
import { TreeSelect } from './tree-select';
|
9
9
|
import { DatePicker, DateRangePicker } from './date-picker';
|
10
10
|
import { TimePicker, TimeRangePicker } from './time-picker';
|
11
11
|
import { Upload } from './upload';
|
12
|
+
import React from 'react';
|
12
13
|
import { StylePrototypes } from './common';
|
13
14
|
import { omitProps } from '../helpers';
|
15
|
+
import { JSONSetter } from '@music163/tango-designer/lib/esm/setters/json-setter';
|
14
16
|
const componentMap = {
|
15
17
|
Input,
|
16
18
|
Password,
|
@@ -31,6 +33,78 @@ const componentMap = {
|
|
31
33
|
UploadImage: Upload,
|
32
34
|
UploadFile: Upload,
|
33
35
|
};
|
36
|
+
const formChildren = [{
|
37
|
+
value: '< Input />',
|
38
|
+
label: '输入框',
|
39
|
+
},
|
40
|
+
{
|
41
|
+
value: '< Password />',
|
42
|
+
label: '密码框',
|
43
|
+
},
|
44
|
+
{
|
45
|
+
value: '< TextArea />',
|
46
|
+
label: '文本域',
|
47
|
+
},
|
48
|
+
{
|
49
|
+
value: '< InputNumber />',
|
50
|
+
label: '数字输入框',
|
51
|
+
},
|
52
|
+
{
|
53
|
+
value: '< Switch />',
|
54
|
+
label: '开关',
|
55
|
+
},
|
56
|
+
{
|
57
|
+
value: '< RadioGroup />',
|
58
|
+
label: '单选框组',
|
59
|
+
}, {
|
60
|
+
value: '< Checkbox />',
|
61
|
+
label: '复选框',
|
62
|
+
},
|
63
|
+
{
|
64
|
+
value: '< CheckboxGroup />',
|
65
|
+
label: '复选框组',
|
66
|
+
},
|
67
|
+
{
|
68
|
+
value: '< Select />',
|
69
|
+
label: '选择框',
|
70
|
+
},
|
71
|
+
{
|
72
|
+
value: '< Cascader />',
|
73
|
+
label: '级联选择框',
|
74
|
+
},
|
75
|
+
{
|
76
|
+
value: '< TreeSelect />',
|
77
|
+
label: '树选择框',
|
78
|
+
},
|
79
|
+
{
|
80
|
+
value: '< DatePicker />',
|
81
|
+
label: '日期选择框',
|
82
|
+
},
|
83
|
+
{
|
84
|
+
value: '< DateRangePicker />',
|
85
|
+
label: '日期范围选择框',
|
86
|
+
},
|
87
|
+
{
|
88
|
+
value: '< TimePicker />',
|
89
|
+
label: '时间选择框',
|
90
|
+
},
|
91
|
+
{
|
92
|
+
value: '< TimeRangePicker />',
|
93
|
+
label: '时间范围选择框',
|
94
|
+
},
|
95
|
+
{
|
96
|
+
value: '< UploadImage />',
|
97
|
+
label: '图片上传',
|
98
|
+
},
|
99
|
+
{
|
100
|
+
value: '< UploadFile />',
|
101
|
+
label: '文件上传',
|
102
|
+
},
|
103
|
+
{
|
104
|
+
value: '< Slider />',
|
105
|
+
label: '滑动输入条',
|
106
|
+
}
|
107
|
+
];
|
34
108
|
export const Form = {
|
35
109
|
name: 'Form',
|
36
110
|
title: '基本表单',
|
@@ -40,6 +114,7 @@ export const Form = {
|
|
40
114
|
package: '@cuvp1225/antd',
|
41
115
|
help: '最基本的表单组件,可以创建一个轻量级表单。',
|
42
116
|
hasChildren: true,
|
117
|
+
hasChildrenItem: true,
|
43
118
|
// initChildren:
|
44
119
|
// `<Form.Item label="Username" name="username" rules={[{ required: true, message: "Please input your username!" }]}>
|
45
120
|
// <Input />
|
@@ -56,16 +131,60 @@ export const Form = {
|
|
56
131
|
// Submit
|
57
132
|
// </Button>
|
58
133
|
// </Form.Item>`,
|
59
|
-
initChildren: '<
|
134
|
+
initChildren: '<Form.Item component="Input" label="表单项" ><Placeholder></Placeholder></Form.Item>',
|
60
135
|
relatedImports: ['FormItem', 'FormFooter', 'Button', 'Input'],
|
61
136
|
childrenName: ['FormItem', 'Fieldset', 'FormFooter'],
|
62
137
|
props: [
|
63
138
|
...StylePrototypes,
|
64
139
|
{
|
65
|
-
name: '
|
140
|
+
name: 'itemArray',
|
66
141
|
title: '表单项',
|
67
142
|
tip: '表单项子节点',
|
68
143
|
setter: 'arraySetter',
|
144
|
+
setterProps: {
|
145
|
+
ArrayProps: [
|
146
|
+
{ label: '标签', name: 'label', required: false, defaultValue: '表单项' },
|
147
|
+
{
|
148
|
+
label: '表单组件',
|
149
|
+
name: 'children',
|
150
|
+
component: React.createElement(Select, { options: formChildren }),
|
151
|
+
defaultValue: '< Input />',
|
152
|
+
},
|
153
|
+
{ label: '是否必填', name: 'required',
|
154
|
+
component: React.createElement(Switch, null),
|
155
|
+
},
|
156
|
+
{
|
157
|
+
label: '是否显示冒号', name: "colon",
|
158
|
+
component: React.createElement(Switch, null),
|
159
|
+
defaultValue: true,
|
160
|
+
},
|
161
|
+
{
|
162
|
+
label: '提示信息', name: "help",
|
163
|
+
},
|
164
|
+
{
|
165
|
+
label: '是否隐藏字段', name: "hidden",
|
166
|
+
component: React.createElement(Switch, null),
|
167
|
+
},
|
168
|
+
// {
|
169
|
+
// label:'默认值',name:"initialValue",
|
170
|
+
// },
|
171
|
+
// {
|
172
|
+
// label:'标签文本对齐方式',name:"labelAlign",
|
173
|
+
// },
|
174
|
+
// {
|
175
|
+
// label:'label 标签布局',name:"labelCol",
|
176
|
+
// }
|
177
|
+
{ label: '下拉选项', name: 'options',
|
178
|
+
component: React.createElement(JSONSetter, { onChange: function (value, detail) {
|
179
|
+
throw new Error('Function not implemented.');
|
180
|
+
} }),
|
181
|
+
getVisible: (form) => {
|
182
|
+
// 配置项 buttonType 仅在配置项 shape 的值为 button 时才展示
|
183
|
+
return form.getFieldValue('children').includes("Select");
|
184
|
+
},
|
185
|
+
}
|
186
|
+
]
|
187
|
+
},
|
69
188
|
},
|
70
189
|
{
|
71
190
|
name: 'layout',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cuvp1225/antd",
|
3
|
-
"version": "0.1.12-beta.
|
3
|
+
"version": "0.1.12-beta.7",
|
4
4
|
"description": "antd components for tango app",
|
5
5
|
"author": "wwsun <ww.sww@outlook.com>",
|
6
6
|
"homepage": "https://github.com/netease/tango-components#readme",
|
@@ -55,5 +55,5 @@
|
|
55
55
|
"classnames": "^2.3.2",
|
56
56
|
"coral-system": "^1.0.6"
|
57
57
|
},
|
58
|
-
"gitHead": "
|
58
|
+
"gitHead": "a87937f170f41214ef36d7ddb88040549c2d6185"
|
59
59
|
}
|