shineout 3.5.2-beta.8 → 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 +47 -12
- 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;
|
|
@@ -33246,6 +33268,7 @@ function useInputAble(props) {
|
|
|
33246
33268
|
var _props$value;
|
|
33247
33269
|
var valuePo = props.value,
|
|
33248
33270
|
onChange = props.onChange,
|
|
33271
|
+
onSameChange = props.onSameChange,
|
|
33249
33272
|
control = props.control,
|
|
33250
33273
|
beforeChange = props.beforeChange,
|
|
33251
33274
|
delay = props.delay;
|
|
@@ -33270,19 +33293,18 @@ function useInputAble(props) {
|
|
|
33270
33293
|
var render = useRender(syncValue);
|
|
33271
33294
|
var shouldUseState = delay || !control;
|
|
33272
33295
|
var value = shouldUseState ? stateValue : valuePo;
|
|
33273
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.
|
|
33274
|
-
if (context.timer) {
|
|
33275
|
-
clearTimeout(context.timer);
|
|
33276
|
-
context.timer = null;
|
|
33277
|
-
}
|
|
33296
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
33278
33297
|
if (delay && control && props.value !== stateValue) {
|
|
33279
33298
|
changeStateValue(props.value);
|
|
33299
|
+
} else if (context.timer) {
|
|
33300
|
+
clearTimeout(context.timer);
|
|
33301
|
+
context.timer = null;
|
|
33280
33302
|
}
|
|
33281
33303
|
}, [props.value, delay, control]);
|
|
33282
33304
|
var forceDelayChange = use_persist_fn(function () {
|
|
33283
|
-
if (context.
|
|
33305
|
+
if (context.delayChange) context.delayChange();
|
|
33306
|
+
if (context.timer) {
|
|
33284
33307
|
clearTimeout(context.timer);
|
|
33285
|
-
context.delayChange();
|
|
33286
33308
|
context.timer = null;
|
|
33287
33309
|
context.delayChange = null;
|
|
33288
33310
|
}
|
|
@@ -33293,7 +33315,10 @@ function useInputAble(props) {
|
|
|
33293
33315
|
}
|
|
33294
33316
|
var vv = v;
|
|
33295
33317
|
if (other.length === 0 || props.filterSameChange) {
|
|
33296
|
-
if (shallowEqual(v, value))
|
|
33318
|
+
if (shallowEqual(v, value)) {
|
|
33319
|
+
if (onSameChange) onSameChange(v);
|
|
33320
|
+
return;
|
|
33321
|
+
}
|
|
33297
33322
|
}
|
|
33298
33323
|
if (isFunc(beforeChange)) {
|
|
33299
33324
|
var temp = beforeChange(v);
|
|
@@ -37093,7 +37118,8 @@ var Scroll = function Scroll(props) {
|
|
|
37093
37118
|
_props$defaultHeight = props.defaultHeight,
|
|
37094
37119
|
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
|
|
37095
37120
|
var _useResize = useResize({
|
|
37096
|
-
targetRef: containerRef
|
|
37121
|
+
targetRef: containerRef,
|
|
37122
|
+
timer: 0
|
|
37097
37123
|
}),
|
|
37098
37124
|
width = _useResize.width,
|
|
37099
37125
|
h = _useResize.height;
|
|
@@ -50533,6 +50559,7 @@ var useSelect = function useSelect(props) {
|
|
|
50533
50559
|
prediction = props.prediction,
|
|
50534
50560
|
valueProp = props.value,
|
|
50535
50561
|
onChangeProp = props.onChange,
|
|
50562
|
+
onSameChange = props.onSameChange,
|
|
50536
50563
|
filterSameChange = props.filterSameChange,
|
|
50537
50564
|
noCache = props.noCache;
|
|
50538
50565
|
var _useInputAble = useInputAble({
|
|
@@ -50541,6 +50568,7 @@ var useSelect = function useSelect(props) {
|
|
|
50541
50568
|
defaultValue: defaultValue,
|
|
50542
50569
|
beforeChange: beforeChange,
|
|
50543
50570
|
onChange: onChangeProp,
|
|
50571
|
+
onSameChange: onSameChange,
|
|
50544
50572
|
filterSameChange: filterSameChange
|
|
50545
50573
|
}),
|
|
50546
50574
|
value = _useInputAble.value,
|
|
@@ -52491,6 +52519,12 @@ function Select(props0) {
|
|
|
52491
52519
|
if (props.absolute === undefined) return;
|
|
52492
52520
|
setAbsoluteListUpdateKey(value);
|
|
52493
52521
|
});
|
|
52522
|
+
var handleSameChange = function handleSameChange() {
|
|
52523
|
+
var shouldFocus = showInput && props.reFocus;
|
|
52524
|
+
if (!multiple && !shouldFocus) {
|
|
52525
|
+
closePop();
|
|
52526
|
+
}
|
|
52527
|
+
};
|
|
52494
52528
|
var _useSelect = use_select({
|
|
52495
52529
|
value: valueProp,
|
|
52496
52530
|
data: data,
|
|
@@ -52506,6 +52540,7 @@ function Select(props0) {
|
|
|
52506
52540
|
prediction: prediction,
|
|
52507
52541
|
beforeChange: beforeChange,
|
|
52508
52542
|
onChange: handleSelectChange,
|
|
52543
|
+
onSameChange: handleSameChange,
|
|
52509
52544
|
filterSameChange: filterSameChange,
|
|
52510
52545
|
noCache: noCache
|
|
52511
52546
|
}),
|
|
@@ -66432,7 +66467,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
66432
66467
|
|
|
66433
66468
|
|
|
66434
66469
|
/* harmony default export */ var src_0 = ({
|
|
66435
|
-
version: '3.5.2-
|
|
66470
|
+
version: '3.5.2-fix.1'
|
|
66436
66471
|
});
|
|
66437
66472
|
}();
|
|
66438
66473
|
/******/ return __webpack_exports__;
|