shineout 3.4.5-beta.2 → 3.4.5-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
@@ -492,5 +492,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
492
492
  // 此文件由脚本自动生成,请勿直接修改。
493
493
  // This file was generated automatically by a script. Please do not modify it directly.
494
494
  var _default = exports.default = {
495
- version: '3.4.5-beta.2'
495
+ version: '3.4.5-beta.3'
496
496
  };
package/dist/shineout.js CHANGED
@@ -11984,7 +11984,7 @@ var handleStyle = function handleStyle(style) {
11984
11984
  };
11985
11985
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11986
11986
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11987
- /* harmony default export */ var version = ('3.4.5-beta.2');
11987
+ /* harmony default export */ var version = ('3.4.5-beta.3');
11988
11988
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11989
11989
 
11990
11990
 
@@ -34152,14 +34152,22 @@ var CheckboxWithContext = function CheckboxWithContext(props) {
34152
34152
 
34153
34153
 
34154
34154
 
34155
+
34155
34156
  var Item = function Item(props) {
34156
34157
  var _props$jssStyle, _props$jssStyle$cardG;
34157
34158
  var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(CardGroupContext),
34158
34159
  container = _useContext.container;
34159
34160
  var classes = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$cardG = _props$jssStyle.cardGroup) === null || _props$jssStyle$cardG === void 0 ? void 0 : _props$jssStyle$cardG.call(_props$jssStyle);
34160
- var _useInView = use_in_view(),
34161
+ var _useInView = use_in_view({
34162
+ root: container,
34163
+ rootMargin: "".concat((container === null || container === void 0 ? void 0 : container.clientHeight) || 100, "px")
34164
+ }),
34161
34165
  itemRef = _useInView.ref,
34162
34166
  isInView = _useInView.isInView;
34167
+ var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
34168
+ _useState2 = slicedToArray_default()(_useState, 2),
34169
+ itemHeight = _useState2[0],
34170
+ setItemHeight = _useState2[1];
34163
34171
  var handleChange = usePersistFn(function (_, checked) {
34164
34172
  if (props.onChange) props.onChange(checked, props.value);
34165
34173
  });
@@ -34184,11 +34192,22 @@ var Item = function Item(props) {
34184
34192
  className: classes === null || classes === void 0 ? void 0 : classes.checkbox
34185
34193
  })]
34186
34194
  });
34187
- var itemStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
34188
- return objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
34195
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
34196
+ if (isInView) {
34197
+ var _itemRef$current;
34198
+ setItemHeight(((_itemRef$current = itemRef.current) === null || _itemRef$current === void 0 ? void 0 : _itemRef$current.clientHeight) || 0);
34199
+ }
34200
+ }, [isInView]);
34201
+ var hiddenStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
34202
+ return isInView ? {} : {
34203
+ height: itemHeight,
34204
+ overflow: 'hidden',
34189
34205
  visibility: isInView ? 'visible' : 'hidden'
34190
- });
34191
- }, [isInView, props.style]);
34206
+ };
34207
+ }, [isInView, itemHeight]);
34208
+ var itemStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
34209
+ return objectSpread2_default()(objectSpread2_default()({}, props.style), hiddenStyle);
34210
+ }, [hiddenStyle, props.style]);
34192
34211
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
34193
34212
  ref: itemRef,
34194
34213
  className: cls,
@@ -65366,7 +65385,7 @@ var upload_interface = __webpack_require__(8821);
65366
65385
 
65367
65386
 
65368
65387
  /* harmony default export */ var src_0 = ({
65369
- version: '3.4.5-beta.2'
65388
+ version: '3.4.5-beta.3'
65370
65389
  });
65371
65390
  }();
65372
65391
  /******/ return __webpack_exports__;