indicator-ui 0.0.168 → 0.0.170
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/dist/index.css +1 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11718,8 +11718,26 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11718
11718
|
function SlideTransition({ children, animation, className, additionStyles, style, }) {
|
|
11719
11719
|
const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
11720
11720
|
const contentRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
11721
|
+
const [clientHeight, setClientHeight] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(contentRef.current?.clientHeight);
|
|
11721
11722
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
11722
|
-
const
|
|
11723
|
+
const element = contentRef.current;
|
|
11724
|
+
if (!element)
|
|
11725
|
+
return;
|
|
11726
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
11727
|
+
const entry = entries[0];
|
|
11728
|
+
setClientHeight(entry.target.clientHeight);
|
|
11729
|
+
});
|
|
11730
|
+
resizeObserver.observe(element);
|
|
11731
|
+
return () => resizeObserver.disconnect();
|
|
11732
|
+
}, []);
|
|
11733
|
+
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
11734
|
+
const isShowAnimation = animation === 'show' || animation === 'enter-up' || animation === 'enter-down';
|
|
11735
|
+
if (isShowAnimation && clientHeight != null) {
|
|
11736
|
+
wrapperRef.current.style.height = clientHeight + 'px';
|
|
11737
|
+
}
|
|
11738
|
+
}, [clientHeight]);
|
|
11739
|
+
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
11740
|
+
const contentClientHeight = clientHeight;
|
|
11723
11741
|
const isShowAnimation = animation === 'show' || animation === 'enter-up' || animation === 'enter-down';
|
|
11724
11742
|
if (contentClientHeight != null) {
|
|
11725
11743
|
wrapperRef.current.style.height = contentClientHeight + 'px';
|