shineout 3.7.8-beta.8 → 3.7.8-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.7.8-beta.8'
525
+ version: '3.7.8-fix.1'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.8-beta.8');
12237
+ /* harmony default export */ var version = ('3.7.8-fix.1');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -23692,7 +23692,6 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
23692
23692
  height: 32,
23693
23693
  padding: "".concat(src.selectHeaderPaddingY, " ").concat(src.selectHeaderPaddingX),
23694
23694
  borderBottom: "1px solid ".concat(src.selectHeaderBorderColor),
23695
- marginBottom: 4,
23696
23695
  '& $columnsCheckbox': {
23697
23696
  marginRight: 0,
23698
23697
  marginLeft: 4,
@@ -31081,6 +31080,23 @@ var getCurrentCSSZoom = function getCurrentCSSZoom() {
31081
31080
  // height: rect.height * zoomRatio,
31082
31081
  // }
31083
31082
  // }
31083
+
31084
+ var getScrollPosition = function getScrollPosition(element) {
31085
+ if (!element) return {
31086
+ scrollTop: 0,
31087
+ scrollLeft: 0
31088
+ };
31089
+ if (element === document.documentElement || element === document.body) {
31090
+ return {
31091
+ scrollTop: document.documentElement.scrollTop || document.body.scrollTop,
31092
+ scrollLeft: document.documentElement.scrollLeft || document.body.scrollLeft
31093
+ };
31094
+ }
31095
+ return {
31096
+ scrollTop: element.scrollTop,
31097
+ scrollLeft: element.scrollLeft
31098
+ };
31099
+ };
31084
31100
  ;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/index.ts
31085
31101
 
31086
31102
 
@@ -31324,17 +31340,18 @@ var usePositionStyle = function usePositionStyle(config) {
31324
31340
  };
31325
31341
  };
31326
31342
  var getAbsoluteStyle = function getAbsoluteStyle(position) {
31327
- var _scrollElRef$current, _scrollElRef$current2, _scrollElRef$current3;
31343
+ var _scrollElRef$current;
31328
31344
  if (!parentElRef.current) return {
31329
31345
  style: hideStyle
31330
31346
  };
31331
31347
  var rect = context.parentRect;
31332
31348
  var needCheck = !show || !shallow_equal(context.prevParentPosition, parentElNewPosition);
31333
- var scrollTop = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current = scrollElRef.current) === null || _scrollElRef$current === void 0 ? void 0 : _scrollElRef$current.scrollTop) || 0;
31334
- var scrollLeft = (scrollElRef === null || scrollElRef === void 0 || (_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.scrollLeft) || 0;
31335
- if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current3 = scrollElRef.current) !== null && _scrollElRef$current3 !== void 0 && _scrollElRef$current3.contains(parentElRef.current)) {
31336
- var _scrollElRef$current4;
31337
- var visibleRect = ((_scrollElRef$current4 = scrollElRef.current) === null || _scrollElRef$current4 === void 0 ? void 0 : _scrollElRef$current4.getBoundingClientRect()) || {};
31349
+ var _getScrollPosition = getScrollPosition(scrollElRef === null || scrollElRef === void 0 ? void 0 : scrollElRef.current),
31350
+ scrollTop = _getScrollPosition.scrollTop,
31351
+ scrollLeft = _getScrollPosition.scrollLeft;
31352
+ if (needCheck && scrollElRef !== null && scrollElRef !== void 0 && scrollElRef.current && (_scrollElRef$current = scrollElRef.current) !== null && _scrollElRef$current !== void 0 && _scrollElRef$current.contains(parentElRef.current)) {
31353
+ var _scrollElRef$current2;
31354
+ var visibleRect = ((_scrollElRef$current2 = scrollElRef.current) === null || _scrollElRef$current2 === void 0 ? void 0 : _scrollElRef$current2.getBoundingClientRect()) || {};
31338
31355
  if (rect.bottom < visibleRect.top || rect.top > visibleRect.bottom + scrollTop || rect.right < visibleRect.left || rect.left > visibleRect.right + scrollLeft) {
31339
31356
  return {
31340
31357
  style: hideStyle
@@ -31408,7 +31425,9 @@ var usePositionStyle = function usePositionStyle(config) {
31408
31425
  }
31409
31426
 
31410
31427
  // 当父元素的滚动容器滚动时,判断是否需要更新弹出层位置,包括是否隐藏弹出层(通过hideStyle隐藏,不是show状态)
31411
- context.prevParentPosition = parentElNewPosition;
31428
+ if (show) {
31429
+ context.prevParentPosition = parentElNewPosition;
31430
+ }
31412
31431
  });
31413
31432
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(updateStyle, [show, position, absolute, updateKey, fixedWidth, parentElNewPosition, popupElSize]);
31414
31433
  return {
@@ -35813,19 +35832,18 @@ function useInputAble(props) {
35813
35832
  var render = useRender(syncValue);
35814
35833
  var shouldUseState = delay || !control;
35815
35834
  var value = shouldUseState ? stateValue : valuePo;
35816
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
35817
- if (context.timer) {
35818
- clearTimeout(context.timer);
35819
- context.timer = null;
35820
- }
35835
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
35821
35836
  if (delay && control && props.value !== stateValue) {
35822
35837
  changeStateValue(props.value);
35838
+ } else if (context.timer) {
35839
+ clearTimeout(context.timer);
35840
+ context.timer = null;
35823
35841
  }
35824
35842
  }, [props.value, delay, control]);
35825
35843
  var forceDelayChange = use_persist_fn(function () {
35826
- if (context.timer && context.delayChange) {
35844
+ if (context.delayChange) context.delayChange();
35845
+ if (context.timer) {
35827
35846
  clearTimeout(context.timer);
35828
- context.delayChange();
35829
35847
  context.timer = null;
35830
35848
  context.delayChange = null;
35831
35849
  }
@@ -50855,7 +50873,7 @@ var useForm = function useForm(props) {
50855
50873
  var _props$onChange;
50856
50874
  var newValue = typeof change === 'function' ? utils_immer_produce(context.value, change) : change;
50857
50875
  context.value = newValue;
50858
- (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, deepClone(context.value));
50876
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 || _props$onChange.call(props, newValue);
50859
50877
  });
50860
50878
  var scrollToField = use_persist_fn(function (name) {
50861
50879
  var _document;
@@ -55393,7 +55411,8 @@ var VirtualNode = function VirtualNode(props) {
55393
55411
  className: rootClass,
55394
55412
  dir: config.direction,
55395
55413
  style: {
55396
- paddingLeft: level * indent
55414
+ paddingLeft: level * indent,
55415
+ height: props.lineHeight
55397
55416
  },
55398
55417
  children: [$indents, /*#__PURE__*/(0,jsx_runtime.jsx)(tree_content, {
55399
55418
  virtual: true,
@@ -55677,7 +55696,8 @@ var TreeVirtual = function TreeVirtual(props) {
55677
55696
  onNodeClick: onNodeClick,
55678
55697
  onToggle: onToggle,
55679
55698
  onChange: onChange,
55680
- size: datum.size
55699
+ size: datum.size,
55700
+ lineHeight: lineHeight
55681
55701
  }, id);
55682
55702
  };
55683
55703
  return /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
@@ -56360,7 +56380,8 @@ var ColumnsList = function ColumnsList(props) {
56360
56380
  colNum: columns,
56361
56381
  lineHeight: lineHeight,
56362
56382
  rowsInView: itemsInView,
56363
- renderItem: renderItem
56383
+ renderItem: renderItem,
56384
+ paddingY: 4
56364
56385
  });
56365
56386
  };
56366
56387
  var renderSelectAll = function renderSelectAll() {
@@ -71859,7 +71880,7 @@ var upload_interface = __webpack_require__(8821);
71859
71880
 
71860
71881
 
71861
71882
  /* harmony default export */ var src_0 = ({
71862
- version: '3.7.8-beta.8'
71883
+ version: '3.7.8-fix.1'
71863
71884
  });
71864
71885
  }();
71865
71886
  /******/ return __webpack_exports__;