ronds-metadata 1.1.49 → 1.1.50

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.
@@ -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,77 +1,77 @@
1
- .markdown-navigation {
2
- font-size: 14px;
3
- font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Helvetica', 'Arial', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
4
- 'WenQuanYi Micro Hei', sans-serif;
5
- width: 100%;
6
- overflow-x: hidden;
7
- overflow-y: scroll;
8
- scrollbar-width: 0;
9
- width: 200px;
10
- }
11
- .markdown-navigation::-webkit-scrollbar {
12
- width: 0;
13
- }
14
-
15
- .markdown-navigation .title-anchor {
16
- display: block;
17
- color: #bbb;
18
- transition: all 0.2s;
19
- margin: 0.8em 0;
20
- font-weight: lighter;
21
- line-height: 2em;
22
- padding-right: 1.8em;
23
- cursor: pointer;
24
- }
25
-
26
- .markdown-navigation .title-anchor:hover,
27
- .markdown-navigation .title-anchor.active {
28
- background-color: #f8f8f8;
29
- text-decoration: inherit;
30
- }
31
-
32
- .markdown-navigation .title-anchor.active {
33
- color: #007fff;
34
- }
35
-
36
- .markdown-navigation .title-anchor small {
37
- margin: 0 0.8em;
38
- }
39
-
40
- .markdown-navigation .title-level1 {
41
- color: #000;
42
- font-size: 1.2em;
43
- padding-left: 1em;
44
- font-weight: normal;
45
- }
46
-
47
- .markdown-navigation .title-level2 {
48
- color: #000;
49
- font-size: 1em;
50
- padding-left: 1em;
51
- font-weight: normal;
52
- }
53
-
54
- .markdown-navigation .title-level3 {
55
- color: #000;
56
- font-size: 0.8em;
57
- padding-left: 3em;
58
- font-weight: normal;
59
- }
60
-
61
- .markdown-navigation .title-level4 {
62
- color: #000;
63
- font-size: 0.72em;
64
- padding-left: 5em;
65
- }
66
-
67
- .markdown-navigation .title-level5 {
68
- color: #000;
69
- font-size: 0.72em;
70
- padding-left: 7em;
71
- }
72
-
73
- .markdown-navigation .title-level6 {
74
- color: #000;
75
- font-size: 0.72em;
76
- padding-left: 9em;
77
- }
1
+ .markdown-navigation {
2
+ font-size: 14px;
3
+ font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Helvetica', 'Arial', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
4
+ 'WenQuanYi Micro Hei', sans-serif;
5
+ width: 100%;
6
+ overflow-x: hidden;
7
+ overflow-y: scroll;
8
+ scrollbar-width: 0;
9
+ width: 200px;
10
+ }
11
+ .markdown-navigation::-webkit-scrollbar {
12
+ width: 0;
13
+ }
14
+
15
+ .markdown-navigation .title-anchor {
16
+ display: block;
17
+ color: #bbb;
18
+ transition: all 0.2s;
19
+ margin: 0.8em 0;
20
+ font-weight: lighter;
21
+ line-height: 2em;
22
+ padding-right: 1.8em;
23
+ cursor: pointer;
24
+ }
25
+
26
+ .markdown-navigation .title-anchor:hover,
27
+ .markdown-navigation .title-anchor.active {
28
+ background-color: #f8f8f8;
29
+ text-decoration: inherit;
30
+ }
31
+
32
+ .markdown-navigation .title-anchor.active {
33
+ color: #007fff;
34
+ }
35
+
36
+ .markdown-navigation .title-anchor small {
37
+ margin: 0 0.8em;
38
+ }
39
+
40
+ .markdown-navigation .title-level1 {
41
+ color: #000;
42
+ font-size: 1.2em;
43
+ padding-left: 1em;
44
+ font-weight: normal;
45
+ }
46
+
47
+ .markdown-navigation .title-level2 {
48
+ color: #000;
49
+ font-size: 1em;
50
+ padding-left: 1em;
51
+ font-weight: normal;
52
+ }
53
+
54
+ .markdown-navigation .title-level3 {
55
+ color: #000;
56
+ font-size: 0.8em;
57
+ padding-left: 3em;
58
+ font-weight: normal;
59
+ }
60
+
61
+ .markdown-navigation .title-level4 {
62
+ color: #000;
63
+ font-size: 0.72em;
64
+ padding-left: 5em;
65
+ }
66
+
67
+ .markdown-navigation .title-level5 {
68
+ color: #000;
69
+ font-size: 0.72em;
70
+ padding-left: 7em;
71
+ }
72
+
73
+ .markdown-navigation .title-level6 {
74
+ color: #000;
75
+ font-size: 0.72em;
76
+ padding-left: 9em;
77
+ }
@@ -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
+ };
@@ -3,3 +3,4 @@ import { IMetaFormProps } from '../interface';
3
3
  declare function Index(props: IMetaFormProps): JSX.Element;
