shineout 3.9.0-beta.20 → 3.9.0-beta.22

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.0-beta.20'
525
+ version: '3.9.0-beta.22'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12400,7 +12400,7 @@ var handleStyle = function handleStyle(style) {
12400
12400
  };
12401
12401
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12402
12402
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12403
- /* harmony default export */ var version = ('3.9.0-beta.20');
12403
+ /* harmony default export */ var version = ('3.9.0-beta.22');
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12405
12405
 
12406
12406
 
@@ -24130,7 +24130,7 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
24130
24130
  hideTag: {},
24131
24131
  list: {},
24132
24132
  tree: {
24133
- padding: 4,
24133
+ padding: '0 4px',
24134
24134
  overflow: 'auto'
24135
24135
  },
24136
24136
  treeOption: {
@@ -30979,6 +30979,9 @@ var addResizeObserver = function addResizeObserver(el, handler) {
30979
30979
  lastWidth = el.clientWidth;
30980
30980
  lastHeight = el.clientHeight;
30981
30981
  h = function h(entry) {
30982
+ if ((el === null || el === void 0 ? void 0 : el.offsetParent) === null) {
30983
+ return;
30984
+ }
30982
30985
  var _entry$0$contentRect = entry[0].contentRect,
30983
30986
  width = _entry$0$contentRect.width,
30984
30987
  height = _entry$0$contentRect.height;
@@ -57824,6 +57827,8 @@ var Tree = function Tree(props) {
57824
57827
 
57825
57828
 
57826
57829
 
57830
+
57831
+
57827
57832
  var TreeList = function TreeList(props) {
57828
57833
  var _jssStyle$select;
57829
57834
  var jssStyle = props.jssStyle,
@@ -57867,25 +57872,46 @@ var TreeList = function TreeList(props) {
57867
57872
  var renderItem = function renderItem(item) {
57868
57873
  return renderItemProp(item);
57869
57874
  };
57875
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)([]),
57876
+ _useState2 = slicedToArray_default()(_useState, 2),
57877
+ virtualExpanded = _useState2[0],
57878
+ setVirtualExpanded = _useState2[1];
57879
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
57880
+ if (props.virtual && expanded) {
57881
+ setVirtualExpanded(expanded);
57882
+ }
57883
+ }, [expanded]);
57884
+ var handleExpand = function handleExpand(expandedKeys) {
57885
+ if (props.virtual) {
57886
+ setVirtualExpanded(expandedKeys);
57887
+ }
57888
+ onExpand === null || onExpand === void 0 || onExpand(expandedKeys);
57889
+ };
57890
+ var $tree = /*#__PURE__*/(0,jsx_runtime.jsx)(src_tree_tree, {
57891
+ line: false,
57892
+ jssStyle: jssStyle,
57893
+ onClick: handleClick,
57894
+ data: data,
57895
+ expanded: props.virtual ? (virtualExpanded === null || virtualExpanded === void 0 ? void 0 : virtualExpanded.length) > 0 ? virtualExpanded : undefined : expanded,
57896
+ keygen: keygen,
57897
+ defaultExpanded: defaultExpanded,
57898
+ defaultExpandAll: defaultExpandAll,
57899
+ childrenKey: childrenKey,
57900
+ onExpand: handleExpand,
57901
+ nodeClass: classnames_default()(styles.treeOption),
57902
+ contentClass: getContentClass,
57903
+ renderItem: renderItem,
57904
+ expandIcons: props.expandIcons,
57905
+ virtual: props.virtual,
57906
+ height: props.height
57907
+ });
57908
+ if (props.virtual) {
57909
+ return $tree;
57910
+ }
57870
57911
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
57871
57912
  className: rootClass,
57872
57913
  style: style,
57873
- children: /*#__PURE__*/(0,jsx_runtime.jsx)(src_tree_tree, {
57874
- line: false,
57875
- jssStyle: jssStyle,
57876
- onClick: handleClick,
57877
- data: data,
57878
- expanded: expanded,
57879
- keygen: keygen,
57880
- defaultExpanded: defaultExpanded,
57881
- defaultExpandAll: defaultExpandAll,
57882
- childrenKey: childrenKey,
57883
- onExpand: onExpand,
57884
- nodeClass: classnames_default()(styles.treeOption),
57885
- contentClass: getContentClass,
57886
- renderItem: renderItem,
57887
- expandIcons: props.expandIcons
57888
- })
57914
+ children: $tree
57889
57915
  });
57890
57916
  };
57891
57917
  /* harmony default export */ var list_tree = (TreeList);
@@ -58849,7 +58875,8 @@ function Select(props0) {
58849
58875
  childrenKey: childrenKey,
58850
58876
  closePop: closePop,
58851
58877
  renderItem: renderItem,
58852
- expandIcons: tiledExpandIcons
58878
+ expandIcons: tiledExpandIcons,
58879
+ virtual: props.virtual
58853
58880
  });
58854
58881
  };
58855
58882
  var renderLoading = function renderLoading() {
@@ -64435,7 +64462,7 @@ var useTableLayout = function useTableLayout(props) {
64435
64462
  });
64436
64463
  var checkFloat = use_persist_fn(function () {
64437
64464
  var scrollEl = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current;
64438
- if (!scrollEl) return;
64465
+ if (!scrollEl || !(scrollEl !== null && scrollEl !== void 0 && scrollEl.offsetParent)) return;
64439
64466
  var max = scrollEl.scrollWidth - scrollEl.clientWidth;
64440
64467
  var min = 0;
64441
64468
  var left = scrollEl.scrollLeft;
@@ -67012,6 +67039,7 @@ function Table(props) {
67012
67039
  setScrollAble(isScrollAble);
67013
67040
  }, [virtual]);
67014
67041
 
67042
+ // TODO: 没用的tbodyHeight,有空移除了
67015
67043
  // 虚拟列表高度另外计算
67016
67044
  var _useResize = useResize({
67017
67045
  targetRef: virtual ? emptyRef : tbodyRef
@@ -74144,7 +74172,7 @@ var upload_interface = __webpack_require__(8821);
74144
74172
 
74145
74173
 
74146
74174
  /* harmony default export */ var src_0 = ({
74147
- version: '3.9.0-beta.20'
74175
+ version: '3.9.0-beta.22'
74148
74176
  });
74149
74177
  }();
74150
74178
  /******/ return __webpack_exports__;