shineout 3.6.1-beta.1 → 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.1'
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.1');
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 {
@@ -55639,11 +55644,12 @@ var PaginationJumper = function PaginationJumper(props) {
55639
55644
  pageSize = props.pageSize,
55640
55645
  disabled = props.disabled,
55641
55646
  text = props.text,
55647
+ current = props.current,
55642
55648
  onChange = props.onChange;
55643
55649
  var paginationStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$pagination = jssStyle.pagination) === null || _jssStyle$pagination === void 0 ? void 0 : _jssStyle$pagination.call(jssStyle);
55644
55650
  var rootClasses = classnames_default()(paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.section, paginationStyle === null || paginationStyle === void 0 ? void 0 : paginationStyle.jumper);
55645
55651
  var txt = text.jumper ? text.jumper.split('{input}') : [];
55646
- var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(''),
55652
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(String(current)),
55647
55653
  _useState2 = slicedToArray_default()(_useState, 2),
55648
55654
  value = _useState2[0],
55649
55655
  setValue = _useState2[1];
@@ -55651,23 +55657,28 @@ var PaginationJumper = function PaginationJumper(props) {
55651
55657
  return Math.ceil(total / pageSize) || 1;
55652
55658
  };
55653
55659
  var cleatInternalState = function cleatInternalState() {
55660
+ if (simple) return;
55654
55661
  setValue('');
55655
55662
  };
55656
55663
  var handleKeyDown = function handleKeyDown(e) {
55657
55664
  if (e.key === 'Enter' || e.keyCode === 13) {
55658
- var current = parseInt(e.target.value, 10);
55659
- if (!Number.isFinite(current)) return;
55660
- if (current < 1) current = 1;
55665
+ var _current = parseInt(e.target.value, 10);
55666
+ if (!Number.isFinite(_current)) return;
55667
+ if (_current < 1) _current = 1;
55661
55668
  var max = getMax();
55662
- if (current > max) current = max;
55663
- onChange(current);
55664
- setValue(String(current));
55669
+ if (_current > max) _current = max;
55670
+ onChange(_current);
55671
+ setValue(String(_current));
55665
55672
  setTimeout(cleatInternalState, 20);
55666
55673
  }
55667
55674
  };
55668
55675
  var handleChange = function handleChange(v) {
55669
55676
  setValue(v || '');
55670
55677
  };
55678
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
55679
+ if (!simple) return;
55680
+ setValue(String(current));
55681
+ }, [current, simple]);
55671
55682
  var renderInput = function renderInput() {
55672
55683
  return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_input_input, {
55673
55684
  jssStyle: jssStyle,
@@ -56075,6 +56086,7 @@ var PaginationSimple = function PaginationSimple(props) {
56075
56086
  total: total,
56076
56087
  text: text,
56077
56088
  size: size,
56089
+ current: current,
56078
56090
  pageSize: pageSize,
56079
56091
  onChange: onChange
56080
56092
  });
@@ -56232,6 +56244,7 @@ var Pagination = function Pagination(props) {
56232
56244
  return /*#__PURE__*/(0,jsx_runtime.jsx)(pagination_jumper, objectSpread2_default()(objectSpread2_default()({}, props), {}, {
56233
56245
  text: text,
56234
56246
  total: total,
56247
+ current: current,
56235
56248
  pageSize: pageSize,
56236
56249
  onChange: onChange
56237
56250
  }), i);
@@ -60595,18 +60608,21 @@ var useTableFilter = function useTableFilter(props) {
60595
60608
 
60596
60609
  // 根据columns生成filterInfo
60597
60610
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
60598
- var _props$columns;
60599
- 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) {
60600
- var _column$filter;
60601
- if (!column.filter) return acc;
60602
- var columnKey = typeof column.render === 'string' ? column.render : String(index);
60603
- acc.set(columnKey, {
60604
- value: undefined,
60605
- onFilter: (_column$filter = column.filter) === null || _column$filter === void 0 ? void 0 : _column$filter.onFilter
60606
- });
60607
- return acc;
60608
- }, new Map());
60609
- 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
+ });
60610
60626
  }, [props.columns]);
60611
60627
  return {
60612
60628
  filterInfo: filterInfo,
@@ -69660,7 +69676,7 @@ var upload_interface = __webpack_require__(8821);
69660
69676
 
69661
69677
 
69662
69678
  /* harmony default export */ var src_0 = ({
69663
- version: '3.6.1-beta.1'
69679
+ version: '3.6.1-beta.3'
69664
69680
  });
69665
69681
  }();
69666
69682
  /******/ return __webpack_exports__;