shineout 3.6.4-beta.7 → 3.6.4-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 +78 -28
- 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
|
@@ -514,5 +514,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
514
514
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
515
515
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
516
516
|
var _default = exports.default = {
|
|
517
|
-
version: '3.6.4-
|
|
517
|
+
version: '3.6.4-fix.1'
|
|
518
518
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -12217,7 +12217,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12217
12217
|
};
|
|
12218
12218
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12219
12219
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12220
|
-
/* harmony default export */ var version = ('3.6.4-
|
|
12220
|
+
/* harmony default export */ var version = ('3.6.4-fix.1');
|
|
12221
12221
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12222
12222
|
|
|
12223
12223
|
|
|
@@ -30383,6 +30383,61 @@ var useCheckElementBorderWidth = function useCheckElementBorderWidth(elementRef)
|
|
|
30383
30383
|
}, [getBorderWidth]);
|
|
30384
30384
|
return borderWidth;
|
|
30385
30385
|
};
|
|
30386
|
+
;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/check-element-size.ts
|
|
30387
|
+
|
|
30388
|
+
|
|
30389
|
+
var useCheckElementSize = function useCheckElementSize(targetElementRef) {
|
|
30390
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
30391
|
+
var enable = options.enable;
|
|
30392
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
|
30393
|
+
width: 0,
|
|
30394
|
+
height: 0
|
|
30395
|
+
}),
|
|
30396
|
+
_useState2 = slicedToArray_default()(_useState, 2),
|
|
30397
|
+
size = _useState2[0],
|
|
30398
|
+
setSize = _useState2[1];
|
|
30399
|
+
var lastSize = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
30400
|
+
width: 0,
|
|
30401
|
+
height: 0
|
|
30402
|
+
});
|
|
30403
|
+
var checkSize = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useCallback)(function () {
|
|
30404
|
+
if (targetElementRef.current) {
|
|
30405
|
+
var rect = targetElementRef.current.getBoundingClientRect();
|
|
30406
|
+
var newSize = {
|
|
30407
|
+
width: rect.width,
|
|
30408
|
+
height: rect.height
|
|
30409
|
+
};
|
|
30410
|
+
if (newSize.width !== lastSize.current.width || newSize.height !== lastSize.current.height) {
|
|
30411
|
+
setSize(newSize);
|
|
30412
|
+
lastSize.current = newSize;
|
|
30413
|
+
}
|
|
30414
|
+
}
|
|
30415
|
+
}, [targetElementRef]);
|
|
30416
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
30417
|
+
var _window;
|
|
30418
|
+
if (!enable) return;
|
|
30419
|
+
var element = targetElementRef.current;
|
|
30420
|
+
if (!element) return;
|
|
30421
|
+
|
|
30422
|
+
// 初始检查
|
|
30423
|
+
checkSize();
|
|
30424
|
+
var resizeObserver = null;
|
|
30425
|
+
if ((_window = window) !== null && _window !== void 0 && _window.ResizeObserver) {
|
|
30426
|
+
resizeObserver = new ResizeObserver(checkSize);
|
|
30427
|
+
resizeObserver.observe(element);
|
|
30428
|
+
}
|
|
30429
|
+
|
|
30430
|
+
// 清理函数
|
|
30431
|
+
return function () {
|
|
30432
|
+
var _resizeObserver;
|
|
30433
|
+
(_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 || _resizeObserver.disconnect();
|
|
30434
|
+
};
|
|
30435
|
+
}, [enable, targetElementRef, checkSize]);
|
|
30436
|
+
if (!enable || !targetElementRef) {
|
|
30437
|
+
return null;
|
|
30438
|
+
}
|
|
30439
|
+
return size;
|
|
30440
|
+
};
|
|
30386
30441
|
// EXTERNAL MODULE: ../../node_modules/.pnpm/react-fast-compare@3.2.2/node_modules/react-fast-compare/index.js
|
|
30387
30442
|
var react_fast_compare = __webpack_require__(5284);
|
|
30388
30443
|
var react_fast_compare_default = /*#__PURE__*/__webpack_require__.n(react_fast_compare);
|
|
@@ -30509,6 +30564,7 @@ var getCurrentCSSZoom = function getCurrentCSSZoom() {
|
|
|
30509
30564
|
|
|
30510
30565
|
|
|
30511
30566
|
|
|
30567
|
+
|
|
30512
30568
|
var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top', 'left', 'right'];
|
|
30513
30569
|
var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
|
|
30514
30570
|
var hideStyle = {
|
|
@@ -30563,6 +30619,9 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
30563
30619
|
var parentElBorderWidth = useCheckElementBorderWidth(parentElRef, {
|
|
30564
30620
|
direction: 'horizontal'
|
|
30565
30621
|
});
|
|
30622
|
+
var popupElSize = useCheckElementSize(popupElRef, {
|
|
30623
|
+
enable: show
|
|
30624
|
+
});
|
|
30566
30625
|
var adjustPosition = function adjustPosition(position) {
|
|
30567
30626
|
var winHeight = docSize.height;
|
|
30568
30627
|
if (!verticalPosition.includes(position)) return position;
|
|
@@ -30799,7 +30858,7 @@ var usePositionStyle = function usePositionStyle(config) {
|
|
|
30799
30858
|
// 当父元素的滚动容器滚动时,判断是否需要更新弹出层位置,包括是否隐藏弹出层(通过hideStyle隐藏,不是show状态)
|
|
30800
30859
|
context.prevParentPosition = parentElNewPosition;
|
|
30801
30860
|
});
|
|
30802
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(updateStyle, [show, position, absolute, updateKey, fixedWidth, parentElNewPosition]);
|
|
30861
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(updateStyle, [show, position, absolute, updateKey, fixedWidth, parentElNewPosition, popupElSize]);
|
|
30803
30862
|
return {
|
|
30804
30863
|
style: style
|
|
30805
30864
|
};
|
|
@@ -31592,11 +31651,11 @@ var Popover = function Popover(props) {
|
|
|
31592
31651
|
_React$useState2 = slicedToArray_default()(_React$useState, 2),
|
|
31593
31652
|
updateKey = _React$useState2[0],
|
|
31594
31653
|
setUpdateKey = _React$useState2[1];
|
|
31595
|
-
var handleUpdateKey = function
|
|
31654
|
+
var handleUpdateKey = usePersistFn(function () {
|
|
31596
31655
|
setUpdateKey(function (prev) {
|
|
31597
31656
|
return (prev + 1) % 2;
|
|
31598
31657
|
});
|
|
31599
|
-
};
|
|
31658
|
+
});
|
|
31600
31659
|
var bindEvents = function bindEvents() {
|
|
31601
31660
|
var _window;
|
|
31602
31661
|
var targetEl = targetRef.current;
|
|
@@ -31609,9 +31668,9 @@ var Popover = function Popover(props) {
|
|
|
31609
31668
|
targetEl.addEventListener('click', closePop);
|
|
31610
31669
|
}
|
|
31611
31670
|
(_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
|
|
31612
|
-
|
|
31613
|
-
|
|
31614
|
-
scrollContainer.addEventListener('scroll', handleUpdateKey);
|
|
31671
|
+
if (props.adjust) {
|
|
31672
|
+
var scrollContainer = getClosestScrollContainer(targetEl);
|
|
31673
|
+
if (scrollContainer) scrollContainer.addEventListener('scroll', handleUpdateKey);
|
|
31615
31674
|
}
|
|
31616
31675
|
};
|
|
31617
31676
|
var unbindEvents = function unbindEvents() {
|
|
@@ -31624,9 +31683,9 @@ var Popover = function Popover(props) {
|
|
|
31624
31683
|
if (events.onClick) targetEl.removeEventListener('click', events.onClick);
|
|
31625
31684
|
targetEl.removeEventListener('click', closePop);
|
|
31626
31685
|
(_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
|
|
31627
|
-
|
|
31628
|
-
|
|
31629
|
-
scrollContainer.
|
|
31686
|
+
if (props.adjust) {
|
|
31687
|
+
var scrollContainer = getClosestScrollContainer(targetEl);
|
|
31688
|
+
if (scrollContainer) scrollContainer.removeEventListener('scroll', handleUpdateKey);
|
|
31630
31689
|
}
|
|
31631
31690
|
};
|
|
31632
31691
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
@@ -34857,19 +34916,18 @@ function useInputAble(props) {
|
|
|
34857
34916
|
var render = useRender(syncValue);
|
|
34858
34917
|
var shouldUseState = delay || !control;
|
|
34859
34918
|
var value = shouldUseState ? stateValue : valuePo;
|
|
34860
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.
|
|
34861
|
-
if (context.timer) {
|
|
34862
|
-
clearTimeout(context.timer);
|
|
34863
|
-
context.timer = null;
|
|
34864
|
-
}
|
|
34919
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
|
|
34865
34920
|
if (delay && control && props.value !== stateValue) {
|
|
34866
34921
|
changeStateValue(props.value);
|
|
34922
|
+
} else if (context.timer) {
|
|
34923
|
+
clearTimeout(context.timer);
|
|
34924
|
+
context.timer = null;
|
|
34867
34925
|
}
|
|
34868
34926
|
}, [props.value, delay, control]);
|
|
34869
34927
|
var forceDelayChange = use_persist_fn(function () {
|
|
34870
|
-
if (context.
|
|
34928
|
+
if (context.delayChange) context.delayChange();
|
|
34929
|
+
if (context.timer) {
|
|
34871
34930
|
clearTimeout(context.timer);
|
|
34872
|
-
context.delayChange();
|
|
34873
34931
|
context.timer = null;
|
|
34874
34932
|
context.delayChange = null;
|
|
34875
34933
|
}
|
|
@@ -50235,11 +50293,11 @@ var Tooltip = function Tooltip(props) {
|
|
|
50235
50293
|
_React$useState2 = slicedToArray_default()(_React$useState, 2),
|
|
50236
50294
|
updateKey = _React$useState2[0],
|
|
50237
50295
|
setUpdateKey = _React$useState2[1];
|
|
50238
|
-
var handleUpdateKey = function
|
|
50296
|
+
var handleUpdateKey = usePersistFn(function () {
|
|
50239
50297
|
setUpdateKey(function (prev) {
|
|
50240
50298
|
return (prev + 1) % 2;
|
|
50241
50299
|
});
|
|
50242
|
-
};
|
|
50300
|
+
});
|
|
50243
50301
|
var bindEvents = function bindEvents() {
|
|
50244
50302
|
var _window;
|
|
50245
50303
|
var targetEl = targetRef.current;
|
|
@@ -50248,10 +50306,6 @@ var Tooltip = function Tooltip(props) {
|
|
|
50248
50306
|
if (events.onMouseLeave) targetEl.addEventListener('mouseleave', events.onMouseLeave);
|
|
50249
50307
|
if (events.onClick) targetEl.addEventListener('click', events.onClick);
|
|
50250
50308
|
(_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
|
|
50251
|
-
var scrollContainer = getClosestScrollContainer(targetEl);
|
|
50252
|
-
if (scrollContainer) {
|
|
50253
|
-
scrollContainer.addEventListener('scroll', handleUpdateKey);
|
|
50254
|
-
}
|
|
50255
50309
|
};
|
|
50256
50310
|
var unbindEvents = function unbindEvents() {
|
|
50257
50311
|
var _window2;
|
|
@@ -50263,10 +50317,6 @@ var Tooltip = function Tooltip(props) {
|
|
|
50263
50317
|
if (events.onClick) targetEl.removeEventListener('click', events.onClick);
|
|
50264
50318
|
targetEl.removeEventListener('click', closePop);
|
|
50265
50319
|
(_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
|
|
50266
|
-
var scrollContainer = getClosestScrollContainer(targetEl);
|
|
50267
|
-
if (scrollContainer) {
|
|
50268
|
-
scrollContainer.addEventListener('scroll', handleUpdateKey);
|
|
50269
|
-
}
|
|
50270
50320
|
};
|
|
50271
50321
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
50272
50322
|
if (!persistent) return;
|
|
@@ -69924,7 +69974,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
69924
69974
|
|
|
69925
69975
|
|
|
69926
69976
|
/* harmony default export */ var src_0 = ({
|
|
69927
|
-
version: '3.6.4-
|
|
69977
|
+
version: '3.6.4-fix.1'
|
|
69928
69978
|
});
|
|
69929
69979
|
}();
|
|
69930
69980
|
/******/ return __webpack_exports__;
|