shineout 3.8.10-beta.8 → 3.8.10-fix.1

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.8.10-beta.8'
525
+ version: '3.8.10-fix.1'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12398,7 +12398,7 @@ var handleStyle = function handleStyle(style) {
12398
12398
  };
12399
12399
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12400
12400
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12401
- /* harmony default export */ var version = ('3.8.10-beta.8');
12401
+ /* harmony default export */ var version = ('3.8.10-fix.1');
12402
12402
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12403
12403
 
12404
12404
 
@@ -36399,19 +36399,18 @@ function useInputAble(props) {
36399
36399
  var render = useRender(syncValue);
36400
36400
  var shouldUseState = delay || !control;
36401
36401
  var value = shouldUseState ? stateValue : valuePo;
36402
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
36403
- if (context.timer) {
36404
- clearTimeout(context.timer);
36405
- context.timer = null;
36406
- }
36402
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
36407
36403
  if (delay && control && props.value !== stateValue) {
36408
36404
  changeStateValue(props.value);
36405
+ } else if (context.timer) {
36406
+ clearTimeout(context.timer);
36407
+ context.timer = null;
36409
36408
  }
36410
36409
  }, [props.value, delay, control]);
36411
36410
  var forceDelayChange = use_persist_fn(function () {
36412
- if (context.timer && context.delayChange) {
36411
+ if (context.delayChange) context.delayChange();
36412
+ if (context.timer) {
36413
36413
  clearTimeout(context.timer);
36414
- context.delayChange();
36415
36414
  context.timer = null;
36416
36415
  context.delayChange = null;
36417
36416
  }
@@ -40521,7 +40520,9 @@ var Scroll = function Scroll(props) {
40521
40520
  _props$scrollWidth = props.scrollWidth,
40522
40521
  scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
40523
40522
  _props$defaultHeight = props.defaultHeight,
40524
- defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
40523
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight,
40524
+ _props$keepScrollTop = props.keepScrollTop,
40525
+ keepScrollTop = _props$keepScrollTop === void 0 ? false : _props$keepScrollTop;
40525
40526
  var _useResize = useResize({
40526
40527
  targetRef: containerRef,
40527
40528
  timer: 100
@@ -40546,7 +40547,9 @@ var Scroll = function Scroll(props) {
40546
40547
 
40547
40548
  // 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
40548
40549
  var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
40549
- return height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
40550
+ var maxHeight = Math.max(0, scrollHeight - height);
40551
+ if (keepScrollTop) return maxHeight;
40552
+ return height === 0 ? 0 : maxHeight;
40550
40553
  }, [scrollHeight, height]);
40551
40554
  var placeStyle = {
40552
40555
  paddingTop: paddingTop,
@@ -40835,6 +40838,7 @@ var VirtualList = function VirtualList(props) {
40835
40838
  wrapperRef: wrapperRef,
40836
40839
  onScroll: handleScroll,
40837
40840
  onMouseMove: handleMouseMove,
40841
+ keepScrollTop: keepScrollTop,
40838
40842
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Tag, {
40839
40843
  className: tagClassName,
40840
40844
  style: innerStyle,
@@ -73396,7 +73400,7 @@ var upload_interface = __webpack_require__(8821);
73396
73400
 
73397
73401
 
73398
73402
  /* harmony default export */ var src_0 = ({
73399
- version: '3.8.10-beta.8'
73403
+ version: '3.8.10-fix.1'
73400
73404
  });
73401
73405
  }();
73402
73406
  /******/ return __webpack_exports__;