indicator-ui 0.0.166 → 0.0.168
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
|
@@ -8561,7 +8561,7 @@ function DropdownItem({ size = 'small', selected = false, disabled = false, supp
|
|
|
8561
8561
|
[_styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.widthHug]: width === 'hug',
|
|
8562
8562
|
[_styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.small]: size === 'small',
|
|
8563
8563
|
[_styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.medium]: size === 'medium',
|
|
8564
|
-
}), children: [showIcon != null ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.showIcon, children: showIcon }) : undefined, user
|
|
8564
|
+
}), children: [showIcon != null ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.showIcon, children: showIcon }) : undefined, user ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_ui__WEBPACK_IMPORTED_MODULE_2__.UserPick, { url: user, size: '20' }) : undefined, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: _styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.main, children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.text, children: text }), getSupportingText()] }), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _styles__WEBPACK_IMPORTED_MODULE_4__.DropdownItemStyle.check, children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_assets__WEBPACK_IMPORTED_MODULE_3__.CheckSVG, {}) })] }));
|
|
8565
8565
|
}
|
|
8566
8566
|
|
|
8567
8567
|
|
|
@@ -11683,8 +11683,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11683
11683
|
/* harmony export */ SlideTransition: () => (/* binding */ SlideTransition)
|
|
11684
11684
|
/* harmony export */ });
|
|
11685
11685
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
|
|
11686
|
-
/* harmony import */ var
|
|
11687
|
-
/* harmony import */ var
|
|
11686
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
11687
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
11688
|
+
/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! clsx */ "./node_modules/clsx/dist/clsx.mjs");
|
|
11689
|
+
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../styles */ "./src/ui/SlideTransition/styles/index.ts");
|
|
11690
|
+
|
|
11688
11691
|
|
|
11689
11692
|
|
|
11690
11693
|
|
|
@@ -11692,6 +11695,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11692
11695
|
* ##### Компонент для анимации прокрутки вверх и вниз.
|
|
11693
11696
|
* Для контроля анимации используйте пропс ```animation```.
|
|
11694
11697
|
*
|
|
11698
|
+
* Важно: анимации `-down` пока еще не доработаны, поэтому работают также как и `-up`
|
|
11699
|
+
*
|
|
11695
11700
|
* ---
|
|
11696
11701
|
* ```'enter-down'``` - производит анимацию появления снизу.
|
|
11697
11702
|
*
|
|
@@ -11711,14 +11716,35 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11711
11716
|
* При высокой (автор проводил тесты на 300ms) скорости анимации ощущается нормально (если вы не Флеш).
|
|
11712
11717
|
* */
|
|
11713
11718
|
function SlideTransition({ children, animation, className, additionStyles, style, }) {
|
|
11714
|
-
|
|
11715
|
-
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11720
|
-
|
|
11721
|
-
|
|
11719
|
+
const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
11720
|
+
const contentRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
11721
|
+
(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
|
|
11722
|
+
const contentClientHeight = contentRef.current?.clientHeight;
|
|
11723
|
+
const isShowAnimation = animation === 'show' || animation === 'enter-up' || animation === 'enter-down';
|
|
11724
|
+
if (contentClientHeight != null) {
|
|
11725
|
+
wrapperRef.current.style.height = contentClientHeight + 'px';
|
|
11726
|
+
if (!isShowAnimation) {
|
|
11727
|
+
wrapperRef.current.style.overflow = 'hidden';
|
|
11728
|
+
}
|
|
11729
|
+
}
|
|
11730
|
+
const handleAnimationEnd = () => {
|
|
11731
|
+
if (wrapperRef.current && isShowAnimation) {
|
|
11732
|
+
wrapperRef.current.style.overflow = '';
|
|
11733
|
+
}
|
|
11734
|
+
};
|
|
11735
|
+
wrapperRef.current?.addEventListener('animationend', handleAnimationEnd);
|
|
11736
|
+
return () => {
|
|
11737
|
+
wrapperRef.current?.removeEventListener('animationend', handleAnimationEnd);
|
|
11738
|
+
};
|
|
11739
|
+
}, [animation]);
|
|
11740
|
+
return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: wrapperRef, className: (0,clsx__WEBPACK_IMPORTED_MODULE_2__["default"])(_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.slideTransition, additionStyles, {
|
|
11741
|
+
[_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.enterDown]: animation === 'enter-down',
|
|
11742
|
+
[_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.exitDown]: animation === 'exit-down',
|
|
11743
|
+
[_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.exitUp]: animation === 'exit-up',
|
|
11744
|
+
[_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.enterUp]: animation === 'enter-up',
|
|
11745
|
+
[_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.hide]: animation === 'hide',
|
|
11746
|
+
[_styles__WEBPACK_IMPORTED_MODULE_3__.SlideTransitionStyle.show]: animation === 'show',
|
|
11747
|
+
}), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: contentRef, style: style, className: className, children: children }) }));
|
|
11722
11748
|
}
|
|
11723
11749
|
|
|
11724
11750
|
|