ronds-metadata 1.1.36 → 1.1.39

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.
@@ -3,18 +3,19 @@ import _Form from "antd/es/form";
3
3
  import "antd/es/select/style";
4
4
  import _Select from "antd/es/select";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
- var _excluded = ["dataIndex", "disabled"];
6
+ var _excluded = ["dataIndex", "mode", "disabled"];
7
7
 
8
8
  /*
9
9
  * @Author: wangxian
10
10
  * @Date: 2022-03-04 14:53:50
11
- * @LastEditTime: 2022-05-12 11:07:04
11
+ * @LastEditTime: 2022-09-28 13:36:46
12
12
  */
13
13
  import React from 'react';
14
14
  import { EditableContext } from '../interface';
15
15
 
16
16
  function Index(props) {
17
17
  var dataIndex = props.dataIndex,
18
+ mode = props.mode,
18
19
  disabled = props.disabled,
19
20
  restProps = _objectWithoutProperties(props, _excluded);
20
21
 
@@ -28,10 +29,21 @@ function Index(props) {
28
29
  }
29
30
  }, /*#__PURE__*/React.createElement(_Select, {
30
31
  disabled: editConfig.type === 'edit' ? disabled : false,
31
- size: "small",
32
+ mode: mode || undefined,
33
+ showSearch: true,
34
+ filterOption: function filterOption(input, option) {
35
+ var _option$label;
36
+
37
+ return (option === null || option === void 0 ? void 0 : (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.toString().indexOf(input)) >= 0;
38
+ },
39
+ getPopupContainer: function getPopupContainer(triggerNode) {
40
+ return triggerNode.parentNode;
41
+ },
42
+ allowClear: true,
32
43
  style: {
33
44
  width: '100%'
34
45
  },
46
+ size: "small",
35
47
  options: restProps.enum
36
48
  }));
37
49
  }
@@ -222,7 +222,7 @@ var Editable = function Editable(props) {
222
222
  record: record,
223
223
  editableType: type,
224
224
  isAddColumn: isAddColumn
225
- }, pick(column, ['editable', 'title', 'dataIndex', 'type', 'enum', 'disabled'])), {}, {
225
+ }, pick(column, ['editable', 'title', 'dataIndex', 'type', 'enum', 'mode', 'disabled'])), {}, {
226
226
  rowIndex: rowIndex
227
227
  });
228
228
  };
@@ -16,6 +16,7 @@ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
16
16
  label: string;
17
17
  value: string;
18
18
  }[];
19
+ mode?: 'multiple' | 'tags';
19
20
  children: React.ReactNode;
20
21
  }
21
22
  export interface EditableHeardCellProps extends React.HTMLAttributes<HTMLElement> {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: wangxian
3
3
  * @Date: 2022-03-04 15:07:57
4
- * @LastEditTime: 2022-04-18 14:59:17
4
+ * @LastEditTime: 2022-09-27 10:11:38
5
5
  */
6
6
  import React from 'react';
7
7
  export var EditableContext = /*#__PURE__*/React.createContext(null);
@@ -1,5 +1,4 @@
1
1
  import 'react-markdown-editor-lite/lib/index.css';
2
- import 'github-markdown-css';
3
2
  import { UploadFunc } from 'react-markdown-editor-lite/cjs/share/var';
4
3
  import './index.less';
5
4
  interface IMdEditProps {
@@ -1,15 +1,13 @@
1
1
  /*
2
2
  * @Author: your name
3
3
  * @Date: 2021-12-15 15:29:51
4
- * @LastEditTime: 2022-08-30 17:11:16
4
+ * @LastEditTime: 2022-09-02 16:52:09
5
5
  */
6
6
  import React from 'react';
7
7
  import MdEditor from 'react-markdown-editor-lite';
8
- import ReactMarkdown from 'react-markdown';
9
8
  import 'react-markdown-editor-lite/lib/index.css';
10
- import remarkGfm from 'remark-gfm';
11
- import 'github-markdown-css';
12
9
  import './index.less';
10
+ import MdView from '../MdView';
13
11
 
14
12
  var MdEdit = function MdEdit(props) {
15
13
  var value = props.value,
@@ -32,9 +30,9 @@ var MdEdit = function MdEdit(props) {
32
30
  height: "".concat(height, "px")
33
31
  },
34
32
  renderHTML: function renderHTML(text) {
35
- return /*#__PURE__*/React.createElement(ReactMarkdown, {
36
- remarkPlugins: [remarkGfm]
37
- }, text);
33
+ return /*#__PURE__*/React.createElement(MdView, {
34
+ source: text
35
+ });
38
36
  },
39
37
  onChange: onValueChange
40
38
  }));
