react-native-package-fast 0.2.2 → 0.2.4-rc.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/README.md +19 -52
- package/lib/commonjs/assets/icons/IconApp.js +19 -0
- package/lib/commonjs/assets/icons/IconApp.js.map +1 -0
- package/lib/commonjs/carousel/carousel/Carousel.js +1311 -0
- package/lib/commonjs/carousel/carousel/Carousel.js.map +1 -0
- package/lib/commonjs/carousel/pagination/Pagination.js +153 -0
- package/lib/commonjs/carousel/pagination/Pagination.js.map +1 -0
- package/lib/commonjs/carousel/pagination/Pagination.style.js +29 -0
- package/lib/commonjs/carousel/pagination/Pagination.style.js.map +1 -0
- package/lib/commonjs/carousel/pagination/PaginationDot.js +150 -0
- package/lib/commonjs/carousel/pagination/PaginationDot.js.map +1 -0
- package/lib/commonjs/carousel/parallaximage/ParallaxImage.js +225 -0
- package/lib/commonjs/carousel/parallaximage/ParallaxImage.js.map +1 -0
- package/lib/commonjs/carousel/parallaximage/ParallaxImage.style.js +26 -0
- package/lib/commonjs/carousel/parallaximage/ParallaxImage.style.js.map +1 -0
- package/lib/commonjs/carousel/shallow-compare.js +38 -0
- package/lib/commonjs/carousel/shallow-compare.js.map +1 -0
- package/lib/commonjs/carousel/utils/animations.js +273 -0
- package/lib/commonjs/carousel/utils/animations.js.map +1 -0
- package/lib/commonjs/cores/ButtonApp.js +64 -0
- package/lib/commonjs/cores/ButtonApp.js.map +1 -0
- package/lib/commonjs/cores/CheckVersionApp.js +129 -0
- package/lib/commonjs/cores/CheckVersionApp.js.map +1 -0
- package/lib/commonjs/cores/DeviceUtils.js +19 -0
- package/lib/commonjs/cores/DeviceUtils.js.map +1 -0
- package/lib/commonjs/cores/ImageApp.js +37 -0
- package/lib/commonjs/cores/ImageApp.js.map +1 -0
- package/lib/commonjs/cores/ImageFastApp.js +30 -0
- package/lib/commonjs/cores/ImageFastApp.js.map +1 -0
- package/lib/commonjs/cores/InputApp.js +147 -0
- package/lib/commonjs/cores/InputApp.js.map +1 -0
- package/lib/commonjs/cores/InputMultiApp.js +27 -0
- package/lib/commonjs/cores/InputMultiApp.js.map +1 -0
- package/lib/commonjs/cores/LoadingApp.js +48 -0
- package/lib/commonjs/cores/LoadingApp.js.map +1 -0
- package/lib/commonjs/cores/LogUtils.js +136 -0
- package/lib/commonjs/cores/LogUtils.js.map +1 -0
- package/lib/commonjs/cores/RatingApp.js +66 -0
- package/lib/commonjs/cores/RatingApp.js.map +1 -0
- package/lib/commonjs/cores/SliderApp.js +156 -0
- package/lib/commonjs/cores/SliderApp.js.map +1 -0
- package/lib/commonjs/cores/StoresProviderApp.js +64 -0
- package/lib/commonjs/cores/StoresProviderApp.js.map +1 -0
- package/lib/commonjs/cores/TextApp.js +38 -0
- package/lib/commonjs/cores/TextApp.js.map +1 -0
- package/lib/commonjs/cores/Utils.js +648 -0
- package/lib/commonjs/cores/Utils.js.map +1 -0
- package/lib/commonjs/cores/ViewApp.js +32 -0
- package/lib/commonjs/cores/ViewApp.js.map +1 -0
- package/lib/commonjs/crypto/CryptoCore.js +42 -0
- package/lib/commonjs/crypto/CryptoCore.js.map +1 -0
- package/lib/commonjs/crypto/CryptoJS.js +662 -0
- package/lib/commonjs/crypto/CryptoJS.js.map +1 -0
- package/lib/commonjs/fab/FAB.js +179 -0
- package/lib/commonjs/fab/FAB.js.map +1 -0
- package/lib/commonjs/fab/FAB.styles.js +22 -0
- package/lib/commonjs/fab/FAB.styles.js.map +1 -0
- package/lib/commonjs/fab/FAB.types.js +6 -0
- package/lib/commonjs/fab/FAB.types.js.map +1 -0
- package/lib/commonjs/float-button/FABGroupDragApp.js +149 -0
- package/lib/commonjs/float-button/FABGroupDragApp.js.map +1 -0
- package/lib/commonjs/index.js +339 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/indicators/ball-indicator/index.js +90 -0
- package/lib/commonjs/indicators/ball-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/ball-indicator/styles.js +21 -0
- package/lib/commonjs/indicators/ball-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/bar-indicator/index.js +109 -0
- package/lib/commonjs/indicators/bar-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/bar-indicator/styles.js +16 -0
- package/lib/commonjs/indicators/bar-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/dot-indicator/index.js +71 -0
- package/lib/commonjs/indicators/dot-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/dot-indicator/styles.js +16 -0
- package/lib/commonjs/indicators/dot-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/index.js +77 -0
- package/lib/commonjs/indicators/index.js.map +1 -0
- package/lib/commonjs/indicators/indicator/index.js +203 -0
- package/lib/commonjs/indicators/indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/material-indicator/index.js +136 -0
- package/lib/commonjs/indicators/material-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/material-indicator/styles.js +20 -0
- package/lib/commonjs/indicators/material-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/pacman-indicator/index.js +147 -0
- package/lib/commonjs/indicators/pacman-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/pacman-indicator/styles.js +15 -0
- package/lib/commonjs/indicators/pacman-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/pulse-indicator/index.js +81 -0
- package/lib/commonjs/indicators/pulse-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/pulse-indicator/styles.js +20 -0
- package/lib/commonjs/indicators/pulse-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/skype-indicator/index.js +98 -0
- package/lib/commonjs/indicators/skype-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/skype-indicator/styles.js +20 -0
- package/lib/commonjs/indicators/skype-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/ui-activity-indicator/index.js +87 -0
- package/lib/commonjs/indicators/ui-activity-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/ui-activity-indicator/styles.js +20 -0
- package/lib/commonjs/indicators/ui-activity-indicator/styles.js.map +1 -0
- package/lib/commonjs/indicators/wave-indicator/index.js +93 -0
- package/lib/commonjs/indicators/wave-indicator/index.js.map +1 -0
- package/lib/commonjs/indicators/wave-indicator/styles.js +20 -0
- package/lib/commonjs/indicators/wave-indicator/styles.js.map +1 -0
- package/lib/commonjs/json-tree/ItemRange.js +56 -0
- package/lib/commonjs/json-tree/ItemRange.js.map +1 -0
- package/lib/commonjs/json-tree/JSONArrow.js +42 -0
- package/lib/commonjs/json-tree/JSONArrow.js.map +1 -0
- package/lib/commonjs/json-tree/Nodes.js +387 -0
- package/lib/commonjs/json-tree/Nodes.js.map +1 -0
- package/lib/commonjs/json-tree/createStylingFromTheme.js +147 -0
- package/lib/commonjs/json-tree/createStylingFromTheme.js.map +1 -0
- package/lib/commonjs/json-tree/getCollectionEntries.js +108 -0
- package/lib/commonjs/json-tree/getCollectionEntries.js.map +1 -0
- package/lib/commonjs/json-tree/index.js +119 -0
- package/lib/commonjs/json-tree/index.js.map +1 -0
- package/lib/commonjs/json-tree/objType.js +13 -0
- package/lib/commonjs/json-tree/objType.js.map +1 -0
- package/lib/commonjs/json-tree/themes/solarized.js +27 -0
- package/lib/commonjs/json-tree/themes/solarized.js.map +1 -0
- package/lib/commonjs/logger/FloatButtonLogger.js +155 -0
- package/lib/commonjs/logger/FloatButtonLogger.js.map +1 -0
- package/lib/commonjs/logger/Logger.js +156 -0
- package/lib/commonjs/logger/Logger.js.map +1 -0
- package/lib/commonjs/logger/Mock.js +2206 -0
- package/lib/commonjs/logger/Mock.js.map +1 -0
- package/lib/commonjs/logger/NetworkRequestInfo.js +108 -0
- package/lib/commonjs/logger/NetworkRequestInfo.js.map +1 -0
- package/lib/commonjs/logger/TouchKey.js +88 -0
- package/lib/commonjs/logger/TouchKey.js.map +1 -0
- package/lib/commonjs/logger/XHRInterceptor.js +27 -0
- package/lib/commonjs/logger/XHRInterceptor.js.map +1 -0
- package/lib/commonjs/logger/backHandler.js +47 -0
- package/lib/commonjs/logger/backHandler.js.map +1 -0
- package/lib/commonjs/logger/components/Button.js +41 -0
- package/lib/commonjs/logger/components/Button.js.map +1 -0
- package/lib/commonjs/logger/components/ColorsLog.js +49 -0
- package/lib/commonjs/logger/components/ColorsLog.js.map +1 -0
- package/lib/commonjs/logger/components/Header.js +63 -0
- package/lib/commonjs/logger/components/Header.js.map +1 -0
- package/lib/commonjs/logger/components/NetworkLogger.js +152 -0
- package/lib/commonjs/logger/components/NetworkLogger.js.map +1 -0
- package/lib/commonjs/logger/components/Options.js +100 -0
- package/lib/commonjs/logger/components/Options.js.map +1 -0
- package/lib/commonjs/logger/components/RequestDetails.js +196 -0
- package/lib/commonjs/logger/components/RequestDetails.js.map +1 -0
- package/lib/commonjs/logger/components/RequestList.js +219 -0
- package/lib/commonjs/logger/components/RequestList.js.map +1 -0
- package/lib/commonjs/logger/components/ResultItem.js +435 -0
- package/lib/commonjs/logger/components/ResultItem.js.map +1 -0
- package/lib/commonjs/logger/components/SearchBar.js +86 -0
- package/lib/commonjs/logger/components/SearchBar.js.map +1 -0
- package/lib/commonjs/logger/components/Unmounted.js +50 -0
- package/lib/commonjs/logger/components/Unmounted.js.map +1 -0
- package/lib/commonjs/logger/components/images/ic_copy.png +0 -0
- package/lib/commonjs/logger/components/images/ic_down.png +0 -0
- package/lib/commonjs/logger/components/images/ic_left.png +0 -0
- package/lib/commonjs/logger/components/images/ic_send.png +0 -0
- package/lib/commonjs/logger/components/images/more.png +0 -0
- package/lib/commonjs/logger/components/images/search.png +0 -0
- package/lib/commonjs/logger/components/images/share.png +0 -0
- package/lib/commonjs/logger/libs.js +25 -0
- package/lib/commonjs/logger/libs.js.map +1 -0
- package/lib/commonjs/logger/loggerSingleton.js +11 -0
- package/lib/commonjs/logger/loggerSingleton.js.map +1 -0
- package/lib/commonjs/logger/theme.js +57 -0
- package/lib/commonjs/logger/theme.js.map +1 -0
- package/lib/commonjs/logger/types.js +6 -0
- package/lib/commonjs/logger/types.js.map +1 -0
- package/lib/commonjs/logger/utils/createHar.js +78 -0
- package/lib/commonjs/logger/utils/createHar.js.map +1 -0
- package/lib/commonjs/logger/utils/extractHost.js +12 -0
- package/lib/commonjs/logger/utils/extractHost.js.map +1 -0
- package/lib/commonjs/logger/utils/fromEntries.js +12 -0
- package/lib/commonjs/logger/utils/fromEntries.js.map +1 -0
- package/lib/commonjs/logger/utils/logger.js +9 -0
- package/lib/commonjs/logger/utils/logger.js.map +1 -0
- package/lib/commonjs/navigation/NavigationApp.js +165 -0
- package/lib/commonjs/navigation/NavigationApp.js.map +1 -0
- package/lib/commonjs/navigation/NavigatorStack.js +226 -0
- package/lib/commonjs/navigation/NavigatorStack.js.map +1 -0
- package/lib/commonjs/navigation/header/HeaderView.js +24 -0
- package/lib/commonjs/navigation/header/HeaderView.js.map +1 -0
- package/lib/commonjs/navigation/index.js +21 -0
- package/lib/commonjs/navigation/index.js.map +1 -0
- package/lib/commonjs/navigation/leftMenu/LeftMenuApp.js +99 -0
- package/lib/commonjs/navigation/leftMenu/LeftMenuApp.js.map +1 -0
- package/lib/commonjs/navigation/navigator/Navigator.js +24 -0
- package/lib/commonjs/navigation/navigator/Navigator.js.map +1 -0
- package/lib/commonjs/navigation/rightMenu/RightMenuApp.js +97 -0
- package/lib/commonjs/navigation/rightMenu/RightMenuApp.js.map +1 -0
- package/lib/commonjs/navigation/stack/ModalSecondStack.js +105 -0
- package/lib/commonjs/navigation/stack/ModalSecondStack.js.map +1 -0
- package/lib/commonjs/navigation/stack/ModalStack.js +246 -0
- package/lib/commonjs/navigation/stack/ModalStack.js.map +1 -0
- package/lib/commonjs/navigation/stack/ToastAnimationView.js +50 -0
- package/lib/commonjs/navigation/stack/ToastAnimationView.js.map +1 -0
- package/lib/commonjs/navigation/stack/ToastStack.js +162 -0
- package/lib/commonjs/navigation/stack/ToastStack.js.map +1 -0
- package/lib/commonjs/navigation/tab/RouterAppCustomer.js +71 -0
- package/lib/commonjs/navigation/tab/RouterAppCustomer.js.map +1 -0
- package/lib/commonjs/navigation/tab/StackAppCustomer.js +58 -0
- package/lib/commonjs/navigation/tab/StackAppCustomer.js.map +1 -0
- package/lib/commonjs/navigation/tabBar/RouterApp.js +112 -0
- package/lib/commonjs/navigation/tabBar/RouterApp.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/skeleton/SkeletonApp.js +107 -0
- package/lib/commonjs/skeleton/SkeletonApp.js.map +1 -0
- package/lib/commonjs/tooltip/Helper.js +75 -0
- package/lib/commonjs/tooltip/Helper.js.map +1 -0
- package/lib/commonjs/tooltip/TooltipApp.js +1234 -0
- package/lib/commonjs/tooltip/TooltipApp.js.map +1 -0
- package/lib/commonjs/top-tab/TabBarApp.js +96 -0
- package/lib/commonjs/top-tab/TabBarApp.js.map +1 -0
- package/lib/commonjs/top-tab/TabScrollApp.js +91 -0
- package/lib/commonjs/top-tab/TabScrollApp.js.map +1 -0
- package/lib/commonjs/utils/CommonUtils.js +22 -0
- package/lib/commonjs/utils/CommonUtils.js.map +1 -0
- package/lib/module/assets/icons/IconApp.js +15 -0
- package/lib/module/assets/icons/IconApp.js.map +1 -0
- package/lib/module/assets/icons/ic_close.png +0 -0
- package/lib/module/assets/icons/ic_exit.png +0 -0
- package/lib/module/assets/icons/ic_rate_empty.png +0 -0
- package/lib/module/assets/icons/ic_rate_full.png +0 -0
- package/lib/module/assets/icons/ic_rate_half.png +0 -0
- package/lib/module/assets/icons/ic_toast_error.png +0 -0
- package/lib/module/assets/icons/ic_toast_info.png +0 -0
- package/lib/module/assets/icons/ic_toast_success.png +0 -0
- package/lib/module/assets/icons/ic_toast_warning.png +0 -0
- package/lib/module/carousel/carousel/Carousel.js +1304 -0
- package/lib/module/carousel/carousel/Carousel.js.map +1 -0
- package/lib/module/carousel/pagination/Pagination.js +146 -0
- package/lib/module/carousel/pagination/Pagination.js.map +1 -0
- package/lib/module/carousel/pagination/Pagination.style.js +25 -0
- package/lib/module/carousel/pagination/Pagination.style.js.map +1 -0
- package/lib/module/carousel/pagination/PaginationDot.js +143 -0
- package/lib/module/carousel/pagination/PaginationDot.js.map +1 -0
- package/lib/module/carousel/parallaximage/ParallaxImage.js +218 -0
- package/lib/module/carousel/parallaximage/ParallaxImage.js.map +1 -0
- package/lib/module/carousel/parallaximage/ParallaxImage.style.js +22 -0
- package/lib/module/carousel/parallaximage/ParallaxImage.style.js.map +1 -0
- package/lib/module/carousel/shallow-compare.js +34 -0
- package/lib/module/carousel/shallow-compare.js.map +1 -0
- package/lib/module/carousel/utils/animations.js +262 -0
- package/lib/module/carousel/utils/animations.js.map +1 -0
- package/lib/module/cores/ButtonApp.js +59 -0
- package/lib/module/cores/ButtonApp.js.map +1 -0
- package/lib/module/cores/CheckVersionApp.js +123 -0
- package/lib/module/cores/CheckVersionApp.js.map +1 -0
- package/lib/module/cores/DeviceUtils.js +14 -0
- package/lib/module/cores/DeviceUtils.js.map +1 -0
- package/lib/module/cores/ImageApp.js +32 -0
- package/lib/module/cores/ImageApp.js.map +1 -0
- package/lib/module/cores/ImageFastApp.js +25 -0
- package/lib/module/cores/ImageFastApp.js.map +1 -0
- package/lib/module/cores/InputApp.js +140 -0
- package/lib/module/cores/InputApp.js.map +1 -0
- package/lib/module/cores/InputMultiApp.js +22 -0
- package/lib/module/cores/InputMultiApp.js.map +1 -0
- package/lib/module/cores/LoadingApp.js +43 -0
- package/lib/module/cores/LoadingApp.js.map +1 -0
- package/lib/module/cores/LogUtils.js +131 -0
- package/lib/module/cores/LogUtils.js.map +1 -0
- package/lib/module/cores/RatingApp.js +60 -0
- package/lib/module/cores/RatingApp.js.map +1 -0
- package/lib/module/cores/SliderApp.js +151 -0
- package/lib/module/cores/SliderApp.js.map +1 -0
- package/lib/module/cores/StoresProviderApp.js +58 -0
- package/lib/module/cores/StoresProviderApp.js.map +1 -0
- package/lib/module/cores/TextApp.js +34 -0
- package/lib/module/cores/TextApp.js.map +1 -0
- package/lib/module/cores/Utils.js +642 -0
- package/lib/module/cores/Utils.js.map +1 -0
- package/lib/module/cores/ViewApp.js +27 -0
- package/lib/module/cores/ViewApp.js.map +1 -0
- package/lib/module/crypto/CryptoCore.js +36 -0
- package/lib/module/crypto/CryptoCore.js.map +1 -0
- package/lib/module/crypto/CryptoJS.js +662 -0
- package/lib/module/crypto/CryptoJS.js.map +1 -0
- package/lib/module/fab/FAB.js +172 -0
- package/lib/module/fab/FAB.js.map +1 -0
- package/lib/module/fab/FAB.styles.js +16 -0
- package/lib/module/fab/FAB.styles.js.map +1 -0
- package/lib/module/fab/FAB.types.js +4 -0
- package/lib/module/fab/FAB.types.js.map +1 -0
- package/lib/module/float-button/FABGroupDragApp.js +143 -0
- package/lib/module/float-button/FABGroupDragApp.js.map +1 -0
- package/lib/module/index.js +63 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/indicators/ball-indicator/index.js +83 -0
- package/lib/module/indicators/ball-indicator/index.js.map +1 -0
- package/lib/module/indicators/ball-indicator/styles.js +17 -0
- package/lib/module/indicators/ball-indicator/styles.js.map +1 -0
- package/lib/module/indicators/bar-indicator/index.js +102 -0
- package/lib/module/indicators/bar-indicator/index.js.map +1 -0
- package/lib/module/indicators/bar-indicator/styles.js +12 -0
- package/lib/module/indicators/bar-indicator/styles.js.map +1 -0
- package/lib/module/indicators/dot-indicator/index.js +64 -0
- package/lib/module/indicators/dot-indicator/index.js.map +1 -0
- package/lib/module/indicators/dot-indicator/styles.js +12 -0
- package/lib/module/indicators/dot-indicator/styles.js.map +1 -0
- package/lib/module/indicators/index.js +14 -0
- package/lib/module/indicators/index.js.map +1 -0
- package/lib/module/indicators/indicator/index.js +196 -0
- package/lib/module/indicators/indicator/index.js.map +1 -0
- package/lib/module/indicators/material-indicator/index.js +129 -0
- package/lib/module/indicators/material-indicator/index.js.map +1 -0
- package/lib/module/indicators/material-indicator/styles.js +16 -0
- package/lib/module/indicators/material-indicator/styles.js.map +1 -0
- package/lib/module/indicators/pacman-indicator/index.js +140 -0
- package/lib/module/indicators/pacman-indicator/index.js.map +1 -0
- package/lib/module/indicators/pacman-indicator/styles.js +11 -0
- package/lib/module/indicators/pacman-indicator/styles.js.map +1 -0
- package/lib/module/indicators/pulse-indicator/index.js +74 -0
- package/lib/module/indicators/pulse-indicator/index.js.map +1 -0
- package/lib/module/indicators/pulse-indicator/styles.js +16 -0
- package/lib/module/indicators/pulse-indicator/styles.js.map +1 -0
- package/lib/module/indicators/skype-indicator/index.js +91 -0
- package/lib/module/indicators/skype-indicator/index.js.map +1 -0
- package/lib/module/indicators/skype-indicator/styles.js +16 -0
- package/lib/module/indicators/skype-indicator/styles.js.map +1 -0
- package/lib/module/indicators/ui-activity-indicator/index.js +80 -0
- package/lib/module/indicators/ui-activity-indicator/index.js.map +1 -0
- package/lib/module/indicators/ui-activity-indicator/styles.js +16 -0
- package/lib/module/indicators/ui-activity-indicator/styles.js.map +1 -0
- package/lib/module/indicators/wave-indicator/index.js +86 -0
- package/lib/module/indicators/wave-indicator/index.js.map +1 -0
- package/lib/module/indicators/wave-indicator/styles.js +16 -0
- package/lib/module/indicators/wave-indicator/styles.js.map +1 -0
- package/lib/module/json-tree/ItemRange.js +49 -0
- package/lib/module/json-tree/ItemRange.js.map +1 -0
- package/lib/module/json-tree/JSONArrow.js +37 -0
- package/lib/module/json-tree/JSONArrow.js.map +1 -0
- package/lib/module/json-tree/Nodes.js +375 -0
- package/lib/module/json-tree/Nodes.js.map +1 -0
- package/lib/module/json-tree/createStylingFromTheme.js +142 -0
- package/lib/module/json-tree/createStylingFromTheme.js.map +1 -0
- package/lib/module/json-tree/getCollectionEntries.js +104 -0
- package/lib/module/json-tree/getCollectionEntries.js.map +1 -0
- package/lib/module/json-tree/index.js +114 -0
- package/lib/module/json-tree/index.js.map +1 -0
- package/lib/module/json-tree/objType.js +9 -0
- package/lib/module/json-tree/objType.js.map +1 -0
- package/lib/module/json-tree/themes/solarized.js +23 -0
- package/lib/module/json-tree/themes/solarized.js.map +1 -0
- package/lib/module/logger/FloatButtonLogger.js +145 -0
- package/lib/module/logger/FloatButtonLogger.js.map +1 -0
- package/lib/module/logger/Logger.js +150 -0
- package/lib/module/logger/Logger.js.map +1 -0
- package/lib/module/logger/Mock.js +2206 -0
- package/lib/module/logger/Mock.js.map +1 -0
- package/lib/module/logger/NetworkRequestInfo.js +103 -0
- package/lib/module/logger/NetworkRequestInfo.js.map +1 -0
- package/lib/module/logger/TouchKey.js +82 -0
- package/lib/module/logger/TouchKey.js.map +1 -0
- package/lib/module/logger/XHRInterceptor.js +23 -0
- package/lib/module/logger/XHRInterceptor.js.map +1 -0
- package/lib/module/logger/backHandler.js +40 -0
- package/lib/module/logger/backHandler.js.map +1 -0
- package/lib/module/logger/components/Button.js +36 -0
- package/lib/module/logger/components/Button.js.map +1 -0
- package/lib/module/logger/components/ColorsLog.js +45 -0
- package/lib/module/logger/components/ColorsLog.js.map +1 -0
- package/lib/module/logger/components/Header.js +58 -0
- package/lib/module/logger/components/Header.js.map +1 -0
- package/lib/module/logger/components/NetworkLogger.js +146 -0
- package/lib/module/logger/components/NetworkLogger.js.map +1 -0
- package/lib/module/logger/components/Options.js +94 -0
- package/lib/module/logger/components/Options.js.map +1 -0
- package/lib/module/logger/components/RequestDetails.js +190 -0
- package/lib/module/logger/components/RequestDetails.js.map +1 -0
- package/lib/module/logger/components/RequestList.js +212 -0
- package/lib/module/logger/components/RequestList.js.map +1 -0
- package/lib/module/logger/components/ResultItem.js +428 -0
- package/lib/module/logger/components/ResultItem.js.map +1 -0
- package/lib/module/logger/components/SearchBar.js +81 -0
- package/lib/module/logger/components/SearchBar.js.map +1 -0
- package/lib/module/logger/components/Unmounted.js +45 -0
- package/lib/module/logger/components/Unmounted.js.map +1 -0
- package/lib/module/logger/components/images/ic_copy.png +0 -0
- package/lib/module/logger/components/images/ic_down.png +0 -0
- package/lib/module/logger/components/images/ic_left.png +0 -0
- package/lib/module/logger/components/images/ic_send.png +0 -0
- package/lib/module/logger/components/images/more.png +0 -0
- package/lib/module/logger/components/images/search.png +0 -0
- package/lib/module/logger/components/images/share.png +0 -0
- package/lib/module/logger/libs.js +19 -0
- package/lib/module/logger/libs.js.map +1 -0
- package/lib/module/logger/loggerSingleton.js +6 -0
- package/lib/module/logger/loggerSingleton.js.map +1 -0
- package/lib/module/logger/theme.js +50 -0
- package/lib/module/logger/theme.js.map +1 -0
- package/lib/module/logger/types.js +4 -0
- package/lib/module/logger/types.js.map +1 -0
- package/lib/module/logger/utils/createHar.js +74 -0
- package/lib/module/logger/utils/createHar.js.map +1 -0
- package/lib/module/logger/utils/extractHost.js +8 -0
- package/lib/module/logger/utils/extractHost.js.map +1 -0
- package/lib/module/logger/utils/fromEntries.js +8 -0
- package/lib/module/logger/utils/fromEntries.js.map +1 -0
- package/lib/module/logger/utils/logger.js +4 -0
- package/lib/module/logger/utils/logger.js.map +1 -0
- package/lib/module/navigation/NavigationApp.js +161 -0
- package/lib/module/navigation/NavigationApp.js.map +1 -0
- package/lib/module/navigation/NavigatorStack.js +219 -0
- package/lib/module/navigation/NavigatorStack.js.map +1 -0
- package/lib/module/navigation/header/HeaderView.js +19 -0
- package/lib/module/navigation/header/HeaderView.js.map +1 -0
- package/lib/module/navigation/index.js +6 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/leftMenu/LeftMenuApp.js +93 -0
- package/lib/module/navigation/leftMenu/LeftMenuApp.js.map +1 -0
- package/lib/module/navigation/navigator/Navigator.js +19 -0
- package/lib/module/navigation/navigator/Navigator.js.map +1 -0
- package/lib/module/navigation/rightMenu/RightMenuApp.js +91 -0
- package/lib/module/navigation/rightMenu/RightMenuApp.js.map +1 -0
- package/lib/module/navigation/stack/ModalSecondStack.js +99 -0
- package/lib/module/navigation/stack/ModalSecondStack.js.map +1 -0
- package/lib/module/navigation/stack/ModalStack.js +245 -0
- package/lib/module/navigation/stack/ModalStack.js.map +1 -0
- package/lib/module/navigation/stack/ToastAnimationView.js +45 -0
- package/lib/module/navigation/stack/ToastAnimationView.js.map +1 -0
- package/lib/module/navigation/stack/ToastStack.js +156 -0
- package/lib/module/navigation/stack/ToastStack.js.map +1 -0
- package/lib/module/navigation/tab/RouterAppCustomer.js +65 -0
- package/lib/module/navigation/tab/RouterAppCustomer.js.map +1 -0
- package/lib/module/navigation/tab/StackAppCustomer.js +52 -0
- package/lib/module/navigation/tab/StackAppCustomer.js.map +1 -0
- package/lib/module/navigation/tabBar/RouterApp.js +107 -0
- package/lib/module/navigation/tabBar/RouterApp.js.map +1 -0
- package/lib/module/skeleton/SkeletonApp.js +101 -0
- package/lib/module/skeleton/SkeletonApp.js.map +1 -0
- package/lib/module/tooltip/Helper.js +60 -0
- package/lib/module/tooltip/Helper.js.map +1 -0
- package/lib/module/tooltip/TooltipApp.js +1229 -0
- package/lib/module/tooltip/TooltipApp.js.map +1 -0
- package/lib/module/top-tab/TabBarApp.js +91 -0
- package/lib/module/top-tab/TabBarApp.js.map +1 -0
- package/lib/module/top-tab/TabScrollApp.js +85 -0
- package/lib/module/top-tab/TabScrollApp.js.map +1 -0
- package/lib/module/utils/CommonUtils.js +16 -0
- package/lib/module/utils/CommonUtils.js.map +1 -0
- package/lib/typescript/assets/icons/IconApp.d.ts.map +1 -0
- package/lib/typescript/carousel/shallow-compare.d.ts.map +1 -0
- package/lib/typescript/cores/ButtonApp.d.ts.map +1 -0
- package/lib/typescript/cores/CheckVersionApp.d.ts +13 -0
- package/lib/typescript/cores/CheckVersionApp.d.ts.map +1 -0
- package/lib/typescript/cores/DeviceUtils.d.ts +4 -0
- package/lib/typescript/cores/DeviceUtils.d.ts.map +1 -0
- package/lib/typescript/cores/ImageApp.d.ts.map +1 -0
- package/lib/typescript/cores/ImageFastApp.d.ts.map +1 -0
- package/lib/typescript/cores/InputApp.d.ts.map +1 -0
- package/lib/typescript/cores/InputMultiApp.d.ts.map +1 -0
- package/lib/typescript/cores/LoadingApp.d.ts.map +1 -0
- package/lib/typescript/cores/LogUtils.d.ts.map +1 -0
- package/{src → lib}/typescript/cores/RatingApp.d.ts +1 -1
- package/lib/typescript/cores/RatingApp.d.ts.map +1 -0
- package/lib/typescript/cores/SliderApp.d.ts.map +1 -0
- package/{src → lib}/typescript/cores/StoresProviderApp.d.ts +1 -1
- package/lib/typescript/cores/StoresProviderApp.d.ts.map +1 -0
- package/lib/typescript/cores/TextApp.d.ts.map +1 -0
- package/{src → lib}/typescript/cores/Utils.d.ts +4 -1
- package/lib/typescript/cores/Utils.d.ts.map +1 -0
- package/lib/typescript/cores/ViewApp.d.ts.map +1 -0
- package/lib/typescript/crypto/CryptoCore.d.ts +7 -0
- package/lib/typescript/crypto/CryptoCore.d.ts.map +1 -0
- package/lib/typescript/fab/FAB.d.ts.map +1 -0
- package/lib/typescript/fab/FAB.styles.d.ts.map +1 -0
- package/{src → lib}/typescript/fab/FAB.types.d.ts +1 -1
- package/lib/typescript/fab/FAB.types.d.ts.map +1 -0
- package/lib/typescript/float-button/FABGroupDragApp.d.ts +4 -0
- package/lib/typescript/float-button/FABGroupDragApp.d.ts.map +1 -0
- package/{src → lib}/typescript/index.d.ts +15 -1
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/indicators/ball-indicator/index.d.ts +24 -0
- package/lib/typescript/indicators/ball-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/ball-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/bar-indicator/index.d.ts +25 -0
- package/lib/typescript/indicators/bar-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/bar-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/dot-indicator/index.d.ts +25 -0
- package/lib/typescript/indicators/dot-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/dot-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/index.d.ts.map +1 -0
- package/{src → lib}/typescript/indicators/indicator/index.d.ts +8 -9
- package/lib/typescript/indicators/indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/material-indicator/index.d.ts +24 -0
- package/lib/typescript/indicators/material-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/material-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/pacman-indicator/index.d.ts +25 -0
- package/lib/typescript/indicators/pacman-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/pacman-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/pulse-indicator/index.d.ts +24 -0
- package/lib/typescript/indicators/pulse-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/pulse-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/skype-indicator/index.d.ts +29 -0
- package/lib/typescript/indicators/skype-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/skype-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/ui-activity-indicator/index.d.ts +24 -0
- package/lib/typescript/indicators/ui-activity-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/ui-activity-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/indicators/wave-indicator/index.d.ts +30 -0
- package/lib/typescript/indicators/wave-indicator/index.d.ts.map +1 -0
- package/lib/typescript/indicators/wave-indicator/styles.d.ts.map +1 -0
- package/lib/typescript/json-tree/ItemRange.d.ts +16 -0
- package/lib/typescript/json-tree/ItemRange.d.ts.map +1 -0
- package/lib/typescript/json-tree/JSONArrow.d.ts +16 -0
- package/lib/typescript/json-tree/JSONArrow.d.ts.map +1 -0
- package/lib/typescript/json-tree/Nodes.d.ts +52 -0
- package/lib/typescript/json-tree/Nodes.d.ts.map +1 -0
- package/lib/typescript/json-tree/createStylingFromTheme.d.ts +3 -0
- package/lib/typescript/json-tree/createStylingFromTheme.d.ts.map +1 -0
- package/lib/typescript/json-tree/getCollectionEntries.d.ts +2 -0
- package/lib/typescript/json-tree/getCollectionEntries.d.ts.map +1 -0
- package/lib/typescript/json-tree/index.d.ts +24 -0
- package/lib/typescript/json-tree/index.d.ts.map +1 -0
- package/lib/typescript/json-tree/objType.d.ts +2 -0
- package/lib/typescript/json-tree/objType.d.ts.map +1 -0
- package/lib/typescript/json-tree/themes/solarized.d.ts +22 -0
- package/lib/typescript/json-tree/themes/solarized.d.ts.map +1 -0
- package/lib/typescript/logger/FloatButtonLogger.d.ts +9 -0
- package/lib/typescript/logger/FloatButtonLogger.d.ts.map +1 -0
- package/lib/typescript/logger/Logger.d.ts +43 -0
- package/lib/typescript/logger/Logger.d.ts.map +1 -0
- package/lib/typescript/logger/Mock.d.ts +2 -0
- package/lib/typescript/logger/Mock.d.ts.map +1 -0
- package/lib/typescript/logger/NetworkRequestInfo.d.ts +35 -0
- package/lib/typescript/logger/NetworkRequestInfo.d.ts.map +1 -0
- package/lib/typescript/logger/TouchKey.d.ts +4 -0
- package/lib/typescript/logger/TouchKey.d.ts.map +1 -0
- package/lib/typescript/logger/XHRInterceptor.d.ts +13 -0
- package/lib/typescript/logger/XHRInterceptor.d.ts.map +1 -0
- package/lib/typescript/logger/backHandler.d.ts +22 -0
- package/lib/typescript/logger/backHandler.d.ts.map +1 -0
- package/lib/typescript/logger/components/Button.d.ts +11 -0
- package/lib/typescript/logger/components/Button.d.ts.map +1 -0
- package/lib/typescript/logger/components/ColorsLog.d.ts +43 -0
- package/lib/typescript/logger/components/ColorsLog.d.ts.map +1 -0
- package/lib/typescript/logger/components/Header.d.ts +8 -0
- package/lib/typescript/logger/components/Header.d.ts.map +1 -0
- package/lib/typescript/logger/components/NetworkLogger.d.ts +11 -0
- package/lib/typescript/logger/components/NetworkLogger.d.ts.map +1 -0
- package/lib/typescript/logger/components/Options.d.ts +10 -0
- package/lib/typescript/logger/components/Options.d.ts.map +1 -0
- package/lib/typescript/logger/components/RequestDetails.d.ts +9 -0
- package/lib/typescript/logger/components/RequestDetails.d.ts.map +1 -0
- package/lib/typescript/logger/components/RequestList.d.ts +27 -0
- package/lib/typescript/logger/components/RequestList.d.ts.map +1 -0
- package/lib/typescript/logger/components/ResultItem.d.ts +13 -0
- package/lib/typescript/logger/components/ResultItem.d.ts.map +1 -0
- package/lib/typescript/logger/components/SearchBar.d.ts +12 -0
- package/lib/typescript/logger/components/SearchBar.d.ts.map +1 -0
- package/lib/typescript/logger/components/Unmounted.d.ts +4 -0
- package/lib/typescript/logger/components/Unmounted.d.ts.map +1 -0
- package/lib/typescript/logger/libs.d.ts +5 -0
- package/lib/typescript/logger/libs.d.ts.map +1 -0
- package/lib/typescript/logger/loggerSingleton.d.ts +4 -0
- package/lib/typescript/logger/loggerSingleton.d.ts.map +1 -0
- package/lib/typescript/logger/theme.d.ts +21 -0
- package/lib/typescript/logger/theme.d.ts.map +1 -0
- package/lib/typescript/logger/types.d.ts +32 -0
- package/lib/typescript/logger/types.d.ts.map +1 -0
- package/lib/typescript/logger/utils/createHar.d.ts +61 -0
- package/lib/typescript/logger/utils/createHar.d.ts.map +1 -0
- package/lib/typescript/logger/utils/extractHost.d.ts +3 -0
- package/lib/typescript/logger/utils/extractHost.d.ts.map +1 -0
- package/lib/typescript/logger/utils/fromEntries.d.ts +3 -0
- package/lib/typescript/logger/utils/fromEntries.d.ts.map +1 -0
- package/lib/typescript/logger/utils/logger.d.ts +2 -0
- package/lib/typescript/logger/utils/logger.d.ts.map +1 -0
- package/lib/typescript/navigation/NavigationApp.d.ts.map +1 -0
- package/lib/typescript/navigation/NavigatorStack.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/header/HeaderView.d.ts +1 -1
- package/lib/typescript/navigation/header/HeaderView.d.ts.map +1 -0
- package/lib/typescript/navigation/index.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/leftMenu/LeftMenuApp.d.ts +1 -1
- package/lib/typescript/navigation/leftMenu/LeftMenuApp.d.ts.map +1 -0
- package/lib/typescript/navigation/navigator/Navigator.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/rightMenu/RightMenuApp.d.ts +1 -1
- package/lib/typescript/navigation/rightMenu/RightMenuApp.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/stack/ModalSecondStack.d.ts +4 -4
- package/lib/typescript/navigation/stack/ModalSecondStack.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/stack/ModalStack.d.ts +1 -1
- package/lib/typescript/navigation/stack/ModalStack.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/stack/ToastAnimationView.d.ts +1 -1
- package/lib/typescript/navigation/stack/ToastAnimationView.d.ts.map +1 -0
- package/lib/typescript/navigation/stack/ToastStack.d.ts.map +1 -0
- package/lib/typescript/navigation/tab/RouterAppCustomer.d.ts.map +1 -0
- package/lib/typescript/navigation/tab/StackAppCustomer.d.ts.map +1 -0
- package/{src → lib}/typescript/navigation/tabBar/RouterApp.d.ts +4 -3
- package/lib/typescript/navigation/tabBar/RouterApp.d.ts.map +1 -0
- package/lib/typescript/skeleton/SkeletonApp.d.ts.map +1 -0
- package/lib/typescript/top-tab/TabBarApp.d.ts.map +1 -0
- package/lib/typescript/top-tab/TabScrollApp.d.ts.map +1 -0
- package/lib/typescript/utils/CommonUtils.d.ts.map +1 -0
- package/package.json +24 -6
- package/src/module/assets/icons/IconApp.js +0 -1
- package/src/module/carousel/carousel/Carousel.js +0 -1
- package/src/module/carousel/pagination/Pagination.js +0 -1
- package/src/module/carousel/pagination/Pagination.style.js +0 -1
- package/src/module/carousel/pagination/PaginationDot.js +0 -1
- package/src/module/carousel/parallaximage/ParallaxImage.js +0 -1
- package/src/module/carousel/parallaximage/ParallaxImage.style.js +0 -1
- package/src/module/carousel/shallow-compare.js +0 -1
- package/src/module/carousel/utils/animations.js +0 -1
- package/src/module/cores/ButtonApp.js +0 -1
- package/src/module/cores/DeviceUtils.js +0 -1
- package/src/module/cores/ImageApp.js +0 -1
- package/src/module/cores/ImageFastApp.js +0 -1
- package/src/module/cores/InputApp.js +0 -1
- package/src/module/cores/InputMultiApp.js +0 -1
- package/src/module/cores/LoadingApp.js +0 -1
- package/src/module/cores/LogUtils.js +0 -1
- package/src/module/cores/RatingApp.js +0 -1
- package/src/module/cores/SliderApp.js +0 -1
- package/src/module/cores/StoresProviderApp.js +0 -1
- package/src/module/cores/TextApp.js +0 -1
- package/src/module/cores/Utils.js +0 -1
- package/src/module/cores/ViewApp.js +0 -1
- package/src/module/fab/FAB.js +0 -1
- package/src/module/fab/FAB.styles.js +0 -1
- package/src/module/fab/FAB.types.js +0 -1
- package/src/module/float-button/FABGroupDragApp.js +0 -1
- package/src/module/index.js +0 -1
- package/src/module/indicators/ball-indicator/index.js +0 -1
- package/src/module/indicators/ball-indicator/styles.js +0 -1
- package/src/module/indicators/bar-indicator/index.js +0 -1
- package/src/module/indicators/bar-indicator/styles.js +0 -1
- package/src/module/indicators/dot-indicator/index.js +0 -1
- package/src/module/indicators/dot-indicator/styles.js +0 -1
- package/src/module/indicators/index.js +0 -1
- package/src/module/indicators/indicator/index.js +0 -1
- package/src/module/indicators/material-indicator/index.js +0 -1
- package/src/module/indicators/material-indicator/styles.js +0 -1
- package/src/module/indicators/pacman-indicator/index.js +0 -1
- package/src/module/indicators/pacman-indicator/styles.js +0 -1
- package/src/module/indicators/pulse-indicator/index.js +0 -1
- package/src/module/indicators/pulse-indicator/styles.js +0 -1
- package/src/module/indicators/skype-indicator/index.js +0 -1
- package/src/module/indicators/skype-indicator/styles.js +0 -1
- package/src/module/indicators/ui-activity-indicator/index.js +0 -1
- package/src/module/indicators/ui-activity-indicator/styles.js +0 -1
- package/src/module/indicators/wave-indicator/index.js +0 -1
- package/src/module/indicators/wave-indicator/styles.js +0 -1
- package/src/module/navigation/NavigationApp.js +0 -1
- package/src/module/navigation/NavigatorStack.js +0 -1
- package/src/module/navigation/header/HeaderView.js +0 -1
- package/src/module/navigation/index.js +0 -1
- package/src/module/navigation/leftMenu/LeftMenuApp.js +0 -1
- package/src/module/navigation/navigator/Navigator.js +0 -1
- package/src/module/navigation/rightMenu/RightMenuApp.js +0 -1
- package/src/module/navigation/stack/ModalSecondStack.js +0 -1
- package/src/module/navigation/stack/ModalStack.js +0 -1
- package/src/module/navigation/stack/ToastAnimationView.js +0 -1
- package/src/module/navigation/stack/ToastStack.js +0 -1
- package/src/module/navigation/tab/RouterAppCustomer.js +0 -1
- package/src/module/navigation/tab/StackAppCustomer.js +0 -1
- package/src/module/navigation/tabBar/RouterApp.js +0 -1
- package/src/module/skeleton/SkeletonApp.js +0 -1
- package/src/module/tooltip/Helper.js +0 -1
- package/src/module/tooltip/TooltipApp.js +0 -1
- package/src/module/top-tab/TabBarApp.js +0 -1
- package/src/module/top-tab/TabScrollApp.js +0 -1
- package/src/module/utils/CommonUtils.js +0 -1
- package/src/typescript/cores/DeviceUtils.d.ts +0 -4
- package/src/typescript/float-button/FABGroupDragApp.d.ts +0 -4
- package/src/typescript/indicators/ball-indicator/index.d.ts +0 -25
- package/src/typescript/indicators/bar-indicator/index.d.ts +0 -26
- package/src/typescript/indicators/dot-indicator/index.d.ts +0 -26
- package/src/typescript/indicators/material-indicator/index.d.ts +0 -25
- package/src/typescript/indicators/pacman-indicator/index.d.ts +0 -26
- package/src/typescript/indicators/pulse-indicator/index.d.ts +0 -25
- package/src/typescript/indicators/skype-indicator/index.d.ts +0 -30
- package/src/typescript/indicators/ui-activity-indicator/index.d.ts +0 -25
- package/src/typescript/indicators/wave-indicator/index.d.ts +0 -31
- /package/{src/module → lib/commonjs}/assets/icons/ic_close.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_exit.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_rate_empty.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_rate_full.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_rate_half.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_toast_error.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_toast_info.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_toast_success.png +0 -0
- /package/{src/module → lib/commonjs}/assets/icons/ic_toast_warning.png +0 -0
- /package/{src → lib}/typescript/assets/icons/IconApp.d.ts +0 -0
- /package/{src → lib}/typescript/carousel/shallow-compare.d.ts +0 -0
- /package/{src → lib}/typescript/cores/ButtonApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/ImageApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/ImageFastApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/InputApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/InputMultiApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/LoadingApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/LogUtils.d.ts +0 -0
- /package/{src → lib}/typescript/cores/SliderApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/TextApp.d.ts +0 -0
- /package/{src → lib}/typescript/cores/ViewApp.d.ts +0 -0
- /package/{src → lib}/typescript/fab/FAB.d.ts +0 -0
- /package/{src → lib}/typescript/fab/FAB.styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/ball-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/bar-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/dot-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/index.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/material-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/pacman-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/pulse-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/skype-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/ui-activity-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/indicators/wave-indicator/styles.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/NavigationApp.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/NavigatorStack.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/index.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/navigator/Navigator.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/stack/ToastStack.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/tab/RouterAppCustomer.d.ts +0 -0
- /package/{src → lib}/typescript/navigation/tab/StackAppCustomer.d.ts +0 -0
- /package/{src → lib}/typescript/skeleton/SkeletonApp.d.ts +0 -0
- /package/{src → lib}/typescript/top-tab/TabBarApp.d.ts +0 -0
- /package/{src → lib}/typescript/top-tab/TabScrollApp.d.ts +0 -0
- /package/{src → lib}/typescript/utils/CommonUtils.d.ts +0 -0
|
@@ -0,0 +1,1311 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _shallowCompare = _interopRequireDefault(require("../shallow-compare"));
|
|
11
|
+
var _deprecatedReactNativePropTypes = require("deprecated-react-native-prop-types");
|
|
12
|
+
var _animations = require("../utils/animations");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
const IS_IOS = _reactNative.Platform.OS === 'ios';
|
|
17
|
+
|
|
18
|
+
// Native driver for scroll events
|
|
19
|
+
// See: https://facebook.github.io/react-native/blog/2017/02/14/using-native-driver-for-animated.html
|
|
20
|
+
const AnimatedFlatList = _reactNative.FlatList ? _reactNative.Animated.createAnimatedComponent(_reactNative.FlatList) : null;
|
|
21
|
+
const AnimatedScrollView = _reactNative.Animated.createAnimatedComponent(_reactNative.ScrollView);
|
|
22
|
+
|
|
23
|
+
// React Native automatically handles RTL layouts; unfortunately, it's buggy with horizontal ScrollView
|
|
24
|
+
// See https://github.com/facebook/react-native/issues/11960
|
|
25
|
+
// NOTE: the following variable is not declared in the constructor
|
|
26
|
+
// otherwise it is undefined at init, which messes with custom indexes
|
|
27
|
+
const IS_RTL = _reactNative.I18nManager.isRTL;
|
|
28
|
+
class Carousel extends _react.Component {
|
|
29
|
+
static propTypes = {
|
|
30
|
+
data: _propTypes.default.array.isRequired,
|
|
31
|
+
renderItem: _propTypes.default.func.isRequired,
|
|
32
|
+
itemWidth: _propTypes.default.number,
|
|
33
|
+
// required for horizontal carousel
|
|
34
|
+
itemHeight: _propTypes.default.number,
|
|
35
|
+
// required for vertical carousel
|
|
36
|
+
sliderWidth: _propTypes.default.number,
|
|
37
|
+
// required for horizontal carousel
|
|
38
|
+
sliderHeight: _propTypes.default.number,
|
|
39
|
+
// required for vertical carousel
|
|
40
|
+
activeAnimationType: _propTypes.default.string,
|
|
41
|
+
activeAnimationOptions: _propTypes.default.object,
|
|
42
|
+
activeSlideAlignment: _propTypes.default.oneOf(['center', 'end', 'start']),
|
|
43
|
+
activeSlideOffset: _propTypes.default.number,
|
|
44
|
+
apparitionDelay: _propTypes.default.number,
|
|
45
|
+
autoplay: _propTypes.default.bool,
|
|
46
|
+
autoplayDelay: _propTypes.default.number,
|
|
47
|
+
autoplayInterval: _propTypes.default.number,
|
|
48
|
+
callbackOffsetMargin: _propTypes.default.number,
|
|
49
|
+
containerCustomStyle: _deprecatedReactNativePropTypes.ViewPropTypes ? _deprecatedReactNativePropTypes.ViewPropTypes.style : _reactNative.View.propTypes.style,
|
|
50
|
+
contentContainerCustomStyle: _deprecatedReactNativePropTypes.ViewPropTypes ? _deprecatedReactNativePropTypes.ViewPropTypes.style : _reactNative.View.propTypes.style,
|
|
51
|
+
enableMomentum: _propTypes.default.bool,
|
|
52
|
+
enableSnap: _propTypes.default.bool,
|
|
53
|
+
firstItem: _propTypes.default.number,
|
|
54
|
+
hasParallaxImages: _propTypes.default.bool,
|
|
55
|
+
inactiveSlideOpacity: _propTypes.default.number,
|
|
56
|
+
inactiveSlideScale: _propTypes.default.number,
|
|
57
|
+
inactiveSlideShift: _propTypes.default.number,
|
|
58
|
+
layout: _propTypes.default.oneOf(['default', 'stack', 'tinder']),
|
|
59
|
+
layoutCardOffset: _propTypes.default.number,
|
|
60
|
+
lockScrollTimeoutDuration: _propTypes.default.number,
|
|
61
|
+
lockScrollWhileSnapping: _propTypes.default.bool,
|
|
62
|
+
loop: _propTypes.default.bool,
|
|
63
|
+
loopClonesPerSide: _propTypes.default.number,
|
|
64
|
+
scrollEnabled: _propTypes.default.bool,
|
|
65
|
+
scrollInterpolator: _propTypes.default.func,
|
|
66
|
+
slideInterpolatedStyle: _propTypes.default.func,
|
|
67
|
+
slideStyle: _deprecatedReactNativePropTypes.ViewPropTypes ? _deprecatedReactNativePropTypes.ViewPropTypes.style : _reactNative.View.propTypes.style,
|
|
68
|
+
shouldOptimizeUpdates: _propTypes.default.bool,
|
|
69
|
+
swipeThreshold: _propTypes.default.number,
|
|
70
|
+
useScrollView: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.func]),
|
|
71
|
+
vertical: _propTypes.default.bool,
|
|
72
|
+
onBeforeSnapToItem: _propTypes.default.func,
|
|
73
|
+
onSnapToItem: _propTypes.default.func
|
|
74
|
+
};
|
|
75
|
+
static defaultProps = {
|
|
76
|
+
activeAnimationType: 'timing',
|
|
77
|
+
activeAnimationOptions: null,
|
|
78
|
+
activeSlideAlignment: 'center',
|
|
79
|
+
activeSlideOffset: 20,
|
|
80
|
+
apparitionDelay: 0,
|
|
81
|
+
autoplay: false,
|
|
82
|
+
autoplayDelay: 1000,
|
|
83
|
+
autoplayInterval: 3000,
|
|
84
|
+
callbackOffsetMargin: 5,
|
|
85
|
+
containerCustomStyle: {},
|
|
86
|
+
contentContainerCustomStyle: {},
|
|
87
|
+
enableMomentum: false,
|
|
88
|
+
enableSnap: true,
|
|
89
|
+
firstItem: 0,
|
|
90
|
+
hasParallaxImages: false,
|
|
91
|
+
inactiveSlideOpacity: 0.7,
|
|
92
|
+
inactiveSlideScale: 0.9,
|
|
93
|
+
inactiveSlideShift: 0,
|
|
94
|
+
layout: 'default',
|
|
95
|
+
lockScrollTimeoutDuration: 1000,
|
|
96
|
+
lockScrollWhileSnapping: false,
|
|
97
|
+
loop: false,
|
|
98
|
+
loopClonesPerSide: 3,
|
|
99
|
+
scrollEnabled: true,
|
|
100
|
+
slideStyle: {},
|
|
101
|
+
shouldOptimizeUpdates: true,
|
|
102
|
+
swipeThreshold: 20,
|
|
103
|
+
useScrollView: !AnimatedFlatList,
|
|
104
|
+
vertical: false
|
|
105
|
+
};
|
|
106
|
+
constructor(props) {
|
|
107
|
+
super(props);
|
|
108
|
+
this.state = {
|
|
109
|
+
hideCarousel: true,
|
|
110
|
+
interpolators: []
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// The following values are not stored in the state because 'setState()' is asynchronous
|
|
114
|
+
// and this results in an absolutely crappy behavior on Android while swiping (see #156)
|
|
115
|
+
const initialActiveItem = this._getFirstItem(props.firstItem);
|
|
116
|
+
this._activeItem = initialActiveItem;
|
|
117
|
+
this._previousActiveItem = initialActiveItem;
|
|
118
|
+
this._previousFirstItem = initialActiveItem;
|
|
119
|
+
this._previousItemsLength = initialActiveItem;
|
|
120
|
+
this._mounted = false;
|
|
121
|
+
this._positions = [];
|
|
122
|
+
this._currentContentOffset = 0; // store ScrollView's scroll position
|
|
123
|
+
this._canFireBeforeCallback = false;
|
|
124
|
+
this._canFireCallback = false;
|
|
125
|
+
this._scrollOffsetRef = null;
|
|
126
|
+
this._onScrollTriggered = true; // used when momentum is enabled to prevent an issue with edges items
|
|
127
|
+
this._lastScrollDate = 0; // used to work around a FlatList bug
|
|
128
|
+
this._scrollEnabled = props.scrollEnabled !== false;
|
|
129
|
+
this._initPositionsAndInterpolators = this._initPositionsAndInterpolators.bind(this);
|
|
130
|
+
this._renderItem = this._renderItem.bind(this);
|
|
131
|
+
this._onSnap = this._onSnap.bind(this);
|
|
132
|
+
this._onLayout = this._onLayout.bind(this);
|
|
133
|
+
this._onScroll = this._onScroll.bind(this);
|
|
134
|
+
this._onScrollBeginDrag = props.enableSnap ? this._onScrollBeginDrag.bind(this) : undefined;
|
|
135
|
+
this._onScrollEnd = props.enableSnap || props.autoplay ? this._onScrollEnd.bind(this) : undefined;
|
|
136
|
+
this._onScrollEndDrag = !props.enableMomentum ? this._onScrollEndDrag.bind(this) : undefined;
|
|
137
|
+
this._onMomentumScrollEnd = props.enableMomentum ? this._onMomentumScrollEnd.bind(this) : undefined;
|
|
138
|
+
this._onTouchStart = this._onTouchStart.bind(this);
|
|
139
|
+
this._onTouchEnd = this._onTouchEnd.bind(this);
|
|
140
|
+
this._onTouchRelease = this._onTouchRelease.bind(this);
|
|
141
|
+
this._getKeyExtractor = this._getKeyExtractor.bind(this);
|
|
142
|
+
this._setScrollHandler(props);
|
|
143
|
+
|
|
144
|
+
// This bool aims at fixing an iOS bug due to scrollTo that triggers onMomentumScrollEnd.
|
|
145
|
+
// onMomentumScrollEnd fires this._snapScroll, thus creating an infinite loop.
|
|
146
|
+
this._ignoreNextMomentum = false;
|
|
147
|
+
|
|
148
|
+
// Warnings
|
|
149
|
+
if (!_deprecatedReactNativePropTypes.ViewPropTypes) {
|
|
150
|
+
console.warn('react-native-snap-carousel: It is recommended to use at least version 0.44 of React Native with the plugin');
|
|
151
|
+
}
|
|
152
|
+
if (!props.vertical && (!props.sliderWidth || !props.itemWidth)) {
|
|
153
|
+
console.error('react-native-snap-carousel: You need to specify both `sliderWidth` and `itemWidth` for horizontal carousels');
|
|
154
|
+
}
|
|
155
|
+
if (props.vertical && (!props.sliderHeight || !props.itemHeight)) {
|
|
156
|
+
console.error('react-native-snap-carousel: You need to specify both `sliderHeight` and `itemHeight` for vertical carousels');
|
|
157
|
+
}
|
|
158
|
+
if (props.apparitionDelay && !IS_IOS && !props.useScrollView) {
|
|
159
|
+
console.warn('react-native-snap-carousel: Using `apparitionDelay` on Android is not recommended since it can lead to rendering issues');
|
|
160
|
+
}
|
|
161
|
+
if (props.customAnimationType || props.customAnimationOptions) {
|
|
162
|
+
console.warn('react-native-snap-carousel: Props `customAnimationType` and `customAnimationOptions` have been renamed to `activeAnimationType` and `activeAnimationOptions`');
|
|
163
|
+
}
|
|
164
|
+
if (props.onScrollViewScroll) {
|
|
165
|
+
console.error('react-native-snap-carousel: Prop `onScrollViewScroll` has been removed. Use `onScroll` instead');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
componentDidMount() {
|
|
169
|
+
const {
|
|
170
|
+
apparitionDelay,
|
|
171
|
+
autoplay,
|
|
172
|
+
firstItem
|
|
173
|
+
} = this.props;
|
|
174
|
+
const _firstItem = this._getFirstItem(firstItem);
|
|
175
|
+
const apparitionCallback = () => {
|
|
176
|
+
this.setState({
|
|
177
|
+
hideCarousel: false
|
|
178
|
+
});
|
|
179
|
+
if (autoplay) {
|
|
180
|
+
this.startAutoplay();
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
this._mounted = true;
|
|
184
|
+
this._initPositionsAndInterpolators();
|
|
185
|
+
|
|
186
|
+
// Without 'requestAnimationFrame' or a `0` timeout, images will randomly not be rendered on Android...
|
|
187
|
+
requestAnimationFrame(() => {
|
|
188
|
+
if (!this._mounted) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
this._snapToItem(_firstItem, false, false, true, false);
|
|
192
|
+
this._hackActiveSlideAnimation(_firstItem, 'start', true);
|
|
193
|
+
if (apparitionDelay) {
|
|
194
|
+
this._apparitionTimeout = setTimeout(() => {
|
|
195
|
+
apparitionCallback();
|
|
196
|
+
}, apparitionDelay);
|
|
197
|
+
} else {
|
|
198
|
+
apparitionCallback();
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
shouldComponentUpdate(nextProps, nextState) {
|
|
203
|
+
if (this.props.shouldOptimizeUpdates === false) {
|
|
204
|
+
return true;
|
|
205
|
+
} else {
|
|
206
|
+
return (0, _shallowCompare.default)(this, nextProps, nextState);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
componentDidUpdate(prevProps) {
|
|
210
|
+
const {
|
|
211
|
+
interpolators
|
|
212
|
+
} = this.state;
|
|
213
|
+
const {
|
|
214
|
+
firstItem,
|
|
215
|
+
itemHeight,
|
|
216
|
+
itemWidth,
|
|
217
|
+
scrollEnabled,
|
|
218
|
+
sliderHeight,
|
|
219
|
+
sliderWidth
|
|
220
|
+
} = this.props;
|
|
221
|
+
const itemsLength = this._getCustomDataLength(this.props);
|
|
222
|
+
if (!itemsLength) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const nextFirstItem = this._getFirstItem(firstItem, this.props);
|
|
226
|
+
let nextActiveItem = this._activeItem || this._activeItem === 0 ? this._activeItem : nextFirstItem;
|
|
227
|
+
const hasNewSliderWidth = sliderWidth && sliderWidth !== prevProps.sliderWidth;
|
|
228
|
+
const hasNewSliderHeight = sliderHeight && sliderHeight !== prevProps.sliderHeight;
|
|
229
|
+
const hasNewItemWidth = itemWidth && itemWidth !== prevProps.itemWidth;
|
|
230
|
+
const hasNewItemHeight = itemHeight && itemHeight !== prevProps.itemHeight;
|
|
231
|
+
const hasNewScrollEnabled = scrollEnabled !== prevProps.scrollEnabled;
|
|
232
|
+
|
|
233
|
+
// Prevent issues with dynamically removed items
|
|
234
|
+
if (nextActiveItem > itemsLength - 1) {
|
|
235
|
+
nextActiveItem = itemsLength - 1;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Handle changing scrollEnabled independent of user -> carousel interaction
|
|
239
|
+
if (hasNewScrollEnabled) {
|
|
240
|
+
this._setScrollEnabled(scrollEnabled);
|
|
241
|
+
}
|
|
242
|
+
if (interpolators.length !== itemsLength || hasNewSliderWidth || hasNewSliderHeight || hasNewItemWidth || hasNewItemHeight) {
|
|
243
|
+
this._activeItem = nextActiveItem;
|
|
244
|
+
this._previousItemsLength = itemsLength;
|
|
245
|
+
this._initPositionsAndInterpolators(this.props);
|
|
246
|
+
|
|
247
|
+
// Handle scroll issue when dynamically removing items (see #133)
|
|
248
|
+
// This also fixes first item's active state on Android
|
|
249
|
+
// Because 'initialScrollIndex' apparently doesn't trigger scroll
|
|
250
|
+
if (this._previousItemsLength > itemsLength) {
|
|
251
|
+
this._hackActiveSlideAnimation(nextActiveItem, null, true);
|
|
252
|
+
}
|
|
253
|
+
if (hasNewSliderWidth || hasNewSliderHeight || hasNewItemWidth || hasNewItemHeight) {
|
|
254
|
+
this._snapToItem(nextActiveItem, false, false, false, false);
|
|
255
|
+
}
|
|
256
|
+
} else if (nextFirstItem !== this._previousFirstItem && nextFirstItem !== this._activeItem) {
|
|
257
|
+
this._activeItem = nextFirstItem;
|
|
258
|
+
this._previousFirstItem = nextFirstItem;
|
|
259
|
+
this._snapToItem(nextFirstItem, false, true, false, false);
|
|
260
|
+
}
|
|
261
|
+
if (this.props.onScroll !== prevProps.onScroll) {
|
|
262
|
+
this._setScrollHandler(this.props);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
componentWillUnmount() {
|
|
266
|
+
this._mounted = false;
|
|
267
|
+
this.stopAutoplay();
|
|
268
|
+
clearTimeout(this._apparitionTimeout);
|
|
269
|
+
clearTimeout(this._hackSlideAnimationTimeout);
|
|
270
|
+
clearTimeout(this._enableAutoplayTimeout);
|
|
271
|
+
clearTimeout(this._autoplayTimeout);
|
|
272
|
+
clearTimeout(this._snapNoMomentumTimeout);
|
|
273
|
+
clearTimeout(this._edgeItemTimeout);
|
|
274
|
+
clearTimeout(this._lockScrollTimeout);
|
|
275
|
+
}
|
|
276
|
+
get realIndex() {
|
|
277
|
+
return this._activeItem;
|
|
278
|
+
}
|
|
279
|
+
get currentIndex() {
|
|
280
|
+
return this._getDataIndex(this._activeItem);
|
|
281
|
+
}
|
|
282
|
+
get currentScrollPosition() {
|
|
283
|
+
return this._currentContentOffset;
|
|
284
|
+
}
|
|
285
|
+
_setScrollHandler(props) {
|
|
286
|
+
// Native driver for scroll events
|
|
287
|
+
const scrollEventConfig = {
|
|
288
|
+
listener: this._onScroll,
|
|
289
|
+
useNativeDriver: true
|
|
290
|
+
};
|
|
291
|
+
this._scrollPos = new _reactNative.Animated.Value(0);
|
|
292
|
+
const argMapping = props.vertical ? [{
|
|
293
|
+
nativeEvent: {
|
|
294
|
+
contentOffset: {
|
|
295
|
+
y: this._scrollPos
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}] : [{
|
|
299
|
+
nativeEvent: {
|
|
300
|
+
contentOffset: {
|
|
301
|
+
x: this._scrollPos
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}];
|
|
305
|
+
if (props.onScroll && Array.isArray(props.onScroll._argMapping)) {
|
|
306
|
+
// Because of a react-native issue https://github.com/facebook/react-native/issues/13294
|
|
307
|
+
argMapping.pop();
|
|
308
|
+
const [argMap] = props.onScroll._argMapping;
|
|
309
|
+
if (argMap && argMap.nativeEvent && argMap.nativeEvent.contentOffset) {
|
|
310
|
+
// Shares the same animated value passed in props
|
|
311
|
+
this._scrollPos = argMap.nativeEvent.contentOffset.x || argMap.nativeEvent.contentOffset.y || this._scrollPos;
|
|
312
|
+
}
|
|
313
|
+
argMapping.push(...props.onScroll._argMapping);
|
|
314
|
+
}
|
|
315
|
+
this._onScrollHandler = _reactNative.Animated.event(argMapping, scrollEventConfig);
|
|
316
|
+
}
|
|
317
|
+
_needsScrollView() {
|
|
318
|
+
const {
|
|
319
|
+
useScrollView
|
|
320
|
+
} = this.props;
|
|
321
|
+
return useScrollView || !AnimatedFlatList || this._shouldUseStackLayout() || this._shouldUseTinderLayout();
|
|
322
|
+
}
|
|
323
|
+
_needsRTLAdaptations() {
|
|
324
|
+
const {
|
|
325
|
+
vertical
|
|
326
|
+
} = this.props;
|
|
327
|
+
return IS_RTL && !IS_IOS && !vertical;
|
|
328
|
+
}
|
|
329
|
+
_canLockScroll() {
|
|
330
|
+
const {
|
|
331
|
+
scrollEnabled,
|
|
332
|
+
enableMomentum,
|
|
333
|
+
lockScrollWhileSnapping
|
|
334
|
+
} = this.props;
|
|
335
|
+
return scrollEnabled && !enableMomentum && lockScrollWhileSnapping;
|
|
336
|
+
}
|
|
337
|
+
_enableLoop() {
|
|
338
|
+
const {
|
|
339
|
+
data,
|
|
340
|
+
enableSnap,
|
|
341
|
+
loop
|
|
342
|
+
} = this.props;
|
|
343
|
+
return enableSnap && loop && data && data.length && data.length > 1;
|
|
344
|
+
}
|
|
345
|
+
_shouldAnimateSlides(props = this.props) {
|
|
346
|
+
const {
|
|
347
|
+
inactiveSlideOpacity,
|
|
348
|
+
inactiveSlideScale,
|
|
349
|
+
scrollInterpolator,
|
|
350
|
+
slideInterpolatedStyle
|
|
351
|
+
} = props;
|
|
352
|
+
return inactiveSlideOpacity < 1 || inactiveSlideScale < 1 || !!scrollInterpolator || !!slideInterpolatedStyle || this._shouldUseShiftLayout() || this._shouldUseStackLayout() || this._shouldUseTinderLayout();
|
|
353
|
+
}
|
|
354
|
+
_shouldUseCustomAnimation() {
|
|
355
|
+
const {
|
|
356
|
+
activeAnimationOptions
|
|
357
|
+
} = this.props;
|
|
358
|
+
return !!activeAnimationOptions && !this._shouldUseStackLayout() && !this._shouldUseTinderLayout();
|
|
359
|
+
}
|
|
360
|
+
_shouldUseShiftLayout() {
|
|
361
|
+
const {
|
|
362
|
+
inactiveSlideShift,
|
|
363
|
+
layout
|
|
364
|
+
} = this.props;
|
|
365
|
+
return layout === 'default' && inactiveSlideShift !== 0;
|
|
366
|
+
}
|
|
367
|
+
_shouldUseStackLayout() {
|
|
368
|
+
return this.props.layout === 'stack';
|
|
369
|
+
}
|
|
370
|
+
_shouldUseTinderLayout() {
|
|
371
|
+
return this.props.layout === 'tinder';
|
|
372
|
+
}
|
|
373
|
+
_getCustomData(props = this.props) {
|
|
374
|
+
const {
|
|
375
|
+
data,
|
|
376
|
+
loopClonesPerSide
|
|
377
|
+
} = props;
|
|
378
|
+
const dataLength = data && data.length;
|
|
379
|
+
if (!dataLength) {
|
|
380
|
+
return [];
|
|
381
|
+
}
|
|
382
|
+
if (!this._enableLoop()) {
|
|
383
|
+
return data;
|
|
384
|
+
}
|
|
385
|
+
let previousItems = [];
|
|
386
|
+
let nextItems = [];
|
|
387
|
+
if (loopClonesPerSide > dataLength) {
|
|
388
|
+
const dataMultiplier = Math.floor(loopClonesPerSide / dataLength);
|
|
389
|
+
const remainder = loopClonesPerSide % dataLength;
|
|
390
|
+
for (let i = 0; i < dataMultiplier; i++) {
|
|
391
|
+
previousItems.push(...data);
|
|
392
|
+
nextItems.push(...data);
|
|
393
|
+
}
|
|
394
|
+
previousItems.unshift(...data.slice(-remainder));
|
|
395
|
+
nextItems.push(...data.slice(0, remainder));
|
|
396
|
+
} else {
|
|
397
|
+
previousItems = data.slice(-loopClonesPerSide);
|
|
398
|
+
nextItems = data.slice(0, loopClonesPerSide);
|
|
399
|
+
}
|
|
400
|
+
return previousItems.concat(data, nextItems);
|
|
401
|
+
}
|
|
402
|
+
_getCustomDataLength(props = this.props) {
|
|
403
|
+
const {
|
|
404
|
+
data,
|
|
405
|
+
loopClonesPerSide
|
|
406
|
+
} = props;
|
|
407
|
+
const dataLength = data && data.length;
|
|
408
|
+
if (!dataLength) {
|
|
409
|
+
return 0;
|
|
410
|
+
}
|
|
411
|
+
return this._enableLoop() ? dataLength + 2 * loopClonesPerSide : dataLength;
|
|
412
|
+
}
|
|
413
|
+
_getCustomIndex(index, props = this.props) {
|
|
414
|
+
const itemsLength = this._getCustomDataLength(props);
|
|
415
|
+
if (!itemsLength || !index && index !== 0) {
|
|
416
|
+
return 0;
|
|
417
|
+
}
|
|
418
|
+
return this._needsRTLAdaptations() ? itemsLength - index - 1 : index;
|
|
419
|
+
}
|
|
420
|
+
_getDataIndex(index) {
|
|
421
|
+
const {
|
|
422
|
+
data,
|
|
423
|
+
loopClonesPerSide
|
|
424
|
+
} = this.props;
|
|
425
|
+
const dataLength = data && data.length;
|
|
426
|
+
if (!this._enableLoop() || !dataLength) {
|
|
427
|
+
return index;
|
|
428
|
+
}
|
|
429
|
+
if (index >= dataLength + loopClonesPerSide) {
|
|
430
|
+
return loopClonesPerSide > dataLength ? (index - loopClonesPerSide) % dataLength : index - dataLength - loopClonesPerSide;
|
|
431
|
+
} else if (index < loopClonesPerSide) {
|
|
432
|
+
// TODO: is there a simpler way of determining the interpolated index?
|
|
433
|
+
if (loopClonesPerSide > dataLength) {
|
|
434
|
+
const baseDataIndexes = [];
|
|
435
|
+
const dataIndexes = [];
|
|
436
|
+
const dataMultiplier = Math.floor(loopClonesPerSide / dataLength);
|
|
437
|
+
const remainder = loopClonesPerSide % dataLength;
|
|
438
|
+
for (let i = 0; i < dataLength; i++) {
|
|
439
|
+
baseDataIndexes.push(i);
|
|
440
|
+
}
|
|
441
|
+
for (let j = 0; j < dataMultiplier; j++) {
|
|
442
|
+
dataIndexes.push(...baseDataIndexes);
|
|
443
|
+
}
|
|
444
|
+
dataIndexes.unshift(...baseDataIndexes.slice(-remainder));
|
|
445
|
+
return dataIndexes[index];
|
|
446
|
+
} else {
|
|
447
|
+
return index + dataLength - loopClonesPerSide;
|
|
448
|
+
}
|
|
449
|
+
} else {
|
|
450
|
+
return index - loopClonesPerSide;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Used with `snapToItem()` and 'PaginationDot'
|
|
455
|
+
_getPositionIndex(index) {
|
|
456
|
+
const {
|
|
457
|
+
loop,
|
|
458
|
+
loopClonesPerSide
|
|
459
|
+
} = this.props;
|
|
460
|
+
return loop ? index + loopClonesPerSide : index;
|
|
461
|
+
}
|
|
462
|
+
_getFirstItem(index, props = this.props) {
|
|
463
|
+
const {
|
|
464
|
+
loopClonesPerSide
|
|
465
|
+
} = props;
|
|
466
|
+
const itemsLength = this._getCustomDataLength(props);
|
|
467
|
+
if (!itemsLength || index > itemsLength - 1 || index < 0) {
|
|
468
|
+
return 0;
|
|
469
|
+
}
|
|
470
|
+
return this._enableLoop() ? index + loopClonesPerSide : index;
|
|
471
|
+
}
|
|
472
|
+
_getWrappedRef() {
|
|
473
|
+
if (this._carouselRef && (this._needsScrollView() && this._carouselRef.scrollTo || !this._needsScrollView() && this._carouselRef.scrollToOffset)) {
|
|
474
|
+
return this._carouselRef;
|
|
475
|
+
}
|
|
476
|
+
// https://github.com/facebook/react-native/issues/10635
|
|
477
|
+
// https://stackoverflow.com/a/48786374/8412141
|
|
478
|
+
return this._carouselRef && this._carouselRef.getNode && this._carouselRef.getNode();
|
|
479
|
+
}
|
|
480
|
+
_getScrollEnabled() {
|
|
481
|
+
return this._scrollEnabled;
|
|
482
|
+
}
|
|
483
|
+
_setScrollEnabled(scrollEnabled = true) {
|
|
484
|
+
const wrappedRef = this._getWrappedRef();
|
|
485
|
+
if (!wrappedRef || !wrappedRef.setNativeProps) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// 'setNativeProps()' is used instead of 'setState()' because the latter
|
|
490
|
+
// really takes a toll on Android behavior when momentum is disabled
|
|
491
|
+
wrappedRef.setNativeProps({
|
|
492
|
+
scrollEnabled
|
|
493
|
+
});
|
|
494
|
+
this._scrollEnabled = scrollEnabled;
|
|
495
|
+
}
|
|
496
|
+
_getKeyExtractor(item, index) {
|
|
497
|
+
return this._needsScrollView() ? `scrollview-item-${index}` : `flatlist-item-${index}`;
|
|
498
|
+
}
|
|
499
|
+
_getScrollOffset(event) {
|
|
500
|
+
const {
|
|
501
|
+
vertical
|
|
502
|
+
} = this.props;
|
|
503
|
+
return event && event.nativeEvent && event.nativeEvent.contentOffset && event.nativeEvent.contentOffset[vertical ? 'y' : 'x'] || 0;
|
|
504
|
+
}
|
|
505
|
+
_getContainerInnerMargin(opposite = false) {
|
|
506
|
+
const {
|
|
507
|
+
sliderWidth,
|
|
508
|
+
sliderHeight,
|
|
509
|
+
itemWidth,
|
|
510
|
+
itemHeight,
|
|
511
|
+
vertical,
|
|
512
|
+
activeSlideAlignment
|
|
513
|
+
} = this.props;
|
|
514
|
+
if (activeSlideAlignment === 'start' && !opposite || activeSlideAlignment === 'end' && opposite) {
|
|
515
|
+
return 0;
|
|
516
|
+
} else if (activeSlideAlignment === 'end' && !opposite || activeSlideAlignment === 'start' && opposite) {
|
|
517
|
+
return vertical ? sliderHeight - itemHeight : sliderWidth - itemWidth;
|
|
518
|
+
} else {
|
|
519
|
+
return vertical ? (sliderHeight - itemHeight) / 2 : (sliderWidth - itemWidth) / 2;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
_getViewportOffset() {
|
|
523
|
+
const {
|
|
524
|
+
sliderWidth,
|
|
525
|
+
sliderHeight,
|
|
526
|
+
itemWidth,
|
|
527
|
+
itemHeight,
|
|
528
|
+
vertical,
|
|
529
|
+
activeSlideAlignment
|
|
530
|
+
} = this.props;
|
|
531
|
+
if (activeSlideAlignment === 'start') {
|
|
532
|
+
return vertical ? itemHeight / 2 : itemWidth / 2;
|
|
533
|
+
} else if (activeSlideAlignment === 'end') {
|
|
534
|
+
return vertical ? sliderHeight - itemHeight / 2 : sliderWidth - itemWidth / 2;
|
|
535
|
+
} else {
|
|
536
|
+
return vertical ? sliderHeight / 2 : sliderWidth / 2;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
_getCenter(offset) {
|
|
540
|
+
return offset + this._getViewportOffset() - this._getContainerInnerMargin();
|
|
541
|
+
}
|
|
542
|
+
_getActiveItem(offset) {
|
|
543
|
+
const {
|
|
544
|
+
activeSlideOffset,
|
|
545
|
+
swipeThreshold
|
|
546
|
+
} = this.props;
|
|
547
|
+
const center = this._getCenter(offset);
|
|
548
|
+
const centerOffset = activeSlideOffset || swipeThreshold;
|
|
549
|
+
for (let i = 0; i < this._positions.length; i++) {
|
|
550
|
+
const {
|
|
551
|
+
start,
|
|
552
|
+
end
|
|
553
|
+
} = this._positions[i];
|
|
554
|
+
if (center + centerOffset >= start && center - centerOffset <= end) {
|
|
555
|
+
return i;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
const lastIndex = this._positions.length - 1;
|
|
559
|
+
if (this._positions[lastIndex] && center - centerOffset > this._positions[lastIndex].end) {
|
|
560
|
+
return lastIndex;
|
|
561
|
+
}
|
|
562
|
+
return 0;
|
|
563
|
+
}
|
|
564
|
+
_initPositionsAndInterpolators(props = this.props) {
|
|
565
|
+
const {
|
|
566
|
+
data,
|
|
567
|
+
itemWidth,
|
|
568
|
+
itemHeight,
|
|
569
|
+
scrollInterpolator,
|
|
570
|
+
vertical
|
|
571
|
+
} = props;
|
|
572
|
+
const sizeRef = vertical ? itemHeight : itemWidth;
|
|
573
|
+
if (!data || !data.length) {
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
let interpolators = [];
|
|
577
|
+
this._positions = [];
|
|
578
|
+
this._getCustomData(props).forEach((itemData, index) => {
|
|
579
|
+
const _index = this._getCustomIndex(index, props);
|
|
580
|
+
let animatedValue;
|
|
581
|
+
this._positions[index] = {
|
|
582
|
+
start: index * sizeRef,
|
|
583
|
+
end: index * sizeRef + sizeRef
|
|
584
|
+
};
|
|
585
|
+
if (!this._shouldAnimateSlides(props)) {
|
|
586
|
+
animatedValue = new _reactNative.Animated.Value(1);
|
|
587
|
+
} else if (this._shouldUseCustomAnimation()) {
|
|
588
|
+
animatedValue = new _reactNative.Animated.Value(_index === this._activeItem ? 1 : 0);
|
|
589
|
+
} else {
|
|
590
|
+
let interpolator;
|
|
591
|
+
if (scrollInterpolator) {
|
|
592
|
+
interpolator = scrollInterpolator(_index, props);
|
|
593
|
+
} else if (this._shouldUseStackLayout()) {
|
|
594
|
+
interpolator = (0, _animations.stackScrollInterpolator)(_index, props);
|
|
595
|
+
} else if (this._shouldUseTinderLayout()) {
|
|
596
|
+
interpolator = (0, _animations.tinderScrollInterpolator)(_index, props);
|
|
597
|
+
}
|
|
598
|
+
if (!interpolator || !interpolator.inputRange || !interpolator.outputRange) {
|
|
599
|
+
interpolator = (0, _animations.defaultScrollInterpolator)(_index, props);
|
|
600
|
+
}
|
|
601
|
+
animatedValue = this._scrollPos.interpolate({
|
|
602
|
+
...interpolator,
|
|
603
|
+
extrapolate: 'clamp'
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
interpolators.push(animatedValue);
|
|
607
|
+
});
|
|
608
|
+
this.setState({
|
|
609
|
+
interpolators
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
_getSlideAnimation(index, toValue) {
|
|
613
|
+
const {
|
|
614
|
+
interpolators
|
|
615
|
+
} = this.state;
|
|
616
|
+
const {
|
|
617
|
+
activeAnimationType,
|
|
618
|
+
activeAnimationOptions
|
|
619
|
+
} = this.props;
|
|
620
|
+
const animatedValue = interpolators && interpolators[index];
|
|
621
|
+
if (!animatedValue && animatedValue !== 0) {
|
|
622
|
+
return null;
|
|
623
|
+
}
|
|
624
|
+
const animationCommonOptions = {
|
|
625
|
+
isInteraction: false,
|
|
626
|
+
useNativeDriver: true,
|
|
627
|
+
...activeAnimationOptions,
|
|
628
|
+
toValue: toValue
|
|
629
|
+
};
|
|
630
|
+
return _reactNative.Animated.parallel([_reactNative.Animated['timing'](animatedValue, {
|
|
631
|
+
...animationCommonOptions,
|
|
632
|
+
easing: _reactNative.Easing.linear
|
|
633
|
+
}), _reactNative.Animated[activeAnimationType](animatedValue, {
|
|
634
|
+
...animationCommonOptions
|
|
635
|
+
})]);
|
|
636
|
+
}
|
|
637
|
+
_playCustomSlideAnimation(current, next) {
|
|
638
|
+
const {
|
|
639
|
+
interpolators
|
|
640
|
+
} = this.state;
|
|
641
|
+
const itemsLength = this._getCustomDataLength();
|
|
642
|
+
const _currentIndex = this._getCustomIndex(current);
|
|
643
|
+
const _currentDataIndex = this._getDataIndex(_currentIndex);
|
|
644
|
+
const _nextIndex = this._getCustomIndex(next);
|
|
645
|
+
const _nextDataIndex = this._getDataIndex(_nextIndex);
|
|
646
|
+
let animations = [];
|
|
647
|
+
|
|
648
|
+
// Keep animations in sync when looping
|
|
649
|
+
if (this._enableLoop()) {
|
|
650
|
+
for (let i = 0; i < itemsLength; i++) {
|
|
651
|
+
if (this._getDataIndex(i) === _currentDataIndex && interpolators[i]) {
|
|
652
|
+
animations.push(this._getSlideAnimation(i, 0));
|
|
653
|
+
} else if (this._getDataIndex(i) === _nextDataIndex && interpolators[i]) {
|
|
654
|
+
animations.push(this._getSlideAnimation(i, 1));
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
} else {
|
|
658
|
+
if (interpolators[current]) {
|
|
659
|
+
animations.push(this._getSlideAnimation(current, 0));
|
|
660
|
+
}
|
|
661
|
+
if (interpolators[next]) {
|
|
662
|
+
animations.push(this._getSlideAnimation(next, 1));
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
_reactNative.Animated.parallel(animations, {
|
|
666
|
+
stopTogether: false
|
|
667
|
+
}).start();
|
|
668
|
+
}
|
|
669
|
+
_hackActiveSlideAnimation(index, goTo, force = false) {
|
|
670
|
+
const {
|
|
671
|
+
data
|
|
672
|
+
} = this.props;
|
|
673
|
+
if (!this._mounted || !this._carouselRef || !this._positions[index] || !force && this._enableLoop()) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
const offset = this._positions[index] && this._positions[index].start;
|
|
677
|
+
if (!offset && offset !== 0) {
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
const itemsLength = data && data.length;
|
|
681
|
+
const direction = goTo || itemsLength === 1 ? 'start' : 'end';
|
|
682
|
+
this._scrollTo(offset + (direction === 'start' ? -1 : 1), false);
|
|
683
|
+
clearTimeout(this._hackSlideAnimationTimeout);
|
|
684
|
+
this._hackSlideAnimationTimeout = setTimeout(() => {
|
|
685
|
+
this._scrollTo(offset, false);
|
|
686
|
+
}, 50); // works randomly when set to '0'
|
|
687
|
+
}
|
|
688
|
+
_lockScroll() {
|
|
689
|
+
const {
|
|
690
|
+
lockScrollTimeoutDuration
|
|
691
|
+
} = this.props;
|
|
692
|
+
clearTimeout(this._lockScrollTimeout);
|
|
693
|
+
this._lockScrollTimeout = setTimeout(() => {
|
|
694
|
+
this._releaseScroll();
|
|
695
|
+
}, lockScrollTimeoutDuration);
|
|
696
|
+
this._setScrollEnabled(false);
|
|
697
|
+
}
|
|
698
|
+
_releaseScroll() {
|
|
699
|
+
clearTimeout(this._lockScrollTimeout);
|
|
700
|
+
this._setScrollEnabled(true);
|
|
701
|
+
}
|
|
702
|
+
_repositionScroll(index) {
|
|
703
|
+
const {
|
|
704
|
+
data,
|
|
705
|
+
loopClonesPerSide
|
|
706
|
+
} = this.props;
|
|
707
|
+
const dataLength = data && data.length;
|
|
708
|
+
if (!this._enableLoop() || !dataLength || index >= loopClonesPerSide && index < dataLength + loopClonesPerSide) {
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
let repositionTo = index;
|
|
712
|
+
if (index >= dataLength + loopClonesPerSide) {
|
|
713
|
+
repositionTo = index - dataLength;
|
|
714
|
+
} else if (index < loopClonesPerSide) {
|
|
715
|
+
repositionTo = index + dataLength;
|
|
716
|
+
}
|
|
717
|
+
this._snapToItem(repositionTo, false, false, false, false);
|
|
718
|
+
}
|
|
719
|
+
_scrollTo(offset, animated = true) {
|
|
720
|
+
const {
|
|
721
|
+
vertical
|
|
722
|
+
} = this.props;
|
|
723
|
+
const wrappedRef = this._getWrappedRef();
|
|
724
|
+
if (!this._mounted || !wrappedRef) {
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
const specificOptions = this._needsScrollView() ? {
|
|
728
|
+
x: vertical ? 0 : offset,
|
|
729
|
+
y: vertical ? offset : 0
|
|
730
|
+
} : {
|
|
731
|
+
offset
|
|
732
|
+
};
|
|
733
|
+
const options = {
|
|
734
|
+
...specificOptions,
|
|
735
|
+
animated
|
|
736
|
+
};
|
|
737
|
+
if (this._needsScrollView()) {
|
|
738
|
+
wrappedRef.scrollTo(options);
|
|
739
|
+
} else {
|
|
740
|
+
wrappedRef.scrollToOffset(options);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
_onScroll(event) {
|
|
744
|
+
const {
|
|
745
|
+
callbackOffsetMargin,
|
|
746
|
+
enableMomentum,
|
|
747
|
+
onScroll
|
|
748
|
+
} = this.props;
|
|
749
|
+
const scrollOffset = event ? this._getScrollOffset(event) : this._currentContentOffset;
|
|
750
|
+
const nextActiveItem = this._getActiveItem(scrollOffset);
|
|
751
|
+
const itemReached = nextActiveItem === this._itemToSnapTo;
|
|
752
|
+
const scrollConditions = scrollOffset >= this._scrollOffsetRef - callbackOffsetMargin && scrollOffset <= this._scrollOffsetRef + callbackOffsetMargin;
|
|
753
|
+
this._currentContentOffset = scrollOffset;
|
|
754
|
+
this._onScrollTriggered = true;
|
|
755
|
+
this._lastScrollDate = Date.now();
|
|
756
|
+
if (this._activeItem !== nextActiveItem && this._shouldUseCustomAnimation()) {
|
|
757
|
+
this._playCustomSlideAnimation(this._activeItem, nextActiveItem);
|
|
758
|
+
}
|
|
759
|
+
if (enableMomentum) {
|
|
760
|
+
clearTimeout(this._snapNoMomentumTimeout);
|
|
761
|
+
if (this._activeItem !== nextActiveItem) {
|
|
762
|
+
this._activeItem = nextActiveItem;
|
|
763
|
+
}
|
|
764
|
+
if (itemReached) {
|
|
765
|
+
if (this._canFireBeforeCallback) {
|
|
766
|
+
this._onBeforeSnap(this._getDataIndex(nextActiveItem));
|
|
767
|
+
}
|
|
768
|
+
if (scrollConditions && this._canFireCallback) {
|
|
769
|
+
this._onSnap(this._getDataIndex(nextActiveItem));
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
} else if (this._activeItem !== nextActiveItem && itemReached) {
|
|
773
|
+
if (this._canFireBeforeCallback) {
|
|
774
|
+
this._onBeforeSnap(this._getDataIndex(nextActiveItem));
|
|
775
|
+
}
|
|
776
|
+
if (scrollConditions) {
|
|
777
|
+
this._activeItem = nextActiveItem;
|
|
778
|
+
if (this._canLockScroll()) {
|
|
779
|
+
this._releaseScroll();
|
|
780
|
+
}
|
|
781
|
+
if (this._canFireCallback) {
|
|
782
|
+
this._onSnap(this._getDataIndex(nextActiveItem));
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
if (nextActiveItem === this._itemToSnapTo && scrollOffset === this._scrollOffsetRef) {
|
|
787
|
+
this._repositionScroll(nextActiveItem);
|
|
788
|
+
}
|
|
789
|
+
if (typeof onScroll === "function" && event) {
|
|
790
|
+
onScroll(event);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
_onStartShouldSetResponderCapture(event) {
|
|
794
|
+
const {
|
|
795
|
+
onStartShouldSetResponderCapture
|
|
796
|
+
} = this.props;
|
|
797
|
+
if (onStartShouldSetResponderCapture) {
|
|
798
|
+
onStartShouldSetResponderCapture(event);
|
|
799
|
+
}
|
|
800
|
+
return this._getScrollEnabled();
|
|
801
|
+
}
|
|
802
|
+
_onTouchStart() {
|
|
803
|
+
const {
|
|
804
|
+
onTouchStart
|
|
805
|
+
} = this.props;
|
|
806
|
+
|
|
807
|
+
// `onTouchStart` is fired even when `scrollEnabled` is set to `false`
|
|
808
|
+
if (this._getScrollEnabled() !== false && this._autoplaying) {
|
|
809
|
+
this.pauseAutoPlay();
|
|
810
|
+
}
|
|
811
|
+
if (onTouchStart) {
|
|
812
|
+
onTouchStart();
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
_onTouchEnd() {
|
|
816
|
+
const {
|
|
817
|
+
onTouchEnd
|
|
818
|
+
} = this.props;
|
|
819
|
+
if (this._getScrollEnabled() !== false && this._autoplay && !this._autoplaying) {
|
|
820
|
+
// This event is buggy on Android, so a fallback is provided in _onScrollEnd()
|
|
821
|
+
this.startAutoplay();
|
|
822
|
+
}
|
|
823
|
+
if (onTouchEnd) {
|
|
824
|
+
onTouchEnd();
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Used when `enableSnap` is ENABLED
|
|
829
|
+
_onScrollBeginDrag(event) {
|
|
830
|
+
const {
|
|
831
|
+
onScrollBeginDrag
|
|
832
|
+
} = this.props;
|
|
833
|
+
if (!this._getScrollEnabled()) {
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
this._scrollStartOffset = this._getScrollOffset(event);
|
|
837
|
+
this._scrollStartActive = this._getActiveItem(this._scrollStartOffset);
|
|
838
|
+
this._ignoreNextMomentum = false;
|
|
839
|
+
// this._canFireCallback = false;
|
|
840
|
+
|
|
841
|
+
if (onScrollBeginDrag) {
|
|
842
|
+
onScrollBeginDrag(event);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// Used when `enableMomentum` is DISABLED
|
|
847
|
+
_onScrollEndDrag(event) {
|
|
848
|
+
const {
|
|
849
|
+
onScrollEndDrag
|
|
850
|
+
} = this.props;
|
|
851
|
+
if (this._carouselRef) {
|
|
852
|
+
this._onScrollEnd && this._onScrollEnd();
|
|
853
|
+
}
|
|
854
|
+
if (onScrollEndDrag) {
|
|
855
|
+
onScrollEndDrag(event);
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
// Used when `enableMomentum` is ENABLED
|
|
860
|
+
_onMomentumScrollEnd(event) {
|
|
861
|
+
const {
|
|
862
|
+
onMomentumScrollEnd
|
|
863
|
+
} = this.props;
|
|
864
|
+
if (this._carouselRef) {
|
|
865
|
+
this._onScrollEnd && this._onScrollEnd();
|
|
866
|
+
}
|
|
867
|
+
if (onMomentumScrollEnd) {
|
|
868
|
+
onMomentumScrollEnd(event);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
_onScrollEnd(event) {
|
|
872
|
+
const {
|
|
873
|
+
autoplayDelay,
|
|
874
|
+
enableSnap
|
|
875
|
+
} = this.props;
|
|
876
|
+
if (this._ignoreNextMomentum) {
|
|
877
|
+
// iOS fix
|
|
878
|
+
this._ignoreNextMomentum = false;
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
if (this._currentContentOffset === this._scrollEndOffset) {
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
this._scrollEndOffset = this._currentContentOffset;
|
|
885
|
+
this._scrollEndActive = this._getActiveItem(this._scrollEndOffset);
|
|
886
|
+
if (enableSnap) {
|
|
887
|
+
this._snapScroll(this._scrollEndOffset - this._scrollStartOffset);
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// The touchEnd event is buggy on Android, so this will serve as a fallback whenever needed
|
|
891
|
+
// https://github.com/facebook/react-native/issues/9439
|
|
892
|
+
if (this._autoplay && !this._autoplaying) {
|
|
893
|
+
clearTimeout(this._enableAutoplayTimeout);
|
|
894
|
+
this._enableAutoplayTimeout = setTimeout(() => {
|
|
895
|
+
this.startAutoplay();
|
|
896
|
+
}, autoplayDelay + 50);
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// Due to a bug, this event is only fired on iOS
|
|
901
|
+
// https://github.com/facebook/react-native/issues/6791
|
|
902
|
+
// it's fine since we're only fixing an iOS bug in it, so ...
|
|
903
|
+
_onTouchRelease(event) {
|
|
904
|
+
const {
|
|
905
|
+
enableMomentum
|
|
906
|
+
} = this.props;
|
|
907
|
+
if (enableMomentum && IS_IOS) {
|
|
908
|
+
clearTimeout(this._snapNoMomentumTimeout);
|
|
909
|
+
this._snapNoMomentumTimeout = setTimeout(() => {
|
|
910
|
+
this._snapToItem(this._activeItem);
|
|
911
|
+
}, 100);
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
_onLayout(event) {
|
|
915
|
+
const {
|
|
916
|
+
onLayout
|
|
917
|
+
} = this.props;
|
|
918
|
+
|
|
919
|
+
// Prevent unneeded actions during the first 'onLayout' (triggered on init)
|
|
920
|
+
if (this._onLayoutInitDone) {
|
|
921
|
+
this._initPositionsAndInterpolators();
|
|
922
|
+
this._snapToItem(this._activeItem, false, false, false, false);
|
|
923
|
+
} else {
|
|
924
|
+
this._onLayoutInitDone = true;
|
|
925
|
+
}
|
|
926
|
+
if (onLayout) {
|
|
927
|
+
onLayout(event);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
_snapScroll(delta) {
|
|
931
|
+
const {
|
|
932
|
+
swipeThreshold
|
|
933
|
+
} = this.props;
|
|
934
|
+
|
|
935
|
+
// When using momentum and releasing the touch with
|
|
936
|
+
// no velocity, scrollEndActive will be undefined (iOS)
|
|
937
|
+
if (!this._scrollEndActive && this._scrollEndActive !== 0 && IS_IOS) {
|
|
938
|
+
this._scrollEndActive = this._scrollStartActive;
|
|
939
|
+
}
|
|
940
|
+
if (this._scrollStartActive !== this._scrollEndActive) {
|
|
941
|
+
// Snap to the new active item
|
|
942
|
+
this._snapToItem(this._scrollEndActive);
|
|
943
|
+
} else {
|
|
944
|
+
// Snap depending on delta
|
|
945
|
+
if (delta > 0) {
|
|
946
|
+
if (delta > swipeThreshold) {
|
|
947
|
+
this._snapToItem(this._scrollStartActive + 1);
|
|
948
|
+
} else {
|
|
949
|
+
this._snapToItem(this._scrollEndActive);
|
|
950
|
+
}
|
|
951
|
+
} else if (delta < 0) {
|
|
952
|
+
if (delta < -swipeThreshold) {
|
|
953
|
+
this._snapToItem(this._scrollStartActive - 1);
|
|
954
|
+
} else {
|
|
955
|
+
this._snapToItem(this._scrollEndActive);
|
|
956
|
+
}
|
|
957
|
+
} else {
|
|
958
|
+
// Snap to current
|
|
959
|
+
this._snapToItem(this._scrollEndActive);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
_snapToItem(index, animated = true, fireCallback = true, initial = false, lockScroll = true) {
|
|
964
|
+
const {
|
|
965
|
+
enableMomentum,
|
|
966
|
+
onSnapToItem,
|
|
967
|
+
onBeforeSnapToItem
|
|
968
|
+
} = this.props;
|
|
969
|
+
const itemsLength = this._getCustomDataLength();
|
|
970
|
+
const wrappedRef = this._getWrappedRef();
|
|
971
|
+
if (!itemsLength || !wrappedRef) {
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
if (!index || index < 0) {
|
|
975
|
+
index = 0;
|
|
976
|
+
} else if (itemsLength > 0 && index >= itemsLength) {
|
|
977
|
+
index = itemsLength - 1;
|
|
978
|
+
}
|
|
979
|
+
if (index !== this._previousActiveItem) {
|
|
980
|
+
this._previousActiveItem = index;
|
|
981
|
+
|
|
982
|
+
// Placed here to allow overscrolling for edges items
|
|
983
|
+
if (lockScroll && this._canLockScroll()) {
|
|
984
|
+
this._lockScroll();
|
|
985
|
+
}
|
|
986
|
+
if (fireCallback) {
|
|
987
|
+
if (onBeforeSnapToItem) {
|
|
988
|
+
this._canFireBeforeCallback = true;
|
|
989
|
+
}
|
|
990
|
+
if (onSnapToItem) {
|
|
991
|
+
this._canFireCallback = true;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
this._itemToSnapTo = index;
|
|
996
|
+
this._scrollOffsetRef = this._positions[index] && this._positions[index].start;
|
|
997
|
+
this._onScrollTriggered = false;
|
|
998
|
+
if (!this._scrollOffsetRef && this._scrollOffsetRef !== 0) {
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
this._scrollTo(this._scrollOffsetRef, animated);
|
|
1002
|
+
this._scrollEndOffset = this._currentContentOffset;
|
|
1003
|
+
if (enableMomentum) {
|
|
1004
|
+
// iOS fix, check the note in the constructor
|
|
1005
|
+
if (!initial) {
|
|
1006
|
+
this._ignoreNextMomentum = true;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// When momentum is enabled and the user is overscrolling or swiping very quickly,
|
|
1010
|
+
// 'onScroll' is not going to be triggered for edge items. Then callback won't be
|
|
1011
|
+
// fired and loop won't work since the scrollview is not going to be repositioned.
|
|
1012
|
+
// As a workaround, '_onScroll()' will be called manually for these items if a given
|
|
1013
|
+
// condition hasn't been met after a small delay.
|
|
1014
|
+
// WARNING: this is ok only when relying on 'momentumScrollEnd', not with 'scrollEndDrag'
|
|
1015
|
+
if (index === 0 || index === itemsLength - 1) {
|
|
1016
|
+
clearTimeout(this._edgeItemTimeout);
|
|
1017
|
+
this._edgeItemTimeout = setTimeout(() => {
|
|
1018
|
+
if (!initial && index === this._activeItem && !this._onScrollTriggered) {
|
|
1019
|
+
this._onScroll();
|
|
1020
|
+
}
|
|
1021
|
+
}, 250);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
_onBeforeSnap(index) {
|
|
1026
|
+
const {
|
|
1027
|
+
onBeforeSnapToItem
|
|
1028
|
+
} = this.props;
|
|
1029
|
+
if (!this._carouselRef) {
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
this._canFireBeforeCallback = false;
|
|
1033
|
+
onBeforeSnapToItem && onBeforeSnapToItem(index);
|
|
1034
|
+
}
|
|
1035
|
+
_onSnap(index) {
|
|
1036
|
+
const {
|
|
1037
|
+
onSnapToItem
|
|
1038
|
+
} = this.props;
|
|
1039
|
+
if (!this._carouselRef) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
this._canFireCallback = false;
|
|
1043
|
+
onSnapToItem && onSnapToItem(index);
|
|
1044
|
+
}
|
|
1045
|
+
startAutoplay() {
|
|
1046
|
+
const {
|
|
1047
|
+
autoplayInterval,
|
|
1048
|
+
autoplayDelay
|
|
1049
|
+
} = this.props;
|
|
1050
|
+
this._autoplay = true;
|
|
1051
|
+
if (this._autoplaying) {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
clearTimeout(this._autoplayTimeout);
|
|
1055
|
+
this._autoplayTimeout = setTimeout(() => {
|
|
1056
|
+
this._autoplaying = true;
|
|
1057
|
+
this._autoplayInterval = setInterval(() => {
|
|
1058
|
+
if (this._autoplaying) {
|
|
1059
|
+
this.snapToNext();
|
|
1060
|
+
}
|
|
1061
|
+
}, autoplayInterval);
|
|
1062
|
+
}, autoplayDelay);
|
|
1063
|
+
}
|
|
1064
|
+
pauseAutoPlay() {
|
|
1065
|
+
this._autoplaying = false;
|
|
1066
|
+
clearTimeout(this._autoplayTimeout);
|
|
1067
|
+
clearTimeout(this._enableAutoplayTimeout);
|
|
1068
|
+
clearInterval(this._autoplayInterval);
|
|
1069
|
+
}
|
|
1070
|
+
stopAutoplay() {
|
|
1071
|
+
this._autoplay = false;
|
|
1072
|
+
this.pauseAutoPlay();
|
|
1073
|
+
}
|
|
1074
|
+
snapToItem(index, animated = true, fireCallback = true) {
|
|
1075
|
+
if (!index || index < 0) {
|
|
1076
|
+
index = 0;
|
|
1077
|
+
}
|
|
1078
|
+
const positionIndex = this._getPositionIndex(index);
|
|
1079
|
+
if (positionIndex === this._activeItem) {
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
this._snapToItem(positionIndex, animated, fireCallback);
|
|
1083
|
+
}
|
|
1084
|
+
snapToNext(animated = true, fireCallback = true) {
|
|
1085
|
+
const itemsLength = this._getCustomDataLength();
|
|
1086
|
+
let newIndex = this._activeItem + 1;
|
|
1087
|
+
if (newIndex > itemsLength - 1) {
|
|
1088
|
+
if (!this._enableLoop()) {
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
newIndex = 0;
|
|
1092
|
+
}
|
|
1093
|
+
this._snapToItem(newIndex, animated, fireCallback);
|
|
1094
|
+
}
|
|
1095
|
+
snapToPrev(animated = true, fireCallback = true) {
|
|
1096
|
+
const itemsLength = this._getCustomDataLength();
|
|
1097
|
+
let newIndex = this._activeItem - 1;
|
|
1098
|
+
if (newIndex < 0) {
|
|
1099
|
+
if (!this._enableLoop()) {
|
|
1100
|
+
return;
|
|
1101
|
+
}
|
|
1102
|
+
newIndex = itemsLength - 1;
|
|
1103
|
+
}
|
|
1104
|
+
this._snapToItem(newIndex, animated, fireCallback);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
// https://github.com/facebook/react-native/issues/1831#issuecomment-231069668
|
|
1108
|
+
triggerRenderingHack(offset) {
|
|
1109
|
+
// Avoid messing with user scroll
|
|
1110
|
+
if (Date.now() - this._lastScrollDate < 500) {
|
|
1111
|
+
return;
|
|
1112
|
+
}
|
|
1113
|
+
const scrollPosition = this._currentContentOffset;
|
|
1114
|
+
if (!scrollPosition && scrollPosition !== 0) {
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
const scrollOffset = offset || (scrollPosition === 0 ? 1 : -1);
|
|
1118
|
+
this._scrollTo(scrollPosition + scrollOffset, false);
|
|
1119
|
+
}
|
|
1120
|
+
_getSlideInterpolatedStyle(index, animatedValue) {
|
|
1121
|
+
const {
|
|
1122
|
+
layoutCardOffset,
|
|
1123
|
+
slideInterpolatedStyle
|
|
1124
|
+
} = this.props;
|
|
1125
|
+
if (slideInterpolatedStyle) {
|
|
1126
|
+
return slideInterpolatedStyle(index, animatedValue, this.props);
|
|
1127
|
+
} else if (this._shouldUseTinderLayout()) {
|
|
1128
|
+
return (0, _animations.tinderAnimatedStyles)(index, animatedValue, this.props, layoutCardOffset);
|
|
1129
|
+
} else if (this._shouldUseStackLayout()) {
|
|
1130
|
+
return (0, _animations.stackAnimatedStyles)(index, animatedValue, this.props, layoutCardOffset);
|
|
1131
|
+
} else if (this._shouldUseShiftLayout()) {
|
|
1132
|
+
return (0, _animations.shiftAnimatedStyles)(index, animatedValue, this.props);
|
|
1133
|
+
} else {
|
|
1134
|
+
return (0, _animations.defaultAnimatedStyles)(index, animatedValue, this.props);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
_renderItem({
|
|
1138
|
+
item,
|
|
1139
|
+
index
|
|
1140
|
+
}) {
|
|
1141
|
+
const {
|
|
1142
|
+
interpolators
|
|
1143
|
+
} = this.state;
|
|
1144
|
+
const {
|
|
1145
|
+
hasParallaxImages,
|
|
1146
|
+
itemWidth,
|
|
1147
|
+
itemHeight,
|
|
1148
|
+
keyExtractor,
|
|
1149
|
+
renderItem,
|
|
1150
|
+
sliderHeight,
|
|
1151
|
+
sliderWidth,
|
|
1152
|
+
slideStyle,
|
|
1153
|
+
vertical
|
|
1154
|
+
} = this.props;
|
|
1155
|
+
const animatedValue = interpolators && interpolators[index];
|
|
1156
|
+
if (!animatedValue && animatedValue !== 0) {
|
|
1157
|
+
return null;
|
|
1158
|
+
}
|
|
1159
|
+
const animate = this._shouldAnimateSlides();
|
|
1160
|
+
const Component = animate ? _reactNative.Animated.View : _reactNative.View;
|
|
1161
|
+
const animatedStyle = animate ? this._getSlideInterpolatedStyle(index, animatedValue) : {};
|
|
1162
|
+
const parallaxProps = hasParallaxImages ? {
|
|
1163
|
+
scrollPosition: this._scrollPos,
|
|
1164
|
+
carouselRef: this._carouselRef,
|
|
1165
|
+
vertical,
|
|
1166
|
+
sliderWidth,
|
|
1167
|
+
sliderHeight,
|
|
1168
|
+
itemWidth,
|
|
1169
|
+
itemHeight
|
|
1170
|
+
} : undefined;
|
|
1171
|
+
const mainDimension = vertical ? {
|
|
1172
|
+
height: itemHeight
|
|
1173
|
+
} : {
|
|
1174
|
+
width: itemWidth
|
|
1175
|
+
};
|
|
1176
|
+
const specificProps = this._needsScrollView() ? {
|
|
1177
|
+
key: keyExtractor ? keyExtractor(item, index) : this._getKeyExtractor(item, index)
|
|
1178
|
+
} : {};
|
|
1179
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
1180
|
+
style: [mainDimension, slideStyle, animatedStyle],
|
|
1181
|
+
pointerEvents: 'box-none',
|
|
1182
|
+
...specificProps,
|
|
1183
|
+
children: renderItem({
|
|
1184
|
+
item,
|
|
1185
|
+
index
|
|
1186
|
+
}, parallaxProps)
|
|
1187
|
+
});
|
|
1188
|
+
}
|
|
1189
|
+
_getComponentOverridableProps() {
|
|
1190
|
+
const {
|
|
1191
|
+
enableMomentum,
|
|
1192
|
+
itemWidth,
|
|
1193
|
+
itemHeight,
|
|
1194
|
+
loopClonesPerSide,
|
|
1195
|
+
sliderWidth,
|
|
1196
|
+
sliderHeight,
|
|
1197
|
+
vertical
|
|
1198
|
+
} = this.props;
|
|
1199
|
+
const visibleItems = Math.ceil(vertical ? sliderHeight / itemHeight : sliderWidth / itemWidth) + 1;
|
|
1200
|
+
const initialNumPerSide = this._enableLoop() ? loopClonesPerSide : 2;
|
|
1201
|
+
const initialNumToRender = visibleItems + initialNumPerSide * 2;
|
|
1202
|
+
const maxToRenderPerBatch = 1 + initialNumToRender * 2;
|
|
1203
|
+
const windowSize = maxToRenderPerBatch;
|
|
1204
|
+
const specificProps = !this._needsScrollView() ? {
|
|
1205
|
+
initialNumToRender: initialNumToRender,
|
|
1206
|
+
maxToRenderPerBatch: maxToRenderPerBatch,
|
|
1207
|
+
windowSize: windowSize
|
|
1208
|
+
// updateCellsBatchingPeriod
|
|
1209
|
+
} : {};
|
|
1210
|
+
return {
|
|
1211
|
+
decelerationRate: enableMomentum ? 0.9 : 'fast',
|
|
1212
|
+
showsHorizontalScrollIndicator: false,
|
|
1213
|
+
showsVerticalScrollIndicator: false,
|
|
1214
|
+
overScrollMode: 'never',
|
|
1215
|
+
automaticallyAdjustContentInsets: false,
|
|
1216
|
+
directionalLockEnabled: true,
|
|
1217
|
+
pinchGestureEnabled: false,
|
|
1218
|
+
scrollsToTop: false,
|
|
1219
|
+
removeClippedSubviews: !this._needsScrollView(),
|
|
1220
|
+
inverted: this._needsRTLAdaptations(),
|
|
1221
|
+
// renderToHardwareTextureAndroid: true,
|
|
1222
|
+
...specificProps
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
_getComponentStaticProps() {
|
|
1226
|
+
const {
|
|
1227
|
+
hideCarousel
|
|
1228
|
+
} = this.state;
|
|
1229
|
+
const {
|
|
1230
|
+
containerCustomStyle,
|
|
1231
|
+
contentContainerCustomStyle,
|
|
1232
|
+
keyExtractor,
|
|
1233
|
+
sliderWidth,
|
|
1234
|
+
sliderHeight,
|
|
1235
|
+
style,
|
|
1236
|
+
vertical
|
|
1237
|
+
} = this.props;
|
|
1238
|
+
const containerStyle = [containerCustomStyle || style || {}, hideCarousel ? {
|
|
1239
|
+
opacity: 0
|
|
1240
|
+
} : {}, vertical ? {
|
|
1241
|
+
height: sliderHeight,
|
|
1242
|
+
flexDirection: 'column'
|
|
1243
|
+
} :
|
|
1244
|
+
// LTR hack; see https://github.com/facebook/react-native/issues/11960
|
|
1245
|
+
// and https://github.com/facebook/react-native/issues/13100#issuecomment-328986423
|
|
1246
|
+
{
|
|
1247
|
+
width: sliderWidth,
|
|
1248
|
+
flexDirection: this._needsRTLAdaptations() ? 'row-reverse' : 'row'
|
|
1249
|
+
}];
|
|
1250
|
+
const contentContainerStyle = [vertical ? {
|
|
1251
|
+
paddingTop: this._getContainerInnerMargin(),
|
|
1252
|
+
paddingBottom: this._getContainerInnerMargin(true)
|
|
1253
|
+
} : {
|
|
1254
|
+
paddingLeft: this._getContainerInnerMargin(),
|
|
1255
|
+
paddingRight: this._getContainerInnerMargin(true)
|
|
1256
|
+
}, contentContainerCustomStyle || {}];
|
|
1257
|
+
const specificProps = !this._needsScrollView() ? {
|
|
1258
|
+
// extraData: this.state,
|
|
1259
|
+
renderItem: this._renderItem,
|
|
1260
|
+
numColumns: 1,
|
|
1261
|
+
keyExtractor: keyExtractor || this._getKeyExtractor
|
|
1262
|
+
} : {};
|
|
1263
|
+
return {
|
|
1264
|
+
ref: c => this._carouselRef = c,
|
|
1265
|
+
data: this._getCustomData(),
|
|
1266
|
+
style: containerStyle,
|
|
1267
|
+
contentContainerStyle: contentContainerStyle,
|
|
1268
|
+
horizontal: !vertical,
|
|
1269
|
+
scrollEventThrottle: 1,
|
|
1270
|
+
onScroll: this._onScrollHandler,
|
|
1271
|
+
onScrollBeginDrag: this._onScrollBeginDrag,
|
|
1272
|
+
onScrollEndDrag: this._onScrollEndDrag,
|
|
1273
|
+
onMomentumScrollEnd: this._onMomentumScrollEnd,
|
|
1274
|
+
onResponderRelease: this._onTouchRelease,
|
|
1275
|
+
onStartShouldSetResponderCapture: this._onStartShouldSetResponderCapture,
|
|
1276
|
+
onTouchStart: this._onTouchStart,
|
|
1277
|
+
onTouchEnd: this._onScrollEnd,
|
|
1278
|
+
onLayout: this._onLayout,
|
|
1279
|
+
...specificProps
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
render() {
|
|
1283
|
+
const {
|
|
1284
|
+
data,
|
|
1285
|
+
renderItem,
|
|
1286
|
+
useScrollView
|
|
1287
|
+
} = this.props;
|
|
1288
|
+
if (!data || !renderItem) {
|
|
1289
|
+
return null;
|
|
1290
|
+
}
|
|
1291
|
+
const props = {
|
|
1292
|
+
...this._getComponentOverridableProps(),
|
|
1293
|
+
...this.props,
|
|
1294
|
+
...this._getComponentStaticProps()
|
|
1295
|
+
};
|
|
1296
|
+
const ScrollViewComponent = typeof useScrollView === 'function' ? useScrollView : AnimatedScrollView;
|
|
1297
|
+
return this._needsScrollView() ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollViewComponent, {
|
|
1298
|
+
...props,
|
|
1299
|
+
children: this._getCustomData().map((item, index) => {
|
|
1300
|
+
return this._renderItem({
|
|
1301
|
+
item,
|
|
1302
|
+
index
|
|
1303
|
+
});
|
|
1304
|
+
})
|
|
1305
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedFlatList, {
|
|
1306
|
+
...props
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
exports.default = Carousel;
|
|
1311
|
+
//# sourceMappingURL=Carousel.js.map
|