shineout 3.4.3-beta.2 → 3.4.3-beta.3

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.3-beta.2'
495
+ version: '3.4.3-beta.3'
496
496
  };
@@ -1 +1,2 @@
1
1
  export type { TreeProps as Props } from './tree.type';
2
+ export type { KeygenResult } from '@sheinx/hooks';
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.3-beta.2');
11994
+ /* harmony default export */ var version = ('3.4.3-beta.3');
11995
11995
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11996
11996
 
11997
11997
 
@@ -35934,14 +35934,15 @@ var useTree = function useTree(props) {
35934
35934
  });
35935
35935
 
35936
35936
  // 注册节点
35937
- var bindNode = function bindNode(id, update) {
35937
+ var bindNode = function bindNode(id, update, item) {
35938
35938
  context.updateMap.set(id, update);
35939
35939
  var isActive = activeProp === id;
35940
35940
  var expandeds = expanded;
35941
35941
  if (defaultExpandAll) {
35942
+ var shouldDefaultExpand = defaultExpandAll && isArray(item[childrenKey]) && item[childrenKey].length > 0;
35942
35943
  return {
35943
35944
  active: isActive,
35944
- expanded: true
35945
+ expanded: shouldDefaultExpand
35945
35946
  };
35946
35947
  }
35947
35948
  return {
@@ -50049,7 +50050,7 @@ var useTreeNode = function useTreeNode(props) {
50049
50050
  return true;
50050
50051
  };
50051
50052
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50052
- var _bindNode = bindNode(id, update),
50053
+ var _bindNode = bindNode(id, update, data),
50053
50054
  active = _bindNode.active,
50054
50055
  nextExpanded = _bindNode.expanded;
50055
50056
  setActive(active);
@@ -50376,6 +50377,7 @@ var tree_list_List = function List(props) {
50376
50377
  childrenKey = props.childrenKey,
50377
50378
  inlineNode = props.inlineNode,
50378
50379
  highlight = props.highlight,
50380
+ defaultExpandAll = props.defaultExpandAll,
50379
50381
  loader = props.loader,
50380
50382
  onNodeClick = props.onNodeClick,
50381
50383
  onToggle = props.onToggle,
@@ -50413,6 +50415,7 @@ var tree_list_List = function List(props) {
50413
50415
  line: line,
50414
50416
  keygen: keygen,
50415
50417
  listComponent: List,
50418
+ defaultExpandAll: defaultExpandAll,
50416
50419
  isControlled: isControlled,
50417
50420
  mode: mode,
50418
50421
  active: active,
@@ -50589,15 +50592,17 @@ var Tree = function Tree(props) {
50589
50592
  update('expanded', tempExpandMap.has(id));
50590
50593
  });
50591
50594
  };
50592
- var handleUpdateActive = function handleUpdateActive(active) {
50595
+ var handleUpdateActive = function handleUpdateActive(active, item) {
50593
50596
  setActive(active);
50594
- propSetActive === null || propSetActive === void 0 || propSetActive(active);
50597
+ if (active !== props.active) {
50598
+ propSetActive === null || propSetActive === void 0 || propSetActive(active, item);
50599
+ }
50595
50600
  datum.updateMap.forEach(function (update, id) {
50596
50601
  update('active', id === active);
50597
50602
  });
50598
50603
  };
50599
50604
  var handleNodeClick = function handleNodeClick(node, id) {
50600
- handleUpdateActive(id);
50605
+ handleUpdateActive(id, node);
50601
50606
  if (onClick) {
50602
50607
  onClick(node, id, datum.getPath(id));
50603
50608
  }
@@ -50705,6 +50710,7 @@ var Tree = function Tree(props) {
50705
50710
  contentClass: contentClass,
50706
50711
  expanded: expanded,
50707
50712
  expandIcons: expandIcons,
50713
+ defaultExpandAll: defaultExpandAll,
50708
50714
  childrenClass: isFunc(childrenClass) ? childrenClass : function () {
50709
50715
  return childrenClass;
50710
50716
  },
@@ -65144,7 +65150,7 @@ var upload_interface = __webpack_require__(8821);
65144
65150
 
65145
65151
 
65146
65152
  /* harmony default export */ var src_0 = ({
65147
- version: '3.4.3-beta.2'
65153
+ version: '3.4.3-beta.3'
65148
65154
  });
65149
65155
  }();
65150
65156
  /******/ return __webpack_exports__;