xh-lab-rc 0.18.3 → 0.18.5

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.
@@ -147,7 +147,7 @@ var LabOperateTree = function LabOperateTree() {
147
147
  initOperateTree(_toConsumableArray(props.treeData), {});
148
148
  }
149
149
  }, props.leafOperateListElement),
150
- open: openMarkData[v.SOURCE_PATH],
150
+ open: openMarkData[v.SOURCE_PATH] || false,
151
151
  onOpenChange: function onOpenChange(newOpen) {
152
152
  if (newOpen) {
153
153
  var _props$onOpenPopover;
@@ -175,7 +175,7 @@ var LabOperateTree = function LabOperateTree() {
175
175
  setOperateTreeData(newTreeData);
176
176
  };
177
177
 
178
- // 选择第一个
178
+ // 选择第一个和展开收起
179
179
  useEffect(function () {
180
180
  var _props$treeData;
181
181
  if (((_props$treeData = props.treeData) === null || _props$treeData === void 0 ? void 0 : _props$treeData.length) > 0) {
@@ -183,22 +183,17 @@ var LabOperateTree = function LabOperateTree() {
183
183
  initOperateTree(props.treeData, openMarkData);
184
184
  setSelectedKeys([leafItemTreeList === null || leafItemTreeList === void 0 || (_leafItemTreeList$3 = leafItemTreeList[0]) === null || _leafItemTreeList$3 === void 0 ? void 0 : _leafItemTreeList$3.SOURCE_PATH]);
185
185
  props === null || props === void 0 || (_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 || _props$onSelect.call(props, leafItemTreeList === null || leafItemTreeList === void 0 ? void 0 : leafItemTreeList[0]);
186
- if (!(props !== null && props !== void 0 && props.expandAll)) {
186
+ if ((props === null || props === void 0 ? void 0 : props.expandAll) === undefined) {
187
187
  setExpandKeys(expandKeysList);
188
+ } else if ((props === null || props === void 0 ? void 0 : props.expandAll) === false) {
189
+ setExpandKeys([]);
190
+ } else if ((props === null || props === void 0 ? void 0 : props.expandAll) === true) {
191
+ setExpandKeys(allItemTreeList.map(function (v) {
192
+ return v.SOURCE_PATH;
193
+ }));
188
194
  }
189
195
  }
190
- }, [props.treeData, props.showIcon, props.showOperateIcon]);
191
-
192
- // 展开收起
193
- useEffect(function () {
194
- if (!(props !== null && props !== void 0 && props.expandAll)) {
195
- setExpandKeys([]);
196
- } else {
197
- setExpandKeys(allItemTreeList.map(function (v) {
198
- return v.SOURCE_PATH;
199
- }));
200
- }
201
- }, [props.expandAll]);
196
+ }, [props.treeData, props.showIcon, props.showOperateIcon, props.expandAll]);
202
197
 
203
198
  // 受控勾选
204
199
  useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xh-lab-rc",
3
- "version": "0.18.3",
3
+ "version": "0.18.5",
4
4
  "description": " A react library for xinhelab",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",