xh-lab-rc 0.18.4 → 0.18.6
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,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './style.less';
|
|
3
3
|
export interface ILabOperateTree {
|
|
4
|
+
showLine?: boolean;
|
|
4
5
|
checkedKeys?: string[];
|
|
5
6
|
expandAll?: boolean;
|
|
6
7
|
showCheck?: boolean;
|
|
7
8
|
showIcon?: boolean;
|
|
9
|
+
singleOperateElement?: boolean;
|
|
8
10
|
showOperateIcon?: boolean;
|
|
9
11
|
disableSelectedByNodeType?: string[];
|
|
10
12
|
loadingElement?: React.ReactElement;
|
|
@@ -126,7 +126,7 @@ var LabOperateTree = function LabOperateTree() {
|
|
|
126
126
|
var initOperateTree = function initOperateTree(treeData, openMarkData) {
|
|
127
127
|
var dfs = function dfs(treeData) {
|
|
128
128
|
treeData.map(function (v) {
|
|
129
|
-
var _props$iconElementByN, _props$operateElement, _props$disableSelecte, _v$CHILDREN2;
|
|
129
|
+
var _props$iconElementByN, _props$operateElement, _props$operateElement2, _props$disableSelecte, _v$CHILDREN2;
|
|
130
130
|
v.key = v.SOURCE_PATH;
|
|
131
131
|
v.children = v.CHILDREN;
|
|
132
132
|
v.title = /*#__PURE__*/React.createElement("div", {
|
|
@@ -138,7 +138,12 @@ var LabOperateTree = function LabOperateTree() {
|
|
|
138
138
|
onClick: function onClick(e) {
|
|
139
139
|
e.stopPropagation();
|
|
140
140
|
}
|
|
141
|
-
}, props.showOperateIcon && /*#__PURE__*/React.createElement(
|
|
141
|
+
}, props.showOperateIcon && (props !== null && props !== void 0 && props.singleOperateElement ? /*#__PURE__*/React.createElement("span", {
|
|
142
|
+
onClick: function onClick() {
|
|
143
|
+
var _props$onOpenPopover;
|
|
144
|
+
props === null || props === void 0 || (_props$onOpenPopover = props.onOpenPopover) === null || _props$onOpenPopover === void 0 || _props$onOpenPopover.call(props, v);
|
|
145
|
+
}
|
|
146
|
+
}, props === null || props === void 0 || (_props$operateElement = props.operateElementByNodeType) === null || _props$operateElement === void 0 ? void 0 : _props$operateElement[v === null || v === void 0 ? void 0 : v.NODE_TYPE]) : /*#__PURE__*/React.createElement(Popover, {
|
|
142
147
|
arrow: false,
|
|
143
148
|
overlayClassName: 'my-popover-box',
|
|
144
149
|
content: /*#__PURE__*/React.createElement("div", {
|
|
@@ -147,17 +152,17 @@ var LabOperateTree = function LabOperateTree() {
|
|
|
147
152
|
initOperateTree(_toConsumableArray(props.treeData), {});
|
|
148
153
|
}
|
|
149
154
|
}, props.leafOperateListElement),
|
|
150
|
-
open: openMarkData[v.SOURCE_PATH],
|
|
155
|
+
open: openMarkData[v.SOURCE_PATH] || false,
|
|
151
156
|
onOpenChange: function onOpenChange(newOpen) {
|
|
152
157
|
if (newOpen) {
|
|
153
|
-
var _props$
|
|
154
|
-
props === null || props === void 0 || (_props$
|
|
158
|
+
var _props$onOpenPopover2;
|
|
159
|
+
props === null || props === void 0 || (_props$onOpenPopover2 = props.onOpenPopover) === null || _props$onOpenPopover2 === void 0 || _props$onOpenPopover2.call(props, v);
|
|
155
160
|
}
|
|
156
161
|
initOperateTree(_toConsumableArray(props.treeData), _defineProperty({}, v.SOURCE_PATH, newOpen));
|
|
157
162
|
},
|
|
158
163
|
trigger: "click",
|
|
159
164
|
destroyTooltipOnHide: true
|
|
160
|
-
}, v.operateElement || (props === null || props === void 0 || (_props$
|
|
165
|
+
}, v.operateElement || (props === null || props === void 0 || (_props$operateElement2 = props.operateElementByNodeType) === null || _props$operateElement2 === void 0 ? void 0 : _props$operateElement2[v === null || v === void 0 ? void 0 : v.NODE_TYPE]) || /*#__PURE__*/React.createElement(MoreOutlined, null)))));
|
|
161
166
|
if (props !== null && props !== void 0 && (_props$disableSelecte = props.disableSelectedByNodeType) !== null && _props$disableSelecte !== void 0 && _props$disableSelecte.includes(v === null || v === void 0 ? void 0 : v.NODE_TYPE)) {
|
|
162
167
|
v.selectable = v.selectable === undefined ? false : v.selectable;
|
|
163
168
|
} else {
|
|
@@ -226,7 +231,7 @@ var LabOperateTree = function LabOperateTree() {
|
|
|
226
231
|
treeCheckedList = info === null || info === void 0 ? void 0 : info.checkedNodes;
|
|
227
232
|
setTreeCheckedKeys(checkedKeys);
|
|
228
233
|
},
|
|
229
|
-
showLine:
|
|
234
|
+
showLine: props.showLine,
|
|
230
235
|
showIcon: true,
|
|
231
236
|
expandedKeys: expandKeys,
|
|
232
237
|
selectedKeys: selectedKeys,
|