indicator-ui 0.0.44 → 0.0.45

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.js CHANGED
@@ -10126,6 +10126,10 @@ __webpack_require__.r(__webpack_exports__);
10126
10126
  function SlideTransition({ children, animation, additionStyles, animationOptions = { duration: 300, easing: 'ease-in-out', fill: 'forwards' } }) {
10127
10127
  const mainRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
10128
10128
  const animateDropWrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
10129
+ const lastClientHeight = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(undefined);
10130
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
10131
+ lastClientHeight.current = mainRef.current.clientHeight;
10132
+ }, []);
10129
10133
  const getConfig = (type) => {
10130
10134
  if (type in animationOptions) {
10131
10135
  return animationOptions[type];
@@ -10134,29 +10138,37 @@ function SlideTransition({ children, animation, additionStyles, animationOptions
10134
10138
  };
10135
10139
  const animateExitDown = () => {
10136
10140
  const animateConfig = getConfig('exit-down');
10137
- animateDropWrapperRef.current.animate([
10141
+ const animateDropWrapper = animateDropWrapperRef.current.animate([
10138
10142
  { transform: 'scaleY(1)', transformOrigin: 'bottom' },
10139
- { transform: 'scaleY(0)', transformOrigin: 'bottom', display: 'none' },
10143
+ { transform: 'scaleY(0)', transformOrigin: 'bottom' },
10140
10144
  ], animateConfig);
10141
10145
  mainRef.current.animate([
10142
10146
  { transform: 'translateY(0)' },
10143
10147
  { transform: 'translateY(100%)' },
10144
10148
  ], animateConfig);
10149
+ animateDropWrapper.finished.then(() => {
10150
+ animateDropWrapperRef.current.style.display = `none`;
10151
+ });
10145
10152
  };
10146
10153
  const animateExitUp = () => {
10147
10154
  const mainHeight = mainRef.current.clientHeight;
10155
+ lastClientHeight.current = mainHeight;
10148
10156
  const animateConfig = getConfig('exit-up');
10149
- animateDropWrapperRef.current.animate([
10157
+ const animateDropWrapper = animateDropWrapperRef.current.animate([
10150
10158
  { height: `${mainHeight}px` },
10151
- { height: `0`, display: 'none' },
10159
+ { height: `0` },
10152
10160
  ], animateConfig);
10153
10161
  mainRef.current.animate([
10154
10162
  { transform: 'translateY(0)' },
10155
10163
  { transform: 'translateY(-100%)' },
10156
10164
  ], animateConfig);
10165
+ animateDropWrapper.finished.then(() => {
10166
+ animateDropWrapperRef.current.style.display = `none`;
10167
+ });
10157
10168
  };
10158
10169
  const animateEnterDown = () => {
10159
- const animateConfig = getConfig('exit-down');
10170
+ const animateConfig = getConfig('enter-down');
10171
+ animateDropWrapperRef.current.style.display = 'block';
10160
10172
  animateDropWrapperRef.current.animate([
10161
10173
  { transform: 'scaleY(0)', transformOrigin: 'bottom', display: 'block' },
10162
10174
  { transform: 'scaleY(1)', transformOrigin: 'bottom' },
@@ -10167,10 +10179,11 @@ function SlideTransition({ children, animation, additionStyles, animationOptions
10167
10179
  ], animateConfig);
10168
10180
  };
10169
10181
  const animateEnterUp = () => {
10170
- const mainHeight = mainRef.current.clientHeight;
10171
- const animateConfig = getConfig('exit-up');
10182
+ const animateConfig = getConfig('enter-up');
10183
+ animateDropWrapperRef.current.style.display = 'block';
10184
+ const mainHeight = mainRef.current.clientHeight || lastClientHeight.current;
10172
10185
  animateDropWrapperRef.current.animate([
10173
- { height: `0`, display: 'block' },
10186
+ { height: `0` },
10174
10187
  { height: `${mainHeight}px` },
10175
10188
  ], animateConfig);
10176
10189
  mainRef.current.animate([