shineout 3.9.7-beta.4 → 3.9.7-beta.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.
package/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.9.7-beta.4'
525
+ version: '3.9.7-beta.5'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12401,7 +12401,7 @@ var handleStyle = function handleStyle(style) {
12401
12401
  };
12402
12402
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12403
12403
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12404
- /* harmony default export */ var version = ('3.9.7-beta.4');
12404
+ /* harmony default export */ var version = ('3.9.7-beta.5');
12405
12405
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12406
12406
 
12407
12407
 
@@ -58022,16 +58022,23 @@ var Tree = function Tree(props) {
58022
58022
  return props.height || styleHeight;
58023
58023
  };
58024
58024
  var handleUpdateActive = function handleUpdateActive(active, item) {
58025
- setActive(active);
58026
- if (active !== props.active) {
58027
- propSetActive === null || propSetActive === void 0 || propSetActive(active, item);
58025
+ var fromUser = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
58026
+ if (isActiveControlled && fromUser) {
58027
+ // 受控模式下,用户点击时只调用外部回调,不更新内部状态
58028
+ if (active !== props.active) {
58029
+ propSetActive === null || propSetActive === void 0 || propSetActive(active, item);
58030
+ }
58031
+ return;
58028
58032
  }
58033
+
58034
+ // 其他情况(非受控模式,或受控模式下由 props.active 变化触发),更新内部状态和节点
58035
+ setActive(active);
58029
58036
  datum.updateMap.forEach(function (update, id) {
58030
58037
  update('active', id === active);
58031
58038
  });
58032
58039
  };
58033
58040
  var handleNodeClick = function handleNodeClick(node, id) {
58034
- handleUpdateActive(id, node);
58041
+ handleUpdateActive(id, node, true);
58035
58042
  if (onClick) {
58036
58043
  onClick(node, id, datum.getPath(id));
58037
58044
  }
@@ -75042,7 +75049,7 @@ var upload_interface = __webpack_require__(8821);
75042
75049
 
75043
75050
 
75044
75051
  /* harmony default export */ var src_0 = ({
75045
- version: '3.9.7-beta.4'
75052
+ version: '3.9.7-beta.5'
75046
75053
  });
75047
75054
  }();
75048
75055
  /******/ return __webpack_exports__;