shineout 3.5.2-beta.9 → 3.5.2-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 +1 -1
- package/dist/shineout.js +33 -11
- 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
|
@@ -500,5 +500,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
500
500
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
501
501
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
502
502
|
var _default = exports.default = {
|
|
503
|
-
version: '3.5.2-
|
|
503
|
+
version: '3.5.2-fix.1'
|
|
504
504
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12002,7 +12002,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12002
12002
|
};
|
|
12003
12003
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12004
12004
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12005
|
-
/* harmony default export */ var version = ('3.5.2-
|
|
12005
|
+
/* harmony default export */ var version = ('3.5.2-fix.1');
|
|
12006
12006
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12007
12007
|
|
|
12008
12008
|
|
|
@@ -29026,6 +29026,25 @@ function getClosestScrollContainer(element) {
|
|
|
29026
29026
|
// 如果没有找到可滚动的祖先,返回 body 或 documentElement
|
|
29027
29027
|
return document.scrollingElement || document.documentElement;
|
|
29028
29028
|
}
|
|
29029
|
+
function getClosestFixedContainer(element) {
|
|
29030
|
+
if (!element) {
|
|
29031
|
+
return null;
|
|
29032
|
+
}
|
|
29033
|
+
var isFixable = function isFixable(el) {
|
|
29034
|
+
var style = window.getComputedStyle(el);
|
|
29035
|
+
return style.position === 'fixed';
|
|
29036
|
+
};
|
|
29037
|
+
|
|
29038
|
+
// 遍历父元素
|
|
29039
|
+
var parent = element.parentElement;
|
|
29040
|
+
while (parent) {
|
|
29041
|
+
if (isFixable(parent)) {
|
|
29042
|
+
return parent;
|
|
29043
|
+
}
|
|
29044
|
+
parent = parent.parentElement;
|
|
29045
|
+
}
|
|
29046
|
+
return null;
|
|
29047
|
+
}
|
|
29029
29048
|
function cssSupport(attr, value) {
|
|
29030
29049
|
if (is_isBrowser()) {
|
|
29031
29050
|
var element = document.createElement('div');
|
|
@@ -32925,6 +32944,7 @@ function getUidStr() {
|
|
|
32925
32944
|
}
|
|
32926
32945
|
;// CONCATENATED MODULE: ../hooks/src/utils/lazyload.ts
|
|
32927
32946
|
|
|
32947
|
+
|
|
32928
32948
|
var lazyload_throttle = 80;
|
|
32929
32949
|
var components = {};
|
|
32930
32950
|
var timeout = null;
|
|
@@ -32984,10 +33004,12 @@ function removeStack(id, removeListener) {
|
|
|
32984
33004
|
function getObserver(obj, id) {
|
|
32985
33005
|
var _obj$container = obj.container,
|
|
32986
33006
|
container = _obj$container === void 0 ? null : _obj$container,
|
|
33007
|
+
element = obj.element,
|
|
32987
33008
|
offset = obj.offset,
|
|
32988
33009
|
render = obj.render,
|
|
32989
33010
|
offscreen = obj.offscreen,
|
|
32990
33011
|
noRemove = obj.noRemove;
|
|
33012
|
+
var fixedContainer = getClosestFixedContainer(element);
|
|
32991
33013
|
var observer = new IntersectionObserver(function (entries) {
|
|
32992
33014
|
entries.forEach(function (en) {
|
|
32993
33015
|
if (en.isIntersecting || en.intersectionRatio > 0) {
|
|
@@ -32998,7 +33020,7 @@ function getObserver(obj, id) {
|
|
|
32998
33020
|
}
|
|
32999
33021
|
});
|
|
33000
33022
|
}, {
|
|
33001
|
-
root: container,
|
|
33023
|
+
root: fixedContainer || container,
|
|
33002
33024
|
rootMargin: "".concat(offset, "px")
|
|
33003
33025
|
});
|
|
33004
33026
|
obj.observer = observer;
|
|
@@ -33271,19 +33293,18 @@ function useInputAble(props) {
|
|
|
33271
33293
|
var render = useRender(syncValue);
|
|
33272
33294
|
var shouldUseState = delay || !control;
|
|
33273
33295
|
var value = shouldUseState ? stateValue : valuePo;
|
|
33274
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.
|
|
33275
|
-
if (context.timer) {
|
|
33276
|
-
clearTimeout(context.timer);
|
|
33277
|
-
context.timer = null;
|
|
33278
|
-
}
|
|
33296
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
33279
33297
|
if (delay && control && props.value !== stateValue) {
|
|
33280
33298
|
changeStateValue(props.value);
|
|
33299
|
+
} else if (context.timer) {
|
|
33300
|
+
clearTimeout(context.timer);
|
|
33301
|
+
context.timer = null;
|
|
33281
33302
|
}
|
|
33282
33303
|
}, [props.value, delay, control]);
|
|
33283
33304
|
var forceDelayChange = use_persist_fn(function () {
|
|
33284
|
-
if (context.
|
|
33305
|
+
if (context.delayChange) context.delayChange();
|
|
33306
|
+
if (context.timer) {
|
|
33285
33307
|
clearTimeout(context.timer);
|
|
33286
|
-
context.delayChange();
|
|
33287
33308
|
context.timer = null;
|
|
33288
33309
|
context.delayChange = null;
|
|
33289
33310
|
}
|
|
@@ -37097,7 +37118,8 @@ var Scroll = function Scroll(props) {
|
|
|
37097
37118
|
_props$defaultHeight = props.defaultHeight,
|
|
37098
37119
|
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
|
|
37099
37120
|
var _useResize = useResize({
|
|
37100
|
-
targetRef: containerRef
|
|
37121
|
+
targetRef: containerRef,
|
|
37122
|
+
timer: 0
|
|
37101
37123
|
}),
|
|
37102
37124
|
width = _useResize.width,
|
|
37103
37125
|
h = _useResize.height;
|
|
@@ -66445,7 +66467,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
66445
66467
|
|
|
66446
66468
|
|
|
66447
66469
|
/* harmony default export */ var src_0 = ({
|
|
66448
|
-
version: '3.5.2-
|
|
66470
|
+
version: '3.5.2-fix.1'
|
|
66449
66471
|
});
|
|
66450
66472
|
}();
|
|
66451
66473
|
/******/ return __webpack_exports__;
|