@@ -0,0 +1,15 @@
1
+ import 'markdown-navbar/dist/navbar.css';
2
+ import 'github-markdown-css';
3
+ import './index.less';
4
+ interface IMdViewProps {
5
+ /**
6
+ * md内容
7
+ */
8
+ source: string;
9
+ /**
10
+ * 是否显示导航
11
+ */
12
+ isMarkNav?: boolean;
13
+ }
14
+ declare const MdView: (props: IMdViewProps) => JSX.Element;
15
+ export default MdView;
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+
3
+ /*
4
+ * @Author: wangxian
5
+ * @Date: 2022-09-02 16:17:38
6
+ * @LastEditTime: 2022-09-02 17:10:04
7
+ */
8
+ import ReactMarkdown from 'react-markdown';
9
+ import remarkGfm from 'remark-gfm';
10
+ import rehypeRaw from 'rehype-raw';
11
+ import MarkNav from 'markdown-navbar';
12
+ import 'markdown-navbar/dist/navbar.css';
13
+ import 'github-markdown-css';
14
+ import './index.less';
15
+
16
+ var MdView = function MdView(props) {
17
+ var source = props.source,
18
+ _props$isMarkNav = props.isMarkNav,
19
+ isMarkNav = _props$isMarkNav === void 0 ? false : _props$isMarkNav;
20
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
21
+ className: "react-mark-down",
22
+ style: {
23
+ height: '100%',
24
+ display: 'flex'
25
+ }
26
+ }, /*#__PURE__*/React.createElement("div", {
27
+ className: "markdown-body react-mark-down"
28
+ }, /*#__PURE__*/React.createElement(ReactMarkdown, {
29
+ remarkPlugins: [remarkGfm],
30
+ rehypePlugins: [rehypeRaw]
31
+ }, source)), isMarkNav && /*#__PURE__*/React.createElement("div", {
32
+ style: {
33
+ width: '250px',
34
+ height: '100%',
35
+ padding: '10px',
36
+ overflowY: 'auto'
37
+ }
38
+ }, /*#__PURE__*/React.createElement(MarkNav, {
39
+ className: "h-full w-full",
40
+ source: source,
41
+ ordered: false
42
+ }))));
43
+ };
44
+
45
+ export default MdView;
@@ -0,0 +1,15 @@
1
+ .react-mark-down {
2
+ flex: 1;
3
+ padding: 10px;
4
+ overflow-y: auto;
5
+ ul {
6
+ li {
7
+ list-style: disc;
8
+ }
9
+ }
10
+ ol {
11
+ li {
12
+ list-style: auto;
13
+ }
14
+ }
15
+ }
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  /*
5
5
  * @Author: wangxian
6
6
  * @Date: 2021-09-18 14:15:04
7
- * @LastEditTime: 2022-04-01 16:48:49
7
+ * @LastEditTime: 2022-09-08 11:08:30
8
8
  */
9
9
  import React from 'react';
10
10
  import { deepClone } from '../../../utils';
@@ -48,11 +48,12 @@ export function withAddOnAfter(WrappedComponent) {
48
48
  key: "".concat(_name.toString(), "_div"),
49
49
  className: "with-add-on-after"
50
50
  }, /*#__PURE__*/React.createElement(WrappedComponent, _extends({
51
- key: _name.toString(),
52
- style: {
53
- padding: '0px'
54
- }
51
+ key: _name.toString()
55
52
  }, props, {
53
+ style: {
54
+ padding: '0px',
55
+ display: 'flex '
56
+ },
56
57
  name: _name,
57
58
  isObj: isObj
58
59
  })), isShowTypeInfo && !field && type !== 'number' && type !== 'bool' && /*#__PURE__*/React.createElement("div", {
@@ -23,3 +23,4 @@
23
23
  z-index: 1000;
24
24
  }
25
25
  }
26
+
@@ -154,8 +154,8 @@ var MetadataForm = function MetadataForm(props) {
154
154
  wrapperCol: {
155
155
  span: 24,
156
156
  offset: 0
157
- },
158
- layout: "horizontal",
157
+ } // layout="vertical"
158
+ ,
159
159
  form: form,
