@momo-kits/native-kits 0.163.1-beta.8 → 0.163.1-beta.9-debug
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/CLAUDE.md +1 -1
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +190 -0
- package/compose/build.gradle.kts.backup +190 -0
- package/compose/compose.podspec +47 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +150 -0
- 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 +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +106 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +183 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +207 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +39 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +294 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +826 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +110 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +378 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +113 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +112 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +477 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +240 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +216 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +328 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +97 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +310 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +323 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +217 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +199 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +470 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +88 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +203 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +175 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +234 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +22 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +276 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +65 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +253 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +129 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +100 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +172 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +581 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +156 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +225 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +320 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +81 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +309 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +360 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +128 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +91 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +66 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +207 -0
- package/gradle/libs.versions.toml +69 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Application/ApplicationEnvironment.swift +15 -2
- package/ios/Application/Components.swift +50 -44
- package/ios/Application/FloatingButton.swift +10 -9
- package/ios/Application/HeaderRight.swift +79 -45
- package/ios/Application/Localize.swift +277 -0
- package/ios/Application/MaxApi.swift +18 -0
- package/ios/Application/Navigation/BottomTab/BottomTab.swift +104 -0
- package/ios/Application/Navigation/BottomTab/BottomTabBar.swift +215 -0
- package/ios/Application/Navigation/BottomTab/CurvedContainer.swift +65 -0
- package/ios/Application/Navigation/HeaderBackProps.swift +66 -0
- package/ios/Application/Navigation/HeaderTitle.swift +57 -0
- package/ios/Application/Navigation/HeaderUser.swift +209 -0
- package/ios/Application/Navigation/NavigationContainer.swift +200 -0
- package/ios/Application/Navigation/NavigationOptions.swift +109 -0
- package/ios/Application/Navigation/Navigator.swift +385 -0
- package/ios/Application/Navigation/Overplay/BottomSheet.swift +256 -0
- package/ios/Application/Navigation/Overplay/ModalScreen.swift +74 -0
- package/ios/Application/Navigation/Overplay/SnackBar.swift +144 -0
- package/ios/Application/Navigation/Tracking/ScreenTracker.swift +117 -0
- package/ios/Application/Navigation/component/Header.swift +178 -0
- package/ios/Application/Navigation/component/HeaderBackground.swift +83 -0
- package/ios/Application/Navigation/component/HeaderColor.swift +65 -0
- package/ios/Application/Screen.swift +2 -1
- package/ios/Application/StackScreen.swift +501 -0
- package/ios/Avatar/Avatar.swift +193 -0
- package/ios/Badge/Badge.swift +11 -14
- package/ios/Badge/BadgeRibbon.swift +92 -21
- package/ios/BaselineView/BaselineView.swift +163 -0
- package/ios/Button/Button.swift +124 -29
- package/ios/Carousel/Carousel.swift +196 -0
- package/ios/Checkbox/Checkbox.swift +23 -28
- package/ios/Chip/Chip.swift +56 -33
- package/ios/Collapse/Collapse.swift +192 -0
- package/ios/Colors+Radius+Spacing/Colors.swift +20 -17
- package/ios/Colors+Radius+Spacing/Spacing.swift +3 -1
- package/ios/Colors+Radius+Spacing/Theme.swift +295 -0
- package/ios/DateTimePicker/DateTimePicker.swift +212 -0
- package/ios/DateTimePicker/DateTimePickerTypes.swift +55 -0
- package/ios/DateTimePicker/DateTimePickerUtils.swift +167 -0
- package/ios/DateTimePicker/WheelPicker.swift +165 -0
- package/ios/Divider/Divider.swift +16 -0
- package/ios/Extensions/ActiveOpacityButtonStyle.swift +14 -0
- package/ios/Extensions/Color++.swift +32 -0
- package/ios/Icon/Icon.swift +10 -1
- package/ios/IconButton/IconButton.swift +140 -0
- package/ios/Image/Image.swift +16 -3
- package/ios/Information/Information.swift +3 -1
- package/ios/Input/ErrorView.swift +3 -1
- package/ios/Input/Input.swift +72 -33
- package/ios/Input/InputPhoneNumber.swift +33 -21
- package/ios/Input/InputSearch.swift +107 -48
- package/ios/Input/InputTextArea.swift +134 -64
- package/ios/InputDropDown/InputDropDown.swift +201 -0
- package/ios/InputMoney/InputMoney.swift +347 -0
- package/ios/InputOTP/InputOTP.swift +210 -0
- package/ios/Loader/Loader.swift +113 -0
- package/ios/MoMoUIKits.podspec +5 -0
- package/ios/Pagination/PaginationDot.swift +61 -0
- package/ios/Pagination/PaginationNumber.swift +35 -0
- package/ios/Pagination/PaginationScroll.swift +101 -0
- package/ios/Pagination/PaginationWhiteDot.swift +37 -0
- package/ios/Popup/PopupDisplay.swift +11 -20
- package/ios/Popup/PopupInput.swift +2 -8
- package/ios/Popup/PopupNotify.swift +218 -0
- package/ios/Popup/PopupPromotion.swift +16 -8
- package/ios/ProgressInfo/ProgressInfo.swift +296 -0
- package/ios/Radio/Radio.swift +69 -0
- package/ios/Rating/Rating.swift +82 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/AccentColor.colorset/Contents.json +11 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Background.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Border.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Card.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Contents.json +6 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Error.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryDark.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/PrimaryLight.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Success.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Text.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/TextSecondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/Contents.json +9 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-pressed.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-selected.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-surface.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/background-tonal.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/border-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/gradient.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-container.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-primary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/success-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-default.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-disable.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-hint.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/ThemeColors/text-secondary.colorset/Contents.json +38 -0
- package/ios/Resources/MoMoUIKitsColors.xcassets/Warning.colorset/Contents.json +38 -0
- package/ios/Skeleton/Skeleton.swift +99 -0
- package/ios/Slider/Slider.swift +237 -0
- package/ios/Stepper/Stepper.swift +220 -0
- package/ios/Steps/Steps.swift +467 -0
- package/ios/SuggestAction/SuggestAction.swift +99 -0
- package/ios/Swipeable/SwipeCell.swift +187 -0
- package/ios/Swipeable/SwipeCellModel.swift +21 -0
- package/ios/Switch/Switch.swift +53 -28
- package/ios/TabView/TabView.swift +534 -0
- package/ios/Tag/Tag.swift +98 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +6 -7
- package/ios/Title/Title.swift +269 -0
- package/ios/Tooltip/Tooltip.swift +485 -0
- package/ios/Typography/FontScaleStore.swift +19 -0
- package/ios/Typography/Text.swift +79 -5
- package/ios/Typography/Typography.swift +3 -0
- package/ios/Uploader/Uploader.swift +174 -0
- package/ios/native-kits.podspec +61 -8
- package/ios-demo/MoMoUIKitsDemo.podspec +20 -0
- package/ios-demo/README.md +120 -0
- package/ios-demo/Resources/dot_loading.json +558 -0
- package/ios-demo/Resources/icon.json +4052 -0
- package/ios-demo/Resources/lottie_circle_loader.json +1 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/DemoScaffold.swift +48 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsBadgeDemoView.swift +25 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsButtonDemoView.swift +26 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsCheckboxDemoView.swift +19 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsChipDemoView.swift +33 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsInputDemoView.swift +48 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsPopupDemoView.swift +21 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsRadioDemoView.swift +17 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/Demos/UIKitsTypographyDemoView.swift +28 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoContext.swift +31 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/MoMoUIKitsDemoFactory.swift +24 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +110 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AvatarDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BadgeDemo.swift +269 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BaselineView.swift +117 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +89 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ButtonDemo.swift +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CarouselDemo.swift +126 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CheckboxDemo.swift +63 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ChipDemo.swift +20 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/CollapseDemo.swift +93 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DateTimePickerDemo.swift +124 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DividerDemo.swift +14 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/HeaderUserDemo.swift +49 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +279 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IconButtonDemo.swift +58 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ImageDemo.swift +78 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InformationDemo.swift +138 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDemo.swift +111 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputDropDownDemo.swift +136 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputMoneyDemo.swift +107 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputOTPDemo.swift +73 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputPhoneNumberDemo.swift +100 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputSearchDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/InputTextAreaDemo.swift +57 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LoaderDemo.swift +70 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/LocalizeDemo.swift +188 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +229 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PaginationDemo.swift +72 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupDisplayDemo.swift +175 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +121 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupPromotionDemo.swift +76 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ProgressInfoDemo.swift +89 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RadioDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/RatingDemo.swift +56 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SkeletonDemo.swift +32 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SliderDemo.swift +150 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SnackBarDemo.swift +138 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepperDemo.swift +103 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/StepsDemo.swift +94 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SuggestActionDemo.swift +79 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwipeDemo.swift +152 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/SwitchDemo.swift +33 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TabViewDemo.swift +190 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TagDemo.swift +34 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ThemeDemo.swift +182 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TitleDemo.swift +109 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TooltipDemo.swift +187 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/TypographyDemo.swift +87 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/UploaderDemo.swift +131 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/SwiftUIDemoBrowserView.swift +51 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoModels.swift +15 -0
- package/ios-demo/Sources/MoMoUIKitsDemo/UIKitsDemoRegistry.swift +73 -0
- package/local.properties +8 -0
- package/package.json +1 -1
- package/publish.sh +53 -0
- package/scripts/gen-ios-color.mjs +136 -0
- package/settings.gradle.kts +64 -0
- package/.claude/settings.local.json +0 -62
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
package vn.momo.kits.application
|
|
2
|
+
|
|
3
|
+
import androidx.compose.runtime.Immutable
|
|
4
|
+
import androidx.compose.runtime.Stable
|
|
5
|
+
import androidx.compose.runtime.getValue
|
|
6
|
+
import androidx.compose.runtime.mutableStateOf
|
|
7
|
+
import androidx.compose.runtime.setValue
|
|
8
|
+
import androidx.compose.runtime.staticCompositionLocalOf
|
|
9
|
+
|
|
10
|
+
/** Translation dictionary keyed by language; both `vi` and `en` are required. */
|
|
11
|
+
@Immutable
|
|
12
|
+
data class LocalizationObject(
|
|
13
|
+
val vi: Map<String, String> = emptyMap(),
|
|
14
|
+
val en: Map<String, String> = emptyMap(),
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Translation gateway, ported from momo-kits React Native (`Application/Localize.ts`).
|
|
19
|
+
* Holds the merged dictionary (kit defaults + host overrides) and the active language,
|
|
20
|
+
* switched at runtime via [changeLanguage]. Language is snapshot-backed, so a switch
|
|
21
|
+
* recomposes consumers of [translate]/[translateData].
|
|
22
|
+
*/
|
|
23
|
+
@Stable
|
|
24
|
+
class Localize(translations: LocalizationObject = LocalizationObject()) {
|
|
25
|
+
|
|
26
|
+
private var assets by mutableStateOf(merge(defaultLanguage, translations))
|
|
27
|
+
|
|
28
|
+
private var language by mutableStateOf(VI)
|
|
29
|
+
|
|
30
|
+
val currentLanguage: String get() = language
|
|
31
|
+
|
|
32
|
+
fun changeLanguage(language: String?) {
|
|
33
|
+
this.language = if (language == EN) EN else VI
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fun translate(key: String): String {
|
|
37
|
+
val dictionary = if (language == EN) assets.en else assets.vi
|
|
38
|
+
return dictionary[key]?.takeIf { it.isNotEmpty() } ?: key
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fun translateData(data: Map<String, String>): String =
|
|
42
|
+
data[language] ?: data.entries.joinToString(prefix = "{", postfix = "}") {
|
|
43
|
+
"\"${it.key}\":\"${it.value}\""
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
fun translateData(vi: String, en: String): String = if (language == EN) en else vi
|
|
47
|
+
|
|
48
|
+
fun addTranslations(translations: LocalizationObject) {
|
|
49
|
+
assets = merge(translations, assets)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
companion object {
|
|
53
|
+
const val VI = "vi"
|
|
54
|
+
const val EN = "en"
|
|
55
|
+
|
|
56
|
+
private fun merge(base: LocalizationObject, override: LocalizationObject) = LocalizationObject(vi = base.vi + override.vi, en = base.en + override.en)
|
|
57
|
+
|
|
58
|
+
private val defaultLanguage = LocalizationObject(
|
|
59
|
+
vi = mapOf(
|
|
60
|
+
"errorCode" to "Mã lỗi: ",
|
|
61
|
+
"seeMore" to "Xem thêm",
|
|
62
|
+
"cancel" to "Huỷ",
|
|
63
|
+
"done" to "Xong",
|
|
64
|
+
"confirm" to "Xác nhận",
|
|
65
|
+
"month" to "tháng",
|
|
66
|
+
"day" to "ngày",
|
|
67
|
+
"choose" to "Chọn",
|
|
68
|
+
"sent" to "Đã gửi",
|
|
69
|
+
"received" to "Đã tiếp nhận",
|
|
70
|
+
"processing" to "Đang xử lý",
|
|
71
|
+
"processed" to "Đã xử lý",
|
|
72
|
+
"addImg" to "Thêm hình",
|
|
73
|
+
"chooseBtn" to "Chọn button",
|
|
74
|
+
"imgEg" to "Hình ảnh tham khảo",
|
|
75
|
+
"filter" to "Sắp xếp",
|
|
76
|
+
"shipping" to "Đang giao hàng",
|
|
77
|
+
"men" to "Nam",
|
|
78
|
+
"women" to "Nữ",
|
|
79
|
+
"more" to "Khác",
|
|
80
|
+
"expDate" to "Ngày hết hạn",
|
|
81
|
+
"exp" to "HSD",
|
|
82
|
+
"inActive" to "Chưa kích hoạt",
|
|
83
|
+
"voucherRemindHour" to "Hết hạn sau {hours} giờ",
|
|
84
|
+
"voucherRemindMinute" to "Hết hạn sau {minutes} phút",
|
|
85
|
+
"voucherRemindSecond" to "Hết hạn sau {seconds} giây",
|
|
86
|
+
"voucherRemindDay" to "Hết hạn sau {days} ngày",
|
|
87
|
+
"chooseRoundtrip" to "Chọn vé khứ hồi",
|
|
88
|
+
"depart" to "Ngày đi",
|
|
89
|
+
"return" to "Ngày về",
|
|
90
|
+
"departing" to "Đi",
|
|
91
|
+
"returning" to "Về",
|
|
92
|
+
"jan" to "Tháng 1",
|
|
93
|
+
"feb" to "Tháng 2",
|
|
94
|
+
"mar" to "Tháng 3",
|
|
95
|
+
"apr" to "Tháng 4",
|
|
96
|
+
"may" to "Tháng 5",
|
|
97
|
+
"jun" to "Tháng 6",
|
|
98
|
+
"jul" to "Tháng 7",
|
|
99
|
+
"aug" to "Tháng 8",
|
|
100
|
+
"sep" to "Tháng 9",
|
|
101
|
+
"oct" to "Tháng 10",
|
|
102
|
+
"nov" to "Tháng 11",
|
|
103
|
+
"dec" to "Tháng 12",
|
|
104
|
+
"mon" to "T2",
|
|
105
|
+
"tue" to "T3",
|
|
106
|
+
"wed" to "T4",
|
|
107
|
+
"thu" to "T5",
|
|
108
|
+
"fri" to "T6",
|
|
109
|
+
"sat" to "T7",
|
|
110
|
+
"sun" to "CN",
|
|
111
|
+
"showLunar" to "Hiển thị lịch âm",
|
|
112
|
+
"newYear" to "Tết Dương lịch",
|
|
113
|
+
"valentine" to "Ngày Lễ Tình nhân",
|
|
114
|
+
"womenDay" to "Ngày Quốc tế Phụ nữ",
|
|
115
|
+
"liberationDay" to "Ngày giải phóng Miền Nam thống nhất đất nước",
|
|
116
|
+
"laborDay" to "Ngày Quốc tế Lao động",
|
|
117
|
+
"childrenDay" to "Ngày Quốc tế Thiếu nhi",
|
|
118
|
+
"nationalDay" to "Quốc khánh nước CHXHCN Việt Nam",
|
|
119
|
+
"womenDayVN" to "Ngày Phụ nữ Việt Nam",
|
|
120
|
+
"teacherDay" to "Ngày Nhà giáo Việt Nam",
|
|
121
|
+
"christmasEve" to "Ngày Lễ Giáng Sinh",
|
|
122
|
+
"christmas" to "Ngày Lễ Giáng Sinh",
|
|
123
|
+
"lunarNewYear" to "Tết Nguyên Đán",
|
|
124
|
+
"hungKingDay" to "Giỗ Tổ Hùng Vương",
|
|
125
|
+
"balance" to "Số dư trong ví",
|
|
126
|
+
"chooseDate" to "Chọn ngày tháng năm",
|
|
127
|
+
"year" to "năm",
|
|
128
|
+
"hour" to "giờ",
|
|
129
|
+
"minute" to "phút",
|
|
130
|
+
"from" to "Từ",
|
|
131
|
+
"to" to "Đến",
|
|
132
|
+
"connected" to "Đã kết nối",
|
|
133
|
+
"disconnected" to "Mất kết nối",
|
|
134
|
+
"hide" to "Ẩn",
|
|
135
|
+
"viewAllTitle" to "Xem tất cả",
|
|
136
|
+
"headerTitle" to "Lịch sử thanh toán",
|
|
137
|
+
"SHORTEN" to "THU GỌN",
|
|
138
|
+
"viewMoreBank" to "XEM THÊM (\${otherItemCount} ngân hàng)",
|
|
139
|
+
"transaction_success" to "Thành công",
|
|
140
|
+
"transaction_fail" to "Thất bại",
|
|
141
|
+
"transaction_processing" to "Đang xử lý",
|
|
142
|
+
"viewMore" to "Xem thêm",
|
|
143
|
+
"shorten" to "Thu gọn",
|
|
144
|
+
"Payment" to "Thanh toán \${serviceName}",
|
|
145
|
+
"currencyUnit" to "đ",
|
|
146
|
+
"Month" to "Tháng",
|
|
147
|
+
"save" to "Lưu",
|
|
148
|
+
"favoriteIn" to "Thêm dịch vụ yêu thích",
|
|
149
|
+
"favoriteOut" to "Xóa dịch vụ yêu thích",
|
|
150
|
+
"deviceIn" to "Thêm vào thiết bị",
|
|
151
|
+
"setting" to "Cài đặt",
|
|
152
|
+
"transaction" to "Lịch sử giao dịch",
|
|
153
|
+
"share" to "Chia sẽ dịch vụ",
|
|
154
|
+
"information" to "Thông tin chung",
|
|
155
|
+
"tutorial" to "Hướng dẫn sử dụng",
|
|
156
|
+
"question" to "Câu hỏi thường gặp",
|
|
157
|
+
"support" to "Trung tâm hỗ trợ",
|
|
158
|
+
"skip" to "Bỏ qua",
|
|
159
|
+
"enterPhoneNumber" to "Vui lòng nhập số điện thoại",
|
|
160
|
+
"invalidPhoneNumber" to "Số điện thoại không đúng",
|
|
161
|
+
),
|
|
162
|
+
en = mapOf(
|
|
163
|
+
"seeMore" to "See more",
|
|
164
|
+
"cancel" to "Cancel",
|
|
165
|
+
"done" to "Done",
|
|
166
|
+
"confirm" to "Confirm",
|
|
167
|
+
"month" to "month",
|
|
168
|
+
"day" to "day",
|
|
169
|
+
"choose" to "Choose",
|
|
170
|
+
"sent" to "Sent",
|
|
171
|
+
"received" to "Received",
|
|
172
|
+
"processing" to "Processing",
|
|
173
|
+
"processed" to "Done",
|
|
174
|
+
"addImg" to "Add image",
|
|
175
|
+
"chooseBtn" to "Choose button",
|
|
176
|
+
"imgEg" to "Example images",
|
|
177
|
+
"filter" to "Filter",
|
|
178
|
+
"shipping" to "Shipping",
|
|
179
|
+
"men" to "Men",
|
|
180
|
+
"women" to "Women",
|
|
181
|
+
"more" to "More",
|
|
182
|
+
"expDate" to "Expiration date",
|
|
183
|
+
"exp" to "EXP",
|
|
184
|
+
"inActive" to "Not Activated",
|
|
185
|
+
"voucherRemindHour" to "Revoke after {hours} hours",
|
|
186
|
+
"voucherRemindMinute" to "Revoke after {minutes} minutes",
|
|
187
|
+
"voucherRemindSecond" to "Revoke after {seconds} seconds",
|
|
188
|
+
"voucherRemindDay" to "Revoke after {days} days",
|
|
189
|
+
"chooseRoundtrip" to "Choose roundtrip ticket",
|
|
190
|
+
"depart" to "Departing",
|
|
191
|
+
"return" to "Returning",
|
|
192
|
+
"departing" to "De",
|
|
193
|
+
"returning" to "Re",
|
|
194
|
+
"jan" to "January",
|
|
195
|
+
"feb" to "February",
|
|
196
|
+
"mar" to "March",
|
|
197
|
+
"apr" to "April",
|
|
198
|
+
"may" to "May",
|
|
199
|
+
"jun" to "June",
|
|
200
|
+
"jul" to "July",
|
|
201
|
+
"aug" to "August",
|
|
202
|
+
"sep" to "September",
|
|
203
|
+
"oct" to "October",
|
|
204
|
+
"nov" to "November",
|
|
205
|
+
"dec" to "December",
|
|
206
|
+
"mon" to "Mon",
|
|
207
|
+
"tue" to "Tue",
|
|
208
|
+
"wed" to "Wed",
|
|
209
|
+
"thu" to "Thu",
|
|
210
|
+
"fri" to "Fri",
|
|
211
|
+
"sat" to "Sat",
|
|
212
|
+
"sun" to "Sun",
|
|
213
|
+
"showLunar" to "Show Lunar Calendar",
|
|
214
|
+
"newYear" to "New Year's Day",
|
|
215
|
+
"valentine" to "Valentine's Day",
|
|
216
|
+
"womenDay" to "International Women's Day",
|
|
217
|
+
"liberationDay" to "Liberation Day",
|
|
218
|
+
"laborDay" to "Internation Labor's Day",
|
|
219
|
+
"childrenDay" to "International Labor's Day",
|
|
220
|
+
"nationalDay" to "National Day",
|
|
221
|
+
"womenDayVN" to "Vietnamese Women's Day",
|
|
222
|
+
"teacherDay" to "Teacher's Day",
|
|
223
|
+
"christmasEve" to "Christmas Eve",
|
|
224
|
+
"christmas" to "Christmas Day",
|
|
225
|
+
"lunarNewYear" to "Lunar New Year",
|
|
226
|
+
"hungKingDay" to "Hung Kings' Festival",
|
|
227
|
+
"balance" to "Wallet Balance",
|
|
228
|
+
"chooseDate" to "Choose date",
|
|
229
|
+
"year" to "year",
|
|
230
|
+
"hour" to "hour",
|
|
231
|
+
"minute" to "minute",
|
|
232
|
+
"from" to "From",
|
|
233
|
+
"to" to "To",
|
|
234
|
+
"connected" to "Connected",
|
|
235
|
+
"disconnected" to "Disconnected",
|
|
236
|
+
"hide" to "Hide",
|
|
237
|
+
"viewAllTitle" to "View all",
|
|
238
|
+
"headerTitle" to "Transaction history",
|
|
239
|
+
"SHORTEN" to "SHORTEN",
|
|
240
|
+
"viewMoreBank" to "VIEW MORE (\${otherItemCount} banks)",
|
|
241
|
+
"transaction_success" to "Success",
|
|
242
|
+
"transaction_fail" to "Fail",
|
|
243
|
+
"transaction_processing" to "Processing",
|
|
244
|
+
"viewMore" to "View more",
|
|
245
|
+
"shorten" to "Shorten",
|
|
246
|
+
"Payment" to "\${serviceName} payment",
|
|
247
|
+
"currencyUnit" to "VND",
|
|
248
|
+
"Month" to "Month",
|
|
249
|
+
"save" to "Save",
|
|
250
|
+
"favoriteIn" to "Add to favorite services",
|
|
251
|
+
"favoriteOut" to "Remove to favorite services",
|
|
252
|
+
"deviceIn" to "Add to device",
|
|
253
|
+
"setting" to "Settings",
|
|
254
|
+
"transaction" to "Transaction History",
|
|
255
|
+
"share" to "Share",
|
|
256
|
+
"information" to "Information",
|
|
257
|
+
"tutorial" to "Instruction",
|
|
258
|
+
"question" to "FAQ",
|
|
259
|
+
"support" to "Support center",
|
|
260
|
+
"errorCode" to "Error code: ",
|
|
261
|
+
"skip" to "Skip",
|
|
262
|
+
"enterPhoneNumber" to "Please enter your phone number",
|
|
263
|
+
"invalidPhoneNumber" to "Invalid phone number",
|
|
264
|
+
),
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
val LocalLocalize = staticCompositionLocalOf { Localize() }
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
package vn.momo.kits.application
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.layout.Box
|
|
4
|
+
import androidx.compose.foundation.layout.wrapContentSize
|
|
5
|
+
import androidx.compose.runtime.*
|
|
6
|
+
import androidx.compose.ui.Modifier
|
|
7
|
+
import androidx.compose.ui.unit.Dp
|
|
8
|
+
import vn.momo.kits.const.*
|
|
9
|
+
import vn.momo.kits.modifier.DeprecatedModifier
|
|
10
|
+
import vn.momo.kits.platform.ProvideOsFontScale
|
|
11
|
+
import vn.momo.kits.platform.getStatusBarHeight
|
|
12
|
+
|
|
13
|
+
@Deprecated("Use IMaxApi instead", ReplaceWith("IMaxApi"))
|
|
14
|
+
interface ComposeApi {
|
|
15
|
+
fun request(funcName: String, params: Any?): String
|
|
16
|
+
fun request(funcName: String, params: Any?, onResponse: ((String) -> Unit)?): String
|
|
17
|
+
fun requestCallback(funcName: String, params: Any?, onResponse: ((String) -> Unit)?)
|
|
18
|
+
fun removeCallback(id: String)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
class Navigator {
|
|
22
|
+
fun push(content: @Composable () -> Unit) {
|
|
23
|
+
//implement
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
fun present(content: @Composable () -> Unit) {
|
|
27
|
+
//implement
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fun reset(content: @Composable () -> Unit) {
|
|
31
|
+
//implement
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fun pop() {
|
|
35
|
+
//implement
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
fun replace(content: @Composable () -> Unit) {
|
|
39
|
+
//implement
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
fun popToTop() {
|
|
43
|
+
//implement
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
fun showModal(
|
|
47
|
+
onClose: () -> Unit = {},
|
|
48
|
+
canBackgroundClose: Boolean = true,
|
|
49
|
+
content: @Composable () -> Unit,
|
|
50
|
+
) {
|
|
51
|
+
//implement
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
fun showBottomSheet(content: @Composable () -> Unit) {
|
|
55
|
+
//implement
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@Deprecated("Use LocalApi instead", ReplaceWith("LocalApi"))
|
|
63
|
+
val PlatformApi = staticCompositionLocalOf<Any?> { null }
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@Deprecated("Use NavigationContainer instead", ReplaceWith("NavigationContainer"))
|
|
67
|
+
@Composable
|
|
68
|
+
fun ApplicationContainer(
|
|
69
|
+
theme: Theme = defaultTheme,
|
|
70
|
+
composeApi: ComposeApi? = null,
|
|
71
|
+
statusBarHeight: Dp? = AppStatusBar.current,
|
|
72
|
+
applicationContext: MiniAppContext? = null,
|
|
73
|
+
config: DesignSystemConfig? = null,
|
|
74
|
+
language: String? = null,
|
|
75
|
+
isWhiteList: Boolean = false,
|
|
76
|
+
content: @Composable () -> Unit,
|
|
77
|
+
) {
|
|
78
|
+
var appTheme by remember { mutableStateOf(theme) }
|
|
79
|
+
|
|
80
|
+
LaunchedEffect(Unit) {
|
|
81
|
+
try {
|
|
82
|
+
val headerBar = config?.headerBar
|
|
83
|
+
if (headerBar != null && appTheme.assets.headerBackground == null) {
|
|
84
|
+
appTheme = appTheme.copy(
|
|
85
|
+
assets = ThemeAssets(
|
|
86
|
+
headerBackground = headerBar
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
} catch (e: Exception) {
|
|
91
|
+
print("@@ == NavigationContainer get config error $e")
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
val appStatusBarHeight = statusBarHeight ?: getStatusBarHeight()
|
|
96
|
+
|
|
97
|
+
ProvideOsFontScale {
|
|
98
|
+
CompositionLocalProvider(
|
|
99
|
+
AppTheme provides appTheme,
|
|
100
|
+
PlatformApi provides composeApi,
|
|
101
|
+
AppStatusBar provides appStatusBarHeight,
|
|
102
|
+
LocalContext provides applicationContext,
|
|
103
|
+
) {
|
|
104
|
+
Box(Modifier.wrapContentSize().then(DeprecatedModifier())) {
|
|
105
|
+
content()
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|