shineout 3.4.0-beta.10 → 3.4.0-beta.11

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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.0-beta.10'
495
+ version: '3.4.0-beta.11'
496
496
  };
package/dist/shineout.js CHANGED
@@ -11991,7 +11991,7 @@ var handleStyle = function handleStyle(style) {
11991
11991
  };
11992
11992
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11993
11993
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11994
- /* harmony default export */ var version = ('3.4.0-beta.10');
11994
+ /* harmony default export */ var version = ('3.4.0-beta.11');
11995
11995
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11996
11996
 
11997
11997
 
@@ -50351,7 +50351,8 @@ var Root = function Root(props) {
50351
50351
 
50352
50352
 
50353
50353
 
50354
- var tree_excluded = ["jssStyle", "line", "childrenKey", "data", "value", "mode", "keygen", "expanded", "expandIcons", "iconClass", "leafClass", "nodeClass", "contentClass", "renderItem", "defaultValue", "dataUpdate", "childrenClass", "defaultExpandAll", "defaultExpanded", "parentClickExpand", "doubleClickExpand", "dragImageSelector", "dragImageStyle", "dragSibling", "unmatch", "dragHoverExpand", "active", "disabled", "inlineNode", "highlight", "className", "onClick", "loader", "getDatum", "onDrop", "onExpand", "onChange", "onDragEnd", "onDragLeave", "onDragOver", "onDragStart", "datum"];
50354
+
50355
+ var tree_excluded = ["jssStyle", "line", "childrenKey", "data", "value", "mode", "keygen", "expanded", "expandIcons", "iconClass", "leafClass", "nodeClass", "contentClass", "renderItem", "defaultValue", "dataUpdate", "childrenClass", "defaultExpandAll", "defaultExpanded", "parentClickExpand", "doubleClickExpand", "dragImageSelector", "dragImageStyle", "dragSibling", "unmatch", "dragHoverExpand", "active", "setActive", "disabled", "inlineNode", "highlight", "className", "onClick", "loader", "getDatum", "onDrop", "onExpand", "onChange", "onDragEnd", "onDragLeave", "onDragOver", "onDragStart", "datum"];
50355
50356
 
50356
50357
 
50357
50358
 
@@ -50390,10 +50391,11 @@ var Tree = function Tree(props) {
50390
50391
  dragSibling = props.dragSibling,
50391
50392
  unmatch = props.unmatch,
50392
50393
  dragHoverExpand = props.dragHoverExpand,
50393
- active = props.active,
50394
+ propActive = props.active,
50395
+ propSetActive = props.setActive,
50394
50396
  disabled = props.disabled,
50395
50397
  inlineNode = props.inlineNode,
50396
- highlight = props.highlight,
50398
+ propHighlight = props.highlight,
50397
50399
  className = props.className,
50398
50400
  onClick = props.onClick,
50399
50401
  loader = props.loader,
@@ -50407,6 +50409,17 @@ var Tree = function Tree(props) {
50407
50409
  onDragStart = props.onDragStart,
50408
50410
  propsDatum = props.datum,
50409
50411
  rest = objectWithoutProperties_default()(props, tree_excluded);
50412
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(propActive),
50413
+ _useState2 = slicedToArray_default()(_useState, 2),
50414
+ active = _useState2[0],
50415
+ setActive = _useState2[1];
50416
+ var isActiveControlled = ('active' in props);
50417
+ var highlight = propHighlight !== null && propHighlight !== void 0 ? propHighlight : isActiveControlled;
50418
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50419
+ if (isActiveControlled && propActive !== active) {
50420
+ setActive(propActive);
50421
+ }
50422
+ }, [active, propActive]);
50410
50423
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
50411
50424
  mounted: false
50412
50425
  }),
@@ -50445,14 +50458,14 @@ var Tree = function Tree(props) {
50445
50458
  });
50446
50459
  };
50447
50460
  var handleUpdateActive = function handleUpdateActive(active) {
50461
+ setActive(active);
50462
+ propSetActive === null || propSetActive === void 0 || propSetActive(active);
50448
50463
  datum.updateMap.forEach(function (update, id) {
50449
50464
  update('active', id === active);
50450
50465
  });
50451
50466
  };
50452
50467
  var handleNodeClick = function handleNodeClick(node, id) {
50453
- if (active === undefined) {
50454
- handleUpdateActive(id);
50455
- }
50468
+ handleUpdateActive(id);
50456
50469
  if (onClick) {
50457
50470
  onClick(node, id, datum.getPath(id));
50458
50471
  }
@@ -64865,7 +64878,7 @@ var upload_interface = __webpack_require__(8821);
64865
64878
 
64866
64879
 
64867
64880
  /* harmony default export */ var src_0 = ({
64868
- version: '3.4.0-beta.10'
64881
+ version: '3.4.0-beta.11'
64869
64882
  });
64870
64883
  }();
64871
64884
  /******/ return __webpack_exports__;