shineout 3.4.4 → 3.4.5-beta.2
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 +1 -1
- package/dist/shineout.js +80 -6
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +5 -5
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.
|
|
495
|
+
version: '3.4.5-beta.2'
|
|
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.
|
|
11987
|
+
/* harmony default export */ var version = ('3.4.5-beta.2');
|
|
11988
11988
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
11989
11989
|
|
|
11990
11990
|
|
|
@@ -31638,7 +31638,9 @@ var useFormFooter = function useFormFooter() {
|
|
|
31638
31638
|
var Card = function Card(props) {
|
|
31639
31639
|
var _props$jssStyle, _props$jssStyle$card, _props$id;
|
|
31640
31640
|
var _props$style = props.style,
|
|
31641
|
-
style = _props$style === void 0 ? {} : _props$style
|
|
31641
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
31642
|
+
_props$defaultCollaps = props.defaultCollapsed,
|
|
31643
|
+
defaultCollapsed = _props$defaultCollaps === void 0 ? true : _props$defaultCollaps;
|
|
31642
31644
|
var cardClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$card = _props$jssStyle.card) === null || _props$jssStyle$card === void 0 ? void 0 : _props$jssStyle$card.call(_props$jssStyle);
|
|
31643
31645
|
var panelRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
31644
31646
|
var forceUpdate = useRender();
|
|
@@ -31646,7 +31648,7 @@ var Card = function Card(props) {
|
|
|
31646
31648
|
id: undefined
|
|
31647
31649
|
}),
|
|
31648
31650
|
context = _useRef.current;
|
|
31649
|
-
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
31651
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(defaultCollapsed),
|
|
31650
31652
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
31651
31653
|
collapsed = _useState2[0],
|
|
31652
31654
|
setCollapsed = _useState2[1];
|
|
@@ -32112,6 +32114,67 @@ var card_group_jssStyle = {
|
|
|
32112
32114
|
jssStyle: card_group_jssStyle
|
|
32113
32115
|
}, props));
|
|
32114
32116
|
});
|
|
32117
|
+
;// CONCATENATED MODULE: ../hooks/src/common/use-in-view/use-in-view.ts
|
|
32118
|
+
|
|
32119
|
+
|
|
32120
|
+
var useInView = function useInView() {
|
|
32121
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32122
|
+
var elementRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
32123
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
32124
|
+
_useState2 = slicedToArray_default()(_useState, 2),
|
|
32125
|
+
isInView = _useState2[0],
|
|
32126
|
+
setIsInView = _useState2[1];
|
|
32127
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
32128
|
+
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
32129
|
+
wasInView = _useState4[0],
|
|
32130
|
+
setWasInView = _useState4[1];
|
|
32131
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
32132
|
+
var element = elementRef.current;
|
|
32133
|
+
if (!element) return;
|
|
32134
|
+
var observer = new IntersectionObserver(function (_ref) {
|
|
32135
|
+
var _ref2 = slicedToArray_default()(_ref, 1),
|
|
32136
|
+
entry = _ref2[0];
|
|
32137
|
+
var inView = entry.isIntersecting;
|
|
32138
|
+
setIsInView(inView);
|
|
32139
|
+
if (inView) {
|
|
32140
|
+
setWasInView(true);
|
|
32141
|
+
// 如果设置了 once 选项,且元素已经出现过,则取消观察
|
|
32142
|
+
if (options.once) {
|
|
32143
|
+
observer.disconnect();
|
|
32144
|
+
}
|
|
32145
|
+
}
|
|
32146
|
+
}, {
|
|
32147
|
+
root: options.root || null,
|
|
32148
|
+
rootMargin: options.rootMargin || '0px',
|
|
32149
|
+
threshold: options.threshold || 0
|
|
32150
|
+
});
|
|
32151
|
+
observer.observe(element);
|
|
32152
|
+
return function () {
|
|
32153
|
+
observer.disconnect();
|
|
32154
|
+
};
|
|
32155
|
+
}, [options.root, options.rootMargin, options.threshold, options.once]);
|
|
32156
|
+
return {
|
|
32157
|
+
ref: elementRef,
|
|
32158
|
+
isInView: isInView,
|
|
32159
|
+
wasInView: wasInView
|
|
32160
|
+
};
|
|
32161
|
+
};
|
|
32162
|
+
/* harmony default export */ var use_in_view = (useInView);
|
|
32163
|
+
|
|
32164
|
+
// 使用示例
|
|
32165
|
+
// const Example = () => {
|
|
32166
|
+
// const { ref, isInView } = useInView({
|
|
32167
|
+
// threshold: 0.5,
|
|
32168
|
+
// rootMargin: '50px',
|
|
32169
|
+
// once: true
|
|
32170
|
+
// });
|
|
32171
|
+
|
|
32172
|
+
// return (
|
|
32173
|
+
// <div ref={ref}>
|
|
32174
|
+
// {isInView ? '元素在视窗中' : '元素不在视窗中'}
|
|
32175
|
+
// </div>
|
|
32176
|
+
// );
|
|
32177
|
+
// };
|
|
32115
32178
|
;// CONCATENATED MODULE: ../hooks/src/utils/uid.ts
|
|
32116
32179
|
function generateUUID() {
|
|
32117
32180
|
var c = crypto || typeof window !== 'undefined' && window.crypto; // 获取加密库
|
|
@@ -32267,7 +32330,7 @@ var Lazyload = function Lazyload(props) {
|
|
|
32267
32330
|
lazyload_removeStack(lazyId);
|
|
32268
32331
|
};
|
|
32269
32332
|
}, []);
|
|
32270
|
-
if (ready) return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
32333
|
+
if (ready && props.isInView) return /*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment, {
|
|
32271
32334
|
children: props.children
|
|
32272
32335
|
});
|
|
32273
32336
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
@@ -34088,11 +34151,15 @@ var CheckboxWithContext = function CheckboxWithContext(props) {
|
|
|
34088
34151
|
|
|
34089
34152
|
|
|
34090
34153
|
|
|
34154
|
+
|
|
34091
34155
|
var Item = function Item(props) {
|
|
34092
34156
|
var _props$jssStyle, _props$jssStyle$cardG;
|
|
34093
34157
|
var _useContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(CardGroupContext),
|
|
34094
34158
|
container = _useContext.container;
|
|
34095
34159
|
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
|
+
itemRef = _useInView.ref,
|
|
34162
|
+
isInView = _useInView.isInView;
|
|
34096
34163
|
var handleChange = usePersistFn(function (_, checked) {
|
|
34097
34164
|
if (props.onChange) props.onChange(checked, props.value);
|
|
34098
34165
|
});
|
|
@@ -34102,6 +34169,7 @@ var Item = function Item(props) {
|
|
|
34102
34169
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(lazyload, {
|
|
34103
34170
|
container: container,
|
|
34104
34171
|
placeholder: props.placeholder,
|
|
34172
|
+
isInView: isInView,
|
|
34105
34173
|
children: content
|
|
34106
34174
|
});
|
|
34107
34175
|
};
|
|
@@ -34116,9 +34184,15 @@ var Item = function Item(props) {
|
|
|
34116
34184
|
className: classes === null || classes === void 0 ? void 0 : classes.checkbox
|
|
34117
34185
|
})]
|
|
34118
34186
|
});
|
|
34187
|
+
var itemStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
34188
|
+
return objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
|
|
34189
|
+
visibility: isInView ? 'visible' : 'hidden'
|
|
34190
|
+
});
|
|
34191
|
+
}, [isInView, props.style]);
|
|
34119
34192
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
34193
|
+
ref: itemRef,
|
|
34120
34194
|
className: cls,
|
|
34121
|
-
style:
|
|
34195
|
+
style: itemStyle,
|
|
34122
34196
|
children: renderChildren(content)
|
|
34123
34197
|
});
|
|
34124
34198
|
};
|
|
@@ -65292,7 +65366,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
65292
65366
|
|
|
65293
65367
|
|
|
65294
65368
|
/* harmony default export */ var src_0 = ({
|
|
65295
|
-
version: '3.4.
|
|
65369
|
+
version: '3.4.5-beta.2'
|
|
65296
65370
|
});
|
|
65297
65371
|
}();
|
|
65298
65372
|
/******/ return __webpack_exports__;
|