shineout 3.4.3-beta.1 → 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.1'
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.1');
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 {
@@ -41581,11 +41582,9 @@ var useTime = function useTime(props) {
41581
41582
 
41582
41583
 
41583
41584
 
41584
- var link_excluded = ["jssStyle", "className", "type", "underline", "disabled", "size", "icon", "href", "target", "children"];
41585
- // import { } from '@sheinx/hooks';
41585
+ var link_excluded = ["jssStyle", "className", "type", "underline", "disabled", "size", "icon", "href", "children"];
41586
41586
 
41587
41587
 
41588
- // import from icons
41589
41588
 
41590
41589
 
41591
41590
 
@@ -41600,16 +41599,38 @@ var Link = function Link(props) {
41600
41599
  size = props.size,
41601
41600
  icon = props.icon,
41602
41601
  href = props.href,
41603
- target = props.target,
41604
41602
  children = props.children,
41605
41603
  restProps = objectWithoutProperties_default()(props, link_excluded);
41606
41604
  var linkClasses = (jssStyle === null || jssStyle === void 0 || (_jssStyle$link = jssStyle.link) === null || _jssStyle$link === void 0 ? void 0 : _jssStyle$link.call(jssStyle)) || {};
41607
41605
  var rootClass = classnames_default()(className, linkClasses.wrapper, defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({}, linkClasses.underline, underline === true), linkClasses.underlineHover, underline === 'hover'), linkClasses.disabled, disabled), linkClasses.sizeSmall, size === 'small'), linkClasses.sizeLarge, size === 'large'), linkClasses.primary, type === 'primary'), linkClasses.secondary, type === 'secondary'), linkClasses.danger, type === 'danger'), linkClasses.warning, type === 'warning'), linkClasses.success, type === 'success'));
41606
+ var handleClick = function handleClick(e) {
41607
+ if (disabled) {
41608
+ e.preventDefault();
41609
+ e.stopPropagation();
41610
+ } else {
41611
+ var _props$onClick;
41612
+ (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, e);
41613
+ }
41614
+ };
41615
+ var handleKeyDown = function handleKeyDown(e) {
41616
+ if (e.key === 'Enter' && !disabled) {
41617
+ var _props$onClick2;
41618
+ (_props$onClick2 = props.onClick) === null || _props$onClick2 === void 0 || _props$onClick2.call(props, e);
41619
+ } else if (disabled) {
41620
+ e.preventDefault();
41621
+ e.stopPropagation();
41622
+ } else {
41623
+ var _props$onKeyDown;
41624
+ (_props$onKeyDown = props.onKeyDown) === null || _props$onKeyDown === void 0 || _props$onKeyDown.call(props, e);
41625
+ }
41626
+ };
41608
41627
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("a", objectSpread2_default()(objectSpread2_default()({
41609
41628
  href: disabled ? undefined : href,
41610
- target: target,
41611
- className: rootClass
41629
+ className: rootClass,
41630
+ "aria-disabled": disabled
41612
41631
  }, restProps), {}, {
41632
+ onClick: handleClick,
41633
+ onKeyDown: handleKeyDown,
41613
41634
  children: [typeof icon === 'boolean' && icon && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
41614
41635
  className: linkClasses.icon,
41615
41636
  children: icons_config.link.prefixIcon
@@ -50029,7 +50050,7 @@ var useTreeNode = function useTreeNode(props) {
50029
50050
  return true;
50030
50051
  };
50031
50052
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
50032
- var _bindNode = bindNode(id, update),
50053
+ var _bindNode = bindNode(id, update, data),
50033
50054
  active = _bindNode.active,
50034
50055
  nextExpanded = _bindNode.expanded;
50035
50056
  setActive(active);
@@ -50356,6 +50377,7 @@ var tree_list_List = function List(props) {
50356
50377
  childrenKey = props.childrenKey,
50357
50378
  inlineNode = props.inlineNode,
50358
50379
  highlight = props.highlight,
50380
+ defaultExpandAll = props.defaultExpandAll,
50359
50381
  loader = props.loader,
50360
50382
  onNodeClick = props.onNodeClick,
50361
50383
  onToggle = props.onToggle,
@@ -50393,6 +50415,7 @@ var tree_list_List = function List(props) {
50393
50415
  line: line,
50394
50416
  keygen: keygen,
50395
50417
  listComponent: List,
50418
+ defaultExpandAll: defaultExpandAll,
50396
50419
  isControlled: isControlled,
50397
50420
  mode: mode,
50398
50421
  active: active,
@@ -50569,15 +50592,17 @@ var Tree = function Tree(props) {
50569
50592
  update('expanded', tempExpandMap.has(id));
50570
50593
  });
50571
50594
  };
50572
- var handleUpdateActive = function handleUpdateActive(active) {
50595
+ var handleUpdateActive = function handleUpdateActive(active, item) {
50573
50596
  setActive(active);
50574
- propSetActive === null || propSetActive === void 0 || propSetActive(active);
50597
+ if (active !== props.active) {
50598
+ propSetActive === null || propSetActive === void 0 || propSetActive(active, item);
50599
+ }
50575
50600
  datum.updateMap.forEach(function (update, id) {
50576
50601
  update('active', id === active);
50577
50602
  });
50578
50603
  };
50579
50604
  var handleNodeClick = function handleNodeClick(node, id) {
50580
- handleUpdateActive(id);
50605
+ handleUpdateActive(id, node);
50581
50606
  if (onClick) {
50582
50607
  onClick(node, id, datum.getPath(id));
50583
50608
  }
@@ -50685,6 +50710,7 @@ var Tree = function Tree(props) {
50685
50710
  contentClass: contentClass,
50686
50711
  expanded: expanded,
50687
50712
  expandIcons: expandIcons,
50713
+ defaultExpandAll: defaultExpandAll,
50688
50714
  childrenClass: isFunc(childrenClass) ? childrenClass : function () {
50689
50715
  return childrenClass;
50690
50716
  },
@@ -65124,7 +65150,7 @@ var upload_interface = __webpack_require__(8821);
65124
65150
 
65125
65151
 
65126
65152
  /* harmony default export */ var src_0 = ({
65127
- version: '3.4.3-beta.1'
65153
+ version: '3.4.3-beta.3'
65128
65154
  });
65129
65155
  }();
65130
65156
  /******/ return __webpack_exports__;