ronds-metadata 1.1.50 → 1.1.51
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/JsonView/index.less +41 -41
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataForm/DataCell/Ref.js +2 -2
- package/es/comps/MetadataForm/index.js +19 -8
- package/es/comps/MetadataForm/interface.d.ts +1 -0
- package/es/comps/MetadataForm/interface.js +1 -1
- package/package.json +90 -90
@@ -1,41 +1,41 @@
|
|
1
|
-
pre {
|
2
|
-
margin: 0;
|
3
|
-
font-weight: 900;
|
4
|
-
font-size: 14px;
|
5
|
-
}
|
6
|
-
.string {
|
7
|
-
color: #3ab54a;
|
8
|
-
}
|
9
|
-
.number {
|
10
|
-
color: #25aae2;
|
11
|
-
}
|
12
|
-
.boolean {
|
13
|
-
color: #f98280;
|
14
|
-
}
|
15
|
-
.null {
|
16
|
-
color: #f1592a;
|
17
|
-
}
|
18
|
-
.width-10 {
|
19
|
-
width: 10px;
|
20
|
-
}
|
21
|
-
.key {
|
22
|
-
color: #92278f;
|
23
|
-
}
|
24
|
-
.open {
|
25
|
-
display: inline-block;
|
26
|
-
width: 12px;
|
27
|
-
height: 12px;
|
28
|
-
background: url('./icon/close.png') no-repeat;
|
29
|
-
background-size: 100% 100%;
|
30
|
-
vertical-align: middle;
|
31
|
-
cursor: pointer;
|
32
|
-
}
|
33
|
-
.close {
|
34
|
-
display: inline-block;
|
35
|
-
width: 12px;
|
36
|
-
height: 12px;
|
37
|
-
background: url('./icon/open.png') no-repeat;
|
38
|
-
background-size: 100% 100%;
|
39
|
-
vertical-align: middle;
|
40
|
-
cursor: pointer;
|
41
|
-
}
|
1
|
+
pre {
|
2
|
+
margin: 0;
|
3
|
+
font-weight: 900;
|
4
|
+
font-size: 14px;
|
5
|
+
}
|
6
|
+
.string {
|
7
|
+
color: #3ab54a;
|
8
|
+
}
|
9
|
+
.number {
|
10
|
+
color: #25aae2;
|
11
|
+
}
|
12
|
+
.boolean {
|
13
|
+
color: #f98280;
|
14
|
+
}
|
15
|
+
.null {
|
16
|
+
color: #f1592a;
|
17
|
+
}
|
18
|
+
.width-10 {
|
19
|
+
width: 10px;
|
20
|
+
}
|
21
|
+
.key {
|
22
|
+
color: #92278f;
|
23
|
+
}
|
24
|
+
.open {
|
25
|
+
display: inline-block;
|
26
|
+
width: 12px;
|
27
|
+
height: 12px;
|
28
|
+
background: url('./icon/close.png') no-repeat;
|
29
|
+
background-size: 100% 100%;
|
30
|
+
vertical-align: middle;
|
31
|
+
cursor: pointer;
|
32
|
+
}
|
33
|
+
.close {
|
34
|
+
display: inline-block;
|
35
|
+
width: 12px;
|
36
|
+
height: 12px;
|
37
|
+
background: url('./icon/open.png') no-repeat;
|
38
|
+
background-size: 100% 100%;
|
39
|
+
vertical-align: middle;
|
40
|
+
cursor: pointer;
|
41
|
+
}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
.metadata-edit {
|
2
|
-
height: 100%;
|
3
|
-
width: 100%;
|
4
|
-
.ant-row {
|
5
|
-
display: block;
|
6
|
-
}
|
7
|
-
.pr-10 {
|
8
|
-
padding-right: 10px;
|
9
|
-
}
|
10
|
-
}
|
1
|
+
.metadata-edit {
|
2
|
+
height: 100%;
|
3
|
+
width: 100%;
|
4
|
+
.ant-row {
|
5
|
+
display: block;
|
6
|
+
}
|
7
|
+
.pr-10 {
|
8
|
+
padding-right: 10px;
|
9
|
+
}
|
10
|
+
}
|
@@ -1,20 +1,20 @@
|
|
1
|
-
export interface IMetaFileds {
|
2
|
-
id: string;
|
3
|
-
type: 'object';
|
4
|
-
properties: any[];
|
5
|
-
value: any;
|
6
|
-
}
|
7
|
-
|
8
|
-
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
-
|
10
|
-
export type IMetaProperty = {
|
11
|
-
/**
|
12
|
-
* 属性的名称
|
13
|
-
*/
|
14
|
-
id: string;
|
15
|
-
/**
|
16
|
-
* 类型
|
17
|
-
*/
|
18
|
-
type: string;
|
19
|
-
enum?: any[];
|
20
|
-
};
|
1
|
+
export interface IMetaFileds {
|
2
|
+
id: string;
|
3
|
+
type: 'object';
|
4
|
+
properties: any[];
|
5
|
+
value: any;
|
6
|
+
}
|
7
|
+
|
8
|
+
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
+
|
10
|
+
export type IMetaProperty = {
|
11
|
+
/**
|
12
|
+
* 属性的名称
|
13
|
+
*/
|
14
|
+
id: string;
|
15
|
+
/**
|
16
|
+
* 类型
|
17
|
+
*/
|
18
|
+
type: string;
|
19
|
+
enum?: any[];
|
20
|
+
};
|
@@ -232,7 +232,7 @@ function Index(props) {
|
|
232
232
|
value: {
|
233
233
|
fields: refFieldsRef.current
|
234
234
|
}
|
235
|
-
}, renderForm(schema, formOptions, formContext.
|
235
|
+
}, renderForm(schema, formOptions, formContext.colSpan))));
|
236
236
|
}
|
237
237
|
|
238
238
|
if (isRefForm && field && schema.length > 0) {
|
@@ -247,7 +247,7 @@ function Index(props) {
|
|
247
247
|
value: {
|
248
248
|
fields: refFieldsRef.current
|
249
249
|
}
|
250
|
-
}, renderForm(schema, formOptions, formContext.
|
250
|
+
}, renderForm(schema, formOptions, formContext.colSpan))));
|
251
251
|
}
|
252
252
|
|
253
253
|
return !field ? /*#__PURE__*/React.createElement(_Form.Item, {
|
@@ -86,6 +86,16 @@ var MetadataForm = function MetadataForm(props) {
|
|
86
86
|
var e = form.setFieldsValue;
|
87
87
|
|
88
88
|
var setFieldsValue = function setFieldsValue(vals) {
|
89
|
+
// 处理时间格式
|
90
|
+
fields.forEach(function (v, k) {
|
91
|
+
var _v$text;
|
92
|
+
|
93
|
+
if ((v === null || v === void 0 ? void 0 : (_v$text = v.text) === null || _v$text === void 0 ? void 0 : _v$text.type) === 'datePicker' && vals[k]) {
|
94
|
+
var _v$text2;
|
95
|
+
|
96
|
+
vals[k] = moment(vals[k], (v === null || v === void 0 ? void 0 : (_v$text2 = v.text) === null || _v$text2 === void 0 ? void 0 : _v$text2.format) || DEFAULT_DATE_FORMAT);
|
97
|
+
}
|
98
|
+
});
|
89
99
|
e(vals);
|
90
100
|
stream$.next({
|
91
101
|
type: 'setFieldsValue',
|
@@ -136,12 +146,12 @@ var MetadataForm = function MetadataForm(props) {
|
|
136
146
|
try {
|
137
147
|
// 处理时间格式
|
138
148
|
fields.forEach(function (v, k) {
|
139
|
-
var _v$
|
149
|
+
var _v$text3;
|
140
150
|
|
141
|
-
if ((v === null || v === void 0 ? void 0 : (_v$
|
142
|
-
var _v$
|
151
|
+
if ((v === null || v === void 0 ? void 0 : (_v$text3 = v.text) === null || _v$text3 === void 0 ? void 0 : _v$text3.type) === 'datePicker' && initialValues[k]) {
|
152
|
+
var _v$text4;
|
143
153
|
|
144
|
-
initialValues[k] = moment(initialValues[k], (v === null || v === void 0 ? void 0 : (_v$
|
154
|
+
initialValues[k] = moment(initialValues[k], (v === null || v === void 0 ? void 0 : (_v$text4 = v.text) === null || _v$text4 === void 0 ? void 0 : _v$text4.format) || DEFAULT_DATE_FORMAT);
|
145
155
|
}
|
146
156
|
});
|
147
157
|
form.setFieldsValue(_objectSpread({}, initialValues));
|
@@ -176,12 +186,12 @@ var MetadataForm = function MetadataForm(props) {
|
|
176
186
|
var onMyFinish = function onMyFinish(values) {
|
177
187
|
// 处理时间格式
|
178
188
|
fields.forEach(function (v, k) {
|
179
|
-
var _v$
|
189
|
+
var _v$text5;
|
180
190
|
|
181
|
-
if ((v === null || v === void 0 ? void 0 : (_v$
|
182
|
-
var _v$
|
191
|
+
if ((v === null || v === void 0 ? void 0 : (_v$text5 = v.text) === null || _v$text5 === void 0 ? void 0 : _v$text5.type) === 'datePicker' && values[k]) {
|
192
|
+
var _v$text6;
|
183
193
|
|
184
|
-
values[k] = moment(values[k]).format((v === null || v === void 0 ? void 0 : (_v$
|
194
|
+
values[k] = moment(values[k]).format((v === null || v === void 0 ? void 0 : (_v$text6 = v.text) === null || _v$text6 === void 0 ? void 0 : _v$text6.format) || DEFAULT_DATE_FORMAT);
|
185
195
|
}
|
186
196
|
});
|
187
197
|
onFinish && onFinish(values);
|
@@ -190,6 +200,7 @@ var MetadataForm = function MetadataForm(props) {
|
|
190
200
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetadataFormContext.Provider, {
|
191
201
|
value: {
|
192
202
|
fields: fields,
|
203
|
+
colSpan: colSpan,
|
193
204
|
form: form,
|
194
205
|
stream$: stream$,
|
195
206
|
initialValues: initialValues,
|
package/package.json
CHANGED
@@ -1,90 +1,90 @@
|
|
1
|
-
{
|
2
|
-
"public": true,
|
3
|
-
"name": "ronds-metadata",
|
4
|
-
"version": "1.1.
|
5
|
-
"scripts": {
|
6
|
-
"start": "dumi dev",
|
7
|
-
"docs:build": "dumi build",
|
8
|
-
"docs:deploy": "gh-pages -d docs-dist",
|
9
|
-
"build": "father-build",
|
10
|
-
"deploy": "npm run docs:build && npm run docs:deploy",
|
11
|
-
"release": "npm run build && npm publish",
|
12
|
-
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
13
|
-
"test": "umi-test",
|
14
|
-
"test:coverage": "umi-test --coverage",
|
15
|
-
"prepublishOnly": "npm run build"
|
16
|
-
},
|
17
|
-
"main": "es",
|
18
|
-
"module": "es",
|
19
|
-
"types": "es/index.d.ts",
|
20
|
-
"gitHooks": {
|
21
|
-
"pre-commit": "lint-staged"
|
22
|
-
},
|
23
|
-
"lint-staged": {
|
24
|
-
"*.{js,jsx,less,md,json}": [
|
25
|
-
"prettier --write"
|
26
|
-
],
|
27
|
-
"*.ts?(x)": [
|
28
|
-
"prettier --parser=typescript --write"
|
29
|
-
]
|
30
|
-
},
|
31
|
-
"files": [
|
32
|
-
"/es"
|
33
|
-
],
|
34
|
-
"dependencies": {
|
35
|
-
"@antv/x6": "^1.32.2",
|
36
|
-
"@antv/x6-react-shape": "^1.6.0",
|
37
|
-
"@babel/helper-create-regexp-features-plugin": "^7.12.13",
|
38
|
-
"@babel/runtime": "^7.11.2",
|
39
|
-
"@popperjs/core": "^2.4.4",
|
40
|
-
"@types/markdown-navbar": "^1.4.0",
|
41
|
-
"ahooks": "^3.4.0",
|
42
|
-
"axios": "^0.21.4",
|
43
|
-
"babel-plugin-import": "^1.13.3",
|
44
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
45
|
-
"bl": "^5.0.0",
|
46
|
-
"codemirror": "^5.63.0",
|
47
|
-
"github-markdown-css": "^5.1.0",
|
48
|
-
"immer": "^9.0.14",
|
49
|
-
"lodash": "^4.17.21",
|
50
|
-
"markdown-navbar": "^1.4.3",
|
51
|
-
"qs": "^6.10.1",
|
52
|
-
"react": "^17.0.2",
|
53
|
-
"react-dnd": "^11.1.3",
|
54
|
-
"react-dnd-html5-backend": "^11.1.3",
|
55
|
-
"react-markdown": "^8.0.3",
|
56
|
-
"react-markdown-editor-lite": "^1.3.2",
|
57
|
-
"react-popper": "^2.2.3",
|
58
|
-
"rehype-raw": "^6.1.1",
|
59
|
-
"remark-gfm": "^3.0.1",
|
60
|
-
"rxjs": "^7.5.4"
|
61
|
-
},
|
62
|
-
"peerDependencies": {
|
63
|
-
"antd": ">=4.1.5",
|
64
|
-
"react": ">=16.14.0",
|
65
|
-
"react-dom": ">=16.14.0",
|
66
|
-
"react-router": ">=5.0.0",
|
67
|
-
"styled-components": ">=4.1.1"
|
68
|
-
},
|
69
|
-
"devDependencies": {
|
70
|
-
"@types/react": "^17.0.2",
|
71
|
-
"@types/react-dom": "^17.0.2",
|
72
|
-
"@types/react-router": "^5.1.8",
|
73
|
-
"@types/react-window": "^1.8.2",
|
74
|
-
"@types/styled-components": "^5.1.2",
|
75
|
-
"@umijs/test": "^3.0.5",
|
76
|
-
"antd": "^4.18.1",
|
77
|
-
"babel-loader": "^8.1.0",
|
78
|
-
"copy-to-clipboard": "^3.3.1",
|
79
|
-
"css-loader": "^4.2.2",
|
80
|
-
"dumi": "^1.0.16",
|
81
|
-
"father-build": "^1.17.2",
|
82
|
-
"gh-pages": "^3.0.0",
|
83
|
-
"less-loader": "^7.0.0",
|
84
|
-
"lint-staged": "^10.0.7",
|
85
|
-
"prettier": "^2.2.1",
|
86
|
-
"style-loader": "^1.2.1",
|
87
|
-
"webpack-cli": "^3.3.12",
|
88
|
-
"yorkie": "^2.0.0"
|
89
|
-
}
|
90
|
-
}
|
1
|
+
{
|
2
|
+
"public": true,
|
3
|
+
"name": "ronds-metadata",
|
4
|
+
"version": "1.1.51",
|
5
|
+
"scripts": {
|
6
|
+
"start": "dumi dev",
|
7
|
+
"docs:build": "dumi build",
|
8
|
+
"docs:deploy": "gh-pages -d docs-dist",
|
9
|
+
"build": "father-build",
|
10
|
+
"deploy": "npm run docs:build && npm run docs:deploy",
|
11
|
+
"release": "npm run build && npm publish",
|
12
|
+
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
13
|
+
"test": "umi-test",
|
14
|
+
"test:coverage": "umi-test --coverage",
|
15
|
+
"prepublishOnly": "npm run build"
|
16
|
+
},
|
17
|
+
"main": "es",
|
18
|
+
"module": "es",
|
19
|
+
"types": "es/index.d.ts",
|
20
|
+
"gitHooks": {
|
21
|
+
"pre-commit": "lint-staged"
|
22
|
+
},
|
23
|
+
"lint-staged": {
|
24
|
+
"*.{js,jsx,less,md,json}": [
|
25
|
+
"prettier --write"
|
26
|
+
],
|
27
|
+
"*.ts?(x)": [
|
28
|
+
"prettier --parser=typescript --write"
|
29
|
+
]
|
30
|
+
},
|
31
|
+
"files": [
|
32
|
+
"/es"
|
33
|
+
],
|
34
|
+
"dependencies": {
|
35
|
+
"@antv/x6": "^1.32.2",
|
36
|
+
"@antv/x6-react-shape": "^1.6.0",
|
37
|
+
"@babel/helper-create-regexp-features-plugin": "^7.12.13",
|
38
|
+
"@babel/runtime": "^7.11.2",
|
39
|
+
"@popperjs/core": "^2.4.4",
|
40
|
+
"@types/markdown-navbar": "^1.4.0",
|
41
|
+
"ahooks": "^3.4.0",
|
42
|
+
"axios": "^0.21.4",
|
43
|
+
"babel-plugin-import": "^1.13.3",
|
44
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
45
|
+
"bl": "^5.0.0",
|
46
|
+
"codemirror": "^5.63.0",
|
47
|
+
"github-markdown-css": "^5.1.0",
|
48
|
+
"immer": "^9.0.14",
|
49
|
+
"lodash": "^4.17.21",
|
50
|
+
"markdown-navbar": "^1.4.3",
|
51
|
+
"qs": "^6.10.1",
|
52
|
+
"react": "^17.0.2",
|
53
|
+
"react-dnd": "^11.1.3",
|
54
|
+
"react-dnd-html5-backend": "^11.1.3",
|
55
|
+
"react-markdown": "^8.0.3",
|
56
|
+
"react-markdown-editor-lite": "^1.3.2",
|
57
|
+
"react-popper": "^2.2.3",
|
58
|
+
"rehype-raw": "^6.1.1",
|
59
|
+
"remark-gfm": "^3.0.1",
|
60
|
+
"rxjs": "^7.5.4"
|
61
|
+
},
|
62
|
+
"peerDependencies": {
|
63
|
+
"antd": ">=4.1.5",
|
64
|
+
"react": ">=16.14.0",
|
65
|
+
"react-dom": ">=16.14.0",
|
66
|
+
"react-router": ">=5.0.0",
|
67
|
+
"styled-components": ">=4.1.1"
|
68
|
+
},
|
69
|
+
"devDependencies": {
|
70
|
+
"@types/react": "^17.0.2",
|
71
|
+
"@types/react-dom": "^17.0.2",
|
72
|
+
"@types/react-router": "^5.1.8",
|
73
|
+
"@types/react-window": "^1.8.2",
|
74
|
+
"@types/styled-components": "^5.1.2",
|
75
|
+
"@umijs/test": "^3.0.5",
|
76
|
+
"antd": "^4.18.1",
|
77
|
+
"babel-loader": "^8.1.0",
|
78
|
+
"copy-to-clipboard": "^3.3.1",
|
79
|
+
"css-loader": "^4.2.2",
|
80
|
+
"dumi": "^1.0.16",
|
81
|
+
"father-build": "^1.17.2",
|
82
|
+
"gh-pages": "^3.0.0",
|
83
|
+
"less-loader": "^7.0.0",
|
84
|
+
"lint-staged": "^10.0.7",
|
85
|
+
"prettier": "^2.2.1",
|
86
|
+
"style-loader": "^1.2.1",
|
87
|
+
"webpack-cli": "^3.3.12",
|
88
|
+
"yorkie": "^2.0.0"
|
89
|
+
}
|
90
|
+
}
|