shineout 3.6.1-beta.2 → 3.6.1-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
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
514
514
  // 此文件由脚本自动生成,请勿直接修改。
515
515
  // This file was generated automatically by a script. Please do not modify it directly.
516
516
  var _default = exports.default = {
517
- version: '3.6.1-beta.2'
517
+ version: '3.6.1-beta.3'
518
518
  };
package/dist/shineout.js CHANGED
@@ -12139,7 +12139,7 @@ var handleStyle = function handleStyle(style) {
12139
12139
  };
12140
12140
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12141
12141
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12142
- /* harmony default export */ var version = ('3.6.1-beta.2');
12142
+ /* harmony default export */ var version = ('3.6.1-beta.3');
12143
12143
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12144
12144
 
12145
12145
 
@@ -30349,7 +30349,8 @@ var usePositionStyle = function usePositionStyle(config) {
30349
30349
  width: 0
30350
30350
  },
30351
30351
  popUpHeight: 0,
30352
- popUpWidth: 0
30352
+ popUpWidth: 0,
30353
+ prevParentPosition: null
30353
30354
  }),
30354
30355
  context = _React$useRef.current;
30355
30356
  var parentElNewPosition = useCheckElementPosition(parentElRef, {
@@ -30549,7 +30550,8 @@ var usePositionStyle = function usePositionStyle(config) {
30549
30550
  style: hideStyle
30550
30551
  };
30551
30552
  var rect = context.parentRect;
30552
- if (!show && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
30553
+ var needCheck = !show || !shallow_equal(context.prevParentPosition, parentElNewPosition);
30554
+ if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
30553
30555
  var _scrollElRef$current2;
30554
30556
  var visibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
30555
30557
  if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom || rect.right < visibleRect.left || rect.left > visibleRect.right) {
@@ -30631,6 +30633,9 @@ var usePositionStyle = function usePositionStyle(config) {
30631
30633
  setStyle(newStyle);
30632
30634
  setArrayStyle(newArrayStyle || {});
30633
30635
  }
30636
+
30637
+ // 当父元素的滚动容器滚动时,判断是否需要更新弹出层位置,包括是否隐藏弹出层(通过hideStyle隐藏,不是show状态)
30638
+ context.prevParentPosition = parentElNewPosition;
30634
30639
  });
30635
30640
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(updateStyle, [show, position, absolute, updateKey, fixedWidth, parentElNewPosition]);
30636
30641
  return {
@@ -60603,18 +60608,21 @@ var useTableFilter = function useTableFilter(props) {
60603
60608
 
60604
60609
  // 根据columns生成filterInfo
60605
60610
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
60606
- var _props$columns;
60607
- var _filterInfo = props === null || props === void 0 || (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.reduce(function (acc, column, index) {
60608
- var _column$filter;
60609
- if (!column.filter) return acc;
60610
- var columnKey = typeof column.render === 'string' ? column.render : String(index);
60611
- acc.set(columnKey, {
60612
- value: undefined,
60613
- onFilter: (_column$filter = column.filter) === null || _column$filter === void 0 ? void 0 : _column$filter.onFilter
60614
- });
60615
- return acc;
60616
- }, new Map());
60617
- if (_filterInfo) setFilterInfo(_filterInfo);
60611
+ setFilterInfo(function (prev) {
60612
+ var _props$columns;
60613
+ var _filterInfo = props === null || props === void 0 || (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.reduce(function (acc, column, index) {
60614
+ var _prev$get2, _column$filter;
60615
+ if (!column.filter) return acc;
60616
+ var columnKey = typeof column.render === 'string' ? column.render : String(index);
60617
+ var prevValue = (_prev$get2 = prev.get(columnKey)) === null || _prev$get2 === void 0 ? void 0 : _prev$get2.value;
60618
+ acc.set(columnKey, {
60619
+ value: prevValue,
60620
+ onFilter: (_column$filter = column.filter) === null || _column$filter === void 0 ? void 0 : _column$filter.onFilter
60621
+ });
60622
+ return acc;
60623
+ }, new Map());
60624
+ return _filterInfo || new Map();
60625
+ });
60618
60626
  }, [props.columns]);
60619
60627
  return {
60620
60628
  filterInfo: filterInfo,
@@ -69668,7 +69676,7 @@ var upload_interface = __webpack_require__(8821);
69668
69676
 
69669
69677
 
69670
69678
  /* harmony default export */ var src_0 = ({
69671
- version: '3.6.1-beta.2'
69679
+ version: '3.6.1-beta.3'
69672
69680
  });
69673
69681
  }();
69674
69682
  /******/ return __webpack_exports__;