@expo/ui 55.0.2 → 55.0.3
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 +31 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
- package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
- package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
- package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +258 -70
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +44 -1
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
- package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
- package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
- package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
- package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +53 -161
- package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
- package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
- package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
- package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -86
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts +65 -51
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +72 -14
- package/build/jetpack-compose/Card/index.d.ts.map +1 -1
- package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
- package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
- package/build/jetpack-compose/Chip/index.d.ts +247 -27
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +38 -3
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/IconButton/index.d.ts +45 -29
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Progress/index.d.ts +78 -35
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
- package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Slider/index.d.ts +34 -10
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Switch/index.d.ts +10 -50
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +5 -4
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/index.d.ts +18 -1
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/ProgressView/index.d.ts +1 -5
- package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
- package/build/swift-ui/Stepper/index.d.ts +3 -3
- package/build/swift-ui/Stepper/index.d.ts.map +1 -1
- package/build/swift-ui/Text/index.d.ts +33 -1
- package/build/swift-ui/Text/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +22 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
- package/build/swift-ui/types.d.ts +7 -0
- package/build/swift-ui/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/BottomSheetView.swift +1 -6
- package/ios/ClosedRangeDateRecord.swift +10 -0
- package/ios/ColorPickerView.swift +9 -8
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +4 -6
- package/ios/DatePickerView.swift +7 -5
- package/ios/DisclosureGroupView.swift +5 -7
- package/ios/ListView.swift +6 -14
- package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
- package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/ios/Picker/PickerView.swift +6 -10
- package/ios/Popover/PopoverView.swift +3 -5
- package/ios/ProgressView.swift +0 -5
- package/ios/SectionView.swift +3 -5
- package/ios/SliderView.swift +8 -6
- package/ios/StepperView.swift +12 -16
- package/ios/TextView.swift +37 -1
- package/ios/Toggle/ToggleView.swift +5 -7
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.2/expo.modules.ui-55.0.2.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +5 -2
- package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
- package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
- package/src/jetpack-compose/Button/index.tsx +69 -92
- package/src/jetpack-compose/Card/index.tsx +105 -29
- package/src/jetpack-compose/Checkbox/index.tsx +126 -0
- package/src/jetpack-compose/Chip/index.tsx +391 -51
- package/src/jetpack-compose/DatePicker/index.tsx +112 -7
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
- package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
- package/src/jetpack-compose/IconButton/index.tsx +49 -56
- package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Progress/index.tsx +120 -62
- package/src/jetpack-compose/RadioButton/index.tsx +8 -9
- package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
- package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Slider/index.tsx +76 -29
- package/src/jetpack-compose/Switch/index.tsx +17 -87
- package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
- package/src/jetpack-compose/index.ts +5 -4
- package/src/jetpack-compose/modifiers/index.ts +26 -2
- package/src/swift-ui/ProgressView/index.tsx +1 -3
- package/src/swift-ui/Stepper/index.tsx +7 -7
- package/src/swift-ui/Text/index.tsx +66 -2
- package/src/swift-ui/modifiers/index.ts +40 -0
- package/src/swift-ui/types.ts +5 -0
- package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
- package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
- package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
- package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
- package/build/jetpack-compose/Button/types.d.ts +0 -5
- package/build/jetpack-compose/Button/types.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
- package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
- package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
- package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
- package/build/jetpack-compose/Picker/index.d.ts +0 -62
- package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
- package/build/jetpack-compose/TextButton/index.d.ts +0 -29
- package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.2/expo.modules.ui-55.0.2.pom.sha512 +0 -1
- package/src/jetpack-compose/Button/types.ts +0 -57
- package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
- package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
- package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
- package/src/jetpack-compose/FilterChip/index.tsx +0 -89
- package/src/jetpack-compose/Picker/index.tsx +0 -90
- package/src/jetpack-compose/TextButton/index.tsx +0 -55
|
@@ -1,96 +1,436 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
-
import
|
|
2
|
+
import { type ColorValue } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { type ModifierConfig } from '../../types';
|
|
5
5
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Colors for AssistChip.
|
|
9
9
|
*/
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
| 'bodyLarge';
|
|
10
|
+
export type AssistChipColors = {
|
|
11
|
+
containerColor?: ColorValue;
|
|
12
|
+
labelColor?: ColorValue;
|
|
13
|
+
leadingIconContentColor?: ColorValue;
|
|
14
|
+
trailingIconContentColor?: ColorValue;
|
|
15
|
+
};
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Colors for FilterChip.
|
|
19
|
+
*/
|
|
20
|
+
export type FilterChipColors = {
|
|
21
|
+
containerColor?: ColorValue;
|
|
22
|
+
labelColor?: ColorValue;
|
|
23
|
+
iconColor?: ColorValue;
|
|
24
|
+
selectedContainerColor?: ColorValue;
|
|
25
|
+
selectedLabelColor?: ColorValue;
|
|
26
|
+
selectedLeadingIconColor?: ColorValue;
|
|
27
|
+
selectedTrailingIconColor?: ColorValue;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Colors for InputChip.
|
|
32
|
+
*/
|
|
33
|
+
export type InputChipColors = {
|
|
34
|
+
containerColor?: ColorValue;
|
|
35
|
+
labelColor?: ColorValue;
|
|
36
|
+
leadingIconColor?: ColorValue;
|
|
37
|
+
trailingIconColor?: ColorValue;
|
|
38
|
+
selectedContainerColor?: ColorValue;
|
|
39
|
+
selectedLabelColor?: ColorValue;
|
|
40
|
+
selectedLeadingIconColor?: ColorValue;
|
|
41
|
+
selectedTrailingIconColor?: ColorValue;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Colors for SuggestionChip.
|
|
46
|
+
*/
|
|
47
|
+
export type SuggestionChipColors = {
|
|
48
|
+
containerColor?: ColorValue;
|
|
49
|
+
labelColor?: ColorValue;
|
|
50
|
+
iconContentColor?: ColorValue;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Border configuration for chips.
|
|
55
|
+
*/
|
|
56
|
+
export type ChipBorder = {
|
|
19
57
|
/**
|
|
20
|
-
*
|
|
58
|
+
* Border width in dp.
|
|
59
|
+
* @default 1
|
|
21
60
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
61
|
+
width?: number;
|
|
24
62
|
/**
|
|
25
|
-
*
|
|
63
|
+
* Border color.
|
|
26
64
|
*/
|
|
27
|
-
|
|
65
|
+
color?: ColorValue;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type SlotChildProps = {
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type NativeSlotViewProps = {
|
|
73
|
+
slotName: string;
|
|
74
|
+
children: React.ReactNode;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const SlotNativeView: React.ComponentType<NativeSlotViewProps> = requireNativeView(
|
|
78
|
+
'ExpoUI',
|
|
79
|
+
'SlotView'
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
// region AssistChip
|
|
28
83
|
|
|
84
|
+
export type AssistChipProps = {
|
|
29
85
|
/**
|
|
30
|
-
*
|
|
86
|
+
* Whether the chip is enabled and can be clicked.
|
|
87
|
+
* @default true
|
|
31
88
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
89
|
+
enabled?: boolean;
|
|
34
90
|
/**
|
|
35
|
-
*
|
|
91
|
+
* Colors for the chip's container, label, and icons.
|
|
36
92
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
93
|
+
colors?: AssistChipColors;
|
|
39
94
|
/**
|
|
40
|
-
*
|
|
95
|
+
* Elevation in dp.
|
|
41
96
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
97
|
+
elevation?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Border configuration.
|
|
100
|
+
*/
|
|
101
|
+
border?: ChipBorder;
|
|
102
|
+
/**
|
|
103
|
+
* Callback fired when the chip is clicked.
|
|
104
|
+
*/
|
|
105
|
+
onClick?: () => void;
|
|
44
106
|
/**
|
|
45
|
-
*
|
|
107
|
+
* Modifiers for the component.
|
|
46
108
|
*/
|
|
47
|
-
|
|
109
|
+
modifiers?: ModifierConfig[];
|
|
110
|
+
/**
|
|
111
|
+
* Children containing Label, LeadingIcon, and TrailingIcon slots.
|
|
112
|
+
*/
|
|
113
|
+
children: React.ReactNode;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type NativeAssistChipProps = Omit<AssistChipProps, 'onClick'> & {
|
|
117
|
+
onNativeClick?: () => void;
|
|
118
|
+
};
|
|
48
119
|
|
|
120
|
+
const AssistChipNativeView: React.ComponentType<NativeAssistChipProps> = requireNativeView(
|
|
121
|
+
'ExpoUI',
|
|
122
|
+
'AssistChipView'
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Label slot for AssistChip.
|
|
127
|
+
*/
|
|
128
|
+
function AssistChipLabel(props: SlotChildProps) {
|
|
129
|
+
return <SlotNativeView slotName="label">{props.children}</SlotNativeView>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Leading icon slot for AssistChip.
|
|
134
|
+
*/
|
|
135
|
+
function AssistChipLeadingIcon(props: SlotChildProps) {
|
|
136
|
+
return <SlotNativeView slotName="leadingIcon">{props.children}</SlotNativeView>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Trailing icon slot for AssistChip.
|
|
141
|
+
*/
|
|
142
|
+
function AssistChipTrailingIcon(props: SlotChildProps) {
|
|
143
|
+
return <SlotNativeView slotName="trailingIcon">{props.children}</SlotNativeView>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* An assist chip that helps users complete actions and primary tasks.
|
|
148
|
+
*/
|
|
149
|
+
function AssistChipComponent(props: AssistChipProps) {
|
|
150
|
+
const { children, modifiers, onClick, ...restProps } = props;
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<AssistChipNativeView
|
|
154
|
+
modifiers={modifiers}
|
|
155
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
156
|
+
{...restProps}
|
|
157
|
+
onNativeClick={onClick}>
|
|
158
|
+
{children}
|
|
159
|
+
</AssistChipNativeView>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
AssistChipComponent.Label = AssistChipLabel;
|
|
164
|
+
AssistChipComponent.LeadingIcon = AssistChipLeadingIcon;
|
|
165
|
+
AssistChipComponent.TrailingIcon = AssistChipTrailingIcon;
|
|
166
|
+
|
|
167
|
+
export { AssistChipComponent as AssistChip };
|
|
168
|
+
|
|
169
|
+
// endregion
|
|
170
|
+
|
|
171
|
+
// region FilterChip
|
|
172
|
+
|
|
173
|
+
export type FilterChipProps = {
|
|
174
|
+
/**
|
|
175
|
+
* Whether the chip is currently selected.
|
|
176
|
+
*/
|
|
177
|
+
selected: boolean;
|
|
49
178
|
/**
|
|
50
|
-
* Whether the chip is enabled and can be
|
|
179
|
+
* Whether the chip is enabled and can be interacted with.
|
|
51
180
|
*/
|
|
52
181
|
enabled?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Colors for the chip's container, label, icon, and selected states.
|
|
184
|
+
*/
|
|
185
|
+
colors?: FilterChipColors;
|
|
186
|
+
/**
|
|
187
|
+
* Elevation in dp.
|
|
188
|
+
*/
|
|
189
|
+
elevation?: number;
|
|
190
|
+
/**
|
|
191
|
+
* Border configuration.
|
|
192
|
+
*/
|
|
193
|
+
border?: ChipBorder;
|
|
194
|
+
/**
|
|
195
|
+
* Callback fired when the chip is clicked.
|
|
196
|
+
*/
|
|
197
|
+
onClick?: () => void;
|
|
198
|
+
/**
|
|
199
|
+
* Modifiers for the component.
|
|
200
|
+
*/
|
|
201
|
+
modifiers?: ModifierConfig[];
|
|
202
|
+
/**
|
|
203
|
+
* Children containing Label, LeadingIcon, and TrailingIcon slots.
|
|
204
|
+
*/
|
|
205
|
+
children: React.ReactNode;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
type NativeFilterChipProps = Omit<FilterChipProps, 'onClick'> & {
|
|
209
|
+
onNativeClick?: () => void;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const FilterChipNativeView: React.ComponentType<NativeFilterChipProps> = requireNativeView(
|
|
213
|
+
'ExpoUI',
|
|
214
|
+
'FilterChipView'
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Label slot for FilterChip.
|
|
219
|
+
*/
|
|
220
|
+
function FilterChipLabel(props: SlotChildProps) {
|
|
221
|
+
return <SlotNativeView slotName="label">{props.children}</SlotNativeView>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Leading icon slot for FilterChip.
|
|
226
|
+
*/
|
|
227
|
+
function FilterChipLeadingIcon(props: SlotChildProps) {
|
|
228
|
+
return <SlotNativeView slotName="leadingIcon">{props.children}</SlotNativeView>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Trailing icon slot for FilterChip.
|
|
233
|
+
*/
|
|
234
|
+
function FilterChipTrailingIcon(props: SlotChildProps) {
|
|
235
|
+
return <SlotNativeView slotName="trailingIcon">{props.children}</SlotNativeView>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* A filter chip component for refining content with selection/deselection.
|
|
240
|
+
*/
|
|
241
|
+
function FilterChipComponent(props: FilterChipProps) {
|
|
242
|
+
const { children, modifiers, onClick, ...restProps } = props;
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<FilterChipNativeView
|
|
246
|
+
modifiers={modifiers}
|
|
247
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
248
|
+
{...restProps}
|
|
249
|
+
onNativeClick={onClick}>
|
|
250
|
+
{children}
|
|
251
|
+
</FilterChipNativeView>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
FilterChipComponent.Label = FilterChipLabel;
|
|
256
|
+
FilterChipComponent.LeadingIcon = FilterChipLeadingIcon;
|
|
257
|
+
FilterChipComponent.TrailingIcon = FilterChipTrailingIcon;
|
|
258
|
+
|
|
259
|
+
export { FilterChipComponent as FilterChip };
|
|
260
|
+
|
|
261
|
+
// endregion
|
|
262
|
+
|
|
263
|
+
// region InputChip
|
|
53
264
|
|
|
265
|
+
export type InputChipProps = {
|
|
54
266
|
/**
|
|
55
|
-
* Whether the chip is
|
|
267
|
+
* Whether the chip is enabled and can be interacted with.
|
|
268
|
+
* @default true
|
|
269
|
+
*/
|
|
270
|
+
enabled?: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Whether the chip is selected.
|
|
273
|
+
* @default false
|
|
56
274
|
*/
|
|
57
275
|
selected?: boolean;
|
|
58
|
-
|
|
276
|
+
/**
|
|
277
|
+
* Colors for the chip's container, label, icons, and selected states.
|
|
278
|
+
*/
|
|
279
|
+
colors?: InputChipColors;
|
|
280
|
+
/**
|
|
281
|
+
* Elevation in dp.
|
|
282
|
+
*/
|
|
283
|
+
elevation?: number;
|
|
284
|
+
/**
|
|
285
|
+
* Border configuration.
|
|
286
|
+
*/
|
|
287
|
+
border?: ChipBorder;
|
|
288
|
+
/**
|
|
289
|
+
* Callback fired when the chip is clicked.
|
|
290
|
+
*/
|
|
291
|
+
onClick?: () => void;
|
|
59
292
|
/**
|
|
60
293
|
* Modifiers for the component.
|
|
61
294
|
*/
|
|
62
|
-
modifiers?:
|
|
63
|
-
|
|
295
|
+
modifiers?: ModifierConfig[];
|
|
64
296
|
/**
|
|
65
|
-
*
|
|
297
|
+
* Children containing Label, Avatar, and TrailingIcon slots.
|
|
66
298
|
*/
|
|
67
|
-
|
|
299
|
+
children: React.ReactNode;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
type NativeInputChipProps = Omit<InputChipProps, 'onClick'> & {
|
|
303
|
+
onNativeClick?: () => void;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
const InputChipNativeView: React.ComponentType<NativeInputChipProps> = requireNativeView(
|
|
307
|
+
'ExpoUI',
|
|
308
|
+
'InputChipView'
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Label slot for InputChip.
|
|
313
|
+
*/
|
|
314
|
+
function InputChipLabel(props: SlotChildProps) {
|
|
315
|
+
return <SlotNativeView slotName="label">{props.children}</SlotNativeView>;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Avatar slot for InputChip.
|
|
320
|
+
*/
|
|
321
|
+
function InputChipAvatar(props: SlotChildProps) {
|
|
322
|
+
return <SlotNativeView slotName="avatar">{props.children}</SlotNativeView>;
|
|
323
|
+
}
|
|
68
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Trailing icon slot for InputChip.
|
|
327
|
+
*/
|
|
328
|
+
function InputChipTrailingIcon(props: SlotChildProps) {
|
|
329
|
+
return <SlotNativeView slotName="trailingIcon">{props.children}</SlotNativeView>;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* An input chip that represents user input and can be dismissed.
|
|
334
|
+
*/
|
|
335
|
+
function InputChipComponent(props: InputChipProps) {
|
|
336
|
+
const { children, modifiers, onClick, ...restProps } = props;
|
|
337
|
+
|
|
338
|
+
return (
|
|
339
|
+
<InputChipNativeView
|
|
340
|
+
modifiers={modifiers}
|
|
341
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
342
|
+
{...restProps}
|
|
343
|
+
onNativeClick={onClick}>
|
|
344
|
+
{children}
|
|
345
|
+
</InputChipNativeView>
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
InputChipComponent.Label = InputChipLabel;
|
|
350
|
+
InputChipComponent.Avatar = InputChipAvatar;
|
|
351
|
+
InputChipComponent.TrailingIcon = InputChipTrailingIcon;
|
|
352
|
+
|
|
353
|
+
export { InputChipComponent as InputChip };
|
|
354
|
+
|
|
355
|
+
// endregion
|
|
356
|
+
|
|
357
|
+
// region SuggestionChip
|
|
358
|
+
|
|
359
|
+
export type SuggestionChipProps = {
|
|
69
360
|
/**
|
|
70
|
-
*
|
|
361
|
+
* Whether the chip is enabled and can be clicked.
|
|
362
|
+
* @default true
|
|
71
363
|
*/
|
|
72
|
-
|
|
73
|
-
|
|
364
|
+
enabled?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Colors for the chip's container, label, and icon.
|
|
367
|
+
*/
|
|
368
|
+
colors?: SuggestionChipColors;
|
|
369
|
+
/**
|
|
370
|
+
* Elevation in dp.
|
|
371
|
+
*/
|
|
372
|
+
elevation?: number;
|
|
373
|
+
/**
|
|
374
|
+
* Border configuration.
|
|
375
|
+
*/
|
|
376
|
+
border?: ChipBorder;
|
|
377
|
+
/**
|
|
378
|
+
* Callback fired when the chip is clicked.
|
|
379
|
+
*/
|
|
380
|
+
onClick?: () => void;
|
|
381
|
+
/**
|
|
382
|
+
* Modifiers for the component.
|
|
383
|
+
*/
|
|
384
|
+
modifiers?: ModifierConfig[];
|
|
385
|
+
/**
|
|
386
|
+
* Children containing Label and Icon slots.
|
|
387
|
+
*/
|
|
388
|
+
children: React.ReactNode;
|
|
389
|
+
};
|
|
74
390
|
|
|
75
|
-
type
|
|
76
|
-
|
|
77
|
-
|
|
391
|
+
type NativeSuggestionChipProps = Omit<SuggestionChipProps, 'onClick'> & {
|
|
392
|
+
onNativeClick?: () => void;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
const SuggestionChipNativeView: React.ComponentType<NativeSuggestionChipProps> = requireNativeView(
|
|
78
396
|
'ExpoUI',
|
|
79
|
-
'
|
|
397
|
+
'SuggestionChipView'
|
|
80
398
|
);
|
|
81
399
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
...restProps,
|
|
88
|
-
};
|
|
400
|
+
/**
|
|
401
|
+
* Label slot for SuggestionChip.
|
|
402
|
+
*/
|
|
403
|
+
function SuggestionChipLabel(props: SlotChildProps) {
|
|
404
|
+
return <SlotNativeView slotName="label">{props.children}</SlotNativeView>;
|
|
89
405
|
}
|
|
90
406
|
|
|
91
407
|
/**
|
|
92
|
-
*
|
|
408
|
+
* Icon slot for SuggestionChip.
|
|
93
409
|
*/
|
|
94
|
-
|
|
95
|
-
return <
|
|
410
|
+
function SuggestionChipIcon(props: SlotChildProps) {
|
|
411
|
+
return <SlotNativeView slotName="icon">{props.children}</SlotNativeView>;
|
|
96
412
|
}
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* A suggestion chip that offers contextual suggestions and recommendations.
|
|
416
|
+
*/
|
|
417
|
+
function SuggestionChipComponent(props: SuggestionChipProps) {
|
|
418
|
+
const { children, modifiers, onClick, ...restProps } = props;
|
|
419
|
+
|
|
420
|
+
return (
|
|
421
|
+
<SuggestionChipNativeView
|
|
422
|
+
modifiers={modifiers}
|
|
423
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
424
|
+
{...restProps}
|
|
425
|
+
onNativeClick={onClick}>
|
|
426
|
+
{children}
|
|
427
|
+
</SuggestionChipNativeView>
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
SuggestionChipComponent.Label = SuggestionChipLabel;
|
|
432
|
+
SuggestionChipComponent.Icon = SuggestionChipIcon;
|
|
433
|
+
|
|
434
|
+
export { SuggestionChipComponent as SuggestionChip };
|
|
435
|
+
|
|
436
|
+
// endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import { type ColorValue } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { ModifierConfig, ViewEvent } from '../../types';
|
|
5
5
|
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
6
|
|
|
7
7
|
export type AndroidVariant = 'picker' | 'input';
|
|
@@ -145,23 +145,40 @@ export type DateTimePickerProps = {
|
|
|
145
145
|
* @default true
|
|
146
146
|
*/
|
|
147
147
|
is24Hour?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Constrains which dates can be selected. Mirrors the native Compose `selectableDates` parameter.
|
|
150
|
+
* `start` is the earliest selectable date, `end` is the latest.
|
|
151
|
+
*/
|
|
152
|
+
selectableDates?: { start?: Date; end?: Date };
|
|
148
153
|
/**
|
|
149
154
|
* Modifiers for the component.
|
|
150
155
|
*/
|
|
151
|
-
modifiers?:
|
|
156
|
+
modifiers?: ModifierConfig[];
|
|
152
157
|
};
|
|
153
158
|
|
|
154
159
|
type NativeDatePickerProps = Omit<
|
|
155
160
|
DateTimePickerProps,
|
|
156
|
-
'variant' | 'onDateSelected' | 'initialDate' | 'elementColors'
|
|
161
|
+
'variant' | 'onDateSelected' | 'initialDate' | 'elementColors' | 'selectableDates'
|
|
157
162
|
> & {
|
|
158
163
|
variant?: AndroidVariant;
|
|
159
164
|
initialDate?: number | null;
|
|
165
|
+
selectableDates?: { start?: number | null; end?: number | null } | null;
|
|
160
166
|
elementColors?: DatePickerElementColors & TimePickerElementColors;
|
|
161
167
|
} & ViewEvent<'onDateSelected', { date: Date }>;
|
|
162
168
|
|
|
169
|
+
function convertSelectableDates(selectableDates?: {
|
|
170
|
+
start?: Date;
|
|
171
|
+
end?: Date;
|
|
172
|
+
}): { start?: number | null; end?: number | null } | null {
|
|
173
|
+
if (!selectableDates) return null;
|
|
174
|
+
return {
|
|
175
|
+
start: selectableDates.start ? selectableDates.start.getTime() : null,
|
|
176
|
+
end: selectableDates.end ? selectableDates.end.getTime() : null,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
163
180
|
function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePickerProps {
|
|
164
|
-
const { modifiers, variant, initialDate, elementColors, color, ...rest } = props;
|
|
181
|
+
const { modifiers, variant, initialDate, selectableDates, elementColors, color, ...rest } = props;
|
|
165
182
|
|
|
166
183
|
// Convert ISO string to timestamp for Android
|
|
167
184
|
const initialDateTimestamp = initialDate ? new Date(initialDate).getTime() : null;
|
|
@@ -172,11 +189,12 @@ function transformDateTimePickerProps(props: DateTimePickerProps): NativeDatePic
|
|
|
172
189
|
...rest,
|
|
173
190
|
color,
|
|
174
191
|
initialDate: initialDateTimestamp,
|
|
192
|
+
selectableDates: convertSelectableDates(selectableDates),
|
|
175
193
|
onDateSelected: ({ nativeEvent: { date } }) => {
|
|
176
|
-
props
|
|
194
|
+
props.onDateSelected?.(new Date(date));
|
|
177
195
|
},
|
|
178
196
|
variant,
|
|
179
|
-
...(elementColors != null ? { elementColors } :
|
|
197
|
+
...(elementColors != null ? { elementColors } : undefined),
|
|
180
198
|
};
|
|
181
199
|
}
|
|
182
200
|
|
|
@@ -186,8 +204,95 @@ const DatePickerNativeView: React.ComponentType<NativeDatePickerProps> = require
|
|
|
186
204
|
);
|
|
187
205
|
|
|
188
206
|
/**
|
|
189
|
-
* Renders
|
|
207
|
+
* Renders an inline `DateTimePicker` component.
|
|
190
208
|
*/
|
|
191
209
|
export function DateTimePicker(props: DateTimePickerProps) {
|
|
192
210
|
return <DatePickerNativeView {...transformDateTimePickerProps(props)} />;
|
|
193
211
|
}
|
|
212
|
+
|
|
213
|
+
// -- Dialog views (used internally by the compat layer) ---------------------
|
|
214
|
+
|
|
215
|
+
export type DatePickerDialogProps = {
|
|
216
|
+
initialDate?: string | null;
|
|
217
|
+
variant?: AndroidVariant;
|
|
218
|
+
showVariantToggle?: boolean;
|
|
219
|
+
confirmButtonLabel?: string;
|
|
220
|
+
dismissButtonLabel?: string;
|
|
221
|
+
color?: ColorValue;
|
|
222
|
+
elementColors?: DatePickerElementColors & TimePickerElementColors;
|
|
223
|
+
selectableDates?: { start?: Date; end?: Date };
|
|
224
|
+
onDateSelected?: (date: Date) => void;
|
|
225
|
+
onDismissRequest: () => void;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
type NativeDatePickerDialogProps = Omit<
|
|
229
|
+
DatePickerDialogProps,
|
|
230
|
+
| 'variant'
|
|
231
|
+
| 'onDateSelected'
|
|
232
|
+
| 'onDismissRequest'
|
|
233
|
+
| 'initialDate'
|
|
234
|
+
| 'elementColors'
|
|
235
|
+
| 'selectableDates'
|
|
236
|
+
> & {
|
|
237
|
+
variant?: AndroidVariant;
|
|
238
|
+
initialDate?: number | null;
|
|
239
|
+
selectableDates?: { start?: number | null; end?: number | null } | null;
|
|
240
|
+
elementColors?: DatePickerElementColors & TimePickerElementColors;
|
|
241
|
+
} & ViewEvent<'onDateSelected', { date: Date }> &
|
|
242
|
+
ViewEvent<'onDismissRequest', void>;
|
|
243
|
+
|
|
244
|
+
const DatePickerDialogNativeView: React.ComponentType<NativeDatePickerDialogProps> =
|
|
245
|
+
requireNativeView('ExpoUI', 'DatePickerDialogView');
|
|
246
|
+
|
|
247
|
+
export function DatePickerDialog(props: DatePickerDialogProps) {
|
|
248
|
+
const { variant, initialDate, selectableDates, elementColors, onDismissRequest, ...rest } = props;
|
|
249
|
+
const nativeProps: NativeDatePickerDialogProps = {
|
|
250
|
+
...rest,
|
|
251
|
+
variant,
|
|
252
|
+
initialDate: initialDate ? new Date(initialDate).getTime() : null,
|
|
253
|
+
selectableDates: convertSelectableDates(selectableDates),
|
|
254
|
+
onDateSelected: ({ nativeEvent: { date } }) => {
|
|
255
|
+
props.onDateSelected?.(new Date(date));
|
|
256
|
+
},
|
|
257
|
+
onDismissRequest,
|
|
258
|
+
...(elementColors != null ? { elementColors } : undefined),
|
|
259
|
+
};
|
|
260
|
+
return <DatePickerDialogNativeView {...nativeProps} />;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export type TimePickerDialogProps = {
|
|
264
|
+
initialDate?: string | null;
|
|
265
|
+
is24Hour?: boolean;
|
|
266
|
+
confirmButtonLabel?: string;
|
|
267
|
+
dismissButtonLabel?: string;
|
|
268
|
+
color?: ColorValue;
|
|
269
|
+
elementColors?: DatePickerElementColors & TimePickerElementColors;
|
|
270
|
+
onDateSelected?: (date: Date) => void;
|
|
271
|
+
onDismissRequest: () => void;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
type NativeTimePickerDialogProps = Omit<
|
|
275
|
+
TimePickerDialogProps,
|
|
276
|
+
'onDateSelected' | 'onDismissRequest' | 'initialDate' | 'elementColors'
|
|
277
|
+
> & {
|
|
278
|
+
initialDate?: number | null;
|
|
279
|
+
elementColors?: DatePickerElementColors & TimePickerElementColors;
|
|
280
|
+
} & ViewEvent<'onDateSelected', { date: Date }> &
|
|
281
|
+
ViewEvent<'onDismissRequest', void>;
|
|
282
|
+
|
|
283
|
+
const TimePickerDialogNativeView: React.ComponentType<NativeTimePickerDialogProps> =
|
|
284
|
+
requireNativeView('ExpoUI', 'TimePickerDialogView');
|
|
285
|
+
|
|
286
|
+
export function TimePickerDialog(props: TimePickerDialogProps) {
|
|
287
|
+
const { initialDate, elementColors, onDismissRequest, ...rest } = props;
|
|
288
|
+
const nativeProps: NativeTimePickerDialogProps = {
|
|
289
|
+
...rest,
|
|
290
|
+
initialDate: initialDate ? new Date(initialDate).getTime() : null,
|
|
291
|
+
onDateSelected: ({ nativeEvent: { date } }) => {
|
|
292
|
+
props.onDateSelected?.(new Date(date));
|
|
293
|
+
},
|
|
294
|
+
onDismissRequest,
|
|
295
|
+
...(elementColors != null ? { elementColors } : undefined),
|
|
296
|
+
};
|
|
297
|
+
return <TimePickerDialogNativeView {...nativeProps} />;
|
|
298
|
+
}
|