160
160
  name: "control-hooks",
161
161
  onFinish: onFinish,
@@ -1,7 +1,7 @@
1
1
  .metadata-form {
2
- .ant-row {
3
- display: block;
4
- }
2
+ // .ant-row {
3
+ // display: flex !important;
4
+ // }
5
5
  .ant-form-item {
6
6
  margin: 0;
7
7
  }
@@ -1,3 +1,7 @@
1
+ import "antd/es/row/style";
2
+ import _Row from "antd/es/row";
3
+ import "antd/es/col/style";
4
+ import _Col from "antd/es/col";
1
5
  import "antd/es/spin/style";
2
6
  import _Spin from "antd/es/spin";
3
7
  import _extends from "@babel/runtime/helpers/esm/extends";
@@ -5,7 +9,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
5
9
  /*
6
10
  * @Author: wangxian
7
11
  * @Date: 2021-09-18 14:15:04
8
- * @LastEditTime: 2022-06-08 15:54:53
12
+ * @LastEditTime: 2022-09-28 12:08:26
9
13
  */
10
14
  import React from 'react';
11
15
  import Input from './DataCell/Input';
@@ -73,10 +77,14 @@ export function renderForm(schemaRef, options, stream$) {
73
77
  var _form = [];
74
78
 
75
79
  for (var i = 0; i < _properties.length; i++) {
76
- _form.push(getDataCell(_properties[i], options));
80
+ _form.push( /*#__PURE__*/React.createElement(_Col, {
81
+ span: 24
82
+ }, getDataCell(_properties[i], options)));
77
83
  }
78
84
 
79
- return /*#__PURE__*/React.createElement(React.Fragment, null, _form);
85
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Row, {
86
+ gutter: 24
87
+ }, _form));
80
88
  }
81
89
  export function getLabelByProps(data) {
82
90
  if (data.fields && data.fields.length > 0) {
package/es/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { default as MetadataForm } from './comps/MetadataForm';
6
6
  export { default as JsonView } from './comps/JsonView';
7
7
  export { default as JsonEdit } from './comps/JsonEdit';
8
8
  export { default as MdEditor } from './comps/MdEdit';
9
+ export { default as MdView } from './comps/MdView';
9
10
  export { default as Editable } from './comps/Editable';
10
11
  export { default as DynamicPorts } from './comps/DynamicPorts';
11
12
  export { default as DragNode } from './comps/DynamicPorts/comps/DragNode';
package/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author:wangxian
3
3
  * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2022-06-24 10:28:22
4
+ * @LastEditTime: 2022-09-02 16:19:21
5
5
  */
6
6
  import './theme.less';
7
7
  export { default as MetadataEdit } from './comps/MetadataEdit';
@@ -11,6 +11,7 @@ export { default as MetadataForm } from './comps/MetadataForm';
11
11
  export { default as JsonView } from './comps/JsonView';
12
12
  export { default as JsonEdit } from './comps/JsonEdit';
13
13
  export { default as MdEditor } from './comps/MdEdit';
14
+ export { default as MdView } from './comps/MdView';
14
15
  export { default as Editable } from './comps/Editable';
15
16
  export { default as DynamicPorts } from './comps/DynamicPorts';
16
17
  export { default as DragNode } from './comps/DynamicPorts/comps/DragNode';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.1.36",
4
+ "version": "1.1.39",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",
@@ -45,11 +45,8 @@
45
45
  "bl": "^5.0.0",
46
46
  "codemirror": "^5.63.0",
47
47
  "github-markdown-css": "^5.1.0",
48
- "highlight.js": "11.3.1",
49
48
  "immer": "^9.0.14",
50
49
  "lodash": "^4.17.21",
51
- "markdown-it": "^12.3.2",
52
- "markdown-it-emoji": "^2.0.0",
53
50
  "markdown-navbar": "^1.4.3",
54
51
  "qs": "^6.10.1",
55
52
  "react": "^17.0.2",
@@ -58,6 +55,7 @@
58
55
  "react-markdown": "^8.0.3",
59
56
  "react-markdown-editor-lite": "^1.3.2",
60
57
  "react-popper": "^2.2.3",
58
+ "rehype-raw": "^6.1.1",
61
59
  "remark-gfm": "^3.0.1",
62
60
  "rxjs": "^7.5.4"
63
61
  },