ronds-metadata 1.3.3 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,221 +0,0 @@
1
- import "antd/es/button/style";
2
- import _Button from "antd/es/button";
3
- import "antd/es/switch/style";
4
- import _Switch from "antd/es/switch";
5
- import "antd/es/input-number/style";
6
- import _InputNumber from "antd/es/input-number";
7
- import "antd/es/select/style";
8
- import _Select from "antd/es/select";
9
- import _extends from "@babel/runtime/helpers/esm/extends";
10
- import "antd/es/input/style";
11
- import _Input from "antd/es/input";
12
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
13
- import "antd/es/form/style";
14
- import _Form from "antd/es/form";
15
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
16
- import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
17
- import React from 'react';
18
- import { RULE_TYPES_OPTIONS } from '../constant';
19
- import { useMetaType } from '../hooks';
20
- import MetadataForm from '../../MetadataForm';
21
- var MetaFieldsEdit = function MetaFieldsEdit(props) {
22
- var defaultValues = props.defaultValues,
23
- onChange = props.onChange;
24
- var _Form$useForm = _Form.useForm(),
25
- _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
26
- form = _Form$useForm2[0];
27
- var _React$useState = React.useState({}),
28
- _React$useState2 = _slicedToArray(_React$useState, 2),
29
- ruleTypes = _React$useState2[0],
30
- setRuleTypes = _React$useState2[1];
31
- var _React$useState3 = React.useState({}),
32
- _React$useState4 = _slicedToArray(_React$useState3, 2),
33
- refIds = _React$useState4[0],
34
- setRefIds = _React$useState4[1];
35
- var _React$useState5 = React.useState({}),
36
- _React$useState6 = _slicedToArray(_React$useState5, 2),
37
- refValues = _React$useState6[0],
38
- setRefValues = _React$useState6[1];
39
- var metaType = useMetaType('扩展规则');
40
- React.useEffect(function () {
41
- if (defaultValues) {
42
- // console.log('defaultValues', defaultValues);
43
- form.setFieldsValue({
44
- fields: defaultValues
45
- });
46
- var _ruleTypes = ruleTypes;
47
- var _refIds = refIds;
48
- for (var i = 0; i < defaultValues.length; i++) {
49
- _ruleTypes[i] = defaultValues[i].type;
50
- if (defaultValues[i].type === 'ref') {
51
- _refIds[i] = defaultValues[i].refId;
52
- }
53
- }
54
- setRefIds(_objectSpread({}, _refIds));
55
- setRuleTypes(_objectSpread({}, _ruleTypes));
56
- }
57
- }, [defaultValues, form]);
58
- var onFinish = function onFinish(values) {
59
- var _fields = values.fields;
60
- for (var i = 0; i < _fields.length; i++) {
61
- if (_fields[i].type === 'ref') {
62
- _fields[i].value = refValues[i] || _fields[i].value;
63
- }
64
- }
65
- // console.log('_fields', _fields);
66
- onChange && onChange(_fields);
67
- };
68
- var onRefRulesValuesChange = function onRefRulesValuesChange(values, idx) {
69
- // console.log('onRefRulesValuesChange', values, refValues);
70
- var _refValues = refValues;
71
- _refValues[idx] = _refValues[idx] ? _objectSpread(_objectSpread({}, _refValues[idx]), values) : _objectSpread({}, values);
72
- setRefValues(_objectSpread({}, _refValues));
73
- };
74
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form, {
75
- className: "metadata-edit",
76
- style: {
77
- position: 'relative'
78
- },
79
- form: form,
80
- name: "control-hooks",
81
- onFinish: onFinish
82
- }, /*#__PURE__*/React.createElement("div", {
83
- style: {
84
- padding: '10px'
85
- }
86
- }, /*#__PURE__*/React.createElement(_Form.List, {
87
- name: "fields"
88
- }, function (fields, _ref) {
89
- var add = _ref.add,
90
- remove = _ref.remove;
91
- return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
92
- var _defaultValues$index;
93
- // console.log('fields=========', fields);
94
- return /*#__PURE__*/React.createElement("div", {
95
- key: field.key
96
- }, /*#__PURE__*/React.createElement("div", {
97
- style: {
98
- display: 'flex',
99
- alignItems: 'flex-start'
100
- }
101
- }, /*#__PURE__*/React.createElement(_Form.Item, _extends({
102
- className: "pr-10"
103
- }, field, {
104
- label: "\u89C4\u5219\u540D\u79F0",
105
- name: [field.name, 'id'],
106
- fieldKey: [field.fieldKey, 'id'],
107
- rules: [{
108
- required: true
109
- }]
110
- }), /*#__PURE__*/React.createElement(_Input, {
111
- style: {
112
- width: '120px'
113
- }
114
- })), /*#__PURE__*/React.createElement(_Form.Item, _extends({
115
- className: "pr-10"
116
- }, field, {
117
- label: "\u89C4\u5219\u7C7B\u578B",
118
- name: [field.name, 'type'],
119
- fieldKey: [field.fieldKey, 'type'],
120
- rules: [{
121
- required: true
122
- }]
123
- }), /*#__PURE__*/React.createElement(_Select, {
124
- style: {
125
- width: '120px'
126
- },
127
- onChange: function onChange(value) {
128
- var _ruleTypes = ruleTypes;
129
- _ruleTypes[index] = value;
130
- setRuleTypes(_objectSpread({}, _ruleTypes));
131
- },
132
- options: RULE_TYPES_OPTIONS
133
- })), ruleTypes[index] === 'text' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
134
- label: "\u89C4\u5219\u503C",
135
- name: [field.name, 'value'],
136
- fieldKey: [field.fieldKey, 'value'],
137
- rules: [{
138
- required: true
139
- }]
140
- }), /*#__PURE__*/React.createElement(_Input, {
141
- style: {
142
- width: '120px'
143
- }
144
- })), ruleTypes[index] === 'number' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
145
- label: "\u89C4\u5219\u503C",
146
- name: [field.name, 'value'],
147
- fieldKey: [field.fieldKey, 'value'],
148
- rules: [{
149
- required: true
150
- }]
151
- }), /*#__PURE__*/React.createElement(_InputNumber, {
152
- style: {
153
- width: '120px'
154
- }
155
- })), ruleTypes[index] === 'bool' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
156
- label: "\u89C4\u5219\u503C",
157
- name: [field.name, 'value'],
158
- fieldKey: [field.fieldKey, 'value'],
159
- rules: [{
160
- required: true
161
- }]
162
- }), /*#__PURE__*/React.createElement(_Switch, null)), ruleTypes[index] === 'ref' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
163
- label: "Ref",
164
- name: [field.name, 'refId'],
165
- fieldKey: [field.fieldKey, 'refId'],
166
- rules: [{
167
- required: true
168
- }]
169
- }), /*#__PURE__*/React.createElement(_Select, {
170
- style: {
171
- width: '120px'
172
- },
173
- onChange: function onChange(value) {
174
- var _refIds = refIds;
175
- _refIds[index] = value;
176
- setRefIds(_objectSpread({}, _refIds));
177
- var newData = form.getFieldValue('fields');
178
- // console.log('newData', newData);
179
- newData[index].id = value;
180
- form.setFieldsValue({
181
- fields: newData
182
- });
183
- },
184
- options: metaType || []
185
- })), /*#__PURE__*/React.createElement("div", {
186
- style: {
187
- lineHeight: '88px',
188
- paddingLeft: '15px'
189
- }
190
- }, /*#__PURE__*/React.createElement(MinusCircleOutlined, {
191
- onClick: function onClick() {
192
- return remove(field.name);
193
- }
194
- }))), refIds[index] && /*#__PURE__*/React.createElement("div", {
195
- style: {
196
- border: '1px solid var(--ronds-metadata-color-border-1)',
197
- padding: '10px',
198
- marginBottom: '10px'
199
- }
200
- }, /*#__PURE__*/React.createElement(MetadataForm, {
201
- initialValues: defaultValues && defaultValues.length > 0 && ((_defaultValues$index = defaultValues[index]) === null || _defaultValues$index === void 0 ? void 0 : _defaultValues$index.value),
202
- refId: refIds[index],
203
- onValuesChange: function onValuesChange(values, allValues) {
204
- onRefRulesValuesChange(allValues, index);
205
- }
206
- })));
207
- }), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
208
- type: "dashed",
209
- onClick: function onClick() {
210
- return add();
211
- },
212
- block: true,
213
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
214
- }, "\u6DFB\u52A0\u6269\u5C55\u89C4\u5219")));
215
- }), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
216
- type: "primary",
217
- block: true,
218
- htmlType: "submit"
219
- }, "\u786E\u5B9A")))));
220
- };
221
- export default MetaFieldsEdit;
@@ -1,12 +0,0 @@
1
- import { FormInstance } from 'antd/lib/form';
2
- interface IMetaPropsEditProps {
3
- form: FormInstance;
4
- id?: string;
5
- metadataTag?: string;
6
- name: string;
7
- isEdit?: boolean;
8
- onAddFields?: (idx: number) => void;
9
- onNewRefClick?: () => void;
10
- }
11
- declare const MetaPropsEdit: (props: IMetaPropsEditProps) => JSX.Element;
12
- export default MetaPropsEdit;
@@ -1,353 +0,0 @@
1
- import "antd/es/space/style";
2
- import _Space from "antd/es/space";
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import "antd/es/tooltip/style";
5
- import _Tooltip from "antd/es/tooltip";
6
- import "antd/es/button/style";
7
- import _Button from "antd/es/button";
8
- import "antd/es/select/style";
9
- import _Select from "antd/es/select";
10
- import "antd/es/form/style";
11
- import _Form from "antd/es/form";
12
- import "antd/es/input/style";
13
- import _Input from "antd/es/input";
14
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
15
- import React from 'react';
16
- import { MinusCircleOutlined, PlusOutlined, ReloadOutlined } from '@ant-design/icons';
17
- import { ARRAY_TYPES_OPTIONS, BASIC_TYPES_OPTIONS, NUMBER_FORMAT_OPTIONS } from '../constant';
18
- import { useMetaType } from '../hooks';
19
- // import { guid } from '../../../utils';
20
- import TextArea from "antd/es/input/TextArea";
21
- var MetaPropsEdit = function MetaPropsEdit(props) {
22
- var form = props.form,
23
- id = props.id,
24
- metadataTag = props.metadataTag,
25
- name = props.name,
26
- onAddFields = props.onAddFields,
27
- onNewRefClick = props.onNewRefClick;
28
- var _React$useState = React.useState(true),
29
- _React$useState2 = _slicedToArray(_React$useState, 2),
30
- refresh = _React$useState2[0],
31
- setRefresh = _React$useState2[1];
32
- var metaType = useMetaType(metadataTag, refresh);
33
- // console.log('metaType', metaType, id);
34
- // 赋值
35
- var onTypeChange = function onTypeChange(idx) {
36
- var _properties = form.getFieldValue('properties');
37
- // console.log('_propertie=========', _properties, idx);
38
- var __properties = {
39
- id: _properties[idx].id,
40
- type: _properties[idx].type,
41
- name: _properties[idx].name,
42
- code: _properties[idx].code,
43
- desc: _properties[idx].desc
44
- };
45
- _properties[idx] = __properties;
46
- form.setFieldsValue({
47
- properties: _properties
48
- });
49
- };
50
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form.List, {
51
- name: name
52
- }, function (fields, _ref) {
53
- var add = _ref.add,
54
- remove = _ref.remove;
55
- return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
56
- // console.log('field=============', field);
57
- return /*#__PURE__*/React.createElement("div", {
58
- key: Math.random()
59
- }, /*#__PURE__*/React.createElement("div", {
60
- key: Math.random(),
61
- style: {
62
- display: 'flex',
63
- alignItems: 'flex-end',
64
- flexWrap: 'wrap'
65
- }
66
- }, /*#__PURE__*/React.createElement(_Form.Item, {
67
- className: "pr-10",
68
- label: "\u540D\u79F0",
69
- name: [field.name, 'name'],
70
- fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey, 'name'],
71
- rules: [{
72
- required: true
73
- }]
74
- }, /*#__PURE__*/React.createElement(_Input, null)), /*#__PURE__*/React.createElement(_Form.Item, {
75
- className: "pr-10",
76
- label: "\u7F16\u7801",
77
- name: [field.name, 'code'],
78
- fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey, 'code'],
79
- rules: [{
80
- required: true
81
- }]
82
- }, /*#__PURE__*/React.createElement(_Input, null)), /*#__PURE__*/React.createElement(_Form.Item, {
83
- className: "pr-10",
84
- label: "\u5B57\u6BB5\u540D\u79F0",
85
- name: [field === null || field === void 0 ? void 0 : field.name, 'id'],
86
- fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey, 'id'],
87
- rules: [{
88
- required: true
89
- }]
90
- }, /*#__PURE__*/React.createElement(_Input, null)), /*#__PURE__*/React.createElement(_Form.Item, {
91
- className: "pr-10",
92
- label: "\u5B57\u6BB5\u7C7B\u578B",
93
- name: [field === null || field === void 0 ? void 0 : field.name, 'type'],
94
- fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey, 'type'],
95
- rules: [{
96
- required: true
97
- }]
98
- }, /*#__PURE__*/React.createElement(_Select, {
99
- style: {
100
- width: '100%'
101
- },
102
- options: BASIC_TYPES_OPTIONS,
103
- onChange: function onChange() {
104
- onTypeChange(index);
105
- }
106
- })), /*#__PURE__*/React.createElement(_Form.Item, {
107
- className: "pr-10",
108
- label: "\u63CF\u8FF0",
109
- style: {
110
- width: '80%'
111
- },
112
- name: [field.name, 'desc'],
113
- fieldKey: [field.fieldKey, 'desc']
114
- }, /*#__PURE__*/React.createElement(TextArea, null)), /*#__PURE__*/React.createElement("div", {
115
- style: {
116
- lineHeight: '88px',
117
- paddingLeft: '15px'
118
- }
119
- }, /*#__PURE__*/React.createElement(MinusCircleOutlined, {
120
- onClick: function onClick() {
121
- return remove(field.name);
122
- }
123
- })), onAddFields && /*#__PURE__*/React.createElement(_Form.Item, {
124
- style: {
125
- flex: 1,
126
- textAlign: 'right'
127
- }
128
- }, /*#__PURE__*/React.createElement(_Tooltip, {
129
- title: "\u6DFB\u52A0\u6269\u5C55\u89C4\u5219"
130
- }, /*#__PURE__*/React.createElement(_Button, {
131
- shape: "circle",
132
- size: "small",
133
- type: "primary",
134
- onClick: function onClick() {
135
- onAddFields(index);
136
- },
137
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
138
- })))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Form.Item, {
139
- noStyle: true,
140
- shouldUpdate: function shouldUpdate(prevValues, currentValues) {
141
- var _prevValues$name$inde, _currentValues$name$i, _prevValues$name$inde2, _currentValues$name$i2;
142
- return (prevValues === null || prevValues === void 0 ? void 0 : (_prevValues$name$inde = prevValues[name][index]) === null || _prevValues$name$inde === void 0 ? void 0 : _prevValues$name$inde.type) !== (currentValues === null || currentValues === void 0 ? void 0 : (_currentValues$name$i = currentValues[name][index]) === null || _currentValues$name$i === void 0 ? void 0 : _currentValues$name$i.type) || (prevValues === null || prevValues === void 0 ? void 0 : (_prevValues$name$inde2 = prevValues[name][index]) === null || _prevValues$name$inde2 === void 0 ? void 0 : _prevValues$name$inde2.items) !== (currentValues === null || currentValues === void 0 ? void 0 : (_currentValues$name$i2 = currentValues[name][index]) === null || _currentValues$name$i2 === void 0 ? void 0 : _currentValues$name$i2.items);
143
- }
144
- }, function (_ref2) {
145
- var _properties$index, _properties$index2, _properties$index2$it, _properties$index3, _properties$index3$it;
146
- var getFieldValue = _ref2.getFieldValue;
147
- var _properties = getFieldValue(name);
148
- switch ((_properties$index = _properties[index]) === null || _properties$index === void 0 ? void 0 : _properties$index.type) {
149
- case 'number':
150
- return /*#__PURE__*/React.createElement("div", {
151
- style: {
152
- border: '1px solid var(--ronds-metadata-color-border-1)',
153
- padding: '10px',
154
- marginBottom: '10px'
155
- }
156
- }, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
157
- label: "format",
158
- name: [field.name, 'format'],
159
- fieldKey: [field.fieldKey, 'format'],
160
- rules: [{
161
- required: true
162
- }]
163
- }), /*#__PURE__*/React.createElement(_Select, {
164
- style: {
165
- width: '180px'
166
- },
167
- options: NUMBER_FORMAT_OPTIONS
168
- })));
169
- case 'ref':
170
- return /*#__PURE__*/React.createElement("div", {
171
- style: {
172
- border: '1px solid var(--ronds-metadata-color-border-1)',
173
- padding: '10px',
174
- display: 'flex',
175
- alignItems: 'center',
176
- marginBottom: '10px'
177
- }
178
- }, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
179
- label: "Ref",
180
- name: [field.name, 'refId'],
181
- fieldKey: [field.fieldKey, 'refId'],
182
- rules: [{
183
- required: true
184
- }]
185
- }), /*#__PURE__*/React.createElement(_Select, {
186
- style: {
187
- width: '180px'
188
- },
189
- options: metaType || []
190
- })), /*#__PURE__*/React.createElement("div", {
191
- style: {
192
- padding: '0 10px'
193
- }
194
- }, /*#__PURE__*/React.createElement(_Tooltip, {
195
- title: "\u6DFB\u52A0\u5F15\u7528\u7C7B\u578B"
196
- }, /*#__PURE__*/React.createElement(_Button, {
197
- shape: "circle",
198
- size: "small",
199
- type: "primary",
200
- onClick: function onClick() {
201
- onNewRefClick && onNewRefClick();
202
- },
203
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
204
- })), /*#__PURE__*/React.createElement(_Tooltip, {
205
- title: "\u5237\u65B0"
206
- }, /*#__PURE__*/React.createElement(_Button, {
207
- shape: "circle",
208
- size: "small",
209
- style: {
210
- marginLeft: '10px'
211
- },
212
- onClick: function onClick() {
213
- setRefresh(false);
214
- setTimeout(function () {
215
- setRefresh(true);
216
- }, 100);
217
- },
218
- icon: /*#__PURE__*/React.createElement(ReloadOutlined, null)
219
- }))));
220
- case 'array':
221
- return /*#__PURE__*/React.createElement("div", {
222
- style: {
223
- border: '1px solid var(--ronds-metadata-color-border-1)',
224
- borderRadius: '5px',
225
- padding: '10px',
226
- marginBottom: '10px',
227
- display: 'flex',
228
- alignItems: 'center'
229
- }
230
- }, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
231
- label: "Array",
232
- className: "pr-10",
233
- name: [field.name, 'items', 'type'],
234
- fieldKey: [field.fieldKey, 'items', 'type'],
235
- rules: [{
236
- required: true
237
- }]
238
- }), /*#__PURE__*/React.createElement(_Select, {
239
- style: {
240
- width: '180px'
241
- },
242
- options: ARRAY_TYPES_OPTIONS
243
- })), _properties && ((_properties$index2 = _properties[index]) === null || _properties$index2 === void 0 ? void 0 : (_properties$index2$it = _properties$index2.items) === null || _properties$index2$it === void 0 ? void 0 : _properties$index2$it.type) === 'ref' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
244
- label: "Ref",
245
- name: [field.name, 'items', 'refId'],
246
- fieldKey: [field.fieldKey, 'items', 'refId'],
247
- rules: [{
248
- required: true
249
- }]
250
- }), /*#__PURE__*/React.createElement(_Select, {
251
- style: {
252
- width: '180px'
253
- },
254
- options: metaType || []
255
- })), /*#__PURE__*/React.createElement("div", {
256
- style: {
257
- padding: '0 10px'
258
- }
259
- }, /*#__PURE__*/React.createElement(_Tooltip, {
260
- title: "\u6DFB\u52A0\u5F15\u7528\u7C7B\u578B"
261
- }, /*#__PURE__*/React.createElement(_Button, {
262
- shape: "circle",
263
- size: "small",
264
- type: "primary",
265
- onClick: function onClick() {
266
- onNewRefClick && onNewRefClick();
267
- },
268
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
269
- })), /*#__PURE__*/React.createElement(_Tooltip, {
270
- title: "\u5237\u65B0"
271
- }, /*#__PURE__*/React.createElement(_Button, {
272
- shape: "circle",
273
- size: "small",
274
- style: {
275
- marginLeft: '10px'
276
- },
277
- onClick: function onClick() {
278
- setRefresh(false);
279
- setTimeout(function () {
280
- setRefresh(true);
281
- }, 100);
282
- },
283
- icon: /*#__PURE__*/React.createElement(ReloadOutlined, null)
284
- })))), _properties && ((_properties$index3 = _properties[index]) === null || _properties$index3 === void 0 ? void 0 : (_properties$index3$it = _properties$index3.items) === null || _properties$index3$it === void 0 ? void 0 : _properties$index3$it.type) === 'number' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
285
- label: "format",
286
- name: [field.name, 'items', 'format'],
287
- fieldKey: [field.fieldKey, 'items', 'format'],
288
- rules: [{
289
- required: true
290
- }]
291
- }), /*#__PURE__*/React.createElement(_Select, {
292
- style: {
293
- width: '180px'
294
- },
295
- options: NUMBER_FORMAT_OPTIONS
296
- }))));
297
- case 'enum':
298
- return /*#__PURE__*/React.createElement("div", {
299
- style: {
300
- border: '1px solid var(--ronds-metadata-color-border-1)',
301
- padding: '10px',
302
- marginBottom: '10px'
303
- }
304
- }, /*#__PURE__*/React.createElement(_Form.List, {
305
- name: [field.name, 'enum']
306
- }, function (enumFields, operation) {
307
- return /*#__PURE__*/React.createElement(React.Fragment, null, enumFields.map(function (enumField) {
308
- return /*#__PURE__*/React.createElement(_Space, {
309
- key: "enumField-".concat(enumField.key),
310
- align: "baseline"
311
- }, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
312
- className: "pr-10",
313
- label: "Enum",
314
- name: [enumField.name, 'value'],
315
- fieldKey: [enumField.fieldKey, 'value'],
316
- rules: [{
317
- required: true
318
- }]
319
- }), /*#__PURE__*/React.createElement(_Input, null)), /*#__PURE__*/React.createElement(MinusCircleOutlined, {
320
- onClick: function onClick() {
321
- return operation.remove(enumField.name);
322
- }
323
- }));
324
- }), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
325
- type: "dashed",
326
- onClick: function onClick() {
327
- return operation.add();
328
- },
329
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
330
- }, "\u6DFB\u52A0Enum")));
331
- }));
332
- default:
333
- return null;
334
- }
335
- })));
336
- }), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
337
- type: "dashed",
338
- onClick: function onClick() {
339
- return add();
340
- },
341
- block: true,
342
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
343
- }, "\u6DFB\u52A0".concat(name, "\u540D\u79F0"))), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
344
- type: "dashed",
345
- onClick: function onClick() {
346
- onAddFields(-1);
347
- },
348
- block: true,
349
- icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
350
- }, "\u6DFB\u52A0\u6269\u5C55\u89C4\u5219")));
351
- }));
352
- };
353
- export default MetaPropsEdit;
@@ -1,24 +0,0 @@
1
- export declare const BASIC_TYPES_OPTIONS: {
2
- label: string;
3
- value: string;
4
- }[];
5
- export declare const ARRAY_TYPES_OPTIONS: {
6
- label: string;
7
- value: string;
8
- }[];
9
- export declare const OUTERMOST_TYPES_OPTIONS: {
10
- label: string;
11
- value: string;
12
- }[];
13
- export declare const RULE_TYPES_OPTIONS: {
14
- label: string;
15
- value: string;
16
- }[];
17
- export declare const NUMBER_FORMAT_OPTIONS: {
18
- label: string;
19
- value: string;
20
- }[];
21
- export declare const REF_OPTIONS: {
22
- label: string;
23
- value: string;
24
- }[];
@@ -1,69 +0,0 @@
1
- export var BASIC_TYPES_OPTIONS = [{
2
- label: '数字',
3
- value: 'number'
4
- }, {
5
- label: '文本',
6
- value: 'text'
7
- }, {
8
- label: '布尔类型',
9
- value: 'bool'
10
- }, {
11
- label: '枚举类型',
12
- value: 'enum'
13
- }, {
14
- label: '数组',
15
- value: 'array'
16
- }, {
17
- label: '引用类型',
18
- value: 'ref'
19
- }];
20
- export var ARRAY_TYPES_OPTIONS = [{
21
- label: '数字',
22
- value: 'number'
23
- }, {
24
- label: '文本',
25
- value: 'text'
26
- }, {
27
- label: '布尔类型',
28
- value: 'bool'
29
- }, {
30
- label: '引用类型',
31
- value: 'ref'
32
- }];
33
- export var OUTERMOST_TYPES_OPTIONS = [{
34
- label: '对象',
35
- value: 'object'
36
- }, {
37
- label: '数字',
38
- value: 'number'
39
- }, {
40
- label: '文本',
41
- value: 'text'
42
- }, {
43
- label: '布尔类型',
44
- value: 'bool'
45
- }];
46
- export var RULE_TYPES_OPTIONS = [{
47
- label: '引用',
48
- value: 'ref'
49
- }, {
50
- label: '数字',
51
- value: 'number'
52
- }, {
53
- label: '文本',
54
- value: 'text'
55
- }, {
56
- label: '布尔类型',
57
- value: 'bool'
58
- }];
59
- export var NUMBER_FORMAT_OPTIONS = [{
60
- label: 'int',
61
- value: 'int'
62
- }, {
63
- label: 'double',
64
- value: 'double'
65
- }];
66
- export var REF_OPTIONS = [{
67
- label: '表单扩展规则',
68
- value: 'FormRules'
69
- }];
@@ -1,4 +0,0 @@
1
- export declare const useMetaType: (tag?: string, isFresh?: boolean) => {
2
- label: string;
3
- value: string;
4
- }[];