ronds-metadata 1.1.85 → 1.1.87
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/es/comps/FormGenerator/Provider.d.ts +3 -0
- package/es/comps/FormGenerator/Provider.js +8 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +15 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +17 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +13 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +11 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +11 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.js +11 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +11 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.d.ts +1 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +114 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.d.ts +7 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +44 -0
- package/es/comps/FormGenerator/comps/Canvas/core/index.d.ts +7 -0
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +170 -0
- package/es/comps/FormGenerator/comps/Canvas/core/index.less +24 -0
- package/es/comps/FormGenerator/comps/Canvas/index.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Canvas/index.js +109 -0
- package/es/comps/FormGenerator/comps/Settings/index.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Settings/index.js +116 -0
- package/es/comps/FormGenerator/comps/Sidebar/Elements.d.ts +6 -0
- package/es/comps/FormGenerator/comps/Sidebar/Elements.js +48 -0
- package/es/comps/FormGenerator/comps/Sidebar/index.d.ts +2 -0
- package/es/comps/FormGenerator/comps/Sidebar/index.js +37 -0
- package/es/comps/FormGenerator/index.d.ts +5 -0
- package/es/comps/FormGenerator/index.js +30 -0
- package/es/comps/FormGenerator/index.less +21 -0
- package/es/comps/FormGenerator/settings/index.d.ts +702 -0
- package/es/comps/FormGenerator/settings/index.js +206 -0
- package/es/comps/FormGenerator/settings/ruleConfig.d.ts +364 -0
- package/es/comps/FormGenerator/settings/ruleConfig.js +346 -0
- package/es/comps/FormGenerator/transformer.d.ts +13 -0
- package/es/comps/FormGenerator/transformer.js +66 -0
- package/es/comps/MetadataForm/DataCell/Input.js +11 -3
- package/es/comps/MetadataForm/DataCell/Number.js +11 -4
- package/es/comps/MetadataForm/DataCell/Ref.js +3 -3
- package/es/comps/MetadataForm/DataCell/Select.js +11 -3
- package/es/comps/MetadataForm/DataCell/Switch.js +11 -3
- package/es/comps/MetadataForm/index.js +10 -4
- package/es/config.js +2 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/theme.less +4 -0
- package/package.json +1 -1
@@ -0,0 +1,206 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: wangxian
|
3
|
+
* @Date: 2023-02-06 08:24:17
|
4
|
+
* @LastEditTime: 2023-02-09 14:09:26
|
5
|
+
*/
|
6
|
+
import { RefRule, Rule } from './ruleConfig';
|
7
|
+
export var inputSchema = [{
|
8
|
+
id: 'inputSchema',
|
9
|
+
type: 'object',
|
10
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
|
11
|
+
types: [RefRule.common.depend.types]
|
12
|
+
}];
|
13
|
+
export var textareaSchema = [{
|
14
|
+
id: 'textareaSchema',
|
15
|
+
type: 'object',
|
16
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props],
|
17
|
+
types: [RefRule.common.depend.types]
|
18
|
+
}];
|
19
|
+
export var dateSchema = [{
|
20
|
+
id: 'textareaSchema',
|
21
|
+
type: 'object',
|
22
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.defaultValue, Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
|
23
|
+
types: [RefRule.common.depend.types, RefRule.text.types]
|
24
|
+
}];
|
25
|
+
export var settingSchema = {
|
26
|
+
input: inputSchema,
|
27
|
+
textarea: textareaSchema,
|
28
|
+
dateSchema: dateSchema
|
29
|
+
};
|
30
|
+
export var inputParam = {
|
31
|
+
type: 'text',
|
32
|
+
schema: settingSchema.input
|
33
|
+
};
|
34
|
+
export var textareaParam = {
|
35
|
+
type: 'text',
|
36
|
+
schema: settingSchema.textarea,
|
37
|
+
rule: {
|
38
|
+
type: 'textarea'
|
39
|
+
}
|
40
|
+
};
|
41
|
+
export var dateParam = {
|
42
|
+
type: 'text',
|
43
|
+
schema: settingSchema.dateSchema,
|
44
|
+
rule: {
|
45
|
+
type: 'datePicker'
|
46
|
+
}
|
47
|
+
}; // 基础组件列表渲染
|
48
|
+
|
49
|
+
export var basicComps = [{
|
50
|
+
id: 'input',
|
51
|
+
name: '输入框',
|
52
|
+
type: 'input',
|
53
|
+
param: inputParam
|
54
|
+
}, {
|
55
|
+
id: 'textarea',
|
56
|
+
name: '文本框',
|
57
|
+
type: 'textarea',
|
58
|
+
param: textareaParam
|
59
|
+
}, {
|
60
|
+
id: 'date',
|
61
|
+
name: '日期选择',
|
62
|
+
type: 'date',
|
63
|
+
param: dateParam
|
64
|
+
}, {
|
65
|
+
id: 'number',
|
66
|
+
name: '数字输入框',
|
67
|
+
type: 'number',
|
68
|
+
param: inputParam
|
69
|
+
}, {
|
70
|
+
id: 'switch',
|
71
|
+
name: '开关',
|
72
|
+
type: 'switch',
|
73
|
+
param: inputParam
|
74
|
+
}, {
|
75
|
+
id: 'select',
|
76
|
+
name: '下拉单选',
|
77
|
+
type: 'select',
|
78
|
+
param: inputParam
|
79
|
+
}, {
|
80
|
+
id: 'mutiSelect',
|
81
|
+
name: '下拉多选',
|
82
|
+
type: 'mutiSelect',
|
83
|
+
param: inputParam
|
84
|
+
}]; // 布局组件列表渲染
|
85
|
+
|
86
|
+
export var layoutComps = [{
|
87
|
+
id: 'obj',
|
88
|
+
name: '对象'
|
89
|
+
}, {
|
90
|
+
id: 'list',
|
91
|
+
name: '常规列表'
|
92
|
+
}]; // Sidebar 内容配置
|
93
|
+
|
94
|
+
export var sidebarCtx = [{
|
95
|
+
name: '基础组件',
|
96
|
+
children: basicComps
|
97
|
+
}, {
|
98
|
+
name: '布局组件',
|
99
|
+
children: layoutComps
|
100
|
+
}];
|
101
|
+
export var dragItemType = 'fg-drag';
|
102
|
+
export var formSettingSchema = [{
|
103
|
+
id: 'formSettingSchema',
|
104
|
+
type: 'object',
|
105
|
+
properties: [{
|
106
|
+
id: 'colSpan',
|
107
|
+
type: 'enum',
|
108
|
+
fields: [{
|
109
|
+
id: 'Rule.Form',
|
110
|
+
refId: 'com.ronds.schema.default.Rule.Form',
|
111
|
+
type: 'ref',
|
112
|
+
value: {
|
113
|
+
'common-en-US': {
|
114
|
+
depend: {}
|
115
|
+
},
|
116
|
+
common: {
|
117
|
+
label: '整体布局',
|
118
|
+
placeholder: '默认布局(一行一列)',
|
119
|
+
depend: {}
|
120
|
+
},
|
121
|
+
enum: {
|
122
|
+
value: [{
|
123
|
+
key: 24,
|
124
|
+
value: '一行一列'
|
125
|
+
}, {
|
126
|
+
key: 12,
|
127
|
+
value: '一行两列'
|
128
|
+
}, {
|
129
|
+
key: 8,
|
130
|
+
value: '一行三列'
|
131
|
+
}, {
|
132
|
+
key: 6,
|
133
|
+
value: '一行四列'
|
134
|
+
}],
|
135
|
+
http: {}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}]
|
139
|
+
}, {
|
140
|
+
id: 'layout',
|
141
|
+
type: 'enum',
|
142
|
+
fields: [{
|
143
|
+
id: 'Rule.Form',
|
144
|
+
refId: 'com.ronds.schema.default.Rule.Form',
|
145
|
+
type: 'ref',
|
146
|
+
value: {
|
147
|
+
'common-en-US': {
|
148
|
+
depend: {}
|
149
|
+
},
|
150
|
+
common: {
|
151
|
+
label: '标签展示模式',
|
152
|
+
depend: {}
|
153
|
+
},
|
154
|
+
enum: {
|
155
|
+
value: [{
|
156
|
+
value: '同行',
|
157
|
+
key: 'horizontal'
|
158
|
+
}, {
|
159
|
+
value: '单独一行',
|
160
|
+
key: 'vertical'
|
161
|
+
}],
|
162
|
+
type: 'checkbox',
|
163
|
+
http: {}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}]
|
167
|
+
}, {
|
168
|
+
id: 'labelSpan',
|
169
|
+
type: 'number',
|
170
|
+
fields: [{
|
171
|
+
id: 'Rule.Form',
|
172
|
+
refId: 'com.ronds.schema.default.Rule.Form',
|
173
|
+
type: 'ref',
|
174
|
+
value: {
|
175
|
+
'common-en-US': {
|
176
|
+
depend: {}
|
177
|
+
},
|
178
|
+
common: {
|
179
|
+
label: '标签宽度',
|
180
|
+
tooltip: '不填自适应默认宽度',
|
181
|
+
depend: {}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}]
|
185
|
+
}]
|
186
|
+
}];
|
187
|
+
export var formSetting = {
|
188
|
+
id: 'formSetting',
|
189
|
+
name: '表单配置',
|
190
|
+
type: 'form',
|
191
|
+
param: {
|
192
|
+
type: 'form',
|
193
|
+
schema: formSettingSchema,
|
194
|
+
defaultValue: {
|
195
|
+
colSpan: 24,
|
196
|
+
layout: 'horizontal'
|
197
|
+
}
|
198
|
+
}
|
199
|
+
};
|
200
|
+
export var streamEventType = {
|
201
|
+
onNodeSelect: 'onNodeSelect',
|
202
|
+
onNodeDelete: 'onNodeDelete',
|
203
|
+
onNodeCopy: 'onNodeCopy',
|
204
|
+
onClearCanvas: 'onClearCanvas',
|
205
|
+
onSettingValueChange: 'onSettingValueChange'
|
206
|
+
};
|
@@ -0,0 +1,364 @@
|
|
1
|
+
export declare const Rule: {
|
2
|
+
common: {
|
3
|
+
id: {
|
4
|
+
id: string;
|
5
|
+
type: string;
|
6
|
+
fields: {
|
7
|
+
id: string;
|
8
|
+
type: string;
|
9
|
+
refId: string;
|
10
|
+
value: {
|
11
|
+
label: string;
|
12
|
+
tooltip: string;
|
13
|
+
};
|
14
|
+
}[];
|
15
|
+
};
|
16
|
+
label: {
|
17
|
+
id: string;
|
18
|
+
type: string;
|
19
|
+
fields: {
|
20
|
+
id: string;
|
21
|
+
type: string;
|
22
|
+
refId: string;
|
23
|
+
value: {
|
24
|
+
label: string;
|
25
|
+
};
|
26
|
+
}[];
|
27
|
+
};
|
28
|
+
color: {
|
29
|
+
id: string;
|
30
|
+
type: string;
|
31
|
+
fields: {
|
32
|
+
id: string;
|
33
|
+
type: string;
|
34
|
+
refId: string;
|
35
|
+
value: {
|
36
|
+
label: string;
|
37
|
+
type: string;
|
38
|
+
};
|
39
|
+
}[];
|
40
|
+
};
|
41
|
+
defaultValue: {
|
42
|
+
id: string;
|
43
|
+
type: string;
|
44
|
+
fields: {
|
45
|
+
id: string;
|
46
|
+
type: string;
|
47
|
+
refId: string;
|
48
|
+
value: {
|
49
|
+
label: string;
|
50
|
+
};
|
51
|
+
}[];
|
52
|
+
};
|
53
|
+
help: {
|
54
|
+
id: string;
|
55
|
+
type: string;
|
56
|
+
fields: {
|
57
|
+
id: string;
|
58
|
+
type: string;
|
59
|
+
refId: string;
|
60
|
+
value: {
|
61
|
+
label: string;
|
62
|
+
};
|
63
|
+
}[];
|
64
|
+
};
|
65
|
+
tooltip: {
|
66
|
+
id: string;
|
67
|
+
type: string;
|
68
|
+
fields: {
|
69
|
+
id: string;
|
70
|
+
type: string;
|
71
|
+
refId: string;
|
72
|
+
value: {
|
73
|
+
label: string;
|
74
|
+
};
|
75
|
+
}[];
|
76
|
+
};
|
77
|
+
placeholder: {
|
78
|
+
id: string;
|
79
|
+
type: string;
|
80
|
+
fields: {
|
81
|
+
id: string;
|
82
|
+
type: string;
|
83
|
+
refId: string;
|
84
|
+
value: {
|
85
|
+
label: string;
|
86
|
+
};
|
87
|
+
}[];
|
88
|
+
};
|
89
|
+
require: {
|
90
|
+
id: string;
|
91
|
+
type: string;
|
92
|
+
fields: {
|
93
|
+
id: string;
|
94
|
+
type: string;
|
95
|
+
refId: string;
|
96
|
+
value: {
|
97
|
+
label: string;
|
98
|
+
};
|
99
|
+
}[];
|
100
|
+
};
|
101
|
+
disabled: {
|
102
|
+
id: string;
|
103
|
+
type: string;
|
104
|
+
fields: {
|
105
|
+
id: string;
|
106
|
+
type: string;
|
107
|
+
refId: string;
|
108
|
+
value: {
|
109
|
+
label: string;
|
110
|
+
};
|
111
|
+
}[];
|
112
|
+
};
|
113
|
+
hidden: {
|
114
|
+
id: string;
|
115
|
+
type: string;
|
116
|
+
fields: {
|
117
|
+
id: string;
|
118
|
+
type: string;
|
119
|
+
refId: string;
|
120
|
+
value: {
|
121
|
+
common: {
|
122
|
+
label: string;
|
123
|
+
};
|
124
|
+
'common-en-US': {};
|
125
|
+
};
|
126
|
+
}[];
|
127
|
+
};
|
128
|
+
};
|
129
|
+
depend: {
|
130
|
+
hidden: {
|
131
|
+
id: string;
|
132
|
+
type: string;
|
133
|
+
fields: {
|
134
|
+
id: string;
|
135
|
+
type: string;
|
136
|
+
refId: string;
|
137
|
+
value: {
|
138
|
+
text: {};
|
139
|
+
common: {
|
140
|
+
label: string;
|
141
|
+
};
|
142
|
+
'common-en-US': {};
|
143
|
+
};
|
144
|
+
}[];
|
145
|
+
};
|
146
|
+
show: {
|
147
|
+
id: string;
|
148
|
+
type: string;
|
149
|
+
fields: {
|
150
|
+
id: string;
|
151
|
+
type: string;
|
152
|
+
refId: string;
|
153
|
+
value: {
|
154
|
+
text: {};
|
155
|
+
common: {
|
156
|
+
label: string;
|
157
|
+
depend: {};
|
158
|
+
};
|
159
|
+
'common-en-US': {};
|
160
|
+
};
|
161
|
+
}[];
|
162
|
+
};
|
163
|
+
};
|
164
|
+
text: {
|
165
|
+
type: {
|
166
|
+
id: string;
|
167
|
+
enum: {
|
168
|
+
value: string;
|
169
|
+
}[];
|
170
|
+
type: string;
|
171
|
+
fields: {
|
172
|
+
id: string;
|
173
|
+
type: string;
|
174
|
+
refId: string;
|
175
|
+
value: {
|
176
|
+
enum: {
|
177
|
+
value: {
|
178
|
+
key: string;
|
179
|
+
value: string;
|
180
|
+
}[];
|
181
|
+
};
|
182
|
+
text: {};
|
183
|
+
common: {
|
184
|
+
label: string;
|
185
|
+
};
|
186
|
+
};
|
187
|
+
}[];
|
188
|
+
};
|
189
|
+
format: {
|
190
|
+
id: string;
|
191
|
+
type: string;
|
192
|
+
fields: {
|
193
|
+
id: string;
|
194
|
+
type: string;
|
195
|
+
refId: string;
|
196
|
+
value: {
|
197
|
+
text: {};
|
198
|
+
common: {
|
199
|
+
label: string;
|
200
|
+
help: string;
|
201
|
+
};
|
202
|
+
'common-en-US': {};
|
203
|
+
};
|
204
|
+
}[];
|
205
|
+
};
|
206
|
+
};
|
207
|
+
rules: {
|
208
|
+
regExp: {
|
209
|
+
id: string;
|
210
|
+
type: string;
|
211
|
+
fields: {
|
212
|
+
id: string;
|
213
|
+
type: string;
|
214
|
+
refId: string;
|
215
|
+
value: {
|
216
|
+
text: {};
|
217
|
+
common: {
|
218
|
+
label: string;
|
219
|
+
};
|
220
|
+
'common-en-US': {};
|
221
|
+
};
|
222
|
+
}[];
|
223
|
+
};
|
224
|
+
message: {
|
225
|
+
id: string;
|
226
|
+
type: string;
|
227
|
+
fields: {
|
228
|
+
id: string;
|
229
|
+
type: string;
|
230
|
+
refId: string;
|
231
|
+
value: {
|
232
|
+
text: {};
|
233
|
+
common: {
|
234
|
+
label: string;
|
235
|
+
};
|
236
|
+
'common-en-US': {};
|
237
|
+
};
|
238
|
+
}[];
|
239
|
+
};
|
240
|
+
};
|
241
|
+
};
|
242
|
+
export declare const RefRule: {
|
243
|
+
common: {
|
244
|
+
depend: {
|
245
|
+
props: {
|
246
|
+
id: string;
|
247
|
+
type: string;
|
248
|
+
refId: string;
|
249
|
+
fields: {
|
250
|
+
id: string;
|
251
|
+
type: string;
|
252
|
+
refId: string;
|
253
|
+
value: {
|
254
|
+
common: {
|
255
|
+
label: string;
|
256
|
+
};
|
257
|
+
'common-en-US': {};
|
258
|
+
};
|
259
|
+
}[];
|
260
|
+
};
|
261
|
+
types: {
|
262
|
+
id: string;
|
263
|
+
type: string;
|
264
|
+
properties: {
|
265
|
+
id: string;
|
266
|
+
type: string;
|
267
|
+
fields: {
|
268
|
+
id: string;
|
269
|
+
type: string;
|
270
|
+
refId: string;
|
271
|
+
value: {
|
272
|
+
text: {};
|
273
|
+
common: {
|
274
|
+
label: string;
|
275
|
+
};
|
276
|
+
'common-en-US': {};
|
277
|
+
};
|
278
|
+
}[];
|
279
|
+
}[];
|
280
|
+
};
|
281
|
+
};
|
282
|
+
rules: {
|
283
|
+
props: {
|
284
|
+
id: string;
|
285
|
+
type: string;
|
286
|
+
items: {
|
287
|
+
type: string;
|
288
|
+
refId: string;
|
289
|
+
};
|
290
|
+
fields: {
|
291
|
+
id: string;
|
292
|
+
type: string;
|
293
|
+
refId: string;
|
294
|
+
value: {
|
295
|
+
array: {};
|
296
|
+
common: {
|
297
|
+
label: string;
|
298
|
+
};
|
299
|
+
'common-en-US': {};
|
300
|
+
};
|
301
|
+
}[];
|
302
|
+
};
|
303
|
+
types: {
|
304
|
+
id: string;
|
305
|
+
type: string;
|
306
|
+
properties: {
|
307
|
+
id: string;
|
308
|
+
type: string;
|
309
|
+
fields: {
|
310
|
+
id: string;
|
311
|
+
type: string;
|
312
|
+
refId: string;
|
313
|
+
value: {
|
314
|
+
text: {};
|
315
|
+
common: {
|
316
|
+
label: string;
|
317
|
+
};
|
318
|
+
'common-en-US': {};
|
319
|
+
};
|
320
|
+
}[];
|
321
|
+
}[];
|
322
|
+
};
|
323
|
+
};
|
324
|
+
};
|
325
|
+
text: {
|
326
|
+
props: {
|
327
|
+
id: string;
|
328
|
+
type: string;
|
329
|
+
refId: string;
|
330
|
+
fields: {
|
331
|
+
id: string;
|
332
|
+
type: string;
|
333
|
+
refId: string;
|
334
|
+
value: {
|
335
|
+
common: {
|
336
|
+
label: string;
|
337
|
+
};
|
338
|
+
'common-en-US': {};
|
339
|
+
};
|
340
|
+
}[];
|
341
|
+
};
|
342
|
+
types: {
|
343
|
+
id: string;
|
344
|
+
type: string;
|
345
|
+
properties: {
|
346
|
+
id: string;
|
347
|
+
type: string;
|
348
|
+
fields: {
|
349
|
+
id: string;
|
350
|
+
type: string;
|
351
|
+
refId: string;
|
352
|
+
value: {
|
353
|
+
text: {};
|
354
|
+
common: {
|
355
|
+
label: string;
|
356
|
+
help: string;
|
357
|
+
};
|
358
|
+
'common-en-US': {};
|
359
|
+
};
|
360
|
+
}[];
|
361
|
+
}[];
|
362
|
+
};
|
363
|
+
};
|
364
|
+
};
|