@cloud-app-dev/vidc 1.0.49 → 1.0.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.
package/es/WorkerFlow/Demo.js
CHANGED
|
@@ -13,7 +13,8 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
13
13
|
|
|
14
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
15
|
|
|
16
|
-
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
16
|
+
import React, { useState, useEffect, useRef, useCallback, useContext } from 'react';
|
|
17
|
+
import WFC from '../OperatorContext';
|
|
17
18
|
|
|
18
19
|
function TitleElement(_ref) {
|
|
19
20
|
var nodeName = _ref.nodeName,
|
|
@@ -22,6 +23,9 @@ function TitleElement(_ref) {
|
|
|
22
23
|
icon = _ref.icon,
|
|
23
24
|
delNode = _ref.delNode;
|
|
24
25
|
|
|
26
|
+
var _useContext = useContext(WFC),
|
|
27
|
+
readOnly = _useContext.readOnly;
|
|
28
|
+
|
|
25
29
|
var _useState = useState(nodeName),
|
|
26
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
31
|
title = _useState2[0],
|
|
@@ -41,11 +45,11 @@ function TitleElement(_ref) {
|
|
|
41
45
|
}
|
|
42
46
|
}, [title, placeholder]);
|
|
43
47
|
useEffect(function () {
|
|
44
|
-
return editable && input.current.focus();
|
|
48
|
+
return !readOnly && editable && input.current.focus();
|
|
45
49
|
}, [editable]);
|
|
46
50
|
|
|
47
51
|
_useChangeEffect(function () {
|
|
48
|
-
!editable && onTitleChange && onTitleChange(title);
|
|
52
|
+
!readOnly && !editable && onTitleChange && onTitleChange(title);
|
|
49
53
|
}, [title, editable]);
|
|
50
54
|
|
|
51
55
|
return /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement(_IconFont, {
|
|
@@ -53,7 +57,7 @@ function TitleElement(_ref) {
|
|
|
53
57
|
style: {
|
|
54
58
|
paddingRight: 4
|
|
55
59
|
}
|
|
56
|
-
}), editable ? /*#__PURE__*/React.createElement("input", {
|
|
60
|
+
}), !readOnly && editable ? /*#__PURE__*/React.createElement("input", {
|
|
57
61
|
ref: input,
|
|
58
62
|
type: "text",
|
|
59
63
|
className: "cloudapp-input editable-title-input",
|
|
@@ -70,8 +74,11 @@ function TitleElement(_ref) {
|
|
|
70
74
|
className: "editable-title",
|
|
71
75
|
onClick: function onClick() {
|
|
72
76
|
return setEditable(true);
|
|
73
|
-
}
|
|
74
|
-
|
|
77
|
+
},
|
|
78
|
+
style: readOnly ? {
|
|
79
|
+
borderColor: 'transparent'
|
|
80
|
+
} : undefined
|
|
81
|
+
}, title), !readOnly && /*#__PURE__*/React.createElement(_IconFont, {
|
|
75
82
|
className: "worker-flow-node-del",
|
|
76
83
|
type: "icon-MarkNo",
|
|
77
84
|
onClick: delNode,
|