@momo-kits/native-kits 0.157.1-com.1-debug → 0.157.1-com.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/package.json +1 -1
- package/build.gradle.kts +0 -11
- package/compose/build.gradle.kts +0 -180
- package/compose/build.gradle.kts.backup +0 -180
- package/compose/compose.podspec +0 -54
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -110
- package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -57
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -107
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -201
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -222
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -48
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -305
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -720
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -121
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -405
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -85
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -340
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -198
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -123
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -94
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -136
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -224
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -543
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -23
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -148
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -188
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -116
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -448
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -172
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -255
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -231
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -233
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -254
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -241
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -364
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -92
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -352
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -103
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -350
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -70
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -96
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -360
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -256
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -494
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -131
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -215
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -96
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -449
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -92
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -130
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -214
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -590
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -177
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -192
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -205
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -239
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -191
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -306
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -185
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -285
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -35
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -59
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -68
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -50
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -239
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -119
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -98
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -161
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -331
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -497
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -162
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -243
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -187
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -279
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -80
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -306
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -32
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -370
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -132
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -42
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -62
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -88
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -149
- package/gradle/libs.versions.toml +0 -57
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +0 -8
- package/gradle.properties +0 -26
- package/gradlew +0 -252
- package/gradlew.bat +0 -94
- package/local.properties +0 -8
- package/settings.gradle.kts +0 -52
- package/src/doctor/README.md +0 -73
- package/src/doctor/package-lock.json +0 -885
- package/src/doctor/package.json +0 -44
- package/src/doctor/publish.sh +0 -27
- package/src/doctor/src/Users.json +0 -112
- package/src/doctor/src/Whitelist.json +0 -6
- package/src/doctor/src/commands/check.ts +0 -81
- package/src/doctor/src/commands/doctor.ts +0 -193
- package/src/doctor/src/index.ts +0 -35
- package/src/doctor/src/logger.ts +0 -84
- package/src/doctor/src/task/native.ts +0 -21
- package/src/doctor/src/task/utils.ts +0 -20
- package/src/doctor/src/utils/checkCoreDependencies.ts +0 -138
- package/src/doctor/src/utils/checkDeletedPackage.ts +0 -53
- package/src/doctor/src/utils/checkDeprecatedPackages.ts +0 -168
- package/src/doctor/src/utils/checkDeprecatedVersion.ts +0 -60
- package/src/doctor/src/utils/checkShareDependencies.ts +0 -251
- package/src/doctor/src/utils/checkWrongVersionCommunityPackage.ts +0 -64
- package/src/doctor/src/utils/getErrorMessage.ts +0 -84
- package/src/doctor/src/utils/scanComponentUsage.ts +0 -206
- package/src/doctor/src/utils/scanFoundationImports.ts +0 -169
- package/src/doctor/src/utils/scanMaxApiUsage.ts +0 -86
- package/src/doctor/src/utils/scanNativeModulesUsage.ts +0 -78
- package/src/doctor/src/utils/sendMessage.ts +0 -28
- package/src/doctor/tsconfig.json +0 -14
- package/src/doctor/yarn.lock +0 -492
- package/src/foundations/Application/BottomSheet.tsx +0 -358
- package/src/foundations/Application/BottomTab/BottomTabBar.tsx +0 -320
- package/src/foundations/Application/BottomTab/CustomBottomTabItem.tsx +0 -155
- package/src/foundations/Application/BottomTab/TabBarIcon.tsx +0 -113
- package/src/foundations/Application/BottomTab/index.tsx +0 -449
- package/src/foundations/Application/Components/BackgroundImageView.tsx +0 -126
- package/src/foundations/Application/Components/HeaderAnimated.tsx +0 -69
- package/src/foundations/Application/Components/HeaderBackground.tsx +0 -83
- package/src/foundations/Application/Components/HeaderExtendHeader.tsx +0 -225
- package/src/foundations/Application/Components/HeaderLeft.tsx +0 -93
- package/src/foundations/Application/Components/HeaderRight.tsx +0 -444
- package/src/foundations/Application/Components/HeaderTitle.tsx +0 -596
- package/src/foundations/Application/Components/NavigationButton.tsx +0 -76
- package/src/foundations/Application/Components/SearchHeader.tsx +0 -127
- package/src/foundations/Application/Localize.ts +0 -44
- package/src/foundations/Application/ModalScreen.tsx +0 -148
- package/src/foundations/Application/Navigation.ts +0 -63
- package/src/foundations/Application/NavigationContainer.tsx +0 -245
- package/src/foundations/Application/Navigator.ts +0 -171
- package/src/foundations/Application/ScaleSizeProvider.tsx +0 -16
- package/src/foundations/Application/StackScreen.tsx +0 -420
- package/src/foundations/Application/TooltipPortal.tsx +0 -127
- package/src/foundations/Application/WidgetContainer.tsx +0 -162
- package/src/foundations/Application/index.ts +0 -34
- package/src/foundations/Application/types.ts +0 -350
- package/src/foundations/Application/utils.tsx +0 -239
- package/src/foundations/Assets/DotAnimation.json +0 -256
- package/src/foundations/Assets/SpinnerAnimation.json +0 -1027
- package/src/foundations/Assets/icon.json +0 -4052
- package/src/foundations/Assets/icon_bank.json +0 -506
- package/src/foundations/Assets/language.json +0 -208
- package/src/foundations/Assets/lottie_circle_loader.json +0 -1
- package/src/foundations/Assets/pinAnimation.json +0 -1
- package/src/foundations/Assets/unpinAnimation.json +0 -1
- package/src/foundations/Badge/Badge.tsx +0 -104
- package/src/foundations/Badge/BadgeDot.tsx +0 -35
- package/src/foundations/Badge/BadgeDotAnimation.tsx +0 -95
- package/src/foundations/Badge/BadgeRibbon.tsx +0 -112
- package/src/foundations/Badge/Shape.tsx +0 -29
- package/src/foundations/Badge/index.tsx +0 -8
- package/src/foundations/Badge/styles.ts +0 -125
- package/src/foundations/Badge/types.ts +0 -68
- package/src/foundations/Button/index.tsx +0 -371
- package/src/foundations/Button/styles.ts +0 -65
- package/src/foundations/CheckBox/index.tsx +0 -104
- package/src/foundations/CheckBox/styles.ts +0 -17
- package/src/foundations/CheckBox/types.ts +0 -37
- package/src/foundations/Consts/colors+spacing+radius.ts +0 -232
- package/src/foundations/Consts/index.ts +0 -4
- package/src/foundations/Consts/styles.ts +0 -52
- package/src/foundations/Consts/theme.ts +0 -121
- package/src/foundations/Context/index.ts +0 -27
- package/src/foundations/Divider/DashDivider.tsx +0 -46
- package/src/foundations/Divider/index.tsx +0 -45
- package/src/foundations/FoundationList/index.tsx +0 -12
- package/src/foundations/FoundationList/types.ts +0 -7
- package/src/foundations/Icon/index.tsx +0 -57
- package/src/foundations/Icon/types.ts +0 -32
- package/src/foundations/IconButton/index.tsx +0 -144
- package/src/foundations/IconButton/styles.ts +0 -20
- package/src/foundations/Image/index.tsx +0 -115
- package/src/foundations/Image/styles.ts +0 -7
- package/src/foundations/Image/types.ts +0 -7
- package/src/foundations/Input/Input.tsx +0 -280
- package/src/foundations/Input/InputDropDown.tsx +0 -161
- package/src/foundations/Input/InputMoney.tsx +0 -325
- package/src/foundations/Input/InputOTP.tsx +0 -299
- package/src/foundations/Input/InputPhoneNumber.tsx +0 -287
- package/src/foundations/Input/InputSearch.tsx +0 -351
- package/src/foundations/Input/InputTextArea.tsx +0 -218
- package/src/foundations/Input/SystemTextInput.tsx +0 -44
- package/src/foundations/Input/TextTyping.tsx +0 -115
- package/src/foundations/Input/common.tsx +0 -243
- package/src/foundations/Input/index.tsx +0 -373
- package/src/foundations/Input/styles.ts +0 -226
- package/src/foundations/Input/utils.ts +0 -97
- package/src/foundations/Layout/Card.tsx +0 -108
- package/src/foundations/Layout/FloatingButton.tsx +0 -179
- package/src/foundations/Layout/GridSystem.tsx +0 -137
- package/src/foundations/Layout/Item.tsx +0 -59
- package/src/foundations/Layout/ItemList.tsx +0 -66
- package/src/foundations/Layout/ItemSectionList.tsx +0 -40
- package/src/foundations/Layout/Screen.tsx +0 -644
- package/src/foundations/Layout/Section.tsx +0 -103
- package/src/foundations/Layout/TrackingScope.tsx +0 -18
- package/src/foundations/Layout/index.ts +0 -34
- package/src/foundations/Layout/styles.ts +0 -95
- package/src/foundations/Layout/types.ts +0 -40
- package/src/foundations/Layout/utils.ts +0 -47
- package/src/foundations/Loader/DotLoader.tsx +0 -37
- package/src/foundations/Loader/Loader.tsx +0 -13
- package/src/foundations/Loader/ProgressBar.tsx +0 -45
- package/src/foundations/Loader/Spinner.tsx +0 -29
- package/src/foundations/Loader/index.tsx +0 -6
- package/src/foundations/Loader/styles.ts +0 -10
- package/src/foundations/Loader/types.ts +0 -35
- package/src/foundations/Loader/utils.ts +0 -25
- package/src/foundations/Pagination/Dot.tsx +0 -19
- package/src/foundations/Pagination/PaginationDot.tsx +0 -44
- package/src/foundations/Pagination/PaginationNumber.tsx +0 -31
- package/src/foundations/Pagination/PaginationScroll.tsx +0 -99
- package/src/foundations/Pagination/PaginationWhiteDot.tsx +0 -43
- package/src/foundations/Pagination/index.tsx +0 -25
- package/src/foundations/Pagination/styles.ts +0 -51
- package/src/foundations/Pagination/types.ts +0 -40
- package/src/foundations/Popup/PopupNotify.tsx +0 -276
- package/src/foundations/Popup/PopupPromotion.tsx +0 -118
- package/src/foundations/Popup/index.tsx +0 -4
- package/src/foundations/Popup/types.ts +0 -96
- package/src/foundations/Radio/index.tsx +0 -108
- package/src/foundations/Radio/styles.ts +0 -15
- package/src/foundations/Radio/types.ts +0 -31
- package/src/foundations/Skeleton/index.tsx +0 -118
- package/src/foundations/Skeleton/styles.ts +0 -5
- package/src/foundations/Skeleton/types.ts +0 -6
- package/src/foundations/Switch/index.tsx +0 -68
- package/src/foundations/Switch/styles.ts +0 -25
- package/src/foundations/Switch/types.ts +0 -19
- package/src/foundations/Tag/index.tsx +0 -128
- package/src/foundations/Tag/types.ts +0 -41
- package/src/foundations/Text/index.tsx +0 -241
- package/src/foundations/Text/styles.ts +0 -78
- package/src/foundations/Text/types.ts +0 -53
- package/src/foundations/Text/utils.ts +0 -63
- package/src/foundations/Title/index.tsx +0 -285
- package/src/foundations/Title/styles.ts +0 -55
- package/src/foundations/Title/types.ts +0 -21
- package/src/foundations/index.ts +0 -50
- package/src/foundations/package.json +0 -35
- package/src/foundations/publish.sh +0 -17
- package/src/libs/AutoComplete/index.tsx +0 -88
- package/src/libs/AutoComplete/package.json +0 -16
- package/src/libs/AutoComplete/publish.sh +0 -16
- package/src/libs/AutoComplete/styles.ts +0 -15
- package/src/libs/AutoComplete/types.ts +0 -60
- package/src/libs/Avatar/index.tsx +0 -146
- package/src/libs/Avatar/package.json +0 -16
- package/src/libs/Avatar/publish.sh +0 -20
- package/src/libs/Avatar/styles.ts +0 -18
- package/src/libs/Avatar/types.ts +0 -57
- package/src/libs/Badge/Badge.tsx +0 -70
- package/src/libs/Badge/BadgeDot.tsx +0 -11
- package/src/libs/Badge/BadgeRibbon.tsx +0 -122
- package/src/libs/Badge/Shape.tsx +0 -29
- package/src/libs/Badge/index.tsx +0 -7
- package/src/libs/Badge/package.json +0 -16
- package/src/libs/Badge/publish.sh +0 -18
- package/src/libs/Badge/styles.ts +0 -55
- package/src/libs/Badge/types.ts +0 -63
- package/src/libs/Calendar/CalendarPro.tsx +0 -307
- package/src/libs/Calendar/Day.tsx +0 -150
- package/src/libs/Calendar/HeaderControl.tsx +0 -55
- package/src/libs/Calendar/LunarDateConverter.ts +0 -228
- package/src/libs/Calendar/LunarService.ts +0 -206
- package/src/libs/Calendar/Month.tsx +0 -118
- package/src/libs/Calendar/MonthList.tsx +0 -226
- package/src/libs/Calendar/TabHeader.tsx +0 -91
- package/src/libs/Calendar/Util.ts +0 -288
- package/src/libs/Calendar/holidayData.ts +0 -118
- package/src/libs/Calendar/index.tsx +0 -383
- package/src/libs/Calendar/package.json +0 -18
- package/src/libs/Calendar/publish.sh +0 -18
- package/src/libs/Calendar/styles.ts +0 -122
- package/src/libs/Calendar/types.ts +0 -212
- package/src/libs/Carousel/animation.ts +0 -62
- package/src/libs/Carousel/index.tsx +0 -517
- package/src/libs/Carousel/package.json +0 -18
- package/src/libs/Carousel/publish.sh +0 -16
- package/src/libs/Carousel/types.ts +0 -71
- package/src/libs/Chip/index.tsx +0 -164
- package/src/libs/Chip/package.json +0 -16
- package/src/libs/Chip/publish.sh +0 -16
- package/src/libs/Chip/styles.ts +0 -20
- package/src/libs/Chip/types.ts +0 -72
- package/src/libs/Collapse/index.tsx +0 -305
- package/src/libs/Collapse/package.json +0 -16
- package/src/libs/Collapse/publish.sh +0 -18
- package/src/libs/Collapse/styles.ts +0 -37
- package/src/libs/Collapse/types.ts +0 -84
- package/src/libs/DateTimePicker/WheelPicker.tsx +0 -163
- package/src/libs/DateTimePicker/WheelPickerItem.tsx +0 -58
- package/src/libs/DateTimePicker/index.tsx +0 -188
- package/src/libs/DateTimePicker/package.json +0 -16
- package/src/libs/DateTimePicker/publish.sh +0 -17
- package/src/libs/DateTimePicker/styles.ts +0 -31
- package/src/libs/DateTimePicker/types.ts +0 -102
- package/src/libs/DateTimePicker/utils.ts +0 -114
- package/src/libs/Information/index.tsx +0 -129
- package/src/libs/Information/package.json +0 -16
- package/src/libs/Information/publish.sh +0 -18
- package/src/libs/Information/styles.ts +0 -34
- package/src/libs/Information/types.ts +0 -79
- package/src/libs/Logo/index.tsx +0 -39
- package/src/libs/Logo/package.json +0 -17
- package/src/libs/Logo/publish.sh +0 -16
- package/src/libs/Logo/styles.ts +0 -25
- package/src/libs/Logo/types.ts +0 -13
- package/src/libs/ProgressInfo/ProgressInfoHorizontal.tsx +0 -128
- package/src/libs/ProgressInfo/ProgressInfoIcon.tsx +0 -88
- package/src/libs/ProgressInfo/ProgressInfoVertical.tsx +0 -85
- package/src/libs/ProgressInfo/index.tsx +0 -22
- package/src/libs/ProgressInfo/package.json +0 -16
- package/src/libs/ProgressInfo/publish.sh +0 -16
- package/src/libs/ProgressInfo/styles.ts +0 -46
- package/src/libs/ProgressInfo/types.ts +0 -60
- package/src/libs/ProgressInfo/yarn.lock +0 -8
- package/src/libs/Rating/index.tsx +0 -74
- package/src/libs/Rating/package.json +0 -16
- package/src/libs/Rating/publish.sh +0 -18
- package/src/libs/Rating/type.ts +0 -25
- package/src/libs/Slider/Label.tsx +0 -33
- package/src/libs/Slider/helpers.ts +0 -35
- package/src/libs/Slider/hooks.tsx +0 -218
- package/src/libs/Slider/index.tsx +0 -453
- package/src/libs/Slider/package.json +0 -16
- package/src/libs/Slider/publish.sh +0 -18
- package/src/libs/Slider/styles.ts +0 -36
- package/src/libs/Stepper/NumberView.tsx +0 -64
- package/src/libs/Stepper/StepperButton.tsx +0 -37
- package/src/libs/Stepper/index.tsx +0 -139
- package/src/libs/Stepper/package.json +0 -16
- package/src/libs/Stepper/publish.sh +0 -17
- package/src/libs/Stepper/styles.ts +0 -44
- package/src/libs/Stepper/types.ts +0 -154
- package/src/libs/Steps/StepIcon.tsx +0 -86
- package/src/libs/Steps/StepsHorizontal.tsx +0 -189
- package/src/libs/Steps/StepsVertical.tsx +0 -133
- package/src/libs/Steps/index.tsx +0 -20
- package/src/libs/Steps/package.json +0 -16
- package/src/libs/Steps/publish.sh +0 -16
- package/src/libs/Steps/styles.ts +0 -46
- package/src/libs/Steps/types.ts +0 -159
- package/src/libs/Steps/utils.ts +0 -175
- package/src/libs/SuggestAction/SuggestActionView.tsx +0 -124
- package/src/libs/SuggestAction/index.tsx +0 -3
- package/src/libs/SuggestAction/package.json +0 -16
- package/src/libs/SuggestAction/publish.sh +0 -16
- package/src/libs/SuggestAction/styles.ts +0 -30
- package/src/libs/SuggestAction/types.ts +0 -36
- package/src/libs/Swipe/SwipeView.tsx +0 -151
- package/src/libs/Swipe/index.tsx +0 -5
- package/src/libs/Swipe/package.json +0 -16
- package/src/libs/Swipe/publish.sh +0 -16
- package/src/libs/Swipe/styles.ts +0 -16
- package/src/libs/Swipe/types.ts +0 -109
- package/src/libs/TabView/assets/Path.tsx +0 -29
- package/src/libs/TabView/index.tsx +0 -184
- package/src/libs/TabView/package.json +0 -16
- package/src/libs/TabView/publish.sh +0 -16
- package/src/libs/TabView/styles.ts +0 -96
- package/src/libs/TabView/tabBar/CardTabBar.tsx +0 -137
- package/src/libs/TabView/tabBar/SrollableTabBar.tsx +0 -218
- package/src/libs/TabView/tabBar/TabBar.tsx +0 -67
- package/src/libs/TabView/tabItem/CardTabItem.tsx +0 -118
- package/src/libs/TabView/tabItem/TabItem.tsx +0 -180
- package/src/libs/TabView/types.ts +0 -166
- package/src/libs/Template/HeaderSliderBanner/index.tsx +0 -86
- package/src/libs/Template/HeaderSliderBanner/types.ts +0 -16
- package/src/libs/Template/TrustBanner/CustomAvatar.tsx +0 -39
- package/src/libs/Template/TrustBanner/index.tsx +0 -161
- package/src/libs/Template/TrustBanner/styles.ts +0 -48
- package/src/libs/Template/TrustBanner/types.ts +0 -50
- package/src/libs/Template/index.tsx +0 -4
- package/src/libs/Template/package.json +0 -18
- package/src/libs/Template/publish.sh +0 -17
- package/src/libs/Title/index.tsx +0 -284
- package/src/libs/Title/package.json +0 -17
- package/src/libs/Title/publish.sh +0 -16
- package/src/libs/Title/styles.ts +0 -54
- package/src/libs/Title/types.ts +0 -21
- package/src/libs/Tooltip/TooltipButtons.tsx +0 -54
- package/src/libs/Tooltip/index.tsx +0 -608
- package/src/libs/Tooltip/package.json +0 -16
- package/src/libs/Tooltip/publish.sh +0 -18
- package/src/libs/Tooltip/styles.ts +0 -70
- package/src/libs/Tooltip/types.ts +0 -61
- package/src/libs/Uploader/index.tsx +0 -87
- package/src/libs/Uploader/package.json +0 -17
- package/src/libs/Uploader/publish.sh +0 -18
- package/src/libs/Uploader/styles.ts +0 -30
- package/src/libs/Uploader/types.ts +0 -69
- package/src/native/MoMoNative.podspec +0 -18
- package/src/native/calculator/android/build.gradle +0 -61
- package/src/native/calculator/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/native/calculator/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/src/native/calculator/android/gradlew +0 -172
- package/src/native/calculator/android/gradlew.bat +0 -84
- package/src/native/calculator/android/src/main/AndroidManifest.xml +0 -5
- package/src/native/calculator/android/src/main/java/com/calculator/KeyboardViewModule.java +0 -22
- package/src/native/calculator/android/src/main/java/com/calculator/KeyboardViewPackage.java +0 -35
- package/src/native/calculator/android/src/main/java/com/calculator/modules/CalculatorKeyboardModule.java +0 -157
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/CalculatorEditText.java +0 -36
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/FixedRelativeLayout.java +0 -45
- package/src/native/calculator/android/src/main/java/com/calculator/views/calculatorkeyboard/MomoTextInputCalculatorManager.java +0 -173
- package/src/native/calculator/android/src/main/java/com/calculator/views/customkeyboard/RNCustomKeyboardModule.java +0 -417
- package/src/native/calculator/ios/Helper/MomoHelper.swift +0 -16
- package/src/native/calculator/ios/KeyboardView-Bridging-Header.h +0 -60
- package/src/native/calculator/ios/KeyboardView.h +0 -19
- package/src/native/calculator/ios/KeyboardView.m +0 -56
- package/src/native/calculator/ios/MomoTextInputCalculator.swift +0 -144
- package/src/native/calculator/ios/RNCustomKeyboard/RNCustomKeyboard.h +0 -6
- package/src/native/calculator/ios/RNCustomKeyboard/RNCustomKeyboard.m +0 -143
- package/src/native/package.json +0 -14
- package/src/native/publish.sh +0 -29
- package/src/native/resource/android/build.gradle +0 -57
- package/src/native/resource/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/native/resource/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/src/native/resource/android/src/main/AndroidManifest.xml +0 -6
- package/src/native/resource/android/src/main/java/com/resource/RNResourceModule.java +0 -90
- package/src/native/resource/android/src/main/java/com/resource/RNResourcePackage.java +0 -22
- package/src/native/resource/ios/RNResouce.m +0 -71
- package/src/native/resource/ios/RNResource.h +0 -5
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
RefObject,
|
|
3
|
-
useCallback,
|
|
4
|
-
useMemo,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
8
|
-
import {Animated} from 'react-native';
|
|
9
|
-
import {clamp} from './helpers';
|
|
10
|
-
import styles from './styles';
|
|
11
|
-
import FollowerContainer, {LabelRef} from './Label';
|
|
12
|
-
import {Spacing} from '@momo-kits/foundation';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* low and high state variables are fallbacks for props (props are not required).
|
|
16
|
-
* This hook ensures that current low and high are not out of [min, max] range.
|
|
17
|
-
* It returns an object which contains:
|
|
18
|
-
* - ref containing correct low, high, min, max and step to work with.
|
|
19
|
-
* - setLow and setHigh setters
|
|
20
|
-
* @param lowProp
|
|
21
|
-
* @param highProp
|
|
22
|
-
* @param min
|
|
23
|
-
* @param max
|
|
24
|
-
* @param step
|
|
25
|
-
* @returns {{inPropsRef: React.MutableRefObject<{high: (*|number), low: (*|number)}>, setLow: (function(number): undefined), setHigh: (function(number): undefined)}}
|
|
26
|
-
*/
|
|
27
|
-
export const useLowHigh = (
|
|
28
|
-
lowProp: number | undefined,
|
|
29
|
-
highProp: number | undefined,
|
|
30
|
-
min: number,
|
|
31
|
-
max: number,
|
|
32
|
-
step: number
|
|
33
|
-
) => {
|
|
34
|
-
const validLowProp = lowProp === undefined ? min : clamp(lowProp, min, max);
|
|
35
|
-
const validHighProp =
|
|
36
|
-
highProp === undefined ? max : clamp(highProp, min, max);
|
|
37
|
-
const inPropsRef = useRef({
|
|
38
|
-
low: validLowProp,
|
|
39
|
-
high: validHighProp,
|
|
40
|
-
step,
|
|
41
|
-
// These 2 fields will be overwritten below.
|
|
42
|
-
min: validLowProp,
|
|
43
|
-
max: validHighProp,
|
|
44
|
-
});
|
|
45
|
-
const {low: lowState, high: highState} = inPropsRef.current;
|
|
46
|
-
const inPropsRefPrev = {lowPrev: lowState, highPrev: highState};
|
|
47
|
-
|
|
48
|
-
// Props have higher priority.
|
|
49
|
-
// If no props are passed, use internal state variables.
|
|
50
|
-
const low = clamp(lowProp === undefined ? lowState : lowProp, min, max);
|
|
51
|
-
const high = clamp(highProp === undefined ? highState : highProp, min, max);
|
|
52
|
-
|
|
53
|
-
// Always update values of refs so pan responder will have updated values
|
|
54
|
-
Object.assign(inPropsRef.current, {low, high, min, max});
|
|
55
|
-
|
|
56
|
-
const setLow = (value: number) => (inPropsRef.current.low = value);
|
|
57
|
-
const setHigh = (value: number) => (inPropsRef.current.high = value);
|
|
58
|
-
return {inPropsRef, inPropsRefPrev, setLow, setHigh};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Sets the current value of widthRef and calls the callback with new width parameter.
|
|
63
|
-
* @param widthRef
|
|
64
|
-
* @param callback
|
|
65
|
-
* @returns {function({nativeEvent: *}): void}
|
|
66
|
-
*/
|
|
67
|
-
export const useWidthLayout = (
|
|
68
|
-
widthRef: RefObject<number>,
|
|
69
|
-
callback?: (width: number) => void
|
|
70
|
-
) => {
|
|
71
|
-
return useCallback(
|
|
72
|
-
({nativeEvent}: {nativeEvent: {layout: {width: number}}}) => {
|
|
73
|
-
const {
|
|
74
|
-
layout: {width},
|
|
75
|
-
} = nativeEvent;
|
|
76
|
-
const {current: w} = widthRef;
|
|
77
|
-
if (w !== width) {
|
|
78
|
-
widthRef.current = width;
|
|
79
|
-
if (callback) {
|
|
80
|
-
callback(width);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
[callback, widthRef]
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* This hook creates a component which follows the thumb.
|
|
90
|
-
* Content renderer is passed to FollowerContainer which re-renders only it's content with setValue method.
|
|
91
|
-
* This allows to re-render only follower, instead of the whole slider with all children (thumb, rail, etc.).
|
|
92
|
-
* Returned update function should be called every time follower should be updated.
|
|
93
|
-
* @param containerWidthRef
|
|
94
|
-
* @param gestureStateRef
|
|
95
|
-
* @param isPressed
|
|
96
|
-
* @param allowOverflow
|
|
97
|
-
* @param disabledLow
|
|
98
|
-
* @param disabledHigh
|
|
99
|
-
* @returns {[JSX.Element, function(*, *=): void]|*[]}
|
|
100
|
-
*/
|
|
101
|
-
export const useThumbFollower = (
|
|
102
|
-
containerWidthRef: RefObject<number>,
|
|
103
|
-
gestureStateRef: RefObject<{
|
|
104
|
-
isLow: boolean;
|
|
105
|
-
lastValue: number;
|
|
106
|
-
lastPosition: number;
|
|
107
|
-
}>,
|
|
108
|
-
isPressed: boolean,
|
|
109
|
-
allowOverflow: boolean,
|
|
110
|
-
disabledLow: boolean,
|
|
111
|
-
disabledHigh: boolean
|
|
112
|
-
): [React.ReactElement, (thumbPositionInView: number, value: number) => void] => {
|
|
113
|
-
const xRef = useRef(new Animated.Value(0));
|
|
114
|
-
const widthRef = useRef(0);
|
|
115
|
-
const contentContainerRef = useRef<LabelRef>(null);
|
|
116
|
-
|
|
117
|
-
const {current: x} = xRef;
|
|
118
|
-
|
|
119
|
-
const update = useCallback(
|
|
120
|
-
(thumbPositionInView: number, value: number) => {
|
|
121
|
-
if (
|
|
122
|
-
(gestureStateRef.current.isLow && disabledLow) ||
|
|
123
|
-
(!gestureStateRef.current.isLow && disabledHigh)
|
|
124
|
-
) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const {current: width} = widthRef;
|
|
129
|
-
const {current: containerWidth} = containerWidthRef;
|
|
130
|
-
const position = thumbPositionInView - width / 2;
|
|
131
|
-
xRef.current.setValue(
|
|
132
|
-
allowOverflow ? position : clamp(position, 0, containerWidth - width)
|
|
133
|
-
);
|
|
134
|
-
contentContainerRef.current?.setValue(value);
|
|
135
|
-
},
|
|
136
|
-
[widthRef, containerWidthRef, allowOverflow, disabledLow, disabledHigh, gestureStateRef] // Include dependencies here.
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const handleLayout = useWidthLayout(widthRef, () => {
|
|
140
|
-
update(
|
|
141
|
-
gestureStateRef.current.lastPosition,
|
|
142
|
-
gestureStateRef.current.lastValue
|
|
143
|
-
);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
const transform = {transform: [{translateX: x}]};
|
|
147
|
-
|
|
148
|
-
const shouldDisplayLabel =
|
|
149
|
-
isPressed &&
|
|
150
|
-
((gestureStateRef.current.isLow && !disabledLow) ||
|
|
151
|
-
(!gestureStateRef.current.isLow && !disabledHigh));
|
|
152
|
-
|
|
153
|
-
const follower = (
|
|
154
|
-
<Animated.View style={[transform, {opacity: shouldDisplayLabel ? 1 : 0}]}>
|
|
155
|
-
<FollowerContainer onLayout={handleLayout} ref={contentContainerRef} />
|
|
156
|
-
</Animated.View>
|
|
157
|
-
);
|
|
158
|
-
return [follower, update];
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
interface InProps {
|
|
162
|
-
low: number;
|
|
163
|
-
high: number;
|
|
164
|
-
min: number;
|
|
165
|
-
max: number;
|
|
166
|
-
step: number;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export const useSelectedRail = (
|
|
170
|
-
inPropsRef: RefObject<InProps>,
|
|
171
|
-
containerWidthRef: RefObject<number>,
|
|
172
|
-
thumbWidth: number,
|
|
173
|
-
disableRange: boolean
|
|
174
|
-
) => {
|
|
175
|
-
const {current: left} = useRef(new Animated.Value(0));
|
|
176
|
-
const {current: right} = useRef(new Animated.Value(0));
|
|
177
|
-
const update = useCallback(() => {
|
|
178
|
-
const {low, high, min, max} = inPropsRef.current;
|
|
179
|
-
const {current: containerWidth} = containerWidthRef;
|
|
180
|
-
const fullScale = (max - min) / (containerWidth - thumbWidth);
|
|
181
|
-
const leftValue = (low - min) / fullScale;
|
|
182
|
-
const rightValue = (max - high) / fullScale;
|
|
183
|
-
left.setValue(disableRange ? 0 : leftValue);
|
|
184
|
-
right.setValue(
|
|
185
|
-
disableRange ? containerWidth - thumbWidth - leftValue : rightValue
|
|
186
|
-
);
|
|
187
|
-
}, [inPropsRef, containerWidthRef, disableRange, thumbWidth, left, right]);
|
|
188
|
-
const styles = useMemo(
|
|
189
|
-
() => ({
|
|
190
|
-
position: 'absolute',
|
|
191
|
-
left: left,
|
|
192
|
-
right: right,
|
|
193
|
-
}),
|
|
194
|
-
[left, right]
|
|
195
|
-
);
|
|
196
|
-
return [styles, update];
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* @param floating
|
|
201
|
-
* @returns {{onLayout: ((function({nativeEvent: *}): void)|undefined), style: [*, {top}]}}
|
|
202
|
-
*/
|
|
203
|
-
export const useLabelContainerProps = (floating: boolean) => {
|
|
204
|
-
const [labelContainerHeight, setLabelContainerHeight] = useState(0);
|
|
205
|
-
const onLayout = useCallback(({nativeEvent}: {nativeEvent: {layout: {height: number}}}) => {
|
|
206
|
-
const {
|
|
207
|
-
layout: {height},
|
|
208
|
-
} = nativeEvent;
|
|
209
|
-
setLabelContainerHeight(height);
|
|
210
|
-
}, []);
|
|
211
|
-
|
|
212
|
-
const top = floating ? -(labelContainerHeight + Spacing.XS) : Spacing.XS;
|
|
213
|
-
const style = [
|
|
214
|
-
floating ? styles.labelFloatingContainer : styles.labelFixedContainer,
|
|
215
|
-
{top},
|
|
216
|
-
];
|
|
217
|
-
return {style, onLayout: onLayout};
|
|
218
|
-
};
|
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
memo,
|
|
3
|
-
useCallback,
|
|
4
|
-
useContext,
|
|
5
|
-
useEffect,
|
|
6
|
-
useMemo,
|
|
7
|
-
useRef,
|
|
8
|
-
useState,
|
|
9
|
-
} from 'react';
|
|
10
|
-
import {
|
|
11
|
-
Animated,
|
|
12
|
-
GestureResponderEvent,
|
|
13
|
-
LayoutChangeEvent,
|
|
14
|
-
PanResponder,
|
|
15
|
-
PanResponderGestureState,
|
|
16
|
-
View,
|
|
17
|
-
ViewProps,
|
|
18
|
-
ViewStyle,
|
|
19
|
-
} from 'react-native';
|
|
20
|
-
|
|
21
|
-
import styles from './styles';
|
|
22
|
-
import {
|
|
23
|
-
useLabelContainerProps,
|
|
24
|
-
useLowHigh,
|
|
25
|
-
useSelectedRail,
|
|
26
|
-
useThumbFollower,
|
|
27
|
-
useWidthLayout,
|
|
28
|
-
} from './hooks';
|
|
29
|
-
import {clamp, getValueForPosition, isLowCloser} from './helpers';
|
|
30
|
-
import {ApplicationContext, Radius, Shadow} from '@momo-kits/foundation';
|
|
31
|
-
|
|
32
|
-
const trueFunc = () => true;
|
|
33
|
-
const falseFunc = () => false;
|
|
34
|
-
|
|
35
|
-
export interface SliderProps extends ViewProps {
|
|
36
|
-
/**
|
|
37
|
-
* Specifies the minimum value permitted for selection in the slider. This value sets the lower
|
|
38
|
-
* bound for the component.
|
|
39
|
-
*/
|
|
40
|
-
min: number;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Specifies the maximum value allowed for selection. This value sets the upper bound for the component.
|
|
44
|
-
*/
|
|
45
|
-
max: number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Optional. Defines the minimum permitted range between the low and high values of the slider.
|
|
49
|
-
* Particularly useful when 'low' and 'high' values both exist, ensuring a certain spread between them.
|
|
50
|
-
*/
|
|
51
|
-
minRange?: number;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Specifies the interval between individual step values. The slider's handle will move only in these increments.
|
|
55
|
-
*/
|
|
56
|
-
step: number;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Optional. Represents the initial lower value of the range when the component is used as a range slider.
|
|
60
|
-
* This value is part of the selected range, between 'min' and 'high'.
|
|
61
|
-
*/
|
|
62
|
-
low?: number;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Optional. Represents the initial upper value of the range when used as a range slider.
|
|
66
|
-
* This value is part of the selected range, between 'low' and 'max'.
|
|
67
|
-
*/
|
|
68
|
-
high?: number;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Optional. If `true`, allows the label to extend beyond the width of the Slider component itself,
|
|
72
|
-
* rather than being clipped at the component boundaries. Defaults to `false` if not provided.
|
|
73
|
-
*/
|
|
74
|
-
allowLabelOverflow?: boolean;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Optional. If `true`, disables the range functionality of the slider, turning it into a regular
|
|
78
|
-
* single-value slider. Defaults to `false` if not provided.
|
|
79
|
-
*/
|
|
80
|
-
disableRange?: boolean;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Optional. If `true`, the 'high' handle of the slider will be disabled and cannot be moved.
|
|
84
|
-
* Useful for setting a maximum limit that users cannot increase. Defaults to `false` if not provided.
|
|
85
|
-
*/
|
|
86
|
-
disabledHigh?: boolean;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Optional. If `true`, the 'low' handle of the slider will be disabled and cannot be moved.
|
|
90
|
-
* Useful for setting a minimum limit that users cannot decrease. Defaults to `false` if not provided.
|
|
91
|
-
*/
|
|
92
|
-
disabledLow?: boolean;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Optional. If `true`, labels will be displayed in a floating manner above the slider handles,
|
|
96
|
-
* typically used to display the current value. Defaults to `false` if not provided.
|
|
97
|
-
*/
|
|
98
|
-
floatingLabel?: boolean;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Optional. A callback function triggered when the slider value changes, either by the user or programmatically.
|
|
102
|
-
* It receives the new low and high values of the slider, as well as a boolean indicating if the change was made by the user.
|
|
103
|
-
*/
|
|
104
|
-
onValueChanged?: (low: number, high: number, byUser: boolean) => void;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Optional. A callback function triggered when the user starts touching the slider's draggable area.
|
|
108
|
-
* It receives the current low and high values of the slider.
|
|
109
|
-
*/
|
|
110
|
-
onSliderTouchStart?: (low: number, high: number) => void;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Optional. A callback function triggered when the user releases the slider's draggable area.
|
|
114
|
-
* It receives the current low and high values of the slider.
|
|
115
|
-
*/
|
|
116
|
-
onSliderTouchEnd?: (low: number, high: number) => void;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const Slider: React.FC<SliderProps> = memo(
|
|
120
|
-
({
|
|
121
|
-
min,
|
|
122
|
-
max,
|
|
123
|
-
minRange = 0,
|
|
124
|
-
step,
|
|
125
|
-
low: lowProp,
|
|
126
|
-
high: highProp,
|
|
127
|
-
floatingLabel = false,
|
|
128
|
-
allowLabelOverflow = false,
|
|
129
|
-
disableRange = false,
|
|
130
|
-
disabledHigh = false,
|
|
131
|
-
disabledLow = false,
|
|
132
|
-
onValueChanged,
|
|
133
|
-
onSliderTouchStart,
|
|
134
|
-
onSliderTouchEnd,
|
|
135
|
-
...restProps
|
|
136
|
-
}) => {
|
|
137
|
-
const {theme} = useContext(ApplicationContext);
|
|
138
|
-
|
|
139
|
-
const {inPropsRef, inPropsRefPrev, setLow, setHigh} = useLowHigh(
|
|
140
|
-
lowProp,
|
|
141
|
-
disableRange ? max : highProp,
|
|
142
|
-
min,
|
|
143
|
-
max,
|
|
144
|
-
step
|
|
145
|
-
);
|
|
146
|
-
const lowThumbXRef = useRef(new Animated.Value(0));
|
|
147
|
-
const highThumbXRef = useRef(new Animated.Value(0));
|
|
148
|
-
const pointerX = useRef(new Animated.Value(0)).current;
|
|
149
|
-
const {current: lowThumbX} = lowThumbXRef;
|
|
150
|
-
const {current: highThumbX} = highThumbXRef;
|
|
151
|
-
|
|
152
|
-
const gestureStateRef = useRef({
|
|
153
|
-
isLow: true,
|
|
154
|
-
lastValue: 0,
|
|
155
|
-
lastPosition: 0,
|
|
156
|
-
});
|
|
157
|
-
const [isPressed, setPressed] = useState(false);
|
|
158
|
-
|
|
159
|
-
const containerWidthRef = useRef(0);
|
|
160
|
-
const [thumbWidth, setThumbWidth] = useState(0);
|
|
161
|
-
|
|
162
|
-
const [selectedRailStyle, updateSelectedRail] = useSelectedRail(
|
|
163
|
-
inPropsRef,
|
|
164
|
-
containerWidthRef,
|
|
165
|
-
thumbWidth,
|
|
166
|
-
disableRange
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
const updateThumbs = useCallback(() => {
|
|
170
|
-
const {current: containerWidth} = containerWidthRef;
|
|
171
|
-
if (!thumbWidth || !containerWidth) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
const {low, high} = inPropsRef.current;
|
|
175
|
-
if (!disableRange) {
|
|
176
|
-
const {current: highThumbX} = highThumbXRef;
|
|
177
|
-
const highPosition =
|
|
178
|
-
((high - min) / (max - min)) * (containerWidth - thumbWidth);
|
|
179
|
-
highThumbX.setValue(highPosition);
|
|
180
|
-
}
|
|
181
|
-
const {current: lowThumbX} = lowThumbXRef;
|
|
182
|
-
const lowPosition =
|
|
183
|
-
((low - min) / (max - min)) * (containerWidth - thumbWidth);
|
|
184
|
-
lowThumbX.setValue(lowPosition);
|
|
185
|
-
typeof updateSelectedRail === 'function' && updateSelectedRail();
|
|
186
|
-
onValueChanged?.(low, high, false);
|
|
187
|
-
}, [
|
|
188
|
-
disableRange,
|
|
189
|
-
inPropsRef,
|
|
190
|
-
max,
|
|
191
|
-
min,
|
|
192
|
-
onValueChanged,
|
|
193
|
-
thumbWidth,
|
|
194
|
-
updateSelectedRail,
|
|
195
|
-
]);
|
|
196
|
-
|
|
197
|
-
useEffect(() => {
|
|
198
|
-
const {lowPrev, highPrev} = inPropsRefPrev;
|
|
199
|
-
if (
|
|
200
|
-
(lowProp !== undefined && lowProp !== lowPrev) ||
|
|
201
|
-
(highProp !== undefined && highProp !== highPrev)
|
|
202
|
-
) {
|
|
203
|
-
updateThumbs();
|
|
204
|
-
}
|
|
205
|
-
}, [highProp, inPropsRefPrev, lowProp, updateThumbs]);
|
|
206
|
-
|
|
207
|
-
useEffect(() => {
|
|
208
|
-
updateThumbs();
|
|
209
|
-
}, [updateThumbs]);
|
|
210
|
-
|
|
211
|
-
const handleContainerLayout = useWidthLayout(
|
|
212
|
-
containerWidthRef,
|
|
213
|
-
updateThumbs
|
|
214
|
-
);
|
|
215
|
-
const handleThumbLayout = useCallback(
|
|
216
|
-
({
|
|
217
|
-
nativeEvent,
|
|
218
|
-
}: LayoutChangeEvent) => {
|
|
219
|
-
const {
|
|
220
|
-
layout: {width},
|
|
221
|
-
} = nativeEvent;
|
|
222
|
-
if (thumbWidth !== width) {
|
|
223
|
-
setThumbWidth(width);
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
[thumbWidth]
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
const lowStyles = useMemo(() => {
|
|
230
|
-
return {transform: [{translateX: lowThumbX}]};
|
|
231
|
-
}, [lowThumbX]);
|
|
232
|
-
|
|
233
|
-
const highStyles = useMemo(() => {
|
|
234
|
-
return disableRange
|
|
235
|
-
? null
|
|
236
|
-
: [styles.highThumbContainer, {transform: [{translateX: highThumbX}]}];
|
|
237
|
-
}, [disableRange, highThumbX]);
|
|
238
|
-
|
|
239
|
-
const railContainerStyles = useMemo(() => {
|
|
240
|
-
return [styles.railsContainer, {marginHorizontal: thumbWidth / 2}];
|
|
241
|
-
}, [thumbWidth]);
|
|
242
|
-
|
|
243
|
-
const [labelView, labelUpdate] = useThumbFollower(
|
|
244
|
-
containerWidthRef,
|
|
245
|
-
gestureStateRef,
|
|
246
|
-
isPressed,
|
|
247
|
-
allowLabelOverflow,
|
|
248
|
-
disabledLow,
|
|
249
|
-
disabledHigh
|
|
250
|
-
);
|
|
251
|
-
|
|
252
|
-
const renderThumb = (name: string) => {
|
|
253
|
-
const isDisabled =
|
|
254
|
-
(name === 'low' && disabledLow) || (name === 'high' && disabledHigh);
|
|
255
|
-
|
|
256
|
-
const thumbColor = isDisabled
|
|
257
|
-
? theme.colors.text.disable
|
|
258
|
-
: theme.colors.primary;
|
|
259
|
-
|
|
260
|
-
return (
|
|
261
|
-
<View
|
|
262
|
-
style={[
|
|
263
|
-
Shadow.Light,
|
|
264
|
-
{
|
|
265
|
-
width: 20,
|
|
266
|
-
height: 20,
|
|
267
|
-
borderRadius: Radius.M,
|
|
268
|
-
borderWidth: 4,
|
|
269
|
-
borderColor: theme.colors.background.surface,
|
|
270
|
-
backgroundColor: thumbColor,
|
|
271
|
-
},
|
|
272
|
-
]}
|
|
273
|
-
/>
|
|
274
|
-
);
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
const lowThumb = renderThumb('low');
|
|
278
|
-
const highThumb = renderThumb('high');
|
|
279
|
-
|
|
280
|
-
const labelContainerProps = useLabelContainerProps(floatingLabel);
|
|
281
|
-
|
|
282
|
-
const {panHandlers} = useMemo(
|
|
283
|
-
() =>
|
|
284
|
-
PanResponder.create({
|
|
285
|
-
onStartShouldSetPanResponderCapture: falseFunc,
|
|
286
|
-
onMoveShouldSetPanResponderCapture: falseFunc,
|
|
287
|
-
onPanResponderTerminationRequest: falseFunc,
|
|
288
|
-
onPanResponderTerminate: trueFunc,
|
|
289
|
-
onShouldBlockNativeResponder: trueFunc,
|
|
290
|
-
|
|
291
|
-
onMoveShouldSetPanResponder: (
|
|
292
|
-
evt: GestureResponderEvent,
|
|
293
|
-
gestureState: PanResponderGestureState
|
|
294
|
-
) => Math.abs(gestureState.dx) > 2 * Math.abs(gestureState.dy),
|
|
295
|
-
|
|
296
|
-
onPanResponderGrant: ({nativeEvent}, gestureState) => {
|
|
297
|
-
const {numberActiveTouches} = gestureState;
|
|
298
|
-
if (numberActiveTouches > 1) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
setPressed(true);
|
|
302
|
-
const {current: lowThumbX} = lowThumbXRef;
|
|
303
|
-
const {current: highThumbX} = highThumbXRef;
|
|
304
|
-
const {locationX: downX, pageX} = nativeEvent;
|
|
305
|
-
const containerX = pageX - downX;
|
|
306
|
-
|
|
307
|
-
const {low, high, min, max} = inPropsRef.current;
|
|
308
|
-
onSliderTouchStart?.(low, high);
|
|
309
|
-
const containerWidth = containerWidthRef.current;
|
|
310
|
-
|
|
311
|
-
const lowPosition =
|
|
312
|
-
thumbWidth / 2 +
|
|
313
|
-
((low - min) / (max - min)) * (containerWidth - thumbWidth);
|
|
314
|
-
const highPosition =
|
|
315
|
-
thumbWidth / 2 +
|
|
316
|
-
((high - min) / (max - min)) * (containerWidth - thumbWidth);
|
|
317
|
-
|
|
318
|
-
const isLow =
|
|
319
|
-
disableRange || isLowCloser(downX, lowPosition, highPosition);
|
|
320
|
-
gestureStateRef.current.isLow = isLow;
|
|
321
|
-
|
|
322
|
-
if ((isLow && disabledLow) || (!isLow && disabledHigh)) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
const handlePositionChange = (positionInView: number) => {
|
|
327
|
-
const {low, high, min, max, step} = inPropsRef.current;
|
|
328
|
-
const minValue = isLow ? min : low + minRange;
|
|
329
|
-
const maxValue = isLow ? high - minRange : max;
|
|
330
|
-
const value = clamp(
|
|
331
|
-
getValueForPosition(
|
|
332
|
-
positionInView,
|
|
333
|
-
containerWidth,
|
|
334
|
-
thumbWidth,
|
|
335
|
-
min,
|
|
336
|
-
max,
|
|
337
|
-
step
|
|
338
|
-
),
|
|
339
|
-
minValue,
|
|
340
|
-
maxValue
|
|
341
|
-
);
|
|
342
|
-
if (gestureStateRef.current.lastValue === value) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
const availableSpace = containerWidth - thumbWidth;
|
|
346
|
-
const absolutePosition =
|
|
347
|
-
((value - min) / (max - min)) * availableSpace;
|
|
348
|
-
gestureStateRef.current.lastValue = value;
|
|
349
|
-
gestureStateRef.current.lastPosition =
|
|
350
|
-
absolutePosition + thumbWidth / 2;
|
|
351
|
-
(isLow ? lowThumbX : highThumbX).setValue(absolutePosition);
|
|
352
|
-
onValueChanged?.(isLow ? value : low, isLow ? high : value, true);
|
|
353
|
-
(isLow ? setLow : setHigh)(value);
|
|
354
|
-
labelUpdate &&
|
|
355
|
-
typeof labelUpdate === 'function' &&
|
|
356
|
-
labelUpdate(gestureStateRef.current.lastPosition, value);
|
|
357
|
-
|
|
358
|
-
typeof updateSelectedRail === 'function' && updateSelectedRail();
|
|
359
|
-
};
|
|
360
|
-
handlePositionChange(downX);
|
|
361
|
-
pointerX.removeAllListeners();
|
|
362
|
-
pointerX.addListener(({value: pointerPosition}) => {
|
|
363
|
-
const positionInView = pointerPosition - containerX;
|
|
364
|
-
handlePositionChange(positionInView);
|
|
365
|
-
});
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
onPanResponderMove: (evt, gestureState) => {
|
|
369
|
-
if (gestureStateRef.current.isLow ? disabledLow : disabledHigh) {
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
Animated.event([null, {moveX: pointerX}], {
|
|
374
|
-
useNativeDriver: false,
|
|
375
|
-
})(evt, gestureState);
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
onPanResponderRelease: () => {
|
|
379
|
-
setPressed(false);
|
|
380
|
-
const {low, high} = inPropsRef.current;
|
|
381
|
-
if (
|
|
382
|
-
(gestureStateRef.current.isLow && disabledLow) ||
|
|
383
|
-
(!gestureStateRef.current.isLow && disabledHigh)
|
|
384
|
-
) {
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
onSliderTouchEnd?.(low, high);
|
|
388
|
-
},
|
|
389
|
-
}),
|
|
390
|
-
[
|
|
391
|
-
pointerX,
|
|
392
|
-
inPropsRef,
|
|
393
|
-
thumbWidth,
|
|
394
|
-
disableRange,
|
|
395
|
-
onValueChanged,
|
|
396
|
-
disabledHigh,
|
|
397
|
-
disabledLow,
|
|
398
|
-
setLow,
|
|
399
|
-
setHigh,
|
|
400
|
-
labelUpdate,
|
|
401
|
-
updateSelectedRail,
|
|
402
|
-
minRange,
|
|
403
|
-
onSliderTouchEnd,
|
|
404
|
-
onSliderTouchStart,
|
|
405
|
-
]
|
|
406
|
-
);
|
|
407
|
-
|
|
408
|
-
const renderTrack = (color: string) => {
|
|
409
|
-
return (
|
|
410
|
-
<View
|
|
411
|
-
style={{
|
|
412
|
-
width: '100%',
|
|
413
|
-
height: 4,
|
|
414
|
-
borderRadius: Radius.L,
|
|
415
|
-
backgroundColor: color,
|
|
416
|
-
}}
|
|
417
|
-
/>
|
|
418
|
-
);
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
const trackColor =
|
|
422
|
-
disabledHigh && disabledLow
|
|
423
|
-
? theme.colors.text.disable
|
|
424
|
-
: theme.colors.primary;
|
|
425
|
-
|
|
426
|
-
return (
|
|
427
|
-
<View {...restProps}>
|
|
428
|
-
<View {...labelContainerProps}>{labelView}</View>
|
|
429
|
-
<View onLayout={handleContainerLayout} style={styles.controlsContainer}>
|
|
430
|
-
<View style={railContainerStyles}>
|
|
431
|
-
{renderTrack(theme.colors.background.default)}
|
|
432
|
-
<Animated.View style={selectedRailStyle as ViewStyle}>
|
|
433
|
-
{renderTrack(trackColor)}
|
|
434
|
-
</Animated.View>
|
|
435
|
-
</View>
|
|
436
|
-
<Animated.View style={lowStyles} onLayout={handleThumbLayout}>
|
|
437
|
-
{lowThumb}
|
|
438
|
-
</Animated.View>
|
|
439
|
-
{!disableRange && (
|
|
440
|
-
<Animated.View style={highStyles}>{highThumb}</Animated.View>
|
|
441
|
-
)}
|
|
442
|
-
<View
|
|
443
|
-
{...panHandlers}
|
|
444
|
-
style={styles.touchableArea}
|
|
445
|
-
collapsable={false}
|
|
446
|
-
/>
|
|
447
|
-
</View>
|
|
448
|
-
</View>
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
);
|
|
452
|
-
|
|
453
|
-
export {Slider};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@momo-kits/slider",
|
|
3
|
-
"version": "0.157.1-beta.4",
|
|
4
|
-
"private": false,
|
|
5
|
-
"main": "index.tsx",
|
|
6
|
-
"peerDependencies": {
|
|
7
|
-
"@momo-kits/foundation": "latest",
|
|
8
|
-
"react": "*",
|
|
9
|
-
"react-native": "*"
|
|
10
|
-
},
|
|
11
|
-
"license": "MoMo",
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"registry": "https://registry.npmjs.org/"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {}
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if [ "$1" == "stable" ]; then
|
|
5
|
-
npm version $(npm view @momo-kits/foundation@stable version)
|
|
6
|
-
npm version patch
|
|
7
|
-
npm publish --tag stable --access=public
|
|
8
|
-
elif [ "$1" == "latest" ]; then
|
|
9
|
-
npm publish --tag latest --access=public
|
|
10
|
-
elif [ "$1" == "beta" ]; then
|
|
11
|
-
npm publish --tag beta --access=public
|
|
12
|
-
else
|
|
13
|
-
npm publish --tag alpha --access=public
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
PACKAGE_NAME=$(npm pkg get name)
|
|
17
|
-
NEW_PACKAGE_VERSION=$(npm pkg get version)
|
|
18
|
-
|