4
4
  declare const _default: React.MemoExoticComponent<typeof Index>;
5
5
  export default _default;
6
+ export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH:mm:ss";
@@ -60,6 +60,7 @@ function Index(props) {
60
60
  case 'datePicker':
61
61
  return /*#__PURE__*/React.createElement(_DatePicker, {
62
62
  showTime: true,
63
+ format: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.format) || DEFAULT_DATE_FORMAT,
63
64
  disabled: (_extraInfo$disabled4 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled4 !== void 0 ? _extraInfo$disabled4 : disabled,
64
65
  placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder
65
66
  });
@@ -125,4 +126,5 @@ function Index(props) {
125
126
  }), processInputType((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type) || ''));
126
127
  }
127
128
 
128
- export default /*#__PURE__*/React.memo(Index);
129
+ export default /*#__PURE__*/React.memo(Index);
130
+ export var DEFAULT_DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
@@ -12,6 +12,7 @@ import { MetadataService } from '../../framework/metadata/MetadataService';
12
12
  import useMemoSubject from '../../framework/rxjs-hooks/useMemoSubject';
13
13
  import useObservable from '../../framework/rxjs-hooks/useObservable';
14
14
  import moment from 'moment';
15
+ import { DEFAULT_DATE_FORMAT } from './DataCell/Input';
15
16
 
16
17
  var MetadataForm = function MetadataForm(props) {
17
18
  var _Form$useForm = _Form.useForm(),
@@ -138,7 +139,9 @@ var MetadataForm = function MetadataForm(props) {
138
139
  var _v$text;
139
140
 
140
141
  if ((v === null || v === void 0 ? void 0 : (_v$text = v.text) === null || _v$text === void 0 ? void 0 : _v$text.type) === 'datePicker' && initialValues[k]) {
141
- initialValues[k] = moment(initialValues[k], 'YYYY-MM-DD HH:mm:ss');
142
+ var _v$text2;
143
+
144
+ initialValues[k] = moment(initialValues[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);
142
145
  }
143
146
  });
144
147
  form.setFieldsValue(_objectSpread({}, initialValues));
@@ -161,8 +164,10 @@ var MetadataForm = function MetadataForm(props) {
161
164
  var extra = fields.get(key[0]);
162
165
 
163
166
  if ((extra === null || extra === void 0 ? void 0 : (_extra$text = extra.text) === null || _extra$text === void 0 ? void 0 : _extra$text.type) === 'datePicker') {
164
- value[key[0]] = moment(value[key[0]]).format('YYYY-MM-DD HH:mm:ss');
165
- allValues[key[0]] = moment(value[key[0]]).format('YYYY-MM-DD HH:mm:ss');
167
+ var _extra$text2, _extra$text3;
168
+
169
+ value[key[0]] = moment(value[key[0]]).format((extra === null || extra === void 0 ? void 0 : (_extra$text2 = extra.text) === null || _extra$text2 === void 0 ? void 0 : _extra$text2.format) || DEFAULT_DATE_FORMAT);
170
+ allValues[key[0]] = moment(value[key[0]]).format((extra === null || extra === void 0 ? void 0 : (_extra$text3 = extra.text) === null || _extra$text3 === void 0 ? void 0 : _extra$text3.format) || DEFAULT_DATE_FORMAT);
166
171
  }
167
172
 
168
173
  onValuesChange && onValuesChange(value, allValues);
@@ -171,10 +176,12 @@ var MetadataForm = function MetadataForm(props) {
171
176
  var onMyFinish = function onMyFinish(values) {
172
177
  // 处理时间格式
173
178
  fields.forEach(function (v, k) {
174
- var _v$text2;
179
+ var _v$text3;
180
+
181
+ if ((v === null || v === void 0 ? void 0 : (_v$text3 = v.text) === null || _v$text3 === void 0 ? void 0 : _v$text3.type) === 'datePicker' && values[k]) {
182
+ var _v$text4;
175
183
 
176
- if ((v === null || v === void 0 ? void 0 : (_v$text2 = v.text) === null || _v$text2 === void 0 ? void 0 : _v$text2.type) === 'datePicker' && values[k]) {
177
- values[k] = moment(values[k]).format('YYYY-MM-DD HH:mm:ss');
184
+ values[k] = moment(values[k]).format((v === null || v === void 0 ? void 0 : (_v$text4 = v.text) === null || _v$text4 === void 0 ? void 0 : _v$text4.format) || DEFAULT_DATE_FORMAT);
178
185
  }
179
186
  });
180
187
  onFinish && onFinish(values);
package/package.json CHANGED
@@ -1,90 +1,90 @@
1
- {
2
- "public": true,
3
- "name": "ronds-metadata",
4
- "version": "1.1.49",
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.50",
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
+ }