ronds-metadata 1.0.78 → 1.0.81
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/Editable/comps/EditableAction.js +10 -9
- package/es/comps/Editable/comps/EditableCell.js +3 -5
- package/es/comps/Editable/comps/EditableHeardCell.js +7 -6
- package/es/comps/Editable/index.js +4 -3
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +24 -27
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +4 -4
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +1 -1
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +4 -4
- package/es/comps/MetadataForm/DataCell/Array.js +8 -10
- package/es/comps/MetadataForm/DataCell/Ref.js +2 -2
- package/es/comps/MetadataForm/index.js +9 -8
- package/es/comps/MetadataForm/utils.js +1 -43
- package/es/comps/locales/en-US.d.ts +14 -0
- package/es/comps/locales/en-US.js +13 -0
- package/es/comps/locales/index.d.ts +2 -0
- package/es/comps/locales/index.js +10 -0
- package/es/comps/locales/zh-CN.d.ts +14 -0
- package/es/comps/locales/zh-CN.js +13 -0
- package/es/config.d.ts +4 -1
- package/es/config.js +29 -3
- package/es/framework/libs/jquery.min.js +4022 -0
- package/es/framework/locale/dil8/di18n.d.ts +17 -0
- package/es/framework/locale/dil8/di18n.js +132 -0
- package/es/framework/locale/dil8/index.d.ts +2 -0
- package/es/framework/locale/dil8/index.js +3 -0
- package/es/framework/locale/dil8/translate.d.ts +7 -0
- package/es/framework/locale/dil8/translate.js +76 -0
- package/es/framework/locale/dil8/util.d.ts +3 -0
- package/es/framework/locale/dil8/util.js +17 -0
- package/es/framework/locale/index.d.ts +7 -0
- package/es/framework/locale/index.js +24 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -2
- package/es/theme.css +6 -0
- package/package.json +1 -1
@@ -5,6 +5,7 @@ import _Button from "antd/es/button";
|
|
5
5
|
import React from 'react';
|
6
6
|
import { EditableContext } from '../interface';
|
7
7
|
import { isFreeEditRow } from '../utils';
|
8
|
+
import { tr } from '@/framework/locale';
|
8
9
|
|
9
10
|
var EditableAction = function EditableAction(props) {
|
10
11
|
var _editConfig$editCellK;
|
@@ -62,44 +63,44 @@ var EditableAction = function EditableAction(props) {
|
|
62
63
|
disabled: (editConfig.curRow || editConfig.curRow === 0) && editConfig.curRow !== record._rowKey_,
|
63
64
|
size: "small",
|
64
65
|
onClick: onEdit,
|
65
|
-
title: '编辑'
|
66
|
-
},
|
66
|
+
title: tr('编辑')
|
67
|
+
}, tr('编辑'))), editConfig.curRow === record._rowKey_ && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
67
68
|
type: "link",
|
68
69
|
onClick: onSave,
|
69
70
|
style: {
|
70
71
|
padding: 0,
|
71
72
|
marginRight: '10px'
|
72
73
|
}
|
73
|
-
},
|
74
|
+
}, tr('确定')), editConfig.type === 'edit' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
74
75
|
type: "link",
|
75
76
|
onClick: onCancel,
|
76
77
|
style: {
|
77
78
|
padding: 0,
|
78
79
|
marginRight: '10px'
|
79
80
|
}
|
80
|
-
},
|
81
|
+
}, tr('取消'))))), type === 'freedom' && /*#__PURE__*/React.createElement(React.Fragment, null, (record._rowKey_ === (editConfig === null || editConfig === void 0 ? void 0 : (_editConfig$editCellK = editConfig.editCellKey) === null || _editConfig$editCellK === void 0 ? void 0 : _editConfig$editCellK.rowIndex) || isFreeEditRow(editConfig.curRow, record._rowKey_)) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
81
82
|
type: "link",
|
82
83
|
onClick: onSave,
|
83
84
|
style: {
|
84
85
|
padding: 0,
|
85
86
|
marginRight: '10px'
|
86
87
|
}
|
87
|
-
},
|
88
|
+
}, tr('确定')))), /*#__PURE__*/React.createElement(_Popconfirm, {
|
88
89
|
placement: 'left',
|
89
|
-
title:
|
90
|
+
title: tr('确认删除该条数据'),
|
90
91
|
onConfirm: onDelete,
|
91
92
|
onCancel: function onCancel(e) {
|
92
93
|
e.stopPropagation();
|
93
94
|
},
|
94
|
-
okText:
|
95
|
-
cancelText:
|
95
|
+
okText: tr('确定'),
|
96
|
+
cancelText: tr('取消')
|
96
97
|
}, /*#__PURE__*/React.createElement(_Button, {
|
97
98
|
type: "link",
|
98
99
|
style: {
|
99
100
|
padding: 0,
|
100
101
|
marginRight: '10px'
|
101
102
|
}
|
102
|
-
},
|
103
|
+
}, tr('删除'))));
|
103
104
|
};
|
104
105
|
|
105
106
|
export default EditableAction;
|
@@ -8,6 +8,7 @@ import { EditableContext } from '../interface';
|
|
8
8
|
import { getDataCell, isFreeEditCell, isFreeEditRow } from '../utils';
|
9
9
|
import "./index.css";
|
10
10
|
import Texty from './Texty';
|
11
|
+
import { tr } from '../../../framework/locale';
|
11
12
|
|
12
13
|
var EditableCell = function EditableCell(props) {
|
13
14
|
var title = props.title,
|
@@ -30,13 +31,13 @@ var EditableCell = function EditableCell(props) {
|
|
30
31
|
if ((editConfig === null || editConfig === void 0 ? void 0 : editConfig.curRow) && (editConfig === null || editConfig === void 0 ? void 0 : editConfig.curRow) !== 'undefined') {
|
31
32
|
if (isFreeEditRow(editConfig.curRow, rowIndex)) return;
|
32
33
|
|
33
|
-
_message.warning('请先保存正在编辑的行');
|
34
|
+
_message.warning(tr('请先保存正在编辑的行'));
|
34
35
|
|
35
36
|
return;
|
36
37
|
}
|
37
38
|
|
38
39
|
if (((editConfig === null || editConfig === void 0 ? void 0 : (_editConfig$editCellK = editConfig.editCellKey) === null || _editConfig$editCellK === void 0 ? void 0 : _editConfig$editCellK.rowIndex) || (editConfig === null || editConfig === void 0 ? void 0 : (_editConfig$editCellK2 = editConfig.editCellKey) === null || _editConfig$editCellK2 === void 0 ? void 0 : _editConfig$editCellK2.rowIndex) === 0) && rowIndex !== editConfig.editCellKey.rowIndex) {
|
39
|
-
_message.warning('请先保存正在编辑的行');
|
40
|
+
_message.warning(tr('请先保存正在编辑的行'));
|
40
41
|
|
41
42
|
return;
|
42
43
|
}
|
@@ -51,9 +52,6 @@ var EditableCell = function EditableCell(props) {
|
|
51
52
|
};
|
52
53
|
|
53
54
|
var onCellClick = function onCellClick() {
|
54
|
-
// if (!isFreeEditCell(editConfig.editCellKey, dataIndex, rowIndex)) {
|
55
|
-
// editableStream.next({ type: 'editCellKey', payload: { dataIndex: undefined, rowIndex: undefined } });
|
56
|
-
// }
|
57
55
|
if (isAddColumn) {
|
58
56
|
editableStream.next({
|
59
57
|
type: 'editHeardCellKey',
|
@@ -14,6 +14,7 @@ var _excluded = ["title", "dataIndex", "isAddColumn", "children"];
|
|
14
14
|
import { PlusSquareOutlined, DeleteOutlined } from '@ant-design/icons';
|
15
15
|
import React from 'react';
|
16
16
|
import { EditableContext } from '../interface';
|
17
|
+
import { tr } from '../../../framework/locale';
|
17
18
|
import "./index.css";
|
18
19
|
|
19
20
|
var EditableHeardCell = function EditableHeardCell(props) {
|
@@ -102,7 +103,7 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
102
103
|
setAddColumn(_objectSpread({}, _));
|
103
104
|
addColumnRef.current = _;
|
104
105
|
},
|
105
|
-
placeholder:
|
106
|
+
placeholder: tr('请输入key')
|
106
107
|
}), /*#__PURE__*/React.createElement(_Input, {
|
107
108
|
value: addColumn.title,
|
108
109
|
style: {
|
@@ -114,13 +115,13 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
114
115
|
setAddColumn(_objectSpread({}, _));
|
115
116
|
addColumnRef.current = _;
|
116
117
|
},
|
117
|
-
placeholder:
|
118
|
+
placeholder: tr('请输入title'),
|
118
119
|
onPressEnter: onAddColumn
|
119
120
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
120
121
|
type: "primary",
|
121
122
|
block: true,
|
122
123
|
onClick: onAddColumn
|
123
|
-
},
|
124
|
+
}, tr('确定'))));
|
124
125
|
|
125
126
|
var onVisibleChange = function onVisibleChange(b) {
|
126
127
|
setVisible(b);
|
@@ -143,13 +144,13 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
143
144
|
className: "".concat(editConfig.editHeardCellKey === dataIndex ? 'editable-th-hover-delete' : 'display-none')
|
144
145
|
}, /*#__PURE__*/React.createElement(_Popconfirm, {
|
145
146
|
placement: 'left',
|
146
|
-
title:
|
147
|
+
title: tr('确认会删除该列'),
|
147
148
|
onConfirm: onDeleteColumn,
|
148
149
|
onCancel: function onCancel(e) {
|
149
150
|
e.stopPropagation();
|
150
151
|
},
|
151
|
-
okText:
|
152
|
-
cancelText:
|
152
|
+
okText: tr('确定'),
|
153
|
+
cancelText: tr('取消')
|
153
154
|
}, /*#__PURE__*/React.createElement(_Button, {
|
154
155
|
type: "link",
|
155
156
|
icon: /*#__PURE__*/React.createElement(DeleteOutlined, null)
|
@@ -18,6 +18,7 @@ import { isFreeEditRow, removeCurKeyFromEditRow } from './utils';
|
|
18
18
|
import EditableHeardCell from './comps/EditableHeardCell';
|
19
19
|
import useMemoSubject from '../../framework/rxjs-hooks/useMemoSubject';
|
20
20
|
import useObservable from '../../framework/rxjs-hooks/useObservable';
|
21
|
+
import { tr } from '../../framework/locale';
|
21
22
|
import "./index.css";
|
22
23
|
|
23
24
|
var Editable = function Editable(props) {
|
@@ -297,7 +298,7 @@ var Editable = function Editable(props) {
|
|
297
298
|
if (!readonly) {
|
298
299
|
var _aciton_ = {
|
299
300
|
dataKey: '_aciton_',
|
300
|
-
title: '操作',
|
301
|
+
title: tr('操作'),
|
301
302
|
width: 40,
|
302
303
|
ellipsis: true,
|
303
304
|
fixed: 'left',
|
@@ -338,7 +339,7 @@ var Editable = function Editable(props) {
|
|
338
339
|
var onAddRow = function onAddRow() {
|
339
340
|
if (defaultValue) {
|
340
341
|
if (type === 'freedom' && editRowKey) {
|
341
|
-
_message.warn('请先保存正在编辑的行');
|
342
|
+
_message.warn(tr('请先保存正在编辑的行'));
|
342
343
|
|
343
344
|
return;
|
344
345
|
}
|
@@ -415,7 +416,7 @@ var Editable = function Editable(props) {
|
|
415
416
|
marginTop: '5px'
|
416
417
|
},
|
417
418
|
onClick: onAddRow
|
418
|
-
},
|
419
|
+
}, tr('添加一行'))));
|
419
420
|
};
|
420
421
|
|
421
422
|
export default Editable;
|
@@ -69,9 +69,13 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
69
69
|
res = _context.sent;
|
70
70
|
_schema = JSON.parse(res.schema);
|
71
71
|
_properties = _schema[0].properties;
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
|
73
|
+
if (_refId === 'com.ronds.schema.default.Rule.Form') {
|
74
|
+
_properties = _properties.filter(function (it) {
|
75
|
+
return it.id === 'common' || it.id === type;
|
76
|
+
});
|
77
|
+
}
|
78
|
+
|
75
79
|
_schema[0].properties = _properties;
|
76
80
|
_refSchema = refSchema;
|
77
81
|
_refSchema[idx] = _schema;
|
@@ -92,7 +96,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
92
96
|
|
93
97
|
var onRefSelectChange = React.useCallback( /*#__PURE__*/function () {
|
94
98
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, index) {
|
95
|
-
var _refIds, newData;
|
99
|
+
var _refIds, _refSchema, newData;
|
96
100
|
|
97
101
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
98
102
|
while (1) {
|
@@ -109,21 +113,24 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
109
113
|
return processSpecialRuleData(value, index);
|
110
114
|
|
111
115
|
case 4:
|
112
|
-
_context2.next =
|
116
|
+
_context2.next = 9;
|
113
117
|
break;
|
114
118
|
|
115
119
|
case 6:
|
120
|
+
_refSchema = refSchema;
|
121
|
+
_refSchema[index] = undefined;
|
122
|
+
setRefSchema(_objectSpread({}, _refSchema));
|
123
|
+
|
124
|
+
case 9:
|
116
125
|
_refIds[index] = value;
|
117
126
|
setRefIds(_objectSpread({}, _refIds));
|
118
|
-
|
119
|
-
case 8:
|
120
127
|
newData = form.getFieldValue('fields');
|
121
128
|
newData[index].id = value;
|
122
129
|
form.setFieldsValue({
|
123
130
|
fields: newData
|
124
131
|
});
|
125
132
|
|
126
|
-
case
|
133
|
+
case 14:
|
127
134
|
case "end":
|
128
135
|
return _context2.stop();
|
129
136
|
}
|
@@ -152,7 +159,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
152
159
|
_ruleTypes = ruleTypes;
|
153
160
|
|
154
161
|
if (!(_defaultValues[0].refId.indexOf('Rule.Form') > -1)) {
|
155
|
-
_context3.next =
|
162
|
+
_context3.next = 6;
|
156
163
|
break;
|
157
164
|
}
|
158
165
|
|
@@ -160,21 +167,15 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
160
167
|
return processSpecialRuleData(_defaultValues[0].refId, 0);
|
161
168
|
|
162
169
|
case 6:
|
163
|
-
_context3.next = 10;
|
164
|
-
break;
|
165
|
-
|
166
|
-
case 8:
|
167
170
|
_refIds[0] = _defaultValues[0].refId;
|
168
171
|
setRefIds(_objectSpread({}, _refIds));
|
169
|
-
|
170
|
-
case 10:
|
171
172
|
_ruleTypes[0] = 'ref';
|
172
173
|
setRuleTypes(_objectSpread({}, _ruleTypes));
|
173
174
|
form.setFieldsValue({
|
174
175
|
fields: _defaultValues
|
175
176
|
});
|
176
177
|
|
177
|
-
case
|
178
|
+
case 11:
|
178
179
|
case "end":
|
179
180
|
return _context3.stop();
|
180
181
|
}
|
@@ -197,19 +198,19 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
197
198
|
|
198
199
|
case 4:
|
199
200
|
if (!(i < defaultValues.length)) {
|
200
|
-
_context4.next =
|
201
|
+
_context4.next = 14;
|
201
202
|
break;
|
202
203
|
}
|
203
204
|
|
204
205
|
_ruleTypes[i] = defaultValues[i].type;
|
205
206
|
|
206
207
|
if (!(defaultValues[i].type === 'ref')) {
|
207
|
-
_context4.next =
|
208
|
+
_context4.next = 11;
|
208
209
|
break;
|
209
210
|
}
|
210
211
|
|
211
212
|
if (!(defaultValues[i].refId.indexOf('Rule.Form') > -1)) {
|
212
|
-
_context4.next =
|
213
|
+
_context4.next = 10;
|
213
214
|
break;
|
214
215
|
}
|
215
216
|
|
@@ -217,22 +218,18 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
217
218
|
return processSpecialRuleData(defaultValues[i].refId, i);
|
218
219
|
|
219
220
|
case 10:
|
220
|
-
_context4.next = 13;
|
221
|
-
break;
|
222
|
-
|
223
|
-
case 12:
|
224
221
|
_refIds[i] = defaultValues[i].refId;
|
225
222
|
|
226
|
-
case
|
223
|
+
case 11:
|
227
224
|
i++;
|
228
225
|
_context4.next = 4;
|
229
226
|
break;
|
230
227
|
|
231
|
-
case
|
228
|
+
case 14:
|
232
229
|
setRefIds(_objectSpread({}, _refIds));
|
233
230
|
setRuleTypes(_objectSpread({}, _ruleTypes));
|
234
231
|
|
235
|
-
case
|
232
|
+
case 16:
|
236
233
|
case "end":
|
237
234
|
return _context4.stop();
|
238
235
|
}
|
@@ -386,7 +383,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
386
383
|
}
|
387
384
|
}))), (refIds[index] || refSchema[index]) && /*#__PURE__*/React.createElement("div", {
|
388
385
|
style: {
|
389
|
-
border: '
|
386
|
+
border: 'var(--color-border-1)',
|
390
387
|
padding: '10px',
|
391
388
|
marginBottom: '10px'
|
392
389
|
}
|
@@ -130,7 +130,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
130
130
|
case 'number':
|
131
131
|
return /*#__PURE__*/React.createElement("div", {
|
132
132
|
style: {
|
133
|
-
border: '
|
133
|
+
border: 'var(--color-border-1)',
|
134
134
|
padding: '10px',
|
135
135
|
marginBottom: '10px'
|
136
136
|
}
|
@@ -154,7 +154,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
154
154
|
case 'ref':
|
155
155
|
return /*#__PURE__*/React.createElement("div", {
|
156
156
|
style: {
|
157
|
-
border: '1px solid
|
157
|
+
border: '1px solid var(--color-border-1)',
|
158
158
|
padding: '10px',
|
159
159
|
display: 'flex',
|
160
160
|
alignItems: 'center',
|
@@ -214,7 +214,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
214
214
|
case 'array':
|
215
215
|
return /*#__PURE__*/React.createElement("div", {
|
216
216
|
style: {
|
217
|
-
border: '1px solid
|
217
|
+
border: '1px solid var(--color-border-1)',
|
218
218
|
borderRadius: '5px',
|
219
219
|
padding: '10px',
|
220
220
|
marginBottom: '10px',
|
@@ -301,7 +301,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
301
301
|
case 'enum':
|
302
302
|
return /*#__PURE__*/React.createElement("div", {
|
303
303
|
style: {
|
304
|
-
border: '1px solid
|
304
|
+
border: '1px solid var(--color-border-1)',
|
305
305
|
padding: '10px',
|
306
306
|
marginBottom: '10px'
|
307
307
|
}
|
@@ -208,7 +208,7 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
208
208
|
}
|
209
209
|
}))), refIds[index] && /*#__PURE__*/React.createElement("div", {
|
210
210
|
style: {
|
211
|
-
border: '1px solid
|
211
|
+
border: '1px solid var(--color-border-1)',
|
212
212
|
padding: '10px',
|
213
213
|
marginBottom: '10px'
|
214
214
|
}
|
@@ -158,7 +158,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
158
158
|
case 'number':
|
159
159
|
return /*#__PURE__*/React.createElement("div", {
|
160
160
|
style: {
|
161
|
-
border: '1px solid
|
161
|
+
border: '1px solid var(--color-border-1)',
|
162
162
|
padding: '10px',
|
163
163
|
marginBottom: '10px'
|
164
164
|
}
|
@@ -179,7 +179,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
179
179
|
case 'ref':
|
180
180
|
return /*#__PURE__*/React.createElement("div", {
|
181
181
|
style: {
|
182
|
-
border: '1px solid
|
182
|
+
border: '1px solid var(--color-border-1)',
|
183
183
|
padding: '10px',
|
184
184
|
display: 'flex',
|
185
185
|
alignItems: 'center',
|
@@ -231,7 +231,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
231
231
|
case 'array':
|
232
232
|
return /*#__PURE__*/React.createElement("div", {
|
233
233
|
style: {
|
234
|
-
border: '1px solid
|
234
|
+
border: '1px solid var(--color-border-1)',
|
235
235
|
borderRadius: '5px',
|
236
236
|
padding: '10px',
|
237
237
|
marginBottom: '10px',
|
@@ -309,7 +309,7 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
|
|
309
309
|
case 'enum':
|
310
310
|
return /*#__PURE__*/React.createElement("div", {
|
311
311
|
style: {
|
312
|
-
border: '1px solid
|
312
|
+
border: '1px solid var(--color-border-1)',
|
313
313
|
padding: '10px',
|
314
314
|
marginBottom: '10px'
|
315
315
|
}
|
@@ -8,13 +8,13 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
8
|
/*
|
9
9
|
* @Author: wangxian
|
10
10
|
* @Date: 2021-09-18 14:15:04
|
11
|
-
* @LastEditTime: 2022-05-
|
11
|
+
* @LastEditTime: 2022-05-07 10:48:55
|
12
12
|
*/
|
13
13
|
import React from 'react';
|
14
14
|
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
15
15
|
import { MetadataFormContext } from '../interface';
|
16
16
|
import { useGetExtraInfo } from '../hooks';
|
17
|
-
import {
|
17
|
+
import { getDataCell } from '../utils';
|
18
18
|
import { deepClone } from '../../../utils';
|
19
19
|
|
20
20
|
function Index(props) {
|
@@ -73,7 +73,7 @@ function Index(props) {
|
|
73
73
|
}, help || (items === null || items === void 0 ? void 0 : items.type))), /*#__PURE__*/React.createElement("div", {
|
74
74
|
style: {
|
75
75
|
padding: '10px',
|
76
|
-
border: '1px solid
|
76
|
+
border: '1px solid var(--color-border-1)',
|
77
77
|
width: '100%',
|
78
78
|
borderRadius: '4px'
|
79
79
|
}
|
@@ -93,18 +93,16 @@ function Index(props) {
|
|
93
93
|
width: '100%',
|
94
94
|
marginBottom: '10px'
|
95
95
|
}
|
96
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null,
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
})]
|
101
|
-
}], {
|
96
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, getDataCell(_objectSpread(_objectSpread({}, items), {}, {
|
97
|
+
idx: idx,
|
98
|
+
id: id
|
99
|
+
}), {
|
102
100
|
disabled: (_extraInfo$disabled = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled !== void 0 ? _extraInfo$disabled : disabled,
|
103
101
|
initEnumValue: initEnumValue,
|
104
102
|
isRefForm: isRefForm,
|
105
103
|
isShowTypeInfo: formContext.isShowTypeInfo,
|
106
104
|
field: field
|
107
|
-
}
|
105
|
+
}), /*#__PURE__*/React.createElement(MinusCircleOutlined, {
|
108
106
|
style: {
|
109
107
|
marginLeft: '10px'
|
110
108
|
},
|
@@ -161,7 +161,7 @@ function Index(props) {
|
|
161
161
|
}, extraInfo.label || id)), /*#__PURE__*/React.createElement("div", {
|
162
162
|
style: {
|
163
163
|
padding: '10px',
|
164
|
-
border: '1px solid
|
164
|
+
border: '1px solid var(--color-border-1)',
|
165
165
|
width: '100%',
|
166
166
|
borderRadius: '4px'
|
167
167
|
}
|
@@ -176,7 +176,7 @@ function Index(props) {
|
|
176
176
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
177
177
|
style: {
|
178
178
|
padding: '10px',
|
179
|
-
border: '1px solid
|
179
|
+
border: '1px solid var(--color-border-1)',
|
180
180
|
width: '100%',
|
181
181
|
borderRadius: '4px'
|
182
182
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
3
3
|
import "antd/es/form/style";
|
4
4
|
import _Form from "antd/es/form";
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
@@ -48,13 +48,7 @@ var MetadataForm = function MetadataForm(props) {
|
|
48
48
|
onSelectChange && onSelectChange(p.payload);
|
49
49
|
}
|
50
50
|
|
51
|
-
if ((p === null || p === void 0 ? void 0 : p.type) === 'onRenderAfter') {
|
52
|
-
try {
|
53
|
-
form.setFieldsValue(_objectSpread({}, initialValues));
|
54
|
-
} catch (err) {
|
55
|
-
console.error("error\uFF1A".concat(err));
|
56
|
-
}
|
57
|
-
}
|
51
|
+
if ((p === null || p === void 0 ? void 0 : p.type) === 'onRenderAfter') {}
|
58
52
|
}, [stream$]);
|
59
53
|
var options = React.useMemo(function () {
|
60
54
|
return {
|
@@ -103,6 +97,13 @@ var MetadataForm = function MetadataForm(props) {
|
|
103
97
|
|
104
98
|
return function () {};
|
105
99
|
}, [mySchma]);
|
100
|
+
React.useEffect(function () {
|
101
|
+
if (initialValues) {
|
102
|
+
setTimeout(function () {
|
103
|
+
form.setFieldsValue(_objectSpread({}, initialValues));
|
104
|
+
}, 500);
|
105
|
+
}
|
106
|
+
}, [initialValues]);
|
106
107
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetadataFormContext.Provider, {
|
107
108
|
value: {
|
108
109
|
fields: fields,
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
/*
|
6
6
|
* @Author: wangxian
|
7
7
|
* @Date: 2021-09-18 14:15:04
|
8
|
-
* @LastEditTime: 2022-05-06
|
8
|
+
* @LastEditTime: 2022-05-06 13:43:47
|
9
9
|
*/
|
10
10
|
import React from 'react';
|
11
11
|
import Input from './DataCell/Input';
|
@@ -63,47 +63,5 @@ export function renderForm(schemaRef, options, stream$) {
|
|
63
63
|
_form.push(getDataCell(_properties[i], options));
|
64
64
|
}
|
65
65
|
|
66
|
-
hasRenderAfter(_form, stream$);
|
67
66
|
return /*#__PURE__*/React.createElement(React.Fragment, null, _form);
|
68
|
-
}
|
69
|
-
var __ref__ = [];
|
70
|
-
var __count__ = 0;
|
71
|
-
|
72
|
-
function hasRenderAfter(_form, stream$) {
|
73
|
-
var _loop = function _loop(i) {
|
74
|
-
if (_form[i].props.type === 'ref') {
|
75
|
-
if (__ref__.findIndex(function (it) {
|
76
|
-
return it === _form[i].key;
|
77
|
-
}) === -1) {
|
78
|
-
__ref__.push(_form[i].key);
|
79
|
-
}
|
80
|
-
} // if (_form[i].props.type === 'array' && _form[i].props.items.type === 'ref') {
|
81
|
-
// if (__ref__.findIndex((it) => it === _form[i].key) === -1) {
|
82
|
-
// __ref__.push(_form[i].key);
|
83
|
-
// }
|
84
|
-
// }
|
85
|
-
|
86
|
-
};
|
87
|
-
|
88
|
-
for (var i = 0; i < _form.length; i++) {
|
89
|
-
_loop(i);
|
90
|
-
}
|
91
|
-
|
92
|
-
var idx = _form.findIndex(function (it) {
|
93
|
-
return it.props.type === 'ref';
|
94
|
-
}); // 表单渲染结束
|
95
|
-
|
96
|
-
|
97
|
-
if (idx === -1) {
|
98
|
-
__count__ = __count__ + 1;
|
99
|
-
|
100
|
-
if (__count__ === __ref__.length) {
|
101
|
-
stream$ && stream$.next({
|
102
|
-
type: 'onRenderAfter',
|
103
|
-
payload: ''
|
104
|
-
});
|
105
|
-
__ref__ = [];
|
106
|
-
__count__ = 0;
|
107
|
-
}
|
108
|
-
}
|
109
67
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export default {
|
2
|
+
操作: 'Operation',
|
3
|
+
添加一行: 'Add New Line',
|
4
|
+
编辑: 'Edit',
|
5
|
+
删除: 'Delete',
|
6
|
+
确定: 'Confirm',
|
7
|
+
取消: 'Cancel',
|
8
|
+
确认删除该条数据: 'Confirm to delete this piece of data?',
|
9
|
+
请先保存正在编辑的行: 'Please save the line being edited first',
|
10
|
+
请输入key: 'Please enter key',
|
11
|
+
请输入title: 'Please enter title',
|
12
|
+
确认会删除该列: 'Confirm will delete the column?'
|
13
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import zhCN from './zh-CN';
|
2
|
+
import enUS from './en-US';
|
3
|
+
import { initLocale } from '../../framework/locale';
|
4
|
+
export var initLocaleMessage = function initLocaleMessage() {
|
5
|
+
initLocale({
|
6
|
+
'zh-CN': zhCN,
|
7
|
+
'en-US': enUS
|
8
|
+
});
|
9
|
+
};
|
10
|
+
export { setLocale, getLocale } from '../../framework/locale';
|
package/es/config.d.ts
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
+
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
1
2
|
export interface IConfig {
|
2
3
|
/** 多语言 */
|
3
4
|
locale: 'zh-CN' | 'en-US';
|
5
|
+
theme: 'normal' | 'dark';
|
4
6
|
msgpack: boolean;
|
5
7
|
openLoading: boolean;
|
6
8
|
baseUrl: string;
|
7
9
|
}
|
10
|
+
export declare const cssPrefix = "ronds-metadata";
|
11
|
+
export declare const globalSettingStream: BehaviorSubject<IConfig>;
|
8
12
|
/** 设置配置 */
|
9
13
|
export declare const setConfig: (opts: Partial<IConfig>) => void;
|
10
14
|
/** 获取单个配置 */
|
11
15
|
export declare function getConfigByKey<K extends keyof IConfig>(key: K): IConfig[K];
|
12
16
|
/** 获取全部配置 */
|
13
17
|
export declare const getConfig: () => IConfig;
|
14
|
-
export declare const cssPrefix = "ronds-base-chart";
|