@expo/ui 58.0.25 → 58.0.26
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/CHANGELOG.md +9 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +50 -0
- package/android/src/main/java/expo/modules/ui/SplitButtonLayoutView.kt +94 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuGroup.kt +36 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +27 -8
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuPopup.kt +28 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +13 -0
- package/android/src/main/java/expo/modules/ui/menu/SelectableDropdownMenuItem.kt +93 -0
- package/build/community/datetime-picker/DateTimePicker.android.js +1 -0
- package/build/community/datetime-picker/DateTimePicker.android.js.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +2 -2
- package/build/jetpack-compose/DatePicker/index.js +1 -1
- package/build/jetpack-compose/DatePicker/index.js.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +10 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.js +12 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.js.map +1 -1
- package/build/jetpack-compose/DropdownMenu/SelectableDropdownMenuItem.d.ts +89 -0
- package/build/jetpack-compose/DropdownMenu/SelectableDropdownMenuItem.js +80 -0
- package/build/jetpack-compose/DropdownMenu/SelectableDropdownMenuItem.js.map +1 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +91 -0
- package/build/jetpack-compose/DropdownMenu/index.js +33 -0
- package/build/jetpack-compose/DropdownMenu/index.js.map +1 -1
- package/build/jetpack-compose/SplitButtonLayout/index.d.ts +102 -0
- package/build/jetpack-compose/SplitButtonLayout/index.js +68 -0
- package/build/jetpack-compose/SplitButtonLayout/index.js.map +1 -0
- package/build/jetpack-compose/index.d.ts +1 -0
- package/build/jetpack-compose/index.js +1 -0
- package/build/jetpack-compose/index.js.map +1 -1
- package/build/universal/TextInput/index.android.d.ts +1 -1
- package/build/universal/TextInput/index.android.js +7 -2
- package/build/universal/TextInput/index.android.js.map +1 -1
- package/build/universal/TextInput/index.d.ts +1 -1
- package/build/universal/TextInput/index.ios.d.ts +1 -1
- package/build/universal/TextInput/index.ios.js +3 -2
- package/build/universal/TextInput/index.ios.js.map +1 -1
- package/build/universal/TextInput/index.js +2 -1
- package/build/universal/TextInput/index.js.map +1 -1
- package/build/universal/TextInput/types.d.ts +4 -0
- package/build/universal/TextInput/types.js.map +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.25/expo.modules.ui-58.0.25-sources.jar → 58.0.26/expo.modules.ui-58.0.26-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.25/expo.modules.ui-58.0.25.module → 58.0.26/expo.modules.ui-58.0.26.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.25/expo.modules.ui-58.0.25.pom → 58.0.26/expo.modules.ui-58.0.26.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.26/expo.modules.ui-58.0.26.pom.sha512 +1 -0
- package/package.json +1 -1
- package/src/community/datetime-picker/DateTimePicker.android.tsx +2 -1
- package/src/jetpack-compose/DatePicker/index.tsx +4 -4
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +18 -0
- package/src/jetpack-compose/DropdownMenu/SelectableDropdownMenuItem.tsx +149 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +147 -0
- package/src/jetpack-compose/SplitButtonLayout/index.tsx +182 -0
- package/src/jetpack-compose/index.ts +1 -0
- package/src/universal/TextInput/index.android.tsx +7 -1
- package/src/universal/TextInput/index.ios.tsx +3 -0
- package/src/universal/TextInput/index.tsx +2 -0
- package/src/universal/TextInput/types.ts +5 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.25/expo.modules.ui-58.0.25.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 58.0.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [Android] Add `DropdownMenuPopup`, `DropdownMenuGroup`, and `SelectableDropdownMenuItem` for Material 3 Expressive menus. Add a `shape` prop and a `SupportingText` slot to `DropdownMenuItem`. ([#52598](https://github.com/expo/expo/pull/52598) by [@intergalacticspacehighway](https://github.com/intergalacticspacehighway))
|
|
8
|
+
- [Android] Add the Jetpack Compose `SplitButtonLayout` component with `SplitButtonLayout.LeadingButton` and `SplitButtonLayout.TrailingButton` slots, and the `SplitButtonLeadingButton` and `SplitButtonTrailingButton` components. ([#52464](https://github.com/expo/expo/pull/52464) by [@juliusmarminge](https://github.com/juliusmarminge))
|
|
9
|
+
- Preserve null selections in the Jetpack Compose `DateTimePicker` instead of reporting January 1, 1970. The `onDateSelected` callback now accepts `Date | null`. Handle `null` before using `Date` methods when date input is incomplete or invalid. ([#52609](https://github.com/expo/expo/pull/52609) by [@sync](https://github.com/sync))
|
|
10
|
+
- Support accessibilityLabel on universal TextInput fields. ([#52606](https://github.com/expo/expo/pull/52606) by [@sync](https://github.com/sync))
|
|
11
|
+
|
|
3
12
|
## 58.0.25
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/android/build.gradle
CHANGED
|
@@ -12,13 +12,13 @@ apply plugin: 'expo-module-gradle-plugin'
|
|
|
12
12
|
apply plugin: 'org.jetbrains.kotlin.plugin.compose'
|
|
13
13
|
|
|
14
14
|
group = 'expo.modules.ui'
|
|
15
|
-
version = '58.0.
|
|
15
|
+
version = '58.0.26'
|
|
16
16
|
|
|
17
17
|
android {
|
|
18
18
|
namespace "expo.modules.ui"
|
|
19
19
|
defaultConfig {
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName "58.0.
|
|
21
|
+
versionName "58.0.26"
|
|
22
22
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
23
23
|
}
|
|
24
24
|
buildFeatures {
|
|
@@ -33,6 +33,10 @@ import expo.modules.ui.graphics.ImageLoader
|
|
|
33
33
|
import expo.modules.ui.icon.IconView
|
|
34
34
|
import expo.modules.ui.image.ImageView
|
|
35
35
|
import expo.modules.ui.menu.DropdownMenuContent
|
|
36
|
+
import expo.modules.ui.menu.DropdownMenuGroupContent
|
|
37
|
+
import expo.modules.ui.menu.DropdownMenuGroupProps
|
|
38
|
+
import expo.modules.ui.menu.DropdownMenuPopupContent
|
|
39
|
+
import expo.modules.ui.menu.DropdownMenuPopupProps
|
|
36
40
|
import expo.modules.ui.menu.DropdownMenuProps
|
|
37
41
|
import expo.modules.ui.menu.DropdownMenuItemContent
|
|
38
42
|
import expo.modules.ui.menu.DropdownMenuItemProps
|
|
@@ -53,6 +57,8 @@ import expo.modules.ui.menu.ExposedDropdownMenuBoxContent
|
|
|
53
57
|
import expo.modules.ui.menu.ExposedDropdownMenuBoxProps
|
|
54
58
|
import expo.modules.ui.menu.ExposedDropdownMenuContent
|
|
55
59
|
import expo.modules.ui.menu.ExposedDropdownMenuProps
|
|
60
|
+
import expo.modules.ui.menu.SelectableDropdownMenuItemContent
|
|
61
|
+
import expo.modules.ui.menu.SelectableDropdownMenuItemProps
|
|
56
62
|
import kotlinx.coroutines.launch
|
|
57
63
|
import okhttp3.OkHttpClient
|
|
58
64
|
|
|
@@ -445,6 +451,20 @@ class ExpoUIModule : Module() {
|
|
|
445
451
|
}
|
|
446
452
|
}
|
|
447
453
|
|
|
454
|
+
ExpoUIView<DropdownMenuPopupProps>("DropdownMenuPopupView") {
|
|
455
|
+
val onDismissRequest by Event<Unit>()
|
|
456
|
+
|
|
457
|
+
Content { props ->
|
|
458
|
+
DropdownMenuPopupContent(props) { onDismissRequest(Unit) }
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
ExpoUIView<DropdownMenuGroupProps>("DropdownMenuGroupView") {
|
|
463
|
+
Content { props ->
|
|
464
|
+
DropdownMenuGroupContent(props)
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
448
468
|
ExpoUIView<DropdownMenuItemProps>("DropdownMenuItemView") {
|
|
449
469
|
val onItemPressed by Event<Unit>()
|
|
450
470
|
|
|
@@ -453,6 +473,14 @@ class ExpoUIModule : Module() {
|
|
|
453
473
|
}
|
|
454
474
|
}
|
|
455
475
|
|
|
476
|
+
ExpoUIView<SelectableDropdownMenuItemProps>("SelectableDropdownMenuItemView") {
|
|
477
|
+
val onItemPressed by Event<Unit>()
|
|
478
|
+
|
|
479
|
+
Content { props ->
|
|
480
|
+
SelectableDropdownMenuItemContent(props) { onItemPressed(Unit) }
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
456
484
|
ExpoUIView<LoadingIndicatorProps>("LoadingIndicatorView") {
|
|
457
485
|
Content { props ->
|
|
458
486
|
LoadingIndicatorContent(props)
|
|
@@ -541,6 +569,28 @@ class ExpoUIModule : Module() {
|
|
|
541
569
|
}
|
|
542
570
|
}
|
|
543
571
|
|
|
572
|
+
ExpoUIView<SplitButtonLayoutProps>("SplitButtonLayoutView") {
|
|
573
|
+
Content { props ->
|
|
574
|
+
SplitButtonLayoutContent(props)
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
ExpoUIView<SplitButtonLeadingButtonProps>("SplitButtonLeadingButtonView") {
|
|
579
|
+
val onButtonPressed by Event<Unit>()
|
|
580
|
+
|
|
581
|
+
Content { props ->
|
|
582
|
+
SplitButtonLeadingButtonContent(props) { onButtonPressed(Unit) }
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
ExpoUIView<SplitButtonTrailingButtonProps>("SplitButtonTrailingButtonView") {
|
|
587
|
+
val onCheckedChange by Event<SplitButtonCheckedChangeEvent>()
|
|
588
|
+
|
|
589
|
+
Content { props ->
|
|
590
|
+
SplitButtonTrailingButtonContent(props) { onCheckedChange(it) }
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
544
594
|
ExpoUIView<TopAppBarProps>("TopAppBarView") {
|
|
545
595
|
Content { props ->
|
|
546
596
|
TopAppBarContent(props)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@file:OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
|
2
|
+
|
|
3
|
+
package expo.modules.ui
|
|
4
|
+
|
|
5
|
+
import androidx.compose.material3.ButtonDefaults
|
|
6
|
+
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|
7
|
+
import androidx.compose.material3.SplitButtonDefaults
|
|
8
|
+
import androidx.compose.material3.SplitButtonLayout
|
|
9
|
+
import androidx.compose.runtime.Composable
|
|
10
|
+
import androidx.compose.ui.unit.dp
|
|
11
|
+
import expo.modules.kotlin.records.Field
|
|
12
|
+
import expo.modules.kotlin.records.Record
|
|
13
|
+
import expo.modules.kotlin.types.OptimizedRecord
|
|
14
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
15
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
16
|
+
import expo.modules.kotlin.views.OptimizedComposeProps
|
|
17
|
+
import expo.modules.ui.button.ButtonColors
|
|
18
|
+
|
|
19
|
+
@OptimizedComposeProps
|
|
20
|
+
data class SplitButtonLayoutProps(
|
|
21
|
+
val spacing: Float? = null,
|
|
22
|
+
val modifiers: ModifierList = emptyList()
|
|
23
|
+
) : ComposeProps
|
|
24
|
+
|
|
25
|
+
@OptimizedComposeProps
|
|
26
|
+
data class SplitButtonLeadingButtonProps(
|
|
27
|
+
val enabled: Boolean = true,
|
|
28
|
+
val colors: ButtonColors = ButtonColors(),
|
|
29
|
+
val modifiers: ModifierList = emptyList()
|
|
30
|
+
) : ComposeProps
|
|
31
|
+
|
|
32
|
+
@OptimizedComposeProps
|
|
33
|
+
data class SplitButtonTrailingButtonProps(
|
|
34
|
+
val checked: Boolean = false,
|
|
35
|
+
val enabled: Boolean = true,
|
|
36
|
+
val colors: ButtonColors = ButtonColors(),
|
|
37
|
+
val modifiers: ModifierList = emptyList()
|
|
38
|
+
) : ComposeProps
|
|
39
|
+
|
|
40
|
+
@OptimizedRecord
|
|
41
|
+
data class SplitButtonCheckedChangeEvent(
|
|
42
|
+
@Field val checked: Boolean = false
|
|
43
|
+
) : Record
|
|
44
|
+
|
|
45
|
+
@Composable
|
|
46
|
+
fun FunctionalComposableScope.SplitButtonLayoutContent(props: SplitButtonLayoutProps) {
|
|
47
|
+
SplitButtonLayout(
|
|
48
|
+
leadingButton = { Children(UIComposableScope(), filter = { isSlotWithName(it, "leadingButton") }) },
|
|
49
|
+
trailingButton = { Children(UIComposableScope(), filter = { isSlotWithName(it, "trailingButton") }) },
|
|
50
|
+
spacing = props.spacing?.dp ?: SplitButtonDefaults.Spacing,
|
|
51
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Composable
|
|
56
|
+
fun FunctionalComposableScope.SplitButtonLeadingButtonContent(
|
|
57
|
+
props: SplitButtonLeadingButtonProps,
|
|
58
|
+
onClick: () -> Unit
|
|
59
|
+
) {
|
|
60
|
+
SplitButtonDefaults.LeadingButton(
|
|
61
|
+
onClick = onClick,
|
|
62
|
+
enabled = props.enabled,
|
|
63
|
+
colors = ButtonDefaults.buttonColors(
|
|
64
|
+
containerColor = props.colors.containerColor.compose,
|
|
65
|
+
contentColor = props.colors.contentColor.compose,
|
|
66
|
+
disabledContainerColor = props.colors.disabledContainerColor.compose,
|
|
67
|
+
disabledContentColor = props.colors.disabledContentColor.compose
|
|
68
|
+
),
|
|
69
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
70
|
+
) {
|
|
71
|
+
Children(UIComposableScope(rowScope = this))
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@Composable
|
|
76
|
+
fun FunctionalComposableScope.SplitButtonTrailingButtonContent(
|
|
77
|
+
props: SplitButtonTrailingButtonProps,
|
|
78
|
+
onCheckedChange: (SplitButtonCheckedChangeEvent) -> Unit
|
|
79
|
+
) {
|
|
80
|
+
SplitButtonDefaults.TrailingButton(
|
|
81
|
+
checked = props.checked,
|
|
82
|
+
onCheckedChange = { onCheckedChange(SplitButtonCheckedChangeEvent(it)) },
|
|
83
|
+
enabled = props.enabled,
|
|
84
|
+
colors = ButtonDefaults.buttonColors(
|
|
85
|
+
containerColor = props.colors.containerColor.compose,
|
|
86
|
+
contentColor = props.colors.contentColor.compose,
|
|
87
|
+
disabledContainerColor = props.colors.disabledContainerColor.compose,
|
|
88
|
+
disabledContentColor = props.colors.disabledContentColor.compose
|
|
89
|
+
),
|
|
90
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher)
|
|
91
|
+
) {
|
|
92
|
+
Children(UIComposableScope(rowScope = this))
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package expo.modules.ui.menu
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import androidx.compose.material3.DropdownMenuGroup
|
|
5
|
+
import androidx.compose.material3.MenuDefaults
|
|
6
|
+
import androidx.compose.runtime.Composable
|
|
7
|
+
import androidx.compose.ui.unit.dp
|
|
8
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
9
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
10
|
+
import expo.modules.kotlin.views.OptimizedComposeProps
|
|
11
|
+
import expo.modules.ui.ModifierList
|
|
12
|
+
import expo.modules.ui.ModifierRegistry
|
|
13
|
+
import expo.modules.ui.UIComposableScope
|
|
14
|
+
import expo.modules.ui.composeOrNull
|
|
15
|
+
|
|
16
|
+
@OptimizedComposeProps
|
|
17
|
+
data class DropdownMenuGroupProps(
|
|
18
|
+
val shapes: MenuShapePosition? = null,
|
|
19
|
+
val containerColor: Color? = null,
|
|
20
|
+
val tonalElevation: Float? = null,
|
|
21
|
+
val shadowElevation: Float? = null,
|
|
22
|
+
val modifiers: ModifierList = emptyList()
|
|
23
|
+
) : ComposeProps
|
|
24
|
+
|
|
25
|
+
@Composable
|
|
26
|
+
fun FunctionalComposableScope.DropdownMenuGroupContent(props: DropdownMenuGroupProps) {
|
|
27
|
+
DropdownMenuGroup(
|
|
28
|
+
shapes = props.shapes?.let { MenuDefaults.groupShape(index = it.index, count = it.count) } ?: MenuDefaults.groupShapes(),
|
|
29
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
30
|
+
containerColor = props.containerColor.composeOrNull ?: MenuDefaults.groupStandardContainerColor,
|
|
31
|
+
tonalElevation = props.tonalElevation?.dp ?: MenuDefaults.TonalElevation,
|
|
32
|
+
shadowElevation = props.shadowElevation?.dp ?: MenuDefaults.ShadowElevation
|
|
33
|
+
) {
|
|
34
|
+
Children(UIComposableScope(columnScope = this))
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -14,6 +14,7 @@ import expo.modules.ui.ModifierList
|
|
|
14
14
|
import expo.modules.ui.ModifierRegistry
|
|
15
15
|
import expo.modules.ui.composeOrNull
|
|
16
16
|
import expo.modules.ui.findChildSlotView
|
|
17
|
+
import expo.modules.ui.renderSlot
|
|
17
18
|
import expo.modules.kotlin.views.OptimizedComposeProps
|
|
18
19
|
|
|
19
20
|
@OptimizedRecord
|
|
@@ -34,6 +35,7 @@ class DropdownMenuItemColors : Record {
|
|
|
34
35
|
@OptimizedComposeProps
|
|
35
36
|
data class DropdownMenuItemProps(
|
|
36
37
|
val enabled: Boolean = true,
|
|
38
|
+
val shape: MenuShapePosition? = null,
|
|
37
39
|
val elementColors: DropdownMenuItemColors = DropdownMenuItemColors(),
|
|
38
40
|
val modifiers: ModifierList = emptyList()
|
|
39
41
|
) : ComposeProps
|
|
@@ -46,22 +48,39 @@ fun FunctionalComposableScope.DropdownMenuItemContent(
|
|
|
46
48
|
val textSlotView = findChildSlotView(view, "text")
|
|
47
49
|
val leadingSlotView = findChildSlotView(view, "leadingIcon")
|
|
48
50
|
val trailingSlotView = findChildSlotView(view, "trailingIcon")
|
|
51
|
+
val supportingTextSlotView = findChildSlotView(view, "supportingText")
|
|
49
52
|
|
|
50
53
|
val colors = props.elementColors
|
|
51
54
|
val defaultColors = MenuDefaults.itemColors()
|
|
55
|
+
val itemColors = MenuDefaults.itemColors(
|
|
56
|
+
textColor = colors.textColor.composeOrNull ?: defaultColors.textColor,
|
|
57
|
+
leadingIconColor = colors.leadingIconColor.composeOrNull ?: defaultColors.leadingIconColor,
|
|
58
|
+
trailingIconColor = colors.trailingIconColor.composeOrNull ?: defaultColors.trailingIconColor,
|
|
59
|
+
disabledTextColor = colors.disabledTextColor.composeOrNull ?: defaultColors.disabledTextColor,
|
|
60
|
+
disabledLeadingIconColor = colors.disabledLeadingIconColor.composeOrNull ?: defaultColors.disabledLeadingIconColor,
|
|
61
|
+
disabledTrailingIconColor = colors.disabledTrailingIconColor.composeOrNull ?: defaultColors.disabledTrailingIconColor
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if (props.shape != null) {
|
|
65
|
+
DropdownMenuItem(
|
|
66
|
+
onClick = { onItemPressed() },
|
|
67
|
+
text = { textSlotView?.renderSlot() },
|
|
68
|
+
shape = MenuDefaults.itemShape(index = props.shape.index, count = props.shape.count).shape,
|
|
69
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
70
|
+
leadingIcon = leadingSlotView?.let { { it.renderSlot() } },
|
|
71
|
+
trailingContent = trailingSlotView?.let { { it.renderSlot() } },
|
|
72
|
+
supportingText = supportingTextSlotView?.let { { it.renderSlot() } },
|
|
73
|
+
enabled = props.enabled,
|
|
74
|
+
colors = itemColors
|
|
75
|
+
)
|
|
76
|
+
return
|
|
77
|
+
}
|
|
52
78
|
|
|
53
79
|
DropdownMenuItem(
|
|
54
80
|
text = { textSlotView?.let { with(UIComposableScope()) { with(it) { Content() } } } ?: Unit },
|
|
55
81
|
enabled = props.enabled,
|
|
56
82
|
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
57
|
-
colors =
|
|
58
|
-
textColor = colors.textColor.composeOrNull ?: defaultColors.textColor,
|
|
59
|
-
leadingIconColor = colors.leadingIconColor.composeOrNull ?: defaultColors.leadingIconColor,
|
|
60
|
-
trailingIconColor = colors.trailingIconColor.composeOrNull ?: defaultColors.trailingIconColor,
|
|
61
|
-
disabledTextColor = colors.disabledTextColor.composeOrNull ?: defaultColors.disabledTextColor,
|
|
62
|
-
disabledLeadingIconColor = colors.disabledLeadingIconColor.composeOrNull ?: defaultColors.disabledLeadingIconColor,
|
|
63
|
-
disabledTrailingIconColor = colors.disabledTrailingIconColor.composeOrNull ?: defaultColors.disabledTrailingIconColor
|
|
64
|
-
),
|
|
83
|
+
colors = itemColors,
|
|
65
84
|
leadingIcon = leadingSlotView?.let {
|
|
66
85
|
{ with(UIComposableScope()) { with(it) { Content() } } }
|
|
67
86
|
},
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package expo.modules.ui.menu
|
|
2
|
+
|
|
3
|
+
import androidx.compose.material3.DropdownMenuPopup
|
|
4
|
+
import androidx.compose.runtime.Composable
|
|
5
|
+
import androidx.compose.ui.window.PopupProperties
|
|
6
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
7
|
+
import expo.modules.ui.UIComposableScope
|
|
8
|
+
import expo.modules.ui.ModifierRegistry
|
|
9
|
+
|
|
10
|
+
@Composable
|
|
11
|
+
fun FunctionalComposableScope.DropdownMenuPopupContent(
|
|
12
|
+
props: DropdownMenuPopupProps,
|
|
13
|
+
onDismissRequest: () -> Unit
|
|
14
|
+
) {
|
|
15
|
+
DropdownMenuPopup(
|
|
16
|
+
expanded = props.expanded,
|
|
17
|
+
onDismissRequest = onDismissRequest,
|
|
18
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
19
|
+
properties = PopupProperties(
|
|
20
|
+
focusable = props.properties.focusable,
|
|
21
|
+
dismissOnBackPress = props.properties.dismissOnBackPress,
|
|
22
|
+
dismissOnClickOutside = props.properties.dismissOnClickOutside,
|
|
23
|
+
clippingEnabled = props.properties.clippingEnabled
|
|
24
|
+
)
|
|
25
|
+
) {
|
|
26
|
+
Children(UIComposableScope(columnScope = this))
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -32,3 +32,16 @@ data class DropdownMenuProps(
|
|
|
32
32
|
val shadowElevation: Float? = null,
|
|
33
33
|
val properties: ExpoPopupProperties = ExpoPopupProperties()
|
|
34
34
|
) : ComposeProps
|
|
35
|
+
|
|
36
|
+
@OptimizedRecord
|
|
37
|
+
data class MenuShapePosition(
|
|
38
|
+
@Field val index: Int = 0,
|
|
39
|
+
@Field val count: Int = 1
|
|
40
|
+
) : Record
|
|
41
|
+
|
|
42
|
+
@OptimizedComposeProps
|
|
43
|
+
data class DropdownMenuPopupProps(
|
|
44
|
+
val expanded: Boolean = false,
|
|
45
|
+
val modifiers: ModifierList = emptyList(),
|
|
46
|
+
val properties: ExpoPopupProperties = ExpoPopupProperties()
|
|
47
|
+
) : ComposeProps
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
package expo.modules.ui.menu
|
|
2
|
+
|
|
3
|
+
import android.graphics.Color
|
|
4
|
+
import androidx.compose.material3.MenuDefaults
|
|
5
|
+
import androidx.compose.material3.SelectableDropdownMenuItem
|
|
6
|
+
import androidx.compose.runtime.Composable
|
|
7
|
+
import expo.modules.kotlin.records.Field
|
|
8
|
+
import expo.modules.kotlin.records.Record
|
|
9
|
+
import expo.modules.kotlin.types.OptimizedRecord
|
|
10
|
+
import expo.modules.kotlin.views.ComposeProps
|
|
11
|
+
import expo.modules.kotlin.views.FunctionalComposableScope
|
|
12
|
+
import expo.modules.kotlin.views.OptimizedComposeProps
|
|
13
|
+
import expo.modules.ui.ModifierList
|
|
14
|
+
import expo.modules.ui.ModifierRegistry
|
|
15
|
+
import expo.modules.ui.compose
|
|
16
|
+
import expo.modules.ui.findChildSlotView
|
|
17
|
+
import expo.modules.ui.renderSlot
|
|
18
|
+
|
|
19
|
+
@OptimizedRecord
|
|
20
|
+
class SelectableDropdownMenuItemColors : Record {
|
|
21
|
+
@Field val textColor: Color? = null
|
|
22
|
+
|
|
23
|
+
@Field val containerColor: Color? = null
|
|
24
|
+
|
|
25
|
+
@Field val leadingIconColor: Color? = null
|
|
26
|
+
|
|
27
|
+
@Field val trailingContentColor: Color? = null
|
|
28
|
+
|
|
29
|
+
@Field val disabledTextColor: Color? = null
|
|
30
|
+
|
|
31
|
+
@Field val disabledContainerColor: Color? = null
|
|
32
|
+
|
|
33
|
+
@Field val disabledLeadingIconColor: Color? = null
|
|
34
|
+
|
|
35
|
+
@Field val disabledTrailingContentColor: Color? = null
|
|
36
|
+
|
|
37
|
+
@Field val selectedTextColor: Color? = null
|
|
38
|
+
|
|
39
|
+
@Field val selectedContainerColor: Color? = null
|
|
40
|
+
|
|
41
|
+
@Field val selectedLeadingIconColor: Color? = null
|
|
42
|
+
|
|
43
|
+
@Field val selectedTrailingContentColor: Color? = null
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@OptimizedComposeProps
|
|
47
|
+
data class SelectableDropdownMenuItemProps(
|
|
48
|
+
val selected: Boolean = false,
|
|
49
|
+
val shapes: MenuShapePosition? = null,
|
|
50
|
+
val enabled: Boolean = true,
|
|
51
|
+
val colors: SelectableDropdownMenuItemColors = SelectableDropdownMenuItemColors(),
|
|
52
|
+
val modifiers: ModifierList = emptyList()
|
|
53
|
+
) : ComposeProps
|
|
54
|
+
|
|
55
|
+
@Composable
|
|
56
|
+
fun FunctionalComposableScope.SelectableDropdownMenuItemContent(
|
|
57
|
+
props: SelectableDropdownMenuItemProps,
|
|
58
|
+
onItemPressed: () -> Unit
|
|
59
|
+
) {
|
|
60
|
+
val textSlotView = findChildSlotView(view, "text")
|
|
61
|
+
val leadingSlotView = findChildSlotView(view, "leadingIcon")
|
|
62
|
+
val selectedLeadingSlotView = findChildSlotView(view, "selectedLeadingIcon")
|
|
63
|
+
val trailingSlotView = findChildSlotView(view, "trailingContent")
|
|
64
|
+
val supportingTextSlotView = findChildSlotView(view, "supportingText")
|
|
65
|
+
val colors = props.colors
|
|
66
|
+
|
|
67
|
+
SelectableDropdownMenuItem(
|
|
68
|
+
selected = props.selected,
|
|
69
|
+
onClick = { onItemPressed() },
|
|
70
|
+
text = { textSlotView?.renderSlot() },
|
|
71
|
+
shapes = props.shapes?.let { MenuDefaults.itemShape(index = it.index, count = it.count) } ?: MenuDefaults.itemShapes(),
|
|
72
|
+
modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher),
|
|
73
|
+
leadingIcon = leadingSlotView?.let { { it.renderSlot() } },
|
|
74
|
+
selectedLeadingIcon = selectedLeadingSlotView?.let { { it.renderSlot() } },
|
|
75
|
+
trailingContent = trailingSlotView?.let { { it.renderSlot() } },
|
|
76
|
+
supportingText = supportingTextSlotView?.let { { it.renderSlot() } },
|
|
77
|
+
enabled = props.enabled,
|
|
78
|
+
colors = MenuDefaults.selectableItemColors(
|
|
79
|
+
textColor = colors.textColor.compose,
|
|
80
|
+
containerColor = colors.containerColor.compose,
|
|
81
|
+
leadingIconColor = colors.leadingIconColor.compose,
|
|
82
|
+
trailingContentColor = colors.trailingContentColor.compose,
|
|
83
|
+
disabledTextColor = colors.disabledTextColor.compose,
|
|
84
|
+
disabledContainerColor = colors.disabledContainerColor.compose,
|
|
85
|
+
disabledLeadingIconColor = colors.disabledLeadingIconColor.compose,
|
|
86
|
+
disabledTrailingContentColor = colors.disabledTrailingContentColor.compose,
|
|
87
|
+
selectedTextColor = colors.selectedTextColor.compose,
|
|
88
|
+
selectedContainerColor = colors.selectedContainerColor.compose,
|
|
89
|
+
selectedLeadingIconColor = colors.selectedLeadingIconColor.compose,
|
|
90
|
+
selectedTrailingContentColor = colors.selectedTrailingContentColor.compose
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
}
|
|
@@ -46,6 +46,7 @@ export function DateTimePicker(props) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
const onDateSelected = (date)=>{
|
|
49
|
+
if (date === null) return;
|
|
49
50
|
const selected = usesDateComponents ? utcDayToLocalDate(date, value) : date;
|
|
50
51
|
if (onValueChange) {
|
|
51
52
|
onValueChange(buildChangeEvent(selected), selected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["community/datetime-picker/DateTimePicker.android.tsx"],"sourcesContent":[null],"names":["DateTimePicker","AndroidPicker","DatePickerDialog","AndroidDatePickerDialog","TimePickerDialog","AndroidTimePickerDialog","Host","buildEvent","buildChangeEvent","localDateToUtcDayISOString","utcDayToLocalDate","modeToDisplayedComponents","mode","displayToAndroidVariant","display","props","value","onChange","onValueChange","onDismiss","onDismissProp","minimumDate","maximumDate","is24Hour","testID","style","accentColor","themeVariant","presentation","positiveButton","negativeButton","usesDateComponents","initialDate","toISOString","onDismissed","type","nativeEvent","timestamp","getTime","utcOffset","getTimezoneOffset","onDateSelected","date","selected","selectableDates","start","end","undefined","dialogProps","color","confirmButtonLabel","label","dismissButtonLabel","onDismissRequest","colorScheme","variant","matchContents","vertical","displayedComponents","elementColors","containerColor","showVariantToggle","showTitle","showHeadline"],"mappings":";AAAA,SACEA,kBAAkBC,aAAa,EAC/BC,oBAAoBC,uBAAuB,EAC3CC,oBAAoBC,uBAAuB,QAEtC,mCAAmC;AAC1C,SAASC,IAAI,QAAQ,6BAA6B;AAClD,SAASC,UAAU,EAAEC,gBAAgB,QAAkC,UAAU;AACjF,SAASC,0BAA0B,EAAEC,iBAAiB,QAAQ,UAAU;AAExE,SAASC,0BACPC,IAAiC;IAEjC,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,kEAAkE;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hB,SAAS,QAAQ;YACnB,qBACE,KAACN;gBAAKgD,aAAa3B;gBAAcF,OAAOA;0BACtC,cAAA,KAACpB;oBAAyB,GAAG2C,WAAW;oBAAEzB,UAAUA;;;QAG1D;QACA,qBACE,KAACjB;YAAKgD,aAAa3B;YAAcF,OAAOA;sBACtC,cAAA,KAACtB;gBACE,GAAG6C,WAAW;gBACfO,SAAS1C,wBAAwBC;gBACjC8B,iBAAiBA;;;IAIzB;IAEA,qBACE,KAACtC;QAAKkD,eAAe;YAAEC,UAAU;QAAK;QAAGH,aAAa3B;QAAcF,OAAOA;kBACzE,cAAA,KAACxB;YACC+B,aAAaA;YACb0B,qBAAqB/C,0BAA0BC;YAC/C2C,SAAS1C,wBAAwBC;YACjC8B,iBAAiBA;YACjBrB,UAAUA;YACV0B,OAAOvB;YACP,mEAAmE;YACnEiC,eAAe;gBAAEC,gBAAgB;YAAc;YAC/CnB,gBAAgBA;YAChBoB,mBAAmB;YACnB,yFAAyF;YACzF,kCAAkC;YAClCC,WAAW;YACXC,cAAc;YACb,GAAIvC,SAAS;gBAAEA;YAAO,IAAIuB,SAAS;;;AAI5C"}
|
|
1
|
+
{"version":3,"sources":["community/datetime-picker/DateTimePicker.android.tsx"],"sourcesContent":[null],"names":["DateTimePicker","AndroidPicker","DatePickerDialog","AndroidDatePickerDialog","TimePickerDialog","AndroidTimePickerDialog","Host","buildEvent","buildChangeEvent","localDateToUtcDayISOString","utcDayToLocalDate","modeToDisplayedComponents","mode","displayToAndroidVariant","display","props","value","onChange","onValueChange","onDismiss","onDismissProp","minimumDate","maximumDate","is24Hour","testID","style","accentColor","themeVariant","presentation","positiveButton","negativeButton","usesDateComponents","initialDate","toISOString","onDismissed","type","nativeEvent","timestamp","getTime","utcOffset","getTimezoneOffset","onDateSelected","date","selected","selectableDates","start","end","undefined","dialogProps","color","confirmButtonLabel","label","dismissButtonLabel","onDismissRequest","colorScheme","variant","matchContents","vertical","displayedComponents","elementColors","containerColor","showVariantToggle","showTitle","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IAAIxB,eAAe;YACjBA,cAAcV,iBAAiBmC,WAAWA;QAC5C,OAAO;YACL1B,WAAWV,WAAWoC,WAAWA;QACnC;IACF;IAEA,MAAMC,kBACJvB,eAAeC,cAAc;QAAEuB,OAAOxB;QAAayB,KAAKxB;IAAY,IAAIyB;IAE1E,MAAMC,cAAc;QAClBhB;QACAiB,OAAOvB;QACPwB,oBAAoBrB,gBAAgBsB;QACpCC,oBAAoBtB,gBAAgBqB;QACpCV;QACAY,kBAAkBnB;IACpB;IAEA,IAAIN,iBAAiB,UAAU;QAC7B,IAAIhB,SAAS,QAAQ;YACnB,qBACE,KAACN;gBAAKgD,aAAa3B;gBAAcF,OAAOA;0BACtC,cAAA,KAACpB;oBAAyB,GAAG2C,WAAW;oBAAEzB,UAAUA;;;QAG1D;QACA,qBACE,KAACjB;YAAKgD,aAAa3B;YAAcF,OAAOA;sBACtC,cAAA,KAACtB;gBACE,GAAG6C,WAAW;gBACfO,SAAS1C,wBAAwBC;gBACjC8B,iBAAiBA;;;IAIzB;IAEA,qBACE,KAACtC;QAAKkD,eAAe;YAAEC,UAAU;QAAK;QAAGH,aAAa3B;QAAcF,OAAOA;kBACzE,cAAA,KAACxB;YACC+B,aAAaA;YACb0B,qBAAqB/C,0BAA0BC;YAC/C2C,SAAS1C,wBAAwBC;YACjC8B,iBAAiBA;YACjBrB,UAAUA;YACV0B,OAAOvB;YACP,mEAAmE;YACnEiC,eAAe;gBAAEC,gBAAgB;YAAc;YAC/CnB,gBAAgBA;YAChBoB,mBAAmB;YACnB,yFAAyF;YACzF,kCAAkC;YAClCC,WAAW;YACXC,cAAc;YACb,GAAIvC,SAAS;gBAAEA;YAAO,IAAIuB,SAAS;;;AAI5C"}
|
|
@@ -129,9 +129,9 @@ export interface DateTimePickerProps {
|
|
|
129
129
|
*/
|
|
130
130
|
initialDate?: string | null;
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
132
|
+
* Called when the selection changes. The date is `null` when date input is incomplete or invalid.
|
|
133
133
|
*/
|
|
134
|
-
onDateSelected?: (date: Date) => void;
|
|
134
|
+
onDateSelected?: (date: Date | null) => void;
|
|
135
135
|
/**
|
|
136
136
|
* The variant of the picker, which determines its appearance and behavior.
|
|
137
137
|
* @default 'picker'
|
|
@@ -23,7 +23,7 @@ function transformDateTimePickerProps(props) {
|
|
|
23
23
|
initialDate: initialDateTimestamp,
|
|
24
24
|
selectableDates: convertSelectableDates(selectableDates),
|
|
25
25
|
onDateSelected: ({ nativeEvent: { date } })=>{
|
|
26
|
-
props.onDateSelected?.(
|
|
26
|
+
props.onDateSelected?.(convertTimestampToDate(date));
|
|
27
27
|
},
|
|
28
28
|
variant,
|
|
29
29
|
...elementColors != null ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/DatePicker/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","convertSelectableDates","selectableDates","start","getTime","end","convertTimestampToDate","timestamp","Date","transformDateTimePickerProps","props","modifiers","variant","initialDate","elementColors","color","rest","initialDateTimestamp","undefined","onDateSelected","nativeEvent","date","DatePickerNativeView","DateTimePicker","transformDateRangePickerProps","initialStartDate","initialEndDate","onDateRangeSelected","DateRangePickerNativeView","DateRangePicker","nativeProps","DatePickerDialogNativeView","DatePickerDialog","onDismissRequest","DateRangePickerDialogNativeView","DateRangePickerDialog","confirmButtonLabel","dismissButtonLabel","TimePickerDialogNativeView","TimePickerDialog"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,+BAA+B,QAAQ,qBAAqB;AAoNrE,SAASC,uBAAuBC,eAG/B;IACC,IAAI,CAACA,iBAAiB,OAAO;IAC7B,OAAO;QACLC,OAAOD,gBAAgBC,KAAK,GAAGD,gBAAgBC,KAAK,CAACC,OAAO,KAAK;QACjEC,KAAKH,gBAAgBG,GAAG,GAAGH,gBAAgBG,GAAG,CAACD,OAAO,KAAK;IAC7D;AACF;AAEA,SAASE,uBAAuBC,SAAwB;IACtD,OAAOA,aAAa,OAAO,OAAO,IAAIC,KAAKD;AAC7C;AAEA,SAASE,6BAA6BC,KAA0B;IAC9D,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAEX,eAAe,EAAEY,aAAa,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAE5F,8CAA8C;IAC9C,MAAMO,uBAAuBJ,cAAc,IAAIL,KAAKK,aAAaT,OAAO,KAAK;IAE7E,OAAO;QACLO;QACA,GAAIA,YAAYX,gCAAgCW,aAAaO,SAAS;QACtE,GAAGF,IAAI;QACPD;QACAF,aAAaI;QACbf,iBAAiBD,uBAAuBC;QACxCiB,gBAAgB,CAAC,EAAEC,aAAa,EAAEC,IAAI,EAAE,EAAE;YACxCX,MAAMS,cAAc,
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/DatePicker/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","convertSelectableDates","selectableDates","start","getTime","end","convertTimestampToDate","timestamp","Date","transformDateTimePickerProps","props","modifiers","variant","initialDate","elementColors","color","rest","initialDateTimestamp","undefined","onDateSelected","nativeEvent","date","DatePickerNativeView","DateTimePicker","transformDateRangePickerProps","initialStartDate","initialEndDate","onDateRangeSelected","DateRangePickerNativeView","DateRangePicker","nativeProps","DatePickerDialogNativeView","DatePickerDialog","onDismissRequest","DateRangePickerDialogNativeView","DateRangePickerDialog","confirmButtonLabel","dismissButtonLabel","TimePickerDialogNativeView","TimePickerDialog"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,+BAA+B,QAAQ,qBAAqB;AAoNrE,SAASC,uBAAuBC,eAG/B;IACC,IAAI,CAACA,iBAAiB,OAAO;IAC7B,OAAO;QACLC,OAAOD,gBAAgBC,KAAK,GAAGD,gBAAgBC,KAAK,CAACC,OAAO,KAAK;QACjEC,KAAKH,gBAAgBG,GAAG,GAAGH,gBAAgBG,GAAG,CAACD,OAAO,KAAK;IAC7D;AACF;AA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E9B,OAAO,SAASwC,iBAAiB7B,KAA4B;IAC3D,MAAM,EAAEG,WAAW,EAAEC,aAAa,EAAEmB,gBAAgB,EAAE,GAAGjB,MAAM,GAAGN;IAClE,MAAMoB,cAA2C;QAC/C,GAAGd,IAAI;QACPH,aAAaA,cAAc,IAAIL,KAAKK,aAAaT,OAAO,KAAK;QAC7De,gBAAgB,CAAC,EAAEC,aAAa,EAAEC,IAAI,EAAE,EAAE;YACxCX,MAAMS,cAAc,GAAG,IAAIX,KAAKa;QAClC;QACAY;QACA,GAAInB,iBAAiB,OAAO;YAAEA;QAAc,IAAII,SAAS;IAC3D;IACA,qBAAO,KAACoB;QAA4B,GAAGR,WAAW;;AACpD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColorValue } from 'react-native';
|
|
2
2
|
import type { ModifierConfig } from '../../types';
|
|
3
|
+
import type { MenuShapePosition } from './index';
|
|
3
4
|
/**
|
|
4
5
|
* Color overrides for the `DropdownMenuItem` component.
|
|
5
6
|
*/
|
|
@@ -22,6 +23,12 @@ export interface DropdownMenuItemProps {
|
|
|
22
23
|
* @default true
|
|
23
24
|
*/
|
|
24
25
|
enabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The position of the item in its `DropdownMenuGroup`, which sets its shape through Compose's
|
|
28
|
+
* `MenuDefaults.itemShape(index, count).shape`. When set, the item is a Material 3 Expressive
|
|
29
|
+
* menu item and can show `SupportingText`.
|
|
30
|
+
*/
|
|
31
|
+
shape?: MenuShapePosition;
|
|
25
32
|
/**
|
|
26
33
|
* Color overrides for the menu item.
|
|
27
34
|
*/
|
|
@@ -63,5 +70,8 @@ declare namespace DropdownMenuItemComponent {
|
|
|
63
70
|
var TrailingIcon: (props: {
|
|
64
71
|
children: React.ReactNode;
|
|
65
72
|
}) => import("react").JSX.Element;
|
|
73
|
+
var SupportingText: (props: {
|
|
74
|
+
children: React.ReactNode;
|
|
75
|
+
}) => import("react").JSX.Element;
|
|
66
76
|
}
|
|
67
77
|
export { DropdownMenuItemComponent as DropdownMenuItem };
|
|
@@ -25,6 +25,17 @@ const DropdownMenuItemNativeView = requireNativeView('ExpoUI', 'DropdownMenuItem
|
|
|
25
25
|
children: props.children
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* A supporting text slot for `DropdownMenuItem`, shown below the text.
|
|
30
|
+
* Only applies to an item with a `shape`.
|
|
31
|
+
*
|
|
32
|
+
* @platform android
|
|
33
|
+
*/ function SupportingText(props) {
|
|
34
|
+
return /*#__PURE__*/ _jsx(SlotNativeView, {
|
|
35
|
+
slotName: "supportingText",
|
|
36
|
+
children: props.children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
28
39
|
/**
|
|
29
40
|
* A text slot for `DropdownMenuItem`.
|
|
30
41
|
* Wrap text content to display as the menu item label.
|
|
@@ -55,6 +66,7 @@ const DropdownMenuItemNativeView = requireNativeView('ExpoUI', 'DropdownMenuItem
|
|
|
55
66
|
DropdownMenuItemComponent.Text = TextSlot;
|
|
56
67
|
DropdownMenuItemComponent.LeadingIcon = LeadingIcon;
|
|
57
68
|
DropdownMenuItemComponent.TrailingIcon = TrailingIcon;
|
|
69
|
+
DropdownMenuItemComponent.SupportingText = SupportingText;
|
|
58
70
|
export { DropdownMenuItemComponent as DropdownMenuItem };
|
|
59
71
|
|
|
60
72
|
//# sourceMappingURL=DropdownMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["jetpack-compose/DropdownMenu/DropdownMenuItem.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","SlotNativeView","DropdownMenuItemNativeView","LeadingIcon","props","slotName","children","TrailingIcon","TextSlot","DropdownMenuItemComponent","onClick","modifiers","restProps","undefined","enabled","onItemPressed","Text","DropdownMenuItem"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,+BAA+B,QAAQ,qBAAqB;
|
|
1
|
+
{"version":3,"sources":["jetpack-compose/DropdownMenu/DropdownMenuItem.tsx"],"sourcesContent":[null],"names":["requireNativeView","createViewModifierEventListener","SlotNativeView","DropdownMenuItemNativeView","LeadingIcon","props","slotName","children","TrailingIcon","SupportingText","TextSlot","DropdownMenuItemComponent","onClick","modifiers","restProps","undefined","enabled","onItemPressed","Text","DropdownMenuItem"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAIzC,SAASC,+BAA+B,QAAQ,qBAAqB;AAQrE,MAAMC,iBAA2DF,kBAC/D,UACA;AAqDF,MAAMG,6BACJH,kBAAkB,UAAU;AAE9B;;;;;CAKC,GACD,SAASI,YAAYC,KAAoC;IACvD,qBAAO,KAACH;QAAeI,UAAS;kBAAeD,MAAME,QAAQ;;AAC/D;AAEA;;;;;CAKC,GACD,SAASC,aAAaH,KAAoC;IACxD,qBAAO,KAACH;QAAeI,UAAS;kBAAgBD,MAAME,QAAQ;;AAChE;AAEA;;;;;CAKC,GACD,SAASE,eAAeJ,KAAoC;IAC1D,qBAAO,KAACH;QAAeI,UAAS;kBAAkBD,MAAME,QAAQ;;AAClE;AAEA;;;;;CAKC,GACD,SAASG,SAASL,KAAoC;IACpD,qBAAO,KAACH;QAAeI,UAAS;kBAAQD,MAAME,QAAQ;;AACxD;AAEA;;;;;CAKC,GACD,SAASI,0BAA0BN,KAA4B;IAC7D,MAAM,EAAEO,OAAO,EAAEC,SAAS,EAAEN,QAAQ,EAAE,GAAGO,WAAW,GAAGT;IACvD,qBACE,KAACF;QACE,GAAGW,SAAS;QACbD,WAAWA;QACV,GAAIA,YAAYZ,gCAAgCY,aAAaE,SAAS;QACvEC,SAASX,MAAMW,OAAO,IAAI;QAC1BC,eAAeL,UAAU,IAAMA,YAAYG;kBAC1CR;;AAGP;AAEAI,0BAA0BO,IAAI,GAAGR;AACjCC,0BAA0BP,WAAW,GAAGA;AACxCO,0BAA0BH,YAAY,GAAGA;AACzCG,0BAA0BF,cAAc,GAAGA;AAE3C,SAASE,6BAA6BQ,gBAAgB,GAAG"}
|