@momo-kits/native-kits 0.169.10-debug → 0.169.11-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/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +20 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +67 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +7 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +34 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +29 -39
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +28 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +3 -10
- package/gradle.properties +1 -1
- package/ios/Input/InputSearch.swift +23 -6
- package/ios/Layout/HeaderLayout.swift +67 -0
- package/ios/Navigation/Component/Header.swift +31 -46
- package/ios/Navigation/Component/HeaderJourney.swift +2 -1
- package/ios/Navigation/Component/HeaderLocation.swift +2 -1
- package/ios/Navigation/Component/HeaderRight.swift +18 -15
- package/ios/Navigation/Component/HeaderUser.swift +2 -1
- package/ios/Navigation/Component/SideBar.swift +4 -13
- package/ios/Navigation/Navigation.swift +6 -1
- package/ios/Navigation/StackScreen.swift +28 -11
- package/ios/native-kits.podspec +1 -1
- package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +11 -2
- package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +11 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ struct AnimatedHeaderDemoContent: View {
|
|
|
30
30
|
|
|
31
31
|
@State private var ratio: AnimatedHeaderRatio = .ratio16_9
|
|
32
32
|
@State private var isSurface = true
|
|
33
|
+
@State private var isStretch = true
|
|
33
34
|
|
|
34
35
|
private let imageUrl = "https://static.momocdn.net/app/img/booking/holiday/mid_atumn_dldl.jpeg"
|
|
35
36
|
|
|
@@ -47,6 +48,11 @@ struct AnimatedHeaderDemoContent: View {
|
|
|
47
48
|
MomoText("Surface")
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
// wide windows (short side >= 600): phone-sized banner, sides filled with the banner color
|
|
52
|
+
Toggle(isOn: $isStretch) {
|
|
53
|
+
MomoText("Stretch content layout")
|
|
54
|
+
}
|
|
55
|
+
|
|
50
56
|
MoMoUIKits.Button(
|
|
51
57
|
title: "Show Animated Header",
|
|
52
58
|
action: show,
|
|
@@ -63,6 +69,7 @@ struct AnimatedHeaderDemoContent: View {
|
|
|
63
69
|
private func show() {
|
|
64
70
|
let ratio = ratio
|
|
65
71
|
let isSurface = isSurface
|
|
72
|
+
let contentLayout: ContentLayout = isStretch ? .stretch : .grid
|
|
66
73
|
let url = imageUrl
|
|
67
74
|
navigator.push(
|
|
68
75
|
{ AnimatedHeaderTargetScreen(ratio: ratio) },
|
|
@@ -77,8 +84,10 @@ struct AnimatedHeaderDemoContent: View {
|
|
|
77
84
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
78
85
|
.clipped()
|
|
79
86
|
)
|
|
80
|
-
}
|
|
81
|
-
|
|
87
|
+
},
|
|
88
|
+
bannerBackgroundColor: Colors.pink09
|
|
89
|
+
),
|
|
90
|
+
contentLayout: contentLayout
|
|
82
91
|
)
|
|
83
92
|
)
|
|
84
93
|
}
|
|
@@ -273,7 +273,9 @@ private struct HeaderTypesScreen: View {
|
|
|
273
273
|
|
|
274
274
|
@EnvironmentObject private var navigation: Navigation
|
|
275
275
|
@Environment(\.applicationEnvironment) private var applicationEnvironment
|
|
276
|
+
@Environment(\.screenLayout) private var layout
|
|
276
277
|
@State private var kind: AnyHashable = Kind.default
|
|
278
|
+
@State private var contentLayout: AnyHashable = ContentLayout.grid
|
|
277
279
|
@State private var titlePosition: AnyHashable = TitlePosition.left
|
|
278
280
|
@State private var showBack = true
|
|
279
281
|
@State private var headerRight: AnyHashable = HeaderRightOption.toolkit
|
|
@@ -295,6 +297,15 @@ private struct HeaderTypesScreen: View {
|
|
|
295
297
|
}, label: position == .left ? "LEFT" : "CENTER")
|
|
296
298
|
}
|
|
297
299
|
Divider()
|
|
300
|
+
// stretch only differs on wide windows (short side >= 600, iPhone Duo excluded)
|
|
301
|
+
let headerLayout = layout.headerLayout(contentLayout.base as? ContentLayout ?? .grid)
|
|
302
|
+
MomoText("Content Layout · wide: \(headerLayout.isWide), frame inset: \(Int(headerLayout.frameInset))")
|
|
303
|
+
ForEach([ContentLayout.grid, ContentLayout.stretch], id: \.self) { item in
|
|
304
|
+
Radio(value: item, groupValue: $contentLayout, onChange: {
|
|
305
|
+
navigation.setOptions { $0.contentLayout = item }
|
|
306
|
+
}, label: item == .grid ? "Grid" : "Stretch")
|
|
307
|
+
}
|
|
308
|
+
Divider()
|
|
298
309
|
Checkbox($showBack, onChange: { checked in
|
|
299
310
|
navigation.setOptions { $0.hiddenBack = !checked }
|
|
300
311
|
}, title: "Show Back")
|