ronds-metadata 1.2.37 → 1.2.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.
- package/es/api/index.js +83 -131
- package/es/comps/DynamicPorts/comps/ContextMenu.js +3 -11
- package/es/comps/DynamicPorts/comps/DragNode.js +3 -8
- package/es/comps/DynamicPorts/comps/GraphHandler/index.js +4 -5
- package/es/comps/DynamicPorts/comps/NodeElement.js +1 -4
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +3 -6
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +3 -7
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +18 -21
- package/es/comps/DynamicPorts/comps/shape/edge.js +5 -18
- package/es/comps/DynamicPorts/comps/shape/node.js +4 -17
- package/es/comps/DynamicPorts/constant/index.js +2 -5
- package/es/comps/DynamicPorts/graph.d.ts +2 -2
- package/es/comps/DynamicPorts/graph.js +228 -312
- package/es/comps/DynamicPorts/index.js +39 -58
- package/es/comps/DynamicPorts/utils.js +21 -25
- package/es/comps/Editable/DataCell/ButtonCell.js +4 -10
- package/es/comps/Editable/DataCell/ColorPicker.js +2 -7
- package/es/comps/Editable/DataCell/Input.js +5 -14
- package/es/comps/Editable/DataCell/Number.js +3 -10
- package/es/comps/Editable/DataCell/Select.js +7 -14
- package/es/comps/Editable/DataCell/Switch.js +2 -7
- package/es/comps/Editable/comps/EditableAction.js +8 -12
- package/es/comps/Editable/comps/EditableCell.js +16 -26
- package/es/comps/Editable/comps/EditableHeardCell.js +21 -34
- package/es/comps/Editable/comps/EditableRow.js +49 -59
- package/es/comps/Editable/comps/Texty.js +40 -73
- package/es/comps/Editable/index.js +67 -112
- package/es/comps/Editable/interface.d.ts +1 -1
- package/es/comps/Editable/utils.js +0 -1
- package/es/comps/FileView/index.js +65 -101
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.js +8 -13
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +6 -10
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.js +8 -13
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +6 -10
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +6 -3
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.js +2 -5
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +86 -109
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +3 -7
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +54 -91
- package/es/comps/FormGenerator/comps/Canvas/index.js +8 -15
- package/es/comps/FormGenerator/comps/Settings/index.js +16 -30
- package/es/comps/FormGenerator/comps/Sidebar/Elements.js +23 -22
- package/es/comps/FormGenerator/comps/Sidebar/index.js +6 -2
- package/es/comps/FormGenerator/index.js +3 -9
- package/es/comps/FormGenerator/interface.d.ts +1 -1
- package/es/comps/FormGenerator/settings/index.js +12 -11
- package/es/comps/FormGenerator/settings/ruleConfig.js +0 -1
- package/es/comps/FormGenerator/transformer.js +40 -105
- package/es/comps/Icons/index.js +4 -7
- package/es/comps/JsonEdit/index.js +25 -50
- package/es/comps/JsonView/index.js +7 -21
- package/es/comps/MdEdit/index.js +7 -10
- package/es/comps/MdEditPro/index.d.ts +10 -0
- package/es/comps/MdEditPro/index.js +22 -0
- package/es/comps/MdEditPro/index.less +74 -0
- package/es/comps/MdNavbar/index.js +17 -40
- package/es/comps/MdNavbar/utils.js +0 -4
- package/es/comps/MdView/index.js +7 -11
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +129 -183
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +11 -27
- package/es/comps/MetadataEdit/hooks/index.js +3 -11
- package/es/comps/MetadataEdit/index.js +25 -58
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +17 -33
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +15 -29
- package/es/comps/MetadataEditV2/hooks/index.js +5 -12
- package/es/comps/MetadataEditV2/index.js +30 -65
- package/es/comps/MetadataForm/DataCell/Array.js +12 -23
- package/es/comps/MetadataForm/DataCell/Input.js +23 -39
- package/es/comps/MetadataForm/DataCell/Number.js +10 -21
- package/es/comps/MetadataForm/DataCell/Ref.js +87 -121
- package/es/comps/MetadataForm/DataCell/Select.js +131 -226
- package/es/comps/MetadataForm/DataCell/Switch.js +7 -14
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +98 -169
- package/es/comps/MetadataForm/HOC/index.js +20 -37
- package/es/comps/MetadataForm/hooks/index.js +12 -38
- package/es/comps/MetadataForm/index.js +37 -72
- package/es/comps/MetadataForm/interface.d.ts +3 -3
- package/es/comps/MetadataForm/utils.d.ts +1 -0
- package/es/comps/MetadataForm/utils.js +12 -14
- package/es/comps/Split/index.js +40 -38
- package/es/config.js +0 -4
- package/es/framework/RxStore/demo/index.js +9 -10
- package/es/framework/RxStore/hooks.d.ts +9 -9
- package/es/framework/RxStore/hooks.js +10 -35
- package/es/framework/RxStore/store.d.ts +4 -4
- package/es/framework/RxStore/store.js +0 -10
- package/es/framework/fg/index.js +18 -80
- package/es/framework/fg/interface.d.ts +2 -2
- package/es/framework/fg/utils.js +0 -10
- package/es/framework/graph/index.d.ts +2 -2
- package/es/framework/graph/index.js +55 -110
- package/es/framework/hooks/use-async-memo.js +3 -7
- package/es/framework/hooks/use-sync-scroll.js +2 -15
- package/es/framework/http/cache.js +25 -32
- package/es/framework/http/cancel.js +1 -7
- package/es/framework/http/index.js +22 -82
- package/es/framework/http/msgpack.js +0 -4
- package/es/framework/http/msgpack5/index.js +2 -12
- package/es/framework/http/msgpack5/lib/codecs/DateCodec.js +1 -13
- package/es/framework/http/msgpack5/lib/decoder.js +10 -68
- package/es/framework/http/msgpack5/lib/encoder.js +8 -36
- package/es/framework/http/msgpack5/lib/helpers.js +3 -2
- package/es/framework/http/msgpack5/lib/streams.js +0 -18
- package/es/framework/libs/jquery.min.js +1009 -1696
- package/es/framework/locale/dil8/di18n.js +4 -15
- package/es/framework/locale/dil8/translate.js +0 -14
- package/es/framework/locale/dil8/util.js +0 -3
- package/es/framework/locale/index.js +2 -3
- package/es/framework/metadata/MetadataService.js +39 -78
- package/es/framework/metadata/index.js +4 -70
- package/es/framework/rxjs-hooks/useMemoSubject.js +0 -2
- package/es/framework/rxjs-hooks/useObservable.js +2 -4
- package/es/framework/rxjs-hooks/useObservableState.js +8 -14
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils.js +58 -97
- package/package.json +4 -2
- package/es/comps/MdEdit/plugin/EditContent.d.ts +0 -5
- package/es/comps/MdEdit/plugin/EditContent.js +0 -34
- package/es/comps/MdEdit/plugin/Mark.d.ts +0 -7
- package/es/comps/MdEdit/plugin/Mark.js +0 -60
- package/es/framework/libs/iconfont/iconfont.json +0 -401
|
@@ -3,46 +3,42 @@ import "antd/es/message/style";
|
|
|
3
3
|
import _message from "antd/es/message";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["title", "isAddColumn", "editable", "record", "editableType", "dataIndex", "rowIndex", "children", "className"];
|
|
6
|
+
/*
|
|
7
|
+
* @Author: wangxian
|
|
8
|
+
* @Date: 2022-03-04 10:01:10
|
|
9
|
+
* @LastEditTime: 2023-03-25 09:01:46
|
|
10
|
+
*/
|
|
6
11
|
import React from 'react';
|
|
7
12
|
import { EditableContext } from '../interface';
|
|
8
13
|
import { getDataCell, isFreeEditCell, isFreeEditRow } from '../utils';
|
|
9
14
|
import './index.less';
|
|
10
15
|
import Texty from './Texty';
|
|
11
16
|
import { tr } from '../../../framework/locale';
|
|
12
|
-
|
|
13
17
|
var EditableCell = function EditableCell(props) {
|
|
14
18
|
var title = props.title,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
isAddColumn = props.isAddColumn,
|
|
20
|
+
editable = props.editable,
|
|
21
|
+
record = props.record,
|
|
22
|
+
editableType = props.editableType,
|
|
23
|
+
dataIndex = props.dataIndex,
|
|
24
|
+
rowIndex = props.rowIndex,
|
|
25
|
+
children = props.children,
|
|
26
|
+
className = props.className,
|
|
27
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
25
28
|
var _ref = React.useContext(EditableContext) || undefined,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
editableStream = _ref.editableStream,
|
|
30
|
+
editConfig = _ref.editConfig;
|
|
29
31
|
var onCellDoubleClick = function onCellDoubleClick() {
|
|
30
32
|
var _editConfig$editCellK, _editConfig$editCellK2;
|
|
31
|
-
|
|
32
33
|
if ((editConfig === null || editConfig === void 0 ? void 0 : editConfig.curRow) && (editConfig === null || editConfig === void 0 ? void 0 : editConfig.curRow) !== 'undefined') {
|
|
33
34
|
if (isFreeEditRow(editConfig.curRow, rowIndex)) return;
|
|
34
|
-
|
|
35
35
|
_message.warning(tr('请先保存正在编辑的行'));
|
|
36
|
-
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
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) {
|
|
41
39
|
_message.warning(tr('请先保存正在编辑的行'));
|
|
42
|
-
|
|
43
40
|
return;
|
|
44
41
|
}
|
|
45
|
-
|
|
46
42
|
editableStream.next({
|
|
47
43
|
type: 'editCellKey',
|
|
48
44
|
payload: {
|
|
@@ -51,7 +47,6 @@ var EditableCell = function EditableCell(props) {
|
|
|
51
47
|
}
|
|
52
48
|
});
|
|
53
49
|
};
|
|
54
|
-
|
|
55
50
|
var onCellClick = function onCellClick() {
|
|
56
51
|
if (isAddColumn) {
|
|
57
52
|
editableStream.next({
|
|
@@ -60,7 +55,6 @@ var EditableCell = function EditableCell(props) {
|
|
|
60
55
|
});
|
|
61
56
|
}
|
|
62
57
|
};
|
|
63
|
-
|
|
64
58
|
if (restProps === null || restProps === void 0 ? void 0 : restProps.colSpan) {
|
|
65
59
|
return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
|
|
66
60
|
className: "".concat(className, " ").concat(isAddColumn && editConfig.editHeardCellKey === dataIndex ? 'border-right' : '', " "),
|
|
@@ -69,7 +63,6 @@ var EditableCell = function EditableCell(props) {
|
|
|
69
63
|
}
|
|
70
64
|
}), children);
|
|
71
65
|
}
|
|
72
|
-
|
|
73
66
|
if (editableType === 'single') {
|
|
74
67
|
return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
|
|
75
68
|
className: "".concat(className, " ").concat(isAddColumn && editConfig.editHeardCellKey === dataIndex ? 'border-right' : '', " ")
|
|
@@ -80,7 +73,6 @@ var EditableCell = function EditableCell(props) {
|
|
|
80
73
|
tooltipMaxWidth: 800
|
|
81
74
|
}, children));
|
|
82
75
|
}
|
|
83
|
-
|
|
84
76
|
if (editableType === 'freedom') {
|
|
85
77
|
return /*#__PURE__*/React.createElement("td", _extends({
|
|
86
78
|
onDoubleClick: onCellDoubleClick,
|
|
@@ -94,7 +86,6 @@ var EditableCell = function EditableCell(props) {
|
|
|
94
86
|
tooltipMaxWidth: 800
|
|
95
87
|
}, children));
|
|
96
88
|
}
|
|
97
|
-
|
|
98
89
|
return /*#__PURE__*/React.createElement("td", _extends({}, restProps, {
|
|
99
90
|
className: "".concat(className, " ").concat(isAddColumn && editConfig.editHeardCellKey === dataIndex ? 'border-right' : '', " ")
|
|
100
91
|
}), editable ? getDataCell(props) : /*#__PURE__*/React.createElement(Texty, {
|
|
@@ -104,5 +95,4 @@ var EditableCell = function EditableCell(props) {
|
|
|
104
95
|
tooltipMaxWidth: 800
|
|
105
96
|
}, children));
|
|
106
97
|
};
|
|
107
|
-
|
|
108
98
|
export default EditableCell;
|
|
@@ -11,72 +11,64 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
11
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
12
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
13
13
|
var _excluded = ["title", "dataIndex", "isAddColumn", "children", "className", "style"];
|
|
14
|
+
/*
|
|
15
|
+
* @Author: wangxian
|
|
16
|
+
* @Date: 2022-03-04 10:01:10
|
|
17
|
+
* @LastEditTime: 2022-07-06 14:16:29
|
|
18
|
+
*/
|
|
14
19
|
import { PlusSquareOutlined, DeleteOutlined } from '@ant-design/icons';
|
|
15
20
|
import React from 'react';
|
|
16
21
|
import { EditableContext } from '../interface';
|
|
17
22
|
import { tr } from '../../../framework/locale';
|
|
18
23
|
import './index.less';
|
|
19
24
|
import Texty from './Texty';
|
|
20
|
-
|
|
21
25
|
var EditableHeardCell = function EditableHeardCell(props) {
|
|
22
26
|
var title = props.title,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
dataIndex = props.dataIndex,
|
|
28
|
+
isAddColumn = props.isAddColumn,
|
|
29
|
+
children = props.children,
|
|
30
|
+
className = props.className,
|
|
31
|
+
style = props.style,
|
|
32
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
30
33
|
var _ref = React.useContext(EditableContext) || undefined,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
editableStream = _ref.editableStream,
|
|
35
|
+
editConfig = _ref.editConfig;
|
|
34
36
|
var addColumnRef = React.useRef({
|
|
35
37
|
title: ''
|
|
36
38
|
});
|
|
37
|
-
|
|
38
39
|
var _React$useState = React.useState({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
title: ''
|
|
41
|
+
}),
|
|
42
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
43
|
+
addColumn = _React$useState2[0],
|
|
44
|
+
setAddColumn = _React$useState2[1];
|
|
45
45
|
var _React$useState3 = React.useState(false),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
47
|
+
visible = _React$useState4[0],
|
|
48
|
+
setVisible = _React$useState4[1];
|
|
50
49
|
var myStyle = React.useMemo(function () {
|
|
51
50
|
var res = {};
|
|
52
|
-
|
|
53
51
|
if (style === null || style === void 0 ? void 0 : style.right) {
|
|
54
52
|
res = _objectSpread(_objectSpread({}, style), {}, {
|
|
55
53
|
right: (style === null || style === void 0 ? void 0 : style.right) - 6
|
|
56
54
|
});
|
|
57
55
|
}
|
|
58
|
-
|
|
59
56
|
return res;
|
|
60
57
|
}, [style]);
|
|
61
58
|
var myClassName = React.useMemo(function () {
|
|
62
59
|
var _cls = className;
|
|
63
|
-
|
|
64
60
|
if (_cls && _cls.indexOf('ant-table-cell-scrollbar')) {
|
|
65
61
|
_cls = _cls.replace('ant-table-cell-scrollbar', '');
|
|
66
62
|
}
|
|
67
|
-
|
|
68
63
|
return _cls;
|
|
69
64
|
}, [className]);
|
|
70
|
-
|
|
71
65
|
var onMouseOver = function onMouseOver() {
|
|
72
66
|
editableStream.next({
|
|
73
67
|
type: 'editHeardCellKey',
|
|
74
68
|
payload: dataIndex
|
|
75
69
|
});
|
|
76
70
|
};
|
|
77
|
-
|
|
78
71
|
var onMouseLeave = function onMouseLeave() {};
|
|
79
|
-
|
|
80
72
|
var onAddColumn = function onAddColumn() {
|
|
81
73
|
setVisible(false);
|
|
82
74
|
editableStream.next({
|
|
@@ -92,7 +84,6 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
|
92
84
|
title: ''
|
|
93
85
|
};
|
|
94
86
|
};
|
|
95
|
-
|
|
96
87
|
var onDeleteColumn = function onDeleteColumn() {
|
|
97
88
|
setVisible(false);
|
|
98
89
|
editableStream.next({
|
|
@@ -102,7 +93,6 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
|
102
93
|
}
|
|
103
94
|
});
|
|
104
95
|
};
|
|
105
|
-
|
|
106
96
|
var content = /*#__PURE__*/React.createElement("div", {
|
|
107
97
|
style: {
|
|
108
98
|
width: '100px'
|
|
@@ -129,11 +119,9 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
|
129
119
|
block: true,
|
|
130
120
|
onClick: onAddColumn
|
|
131
121
|
}, tr('确定'))));
|
|
132
|
-
|
|
133
122
|
var onVisibleChange = function onVisibleChange(b) {
|
|
134
123
|
setVisible(b);
|
|
135
124
|
};
|
|
136
|
-
|
|
137
125
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("th", _extends({
|
|
138
126
|
className: "".concat(myClassName, " ant-table-th font-bold ").concat(isAddColumn && editConfig.editHeardCellKey === dataIndex ? 'border-right ' : '', " ")
|
|
139
127
|
}, restProps, {
|
|
@@ -168,5 +156,4 @@ var EditableHeardCell = function EditableHeardCell(props) {
|
|
|
168
156
|
onMouseLeave: onMouseLeave
|
|
169
157
|
}, /*#__PURE__*/React.createElement(Texty, null, children))));
|
|
170
158
|
};
|
|
171
|
-
|
|
172
159
|
export default EditableHeardCell;
|
|
@@ -2,79 +2,72 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import "antd/es/form/style";
|
|
3
3
|
import _Form from "antd/es/form";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
/*
|
|
6
|
+
* @Author: wangxian
|
|
7
|
+
* @Date: 2022-03-04 10:01:10
|
|
8
|
+
* @LastEditTime: 2023-01-04 10:39:58
|
|
9
|
+
*/
|
|
5
10
|
import React from 'react';
|
|
6
11
|
import { useDrag, useDrop } from 'react-dnd';
|
|
7
12
|
import { DND_TYPE, EditableContext } from '../interface';
|
|
8
|
-
|
|
9
13
|
var EditableRow = function EditableRow(props) {
|
|
10
14
|
var record = props.record,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
index = props.index,
|
|
16
|
+
className = props.className,
|
|
17
|
+
onMove = props.onMove;
|
|
15
18
|
var _Form$useForm = _Form.useForm(),
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
20
|
+
form = _Form$useForm2[0];
|
|
19
21
|
var ref = React.useRef(null);
|
|
20
|
-
|
|
21
22
|
var _ref = React.useContext(EditableContext) || undefined,
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
editableStream = _ref.editableStream;
|
|
24
24
|
React.useEffect(function () {
|
|
25
25
|
if (!form) return;
|
|
26
26
|
form.setFieldsValue(record);
|
|
27
27
|
}, [record]);
|
|
28
|
-
|
|
29
28
|
var _useDrop = useDrop({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
accept: DND_TYPE,
|
|
30
|
+
collect: function collect(monitor) {
|
|
31
|
+
var _ref2 = monitor.getItem() || {},
|
|
33
32
|
dragIndex = _ref2.index;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
if (dragIndex === index || !onMove) {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
isOver: monitor.isOver(),
|
|
38
|
+
dropClassName: dragIndex < index ? ' drop-over-downward' : ' drop-over-upward'
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
drop: function drop(item, monitor) {
|
|
42
|
+
onMove && onMove({
|
|
43
|
+
dragIndex: item.index,
|
|
44
|
+
hoverIndex: index
|
|
45
|
+
});
|
|
37
46
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
drop: function drop(item, monitor) {
|
|
45
|
-
onMove && onMove({
|
|
46
|
-
dragIndex: item.index,
|
|
47
|
-
hoverIndex: index
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}),
|
|
51
|
-
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
52
|
-
_useDrop2$ = _useDrop2[0],
|
|
53
|
-
isOver = _useDrop2$.isOver,
|
|
54
|
-
dropClassName = _useDrop2$.dropClassName,
|
|
55
|
-
drop = _useDrop2[1];
|
|
56
|
-
|
|
47
|
+
}),
|
|
48
|
+
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
49
|
+
_useDrop2$ = _useDrop2[0],
|
|
50
|
+
isOver = _useDrop2$.isOver,
|
|
51
|
+
dropClassName = _useDrop2$.dropClassName,
|
|
52
|
+
drop = _useDrop2[1];
|
|
57
53
|
var _useDrag = useDrag({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
drag = _useDrag2[1];
|
|
75
|
-
|
|
54
|
+
item: {
|
|
55
|
+
index: index,
|
|
56
|
+
type: DND_TYPE
|
|
57
|
+
},
|
|
58
|
+
end: function end(item, monitor) {
|
|
59
|
+
var dropResult = monitor.getDropResult();
|
|
60
|
+
if (item && dropResult) {}
|
|
61
|
+
},
|
|
62
|
+
collect: function collect(monitor) {
|
|
63
|
+
return {
|
|
64
|
+
isDragging: monitor.isDragging()
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
69
|
+
drag = _useDrag2[1];
|
|
76
70
|
onMove && drop(drag(ref));
|
|
77
|
-
|
|
78
71
|
var onValuesChange = function onValuesChange(values, allValues) {
|
|
79
72
|
if (editableStream) {
|
|
80
73
|
editableStream.next({
|
|
@@ -87,7 +80,6 @@ var EditableRow = function EditableRow(props) {
|
|
|
87
80
|
});
|
|
88
81
|
}
|
|
89
82
|
};
|
|
90
|
-
|
|
91
83
|
var onRowClick = function onRowClick() {
|
|
92
84
|
editableStream.next({
|
|
93
85
|
type: 'onRowClick',
|
|
@@ -96,7 +88,6 @@ var EditableRow = function EditableRow(props) {
|
|
|
96
88
|
}
|
|
97
89
|
});
|
|
98
90
|
};
|
|
99
|
-
|
|
100
91
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form, {
|
|
101
92
|
name: "editable_".concat(record === null || record === void 0 ? void 0 : record._rowKey_, "_"),
|
|
102
93
|
form: form,
|
|
@@ -114,5 +105,4 @@ var EditableRow = function EditableRow(props) {
|
|
|
114
105
|
onClick: onRowClick
|
|
115
106
|
}))));
|
|
116
107
|
};
|
|
117
|
-
|
|
118
108
|
export default EditableRow;
|
|
@@ -20,21 +20,15 @@ var modifiers = [{
|
|
|
20
20
|
/**
|
|
21
21
|
* 基于Popper的tooltip
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
23
|
var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
25
24
|
_inherits(Texty, _React$PureComponent);
|
|
26
|
-
|
|
27
25
|
var _super = _createSuper(Texty);
|
|
28
|
-
|
|
29
26
|
function Texty() {
|
|
30
27
|
var _this;
|
|
31
|
-
|
|
32
28
|
_classCallCheck(this, Texty);
|
|
33
|
-
|
|
34
29
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
30
|
args[_key] = arguments[_key];
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
39
33
|
_this.state = {
|
|
40
34
|
isHovered: false
|
|
@@ -43,21 +37,20 @@ var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
43
37
|
_this.targetNode = void 0;
|
|
44
38
|
_this.hideTimer = void 0;
|
|
45
39
|
_this.showTimer = void 0;
|
|
46
|
-
|
|
47
40
|
_this.renderTooltip = function (_ref) {
|
|
48
41
|
var ref = _ref.ref,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
style = _ref.style,
|
|
43
|
+
placement = _ref.placement,
|
|
44
|
+
arrowProps = _ref.arrowProps;
|
|
52
45
|
var _this$props = _this.props,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
children = _this$props.children,
|
|
47
|
+
container = _this$props.container,
|
|
48
|
+
tooltip = _this$props.tooltip,
|
|
49
|
+
tooltipClassName = _this$props.tooltipClassName,
|
|
50
|
+
tooltipStyle = _this$props.tooltipStyle,
|
|
51
|
+
tooltipMaxWidth = _this$props.tooltipMaxWidth,
|
|
52
|
+
arrowClassName = _this$props.arrowClassName,
|
|
53
|
+
hideArrow = _this$props.hideArrow;
|
|
61
54
|
var content = tooltip || children;
|
|
62
55
|
var extraStyle = tooltipMaxWidth ? _objectSpread(_objectSpread({}, tooltipStyle), {}, {
|
|
63
56
|
maxWidth: tooltipMaxWidth
|
|
@@ -79,101 +72,80 @@ var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
72
|
style: arrowProps.style
|
|
80
73
|
})), container || _this.targetNode.ownerDocument.body);
|
|
81
74
|
};
|
|
82
|
-
|
|
83
75
|
_this.setTargetRef = function (ref) {
|
|
84
76
|
_this.props.innerRef && _this.props.innerRef(ref);
|
|
85
|
-
_this.targetNode = ref;
|
|
77
|
+
_this.targetNode = ref;
|
|
78
|
+
// console.log("setTargetRef",ref,this.targetNode)
|
|
86
79
|
};
|
|
87
|
-
|
|
88
80
|
_this.handleMouseEvent = function (e) {
|
|
89
81
|
e.stopPropagation();
|
|
90
82
|
};
|
|
91
|
-
|
|
92
83
|
_this.handleScroll = function (e) {
|
|
93
84
|
var _e$srcElement, _e$srcElement2;
|
|
94
|
-
|
|
95
85
|
if ((e === null || e === void 0 ? void 0 : (_e$srcElement = e.srcElement) === null || _e$srcElement === void 0 ? void 0 : _e$srcElement.className) === 'contract-trigger') {
|
|
96
86
|
return;
|
|
97
87
|
}
|
|
98
|
-
|
|
99
88
|
if ((e === null || e === void 0 ? void 0 : (_e$srcElement2 = e.srcElement) === null || _e$srcElement2 === void 0 ? void 0 : _e$srcElement2.className) === 'texty-scroll') {
|
|
100
89
|
return;
|
|
101
90
|
}
|
|
102
|
-
|
|
103
91
|
_this.setState({
|
|
104
92
|
isHovered: false
|
|
105
93
|
});
|
|
106
94
|
};
|
|
107
|
-
|
|
108
95
|
_this.handleMouseEnter = function (e) {
|
|
109
96
|
// console.log('handleMouseEnter');
|
|
110
97
|
// eslint-disable-next-line react/prop-types
|
|
111
98
|
var _this$props2 = _this.props,
|
|
112
|
-
|
|
113
|
-
|
|
99
|
+
showDelay = _this$props2.showDelay,
|
|
100
|
+
onMouseEnter = _this$props2.onMouseEnter;
|
|
114
101
|
onMouseEnter && onMouseEnter(e);
|
|
115
|
-
|
|
116
102
|
_this._clearHideTimer();
|
|
117
|
-
|
|
118
103
|
if (!showDelay) {
|
|
119
104
|
_this.setState({
|
|
120
105
|
isHovered: true
|
|
121
106
|
});
|
|
122
|
-
|
|
123
107
|
return;
|
|
124
108
|
}
|
|
125
|
-
|
|
126
109
|
_this.showTimer = setTimeout(function () {
|
|
127
110
|
_this.setState({
|
|
128
111
|
isHovered: true
|
|
129
112
|
});
|
|
130
|
-
|
|
131
113
|
delete _this.showTimer;
|
|
132
114
|
}, showDelay);
|
|
133
115
|
};
|
|
134
|
-
|
|
135
116
|
_this.handleMouseLeave = function (e) {
|
|
136
117
|
// console.log('handleMouseLeave');
|
|
137
118
|
// eslint-disable-next-line react/prop-types
|
|
138
119
|
var _this$props3 = _this.props,
|
|
139
|
-
|
|
140
|
-
|
|
120
|
+
hideDelay = _this$props3.hideDelay,
|
|
121
|
+
onMouseLeave = _this$props3.onMouseLeave;
|
|
141
122
|
onMouseLeave && onMouseLeave(e);
|
|
142
|
-
|
|
143
123
|
_this._clearShowTimer();
|
|
144
|
-
|
|
145
124
|
var isHovered = _this.state.isHovered;
|
|
146
125
|
if (!isHovered) return;
|
|
147
|
-
|
|
148
126
|
if (!hideDelay) {
|
|
149
127
|
_this.setState({
|
|
150
128
|
isHovered: false
|
|
151
129
|
});
|
|
152
|
-
|
|
153
130
|
return;
|
|
154
131
|
}
|
|
155
|
-
|
|
156
132
|
_this.hideTimer = setTimeout(function () {
|
|
157
133
|
_this.setState({
|
|
158
134
|
isHovered: false
|
|
159
135
|
});
|
|
160
|
-
|
|
161
136
|
delete _this.hideTimer;
|
|
162
137
|
}, hideDelay);
|
|
163
138
|
};
|
|
164
|
-
|
|
165
139
|
return _this;
|
|
166
140
|
}
|
|
167
|
-
|
|
168
141
|
_createClass(Texty, [{
|
|
169
142
|
key: "componentDidUpdate",
|
|
170
143
|
value: function componentDidUpdate() {
|
|
171
144
|
var _this2 = this;
|
|
172
|
-
|
|
173
145
|
// console.log(this.state);
|
|
174
146
|
if (this.state.isHovered) {
|
|
175
|
-
window.addEventListener('scroll', this.handleScroll, true);
|
|
176
|
-
|
|
147
|
+
window.addEventListener('scroll', this.handleScroll, true);
|
|
148
|
+
// react - virtualized - auto - sizer would trigger scroll events after tooltip shown in some case,we have to skip those scroll events
|
|
177
149
|
this.listenTimer = setTimeout(function () {
|
|
178
150
|
window.removeEventListener('scroll', _this2.handleScroll, true);
|
|
179
151
|
window.addEventListener('scroll', _this2.handleScroll, true);
|
|
@@ -181,7 +153,6 @@ var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
181
153
|
}, 50);
|
|
182
154
|
} else {
|
|
183
155
|
this._clearListenTimer();
|
|
184
|
-
|
|
185
156
|
window.removeEventListener('scroll', this.handleScroll, true);
|
|
186
157
|
}
|
|
187
158
|
}
|
|
@@ -189,11 +160,8 @@ var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
189
160
|
key: "componentWillUnmount",
|
|
190
161
|
value: function componentWillUnmount() {
|
|
191
162
|
this._clearListenTimer();
|
|
192
|
-
|
|
193
163
|
window.removeEventListener('scroll', this.handleScroll, true);
|
|
194
|
-
|
|
195
164
|
this._clearShowTimer();
|
|
196
|
-
|
|
197
165
|
this._clearHideTimer();
|
|
198
166
|
}
|
|
199
167
|
}, {
|
|
@@ -201,38 +169,39 @@ var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
201
169
|
value: function render() {
|
|
202
170
|
/* eslint-disable no-unused-vars */
|
|
203
171
|
var _this$props4 = this.props,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
172
|
+
tagName = _this$props4.tagName,
|
|
173
|
+
children = _this$props4.children,
|
|
174
|
+
placement = _this$props4.placement,
|
|
175
|
+
innerRef = _this$props4.innerRef,
|
|
176
|
+
showDelay = _this$props4.showDelay,
|
|
177
|
+
hideDelay = _this$props4.hideDelay,
|
|
178
|
+
tooltip = _this$props4.tooltip,
|
|
179
|
+
tooltipClassName = _this$props4.tooltipClassName,
|
|
180
|
+
tooltipStyle = _this$props4.tooltipStyle,
|
|
181
|
+
tooltipMaxWidth = _this$props4.tooltipMaxWidth,
|
|
182
|
+
hideArrow = _this$props4.hideArrow,
|
|
183
|
+
container = _this$props4.container,
|
|
184
|
+
rest = _objectWithoutProperties(_this$props4, _excluded);
|
|
217
185
|
/* eslint-enable no-unused-vars */
|
|
218
|
-
|
|
219
|
-
|
|
220
186
|
var Tag = tagName;
|
|
221
|
-
|
|
222
187
|
if (!children) {
|
|
223
|
-
return null;
|
|
188
|
+
return null;
|
|
189
|
+
// return <Tag { ...rest } ref={ this.setTargetRef } data-texty={ false } />;
|
|
224
190
|
}
|
|
225
191
|
|
|
226
192
|
var target = this.targetNode;
|
|
227
193
|
var isTruncated = !!target && target.scrollWidth > target.offsetWidth;
|
|
228
|
-
var showTooltip = this.state.isHovered && isTruncated;
|
|
229
|
-
|
|
194
|
+
var showTooltip = this.state.isHovered && isTruncated;
|
|
195
|
+
// console.log("showTooltip",showTooltip)
|
|
230
196
|
return /*#__PURE__*/React.createElement(Tag, _extends({}, rest, {
|
|
231
197
|
ref: this.setTargetRef,
|
|
232
198
|
"data-texty": showTooltip,
|
|
233
199
|
onMouseEnter: this.handleMouseEnter,
|
|
234
200
|
onMouseLeave: this.handleMouseLeave
|
|
235
|
-
}), children, showTooltip &&
|
|
201
|
+
}), children, showTooltip &&
|
|
202
|
+
/*#__PURE__*/
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
React.createElement(Popper, {
|
|
236
205
|
referenceElement: target,
|
|
237
206
|
placement: placement,
|
|
238
207
|
modifiers: modifiers
|
|
@@ -263,10 +232,8 @@ var Texty = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
263
232
|
}
|
|
264
233
|
}
|
|
265
234
|
}]);
|
|
266
|
-
|
|
267
235
|
return Texty;
|
|
268
236
|
}(React.PureComponent);
|
|
269
|
-
|
|
270
237
|
Texty.defaultProps = {
|
|
271
238
|
tagName: 'div',
|
|
272
239
|
showDelay: 150,
|