indicator-ui 0.0.45 → 0.0.47
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
|
@@ -10119,6 +10119,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
10119
10119
|
*
|
|
10120
10120
|
* ```'exit-up'``` - производит анимацию скрытия сверху.
|
|
10121
10121
|
*
|
|
10122
|
+
* ```'hide'``` - изначально скрывает элемент.
|
|
10123
|
+
*
|
|
10124
|
+
* ```'show'``` - изначально показывает элемент.
|
|
10125
|
+
*
|
|
10122
10126
|
* ---
|
|
10123
10127
|
* Учтите, что анимации **"снизу"** сужают компонент, поэтому он будет деформироваться.
|
|
10124
10128
|
* При высокой (автор проводил тесты на 300ms) скорости анимации это незаметно (если вы не Флеш).
|
|
@@ -10129,6 +10133,12 @@ function SlideTransition({ children, animation, additionStyles, animationOptions
|
|
|
10129
10133
|
const lastClientHeight = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(undefined);
|
|
10130
10134
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
10131
10135
|
lastClientHeight.current = mainRef.current.clientHeight;
|
|
10136
|
+
if (animation === 'hide') {
|
|
10137
|
+
animateDropWrapperRef.current.style.display = 'none';
|
|
10138
|
+
}
|
|
10139
|
+
else if (animation === 'show') {
|
|
10140
|
+
animateDropWrapperRef.current.style.display = 'block';
|
|
10141
|
+
}
|
|
10132
10142
|
}, []);
|
|
10133
10143
|
const getConfig = (type) => {
|
|
10134
10144
|
if (type in animationOptions) {
|
|
@@ -10138,58 +10148,68 @@ function SlideTransition({ children, animation, additionStyles, animationOptions
|
|
|
10138
10148
|
};
|
|
10139
10149
|
const animateExitDown = () => {
|
|
10140
10150
|
const animateConfig = getConfig('exit-down');
|
|
10141
|
-
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10151
|
+
if (animateDropWrapperRef.current && mainRef.current) {
|
|
10152
|
+
animateDropWrapperRef.current.style.display = 'block';
|
|
10153
|
+
const animateDropWrapper = animateDropWrapperRef.current.animate([
|
|
10154
|
+
{ transform: 'scaleY(1)', transformOrigin: 'bottom' },
|
|
10155
|
+
{ transform: 'scaleY(0)', transformOrigin: 'bottom' },
|
|
10156
|
+
], animateConfig);
|
|
10157
|
+
mainRef.current.animate([
|
|
10158
|
+
{ transform: 'translateY(0)' },
|
|
10159
|
+
{ transform: 'translateY(100%)' },
|
|
10160
|
+
], animateConfig);
|
|
10161
|
+
animateDropWrapper.finished.then(() => {
|
|
10162
|
+
animateDropWrapperRef.current.style.display = `none`;
|
|
10163
|
+
});
|
|
10164
|
+
}
|
|
10152
10165
|
};
|
|
10153
10166
|
const animateExitUp = () => {
|
|
10154
|
-
const mainHeight = mainRef.current.clientHeight;
|
|
10155
|
-
lastClientHeight.current = mainHeight;
|
|
10156
10167
|
const animateConfig = getConfig('exit-up');
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
+
if (animateDropWrapperRef.current && mainRef.current) {
|
|
10169
|
+
const mainHeight = mainRef.current.clientHeight;
|
|
10170
|
+
animateDropWrapperRef.current.style.display = 'block';
|
|
10171
|
+
lastClientHeight.current = mainHeight;
|
|
10172
|
+
const animateDropWrapper = animateDropWrapperRef.current.animate([
|
|
10173
|
+
{ height: `${mainHeight}px` },
|
|
10174
|
+
{ height: `0` },
|
|
10175
|
+
], animateConfig);
|
|
10176
|
+
mainRef.current.animate([
|
|
10177
|
+
{ transform: 'translateY(0)' },
|
|
10178
|
+
{ transform: 'translateY(-100%)' },
|
|
10179
|
+
], animateConfig);
|
|
10180
|
+
animateDropWrapper.finished.then(() => {
|
|
10181
|
+
animateDropWrapperRef.current.style.display = `none`;
|
|
10182
|
+
});
|
|
10183
|
+
}
|
|
10168
10184
|
};
|
|
10169
10185
|
const animateEnterDown = () => {
|
|
10170
10186
|
const animateConfig = getConfig('enter-down');
|
|
10171
|
-
animateDropWrapperRef.current.
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10187
|
+
if (animateDropWrapperRef.current && mainRef.current) {
|
|
10188
|
+
animateDropWrapperRef.current.style.display = 'block';
|
|
10189
|
+
animateDropWrapperRef.current.animate([
|
|
10190
|
+
{ transform: 'scaleY(0)', transformOrigin: 'bottom', display: 'block' },
|
|
10191
|
+
{ transform: 'scaleY(1)', transformOrigin: 'bottom' },
|
|
10192
|
+
], animateConfig);
|
|
10193
|
+
mainRef.current.animate([
|
|
10194
|
+
{ transform: 'translateY(100%)' },
|
|
10195
|
+
{ transform: 'translateY(0)' },
|
|
10196
|
+
], animateConfig);
|
|
10197
|
+
}
|
|
10180
10198
|
};
|
|
10181
10199
|
const animateEnterUp = () => {
|
|
10182
10200
|
const animateConfig = getConfig('enter-up');
|
|
10183
|
-
animateDropWrapperRef.current.
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10201
|
+
if (animateDropWrapperRef.current && mainRef.current) {
|
|
10202
|
+
animateDropWrapperRef.current.style.display = 'block';
|
|
10203
|
+
const mainHeight = mainRef.current.clientHeight || lastClientHeight.current;
|
|
10204
|
+
animateDropWrapperRef.current.animate([
|
|
10205
|
+
{ height: `0` },
|
|
10206
|
+
{ height: `${mainHeight}px` },
|
|
10207
|
+
], animateConfig);
|
|
10208
|
+
mainRef.current.animate([
|
|
10209
|
+
{ transform: 'translateY(-100%)' },
|
|
10210
|
+
{ transform: 'translateY(0)' },
|
|
10211
|
+
], animateConfig);
|
|
10212
|
+
}
|
|
10193
10213
|
};
|
|
10194
10214
|
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
10195
10215
|
switch (animation) {
|