react-native-ui-lib 7.44.0-snapshot.7233 → 7.44.0
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/babel.config.js +0 -12
- package/index.js +0 -1
- package/lib/android/build.gradle +5 -5
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +2 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +23 -31
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReactHacks.java +30 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java +34 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +1 -1
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java +33 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/KeyListenerProxy.java +53 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java +54 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/ViewUtils.java +36 -0
- package/lib/components/{HighlighterOverlayView/index.d.ts → HighlighterOverlayView.d.ts} +1 -1
- package/lib/components/HighlighterOverlayView.js +40 -0
- package/lib/components/{HighlighterOverlayView/index.web.d.ts → HighlighterOverlayView.web.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/CustomKeyboardView.android.d.ts +2 -5
- package/lib/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +28 -0
- package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/CustomKeyboardView.ios.d.ts +1 -1
- package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/CustomKeyboardView.ios.js +3 -3
- package/lib/components/Keyboard/{KeyboardAccessoryView/CustomKeyboardView → KeyboardInput}/CustomKeyboardViewBase.d.ts +0 -3
- package/lib/components/Keyboard/{KeyboardAccessoryView/CustomKeyboardView → KeyboardInput}/CustomKeyboardViewBase.js +1 -1
- package/lib/components/Keyboard/{KeyboardAccessoryView/index.d.ts → KeyboardInput/KeyboardAccessoryView.d.ts} +1 -11
- package/lib/components/Keyboard/{KeyboardAccessoryView/index.js → KeyboardInput/KeyboardAccessoryView.js} +5 -31
- package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry/index.d.ts → KeyboardInput/KeyboardRegistry.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry/index.js → KeyboardInput/KeyboardRegistry.js} +1 -1
- package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry → KeyboardInput}/__tests__/KeyboardRegistry.spec.js +1 -1
- package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/keyboardAccessoryView.api.json +5 -5
- package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry → KeyboardInput}/keyboardRegistry.api.json +9 -9
- package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +11 -0
- package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.js +17 -0
- package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager → KeyboardInput/utils}/__tests__/EventEmitterManager.spec.js +1 -1
- package/lib/components/Keyboard/{KeyboardAwareInsetsView/index.d.ts → KeyboardTracking/KeyboardAwareInsetsView.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardAwareInsetsView/index.js → KeyboardTracking/KeyboardAwareInsetsView.js} +1 -1
- package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/KeyboardTrackingView.ios.d.ts +4 -1
- package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/KeyboardTrackingView.ios.js +8 -5
- package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/index.d.ts +2 -2
- package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/keyboardTrackingView.api.json +20 -11
- package/lib/components/Keyboard/index.d.ts +6 -6
- package/lib/components/Keyboard/index.js +6 -6
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.ts +7 -15
- package/lib/components/SafeArea/SafeAreaInsetsManager.js +28 -91
- package/lib/components/SafeArea/SafeAreaSpacerView.d.ts +2 -2
- package/lib/components/SafeArea/SafeAreaSpacerView.js +9 -63
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/package.json +1 -1
- package/lib/react-native.config.js +3 -1
- package/metro.config.js +2 -2
- package/package.json +23 -23
- package/panningViews.d.ts +2 -0
- package/panningViews.js +1 -0
- package/react-native.config.js +3 -1
- package/sharedTransition.d.ts +2 -0
- package/sharedTransition.js +1 -0
- package/src/commons/Constants.js +5 -2
- package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +1 -5
- package/src/components/actionSheet/index.d.ts +12 -2
- package/src/components/actionSheet/index.js +42 -3
- package/src/components/badge/index.d.ts +47 -107
- package/src/components/button/button.api.json +1 -1
- package/src/components/button/index.d.ts +23 -53
- package/src/components/button/types.d.ts +1 -0
- package/src/components/colorPicker/ColorPickerDialog.d.ts +1 -1
- package/src/components/colorPicker/ColorPickerDialog.js +1 -1
- package/src/components/dateTimePicker/index.d.ts +5 -186
- package/src/components/dateTimePicker/index.js +2 -1
- package/src/components/dialog/DialogDismissibleView.d.ts +34 -0
- package/src/components/dialog/DialogDismissibleView.js +184 -0
- package/src/components/dialog/OverlayFadingBackground.d.ts +14 -0
- package/src/components/dialog/OverlayFadingBackground.js +45 -0
- package/src/components/dialog/dialog.api.json +37 -31
- package/src/components/dialog/index.d.ts +105 -13
- package/src/components/dialog/index.js +212 -204
- package/src/components/drawer/Swipeable.js +2 -1
- package/src/components/drawer/index.js +25 -31
- package/src/components/fadedScrollView/index.js +2 -7
- package/src/components/featureHighlight/index.d.ts +1 -1
- package/src/components/index.js +19 -0
- package/src/components/modal/index.d.ts +0 -5
- package/src/components/modal/index.js +10 -14
- package/src/components/modal/modal.api.json +0 -5
- package/src/components/panningViews/asPanViewConsumer.d.ts +3 -0
- package/src/components/panningViews/asPanViewConsumer.js +16 -0
- package/src/components/panningViews/panDismissibleView.d.ts +51 -0
- package/src/components/panningViews/panDismissibleView.js +350 -0
- package/src/components/panningViews/panGestureView.d.ts +23 -0
- package/src/components/panningViews/panGestureView.js +156 -0
- package/src/components/panningViews/panListenerView.d.ts +66 -0
- package/src/components/panningViews/panListenerView.js +155 -0
- package/src/components/panningViews/panResponderView.d.ts +19 -0
- package/src/components/panningViews/panResponderView.js +79 -0
- package/src/components/panningViews/panningContext.d.ts +3 -0
- package/src/components/panningViews/panningContext.js +4 -0
- package/src/components/panningViews/panningProvider.d.ts +73 -0
- package/src/components/panningViews/panningProvider.js +101 -0
- package/src/components/picker/Picker.driver.new.js +1 -1
- package/src/components/picker/PickerItem.js +20 -6
- package/src/components/picker/PickerPresenter.d.ts +1 -0
- package/src/components/picker/PickerPresenter.js +23 -1
- package/src/components/picker/api/picker.api.json +1 -0
- package/src/components/picker/api/pickerItem.api.json +5 -0
- package/src/components/picker/helpers/useFieldType.d.ts +23 -53
- package/src/components/picker/helpers/usePickerLabel.d.ts +1 -1
- package/src/components/picker/helpers/usePickerLabel.js +3 -2
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +1 -1
- package/src/components/picker/helpers/usePickerMigrationWarnings.js +12 -0
- package/src/components/picker/helpers/usePickerSearch.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSearch.js +8 -4
- package/src/components/picker/helpers/usePickerSelection.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSelection.js +10 -2
- package/src/components/picker/index.js +22 -4
- package/src/components/picker/types.d.ts +24 -1
- package/src/components/segmentedControl/index.js +3 -3
- package/src/components/sharedTransition/ShareTransitionContext.js +3 -0
- package/src/components/sharedTransition/SharedArea.js +153 -0
- package/src/components/sharedTransition/SourceElement.js +44 -0
- package/src/components/sharedTransition/TargetElement.js +38 -0
- package/src/components/sharedTransition/index.js +9 -0
- package/src/components/slider/GradientSlider.d.ts +1 -1
- package/src/components/sortableGridList/SortableItem.js +4 -13
- package/src/components/sortableList/SortableListItem.js +4 -13
- package/src/components/stackAggregator/index.js +11 -16
- package/src/components/textField/Input.js +1 -0
- package/src/components/textField/presets/outline.d.ts +46 -106
- package/src/components/textField/presets/underline.d.ts +46 -106
- package/src/components/textField/usePreset.d.ts +44 -72
- package/src/incubator/dialog/dialog.api.json +54 -0
- package/src/{components → incubator}/dialog/dialogHeader.api.json +2 -2
- package/src/incubator/dialog/index.d.ts +15 -0
- package/src/incubator/dialog/index.js +218 -0
- package/src/{components → incubator}/dialog/types.d.ts +19 -0
- package/src/{components → incubator}/dialog/types.js +3 -1
- package/src/{components → incubator}/dialog/useDialogContent.d.ts +1 -1
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.js +1 -1
- package/src/incubator/expandableOverlay/index.d.ts +3 -42
- package/src/incubator/expandableOverlay/index.js +4 -1
- package/src/{hooks/useHiddenLocation/index.d.ts → incubator/hooks/useHiddenLocation.d.ts} +1 -1
- package/src/{hooks/useHiddenLocation/index.web.d.ts → incubator/hooks/useHiddenLocation.web.d.ts} +1 -1
- package/src/incubator/index.d.ts +2 -0
- package/src/incubator/index.js +2 -0
- package/src/{components → incubator}/panView/index.d.ts +3 -3
- package/src/{components → incubator}/panView/index.js +4 -4
- package/src/{components → incubator}/panView/usePanGesture.d.ts +1 -1
- package/src/incubator/toast/index.js +1 -1
- package/src/index.d.ts +10 -3
- package/src/index.js +160 -41
- package/src/testkit/index.d.ts +1 -1
- package/src/testkit/index.js +1 -1
- package/lib/components/HighlighterOverlayView/index.js +0 -49
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.js +0 -51
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.ts +0 -26
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.js +0 -91
- package/lib/components/SafeArea/__tests__/SafeAreaInsetsManager.spec.js +0 -271
- package/lib/components/SafeArea/index.d.ts +0 -10
- package/lib/components/SafeArea/index.js +0 -11
- package/panView.d.ts +0 -2
- package/panView.js +0 -1
- /package/lib/components/{HighlighterOverlayView/index.web.js → HighlighterOverlayView.web.js} +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/index.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/index.web.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/CustomKeyboardView/index.web.js +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/TextInputKeyboardManager/TextInputKeyboardManager.android.js +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/TextInputKeyboardManager/TextInputKeyboardManager.ios.js +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/TextInputKeyboardManager/index.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView → KeyboardInput}/TextInputKeyboardManager/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.ts → KeyboardInput/utils/EventEmitterManager.d.ts} +0 -0
- /package/lib/components/Keyboard/{KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.js → KeyboardInput/utils/EventEmitterManager.js} +0 -0
- /package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/KeyboardTrackingView.android.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/KeyboardTrackingView.android.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/index.web.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardTrackingView → KeyboardTracking/KeyboardTrackingView}/index.web.js +0 -0
- /package/lib/components/Keyboard/{KeyboardAwareInsetsView → KeyboardTracking}/keyboardAwareInsetsView.api.json +0 -0
- /package/src/{components → incubator}/dialog/Dialog.driver.new.d.ts +0 -0
- /package/src/{components → incubator}/dialog/Dialog.driver.new.js +0 -0
- /package/src/{components → incubator}/dialog/DialogHeader.d.ts +0 -0
- /package/src/{components → incubator}/dialog/DialogHeader.js +0 -0
- /package/src/{components → incubator}/dialog/useDialogContent.js +0 -0
- /package/src/{hooks/useHiddenLocation/index.js → incubator/hooks/useHiddenLocation.js} +0 -0
- /package/src/{hooks/useHiddenLocation/index.web.js → incubator/hooks/useHiddenLocation.web.js} +0 -0
- /package/src/{components → incubator}/panView/panningUtil.d.ts +0 -0
- /package/src/{components → incubator}/panView/panningUtil.js +0 -0
- /package/src/{components → incubator}/panView/usePanGesture.js +0 -0
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { BaseComponentInjectedProps } from '../../commons/new';
|
|
4
4
|
import { TextFieldProps } from '../textField';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DialogMigrationProps } from '../../incubator/dialog';
|
|
6
6
|
import { ButtonProps } from '../button';
|
|
7
7
|
import { OldApiProps } from './useOldApi';
|
|
8
8
|
export type DateTimePickerMode = 'date' | 'time';
|
|
9
|
-
export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | 'onChange'> & {
|
|
9
|
+
export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | 'onChange'> & DialogMigrationProps & {
|
|
10
10
|
/**
|
|
11
11
|
* The type of picker to display ('date' or 'time')
|
|
12
12
|
*/
|
|
@@ -15,10 +15,6 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
15
15
|
* The initial value to set the picker to. Defaults to device's date / time
|
|
16
16
|
*/
|
|
17
17
|
value?: Date;
|
|
18
|
-
/**
|
|
19
|
-
* The props to pass to the dialog expandable container
|
|
20
|
-
*/
|
|
21
|
-
dialogProps?: DialogProps;
|
|
22
18
|
/**
|
|
23
19
|
* The onChange callback
|
|
24
20
|
*/
|
|
@@ -96,6 +92,7 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
96
92
|
*/
|
|
97
93
|
cancelButtonProps?: ButtonProps;
|
|
98
94
|
};
|
|
95
|
+
type DateTimePickerPropsInternal = DateTimePickerProps & BaseComponentInjectedProps;
|
|
99
96
|
/**
|
|
100
97
|
* @description: Date and Time Picker Component that wraps RNDateTimePicker for date and time modes.
|
|
101
98
|
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DateTimePickerScreen.tsx
|
|
@@ -104,185 +101,7 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
|
|
|
104
101
|
* @extendsLink: https://github.com/react-native-community/react-native-datetimepicker#react-native-datetimepicker
|
|
105
102
|
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/DateTimePicker/DateTimePicker_iOS.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/DateTimePicker/DateTimePicker_Android.gif?raw=true
|
|
106
103
|
*/
|
|
107
|
-
declare const DateTimePicker: React.ForwardRefExoticComponent<
|
|
108
|
-
/**
|
|
109
|
-
* The type of picker to display ('date' or 'time')
|
|
110
|
-
*/
|
|
111
|
-
mode?: DateTimePickerMode | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* The initial value to set the picker to. Defaults to device's date / time
|
|
114
|
-
*/
|
|
115
|
-
value?: Date | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* The props to pass to the dialog expandable container
|
|
118
|
-
*/
|
|
119
|
-
dialogProps?: DialogProps | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* The onChange callback
|
|
122
|
-
*/
|
|
123
|
-
onChange?: ((date: Date) => void) | undefined;
|
|
124
|
-
/**
|
|
125
|
-
* Should this input be editable or disabled
|
|
126
|
-
*/
|
|
127
|
-
editable?: boolean | undefined;
|
|
128
|
-
/**
|
|
129
|
-
* The minimum date or time value to use
|
|
130
|
-
*/
|
|
131
|
-
minimumDate?: Date | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* The maximum date or time value to use
|
|
134
|
-
*/
|
|
135
|
-
maximumDate?: Date | undefined;
|
|
136
|
-
/**
|
|
137
|
-
* A callback function to format the time or date
|
|
138
|
-
* @param mode the type of the picker ('date' or 'time')
|
|
139
|
-
* @returns the formatted string to display
|
|
140
|
-
*/
|
|
141
|
-
dateTimeFormatter?: ((value: Date, mode: DateTimePickerMode) => string) | undefined;
|
|
142
|
-
/**
|
|
143
|
-
* Allows changing of the locale of the component (iOS only)
|
|
144
|
-
*/
|
|
145
|
-
locale?: string | undefined;
|
|
146
|
-
/**
|
|
147
|
-
* Allows changing of the time picker to a 24 hour format (Android only)
|
|
148
|
-
*/
|
|
149
|
-
is24Hour?: boolean | undefined;
|
|
150
|
-
/**
|
|
151
|
-
* The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 (iOS only)
|
|
152
|
-
*/
|
|
153
|
-
minuteInterval?: number | undefined;
|
|
154
|
-
/**
|
|
155
|
-
* Allows changing of the timeZone of the date picker. By default it uses the device's time zone (iOS only)
|
|
156
|
-
*/
|
|
157
|
-
timeZoneOffsetInMinutes?: number | undefined;
|
|
158
|
-
/**
|
|
159
|
-
* style to apply to the iOS dialog header
|
|
160
|
-
*/
|
|
161
|
-
headerStyle?: StyleProp<ViewStyle>;
|
|
162
|
-
/**
|
|
163
|
-
* Render custom input
|
|
164
|
-
*/
|
|
165
|
-
renderInput?: ((props: Omit<DateTimePickerProps, 'value'> & {
|
|
166
|
-
value?: string;
|
|
167
|
-
}) => React.ReactElement) | undefined;
|
|
168
|
-
/**
|
|
169
|
-
* Override system theme variant (dark or light mode) used by the date picker.
|
|
170
|
-
*/
|
|
171
|
-
themeVariant?: "light" | "dark" | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* The component testID
|
|
174
|
-
*/
|
|
175
|
-
testID?: string | undefined;
|
|
176
|
-
/**
|
|
177
|
-
* Allows changing the visual display of the picker
|
|
178
|
-
*/
|
|
179
|
-
display?: string | undefined;
|
|
180
|
-
/**
|
|
181
|
-
* Text color of the wheel picker items
|
|
182
|
-
*/
|
|
183
|
-
textColor?: string | undefined;
|
|
184
|
-
/**
|
|
185
|
-
* Background color of the wheel picker
|
|
186
|
-
*/
|
|
187
|
-
backgroundColor?: string | undefined;
|
|
188
|
-
/**
|
|
189
|
-
* Confirm button props
|
|
190
|
-
*/
|
|
191
|
-
confirmButtonProps?: ButtonProps | undefined;
|
|
192
|
-
/**
|
|
193
|
-
* Cancel button props
|
|
194
|
-
*/
|
|
195
|
-
cancelButtonProps?: ButtonProps | undefined;
|
|
196
|
-
} & BaseComponentInjectedProps & React.RefAttributes<any>>;
|
|
104
|
+
declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerPropsInternal & React.RefAttributes<any>>;
|
|
197
105
|
export { DateTimePicker };
|
|
198
|
-
declare const _default: React.ForwardRefExoticComponent<
|
|
199
|
-
/**
|
|
200
|
-
* The type of picker to display ('date' or 'time')
|
|
201
|
-
*/
|
|
202
|
-
mode?: DateTimePickerMode | undefined;
|
|
203
|
-
/**
|
|
204
|
-
* The initial value to set the picker to. Defaults to device's date / time
|
|
205
|
-
*/
|
|
206
|
-
value?: Date | undefined;
|
|
207
|
-
/**
|
|
208
|
-
* The props to pass to the dialog expandable container
|
|
209
|
-
*/
|
|
210
|
-
dialogProps?: DialogProps | undefined;
|
|
211
|
-
/**
|
|
212
|
-
* The onChange callback
|
|
213
|
-
*/
|
|
214
|
-
onChange?: ((date: Date) => void) | undefined;
|
|
215
|
-
/**
|
|
216
|
-
* Should this input be editable or disabled
|
|
217
|
-
*/
|
|
218
|
-
editable?: boolean | undefined;
|
|
219
|
-
/**
|
|
220
|
-
* The minimum date or time value to use
|
|
221
|
-
*/
|
|
222
|
-
minimumDate?: Date | undefined;
|
|
223
|
-
/**
|
|
224
|
-
* The maximum date or time value to use
|
|
225
|
-
*/
|
|
226
|
-
maximumDate?: Date | undefined;
|
|
227
|
-
/**
|
|
228
|
-
* A callback function to format the time or date
|
|
229
|
-
* @param mode the type of the picker ('date' or 'time')
|
|
230
|
-
* @returns the formatted string to display
|
|
231
|
-
*/
|
|
232
|
-
dateTimeFormatter?: ((value: Date, mode: DateTimePickerMode) => string) | undefined;
|
|
233
|
-
/**
|
|
234
|
-
* Allows changing of the locale of the component (iOS only)
|
|
235
|
-
*/
|
|
236
|
-
locale?: string | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* Allows changing of the time picker to a 24 hour format (Android only)
|
|
239
|
-
*/
|
|
240
|
-
is24Hour?: boolean | undefined;
|
|
241
|
-
/**
|
|
242
|
-
* The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 (iOS only)
|
|
243
|
-
*/
|
|
244
|
-
minuteInterval?: number | undefined;
|
|
245
|
-
/**
|
|
246
|
-
* Allows changing of the timeZone of the date picker. By default it uses the device's time zone (iOS only)
|
|
247
|
-
*/
|
|
248
|
-
timeZoneOffsetInMinutes?: number | undefined;
|
|
249
|
-
/**
|
|
250
|
-
* style to apply to the iOS dialog header
|
|
251
|
-
*/
|
|
252
|
-
headerStyle?: StyleProp<ViewStyle>;
|
|
253
|
-
/**
|
|
254
|
-
* Render custom input
|
|
255
|
-
*/
|
|
256
|
-
renderInput?: ((props: Omit<DateTimePickerProps, "value"> & {
|
|
257
|
-
value?: string | undefined;
|
|
258
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
|
|
259
|
-
/**
|
|
260
|
-
* Override system theme variant (dark or light mode) used by the date picker.
|
|
261
|
-
*/
|
|
262
|
-
themeVariant?: "light" | "dark" | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* The component testID
|
|
265
|
-
*/
|
|
266
|
-
testID?: string | undefined;
|
|
267
|
-
/**
|
|
268
|
-
* Allows changing the visual display of the picker
|
|
269
|
-
*/
|
|
270
|
-
display?: string | undefined;
|
|
271
|
-
/**
|
|
272
|
-
* Text color of the wheel picker items
|
|
273
|
-
*/
|
|
274
|
-
textColor?: string | undefined;
|
|
275
|
-
/**
|
|
276
|
-
* Background color of the wheel picker
|
|
277
|
-
*/
|
|
278
|
-
backgroundColor?: string | undefined;
|
|
279
|
-
/**
|
|
280
|
-
* Confirm button props
|
|
281
|
-
*/
|
|
282
|
-
confirmButtonProps?: ButtonProps | undefined;
|
|
283
|
-
/**
|
|
284
|
-
* Cancel button props
|
|
285
|
-
*/
|
|
286
|
-
cancelButtonProps?: ButtonProps | undefined;
|
|
287
|
-
} & React.RefAttributes<any>>;
|
|
106
|
+
declare const _default: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<any>>;
|
|
288
107
|
export default _default;
|
|
@@ -42,6 +42,7 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
42
42
|
themeVariant = Colors.getScheme(),
|
|
43
43
|
onChange,
|
|
44
44
|
dialogProps,
|
|
45
|
+
migrateDialog,
|
|
45
46
|
textColor = Colors.$textDefault,
|
|
46
47
|
backgroundColor = Colors.$backgroundDefault,
|
|
47
48
|
headerStyle,
|
|
@@ -164,7 +165,7 @@ const DateTimePicker = forwardRef((props, ref) => {
|
|
|
164
165
|
return <>
|
|
165
166
|
<ExpandableOverlay
|
|
166
167
|
// @ts-expect-error
|
|
167
|
-
ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} disabled={editable === false}
|
|
168
|
+
ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} migrateDialog={migrateDialog} disabled={editable === false}
|
|
168
169
|
// NOTE: Android picker comes with its own overlay built-in therefor we're not using ExpandableOverlay for it
|
|
169
170
|
renderCustomOverlay={Constants.isAndroid ? renderAndroidDateTimePicker : undefined} testID={`${testID}.overlay`}>
|
|
170
171
|
{renderInput ? renderInput({
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { PanningDirections } from '../panningViews/panningProvider';
|
|
4
|
+
interface DialogDismissibleProps {
|
|
5
|
+
/**
|
|
6
|
+
* Additional styling
|
|
7
|
+
*/
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
/**
|
|
10
|
+
* The direction of the allowed pan (default is DOWN)
|
|
11
|
+
* Types: UP, DOWN, LEFT and RIGHT (using PanningProvider.Directions.###)
|
|
12
|
+
*/
|
|
13
|
+
direction?: PanningDirections;
|
|
14
|
+
/**
|
|
15
|
+
* onDismiss callback
|
|
16
|
+
*/
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* The dialog`s container style
|
|
20
|
+
*/
|
|
21
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to show the dialog or not
|
|
24
|
+
*/
|
|
25
|
+
visible?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface Props extends DialogDismissibleProps {
|
|
28
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
29
|
+
}
|
|
30
|
+
declare const DialogDismissibleView: {
|
|
31
|
+
(props: Props): React.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
export default DialogDismissibleView;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import _isUndefined from "lodash/isUndefined";
|
|
2
|
+
import React, { useEffect, useRef, useCallback, useContext } from 'react';
|
|
3
|
+
import { Animated, Easing, StyleSheet } from 'react-native';
|
|
4
|
+
import { Constants } from "../../commons/new";
|
|
5
|
+
import View from "../view";
|
|
6
|
+
import PanningContext from "../panningViews/panningContext";
|
|
7
|
+
import PanningProvider from "../panningViews/panningProvider";
|
|
8
|
+
import PanResponderView from "../panningViews/panResponderView";
|
|
9
|
+
const MAXIMUM_DRAGS_AFTER_SWIPE = 2;
|
|
10
|
+
|
|
11
|
+
// TODO: move this to panningContext
|
|
12
|
+
|
|
13
|
+
const DEFAULT_DIRECTION = PanningProvider.Directions.DOWN;
|
|
14
|
+
const DialogDismissibleView = props => {
|
|
15
|
+
const {
|
|
16
|
+
direction = DEFAULT_DIRECTION,
|
|
17
|
+
visible: propsVisible,
|
|
18
|
+
containerStyle,
|
|
19
|
+
style,
|
|
20
|
+
children,
|
|
21
|
+
onDismiss = () => {}
|
|
22
|
+
} = props;
|
|
23
|
+
// @ts-expect-error
|
|
24
|
+
const {
|
|
25
|
+
isPanning,
|
|
26
|
+
dragDeltas,
|
|
27
|
+
swipeDirections
|
|
28
|
+
} = useContext(PanningContext);
|
|
29
|
+
const width = useRef(Constants.screenWidth);
|
|
30
|
+
const height = useRef(Constants.screenHeight);
|
|
31
|
+
const TOP_INSET = useRef(Constants.isIphoneX ? Constants.getSafeAreaInsets().top : Constants.isIOS ? 20 : 0);
|
|
32
|
+
const BOTTOM_INSET = useRef(Constants.isIphoneX ? Constants.getSafeAreaInsets().bottom : Constants.isIOS ? 20 : 0);
|
|
33
|
+
const thresholdX = useRef(0);
|
|
34
|
+
const thresholdY = useRef(0);
|
|
35
|
+
const dragsCounter = useRef(0);
|
|
36
|
+
const containerRef = useRef();
|
|
37
|
+
const animatedValue = useRef(new Animated.Value(0));
|
|
38
|
+
const mutableSwipeDirections = useRef({});
|
|
39
|
+
const prevDragDeltas = useRef();
|
|
40
|
+
const prevSwipeDirections = useRef();
|
|
41
|
+
const visible = useRef(Boolean(propsVisible));
|
|
42
|
+
const getHiddenLocation = useCallback((left, top) => {
|
|
43
|
+
const result = {
|
|
44
|
+
left: 0,
|
|
45
|
+
top: 0
|
|
46
|
+
};
|
|
47
|
+
switch (direction) {
|
|
48
|
+
case PanningProvider.Directions.LEFT:
|
|
49
|
+
result.left = -left - width.current;
|
|
50
|
+
break;
|
|
51
|
+
case PanningProvider.Directions.RIGHT:
|
|
52
|
+
result.left = Constants.screenWidth - left;
|
|
53
|
+
break;
|
|
54
|
+
case PanningProvider.Directions.UP:
|
|
55
|
+
result.top = -top - height.current - TOP_INSET.current;
|
|
56
|
+
break;
|
|
57
|
+
case PanningProvider.Directions.DOWN:
|
|
58
|
+
default:
|
|
59
|
+
result.top = Constants.screenHeight - top + BOTTOM_INSET.current;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}, [direction]);
|
|
64
|
+
const hiddenLocation = useRef(getHiddenLocation(0, 0));
|
|
65
|
+
const animateTo = useCallback((toValue, animationEndCallback) => {
|
|
66
|
+
Animated.timing(animatedValue.current, {
|
|
67
|
+
toValue,
|
|
68
|
+
duration: 300,
|
|
69
|
+
easing: Easing.bezier(0.2, 0, 0.35, 1),
|
|
70
|
+
useNativeDriver: true
|
|
71
|
+
}).start(animationEndCallback);
|
|
72
|
+
}, []);
|
|
73
|
+
const isSwiping = useCallback(() => {
|
|
74
|
+
return !_isUndefined(mutableSwipeDirections.current.x) || !_isUndefined(mutableSwipeDirections.current.y);
|
|
75
|
+
}, []);
|
|
76
|
+
const resetSwipe = useCallback(() => {
|
|
77
|
+
dragsCounter.current = 0;
|
|
78
|
+
mutableSwipeDirections.current = {};
|
|
79
|
+
}, []);
|
|
80
|
+
const onDrag = useCallback(() => {
|
|
81
|
+
if (isSwiping()) {
|
|
82
|
+
if (dragsCounter.current < MAXIMUM_DRAGS_AFTER_SWIPE) {
|
|
83
|
+
dragsCounter.current += 1;
|
|
84
|
+
} else {
|
|
85
|
+
resetSwipe();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}, [isSwiping, resetSwipe]);
|
|
89
|
+
const hide = useCallback(() => {
|
|
90
|
+
// TODO: test we're not animating?
|
|
91
|
+
animateTo(0, () => {
|
|
92
|
+
visible.current = false;
|
|
93
|
+
onDismiss?.();
|
|
94
|
+
});
|
|
95
|
+
}, [animateTo, onDismiss]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (isPanning && (dragDeltas.x || dragDeltas.y) && (dragDeltas.x !== prevDragDeltas.current?.x || dragDeltas.y !== prevDragDeltas.current?.y)) {
|
|
98
|
+
onDrag();
|
|
99
|
+
prevDragDeltas.current = dragDeltas;
|
|
100
|
+
}
|
|
101
|
+
}, [isPanning, dragDeltas, onDrag, hide]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (isPanning && (swipeDirections.x || swipeDirections.y) && (swipeDirections.x !== prevSwipeDirections.current?.x || swipeDirections.y !== prevSwipeDirections.current?.y)) {
|
|
104
|
+
mutableSwipeDirections.current = swipeDirections;
|
|
105
|
+
}
|
|
106
|
+
}, [isPanning, swipeDirections, hide]);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (visible.current && !propsVisible) {
|
|
109
|
+
hide();
|
|
110
|
+
}
|
|
111
|
+
}, [propsVisible, hide]);
|
|
112
|
+
const onLayout = useCallback(event => {
|
|
113
|
+
// DO NOT move the width\height into the measureInWindow - it causes errors with orientation change
|
|
114
|
+
const layout = event.nativeEvent.layout;
|
|
115
|
+
width.current = layout.width;
|
|
116
|
+
height.current = layout.height;
|
|
117
|
+
thresholdX.current = width.current / 2;
|
|
118
|
+
thresholdY.current = height.current / 2;
|
|
119
|
+
if (containerRef.current) {
|
|
120
|
+
// @ts-ignore TODO: can we fix this on ViewProps \ View?
|
|
121
|
+
containerRef.current.measureInWindow((x, y) => {
|
|
122
|
+
hiddenLocation.current = getHiddenLocation(x, y);
|
|
123
|
+
animateTo(1);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}, [getHiddenLocation, animateTo]);
|
|
127
|
+
const getAnimationStyle = useCallback(() => {
|
|
128
|
+
return {
|
|
129
|
+
transform: [{
|
|
130
|
+
translateX: animatedValue.current.interpolate({
|
|
131
|
+
inputRange: [0, 1],
|
|
132
|
+
outputRange: [hiddenLocation.current.left, 0]
|
|
133
|
+
})
|
|
134
|
+
}, {
|
|
135
|
+
translateY: animatedValue.current.interpolate({
|
|
136
|
+
inputRange: [0, 1],
|
|
137
|
+
outputRange: [hiddenLocation.current.top, 0]
|
|
138
|
+
})
|
|
139
|
+
}]
|
|
140
|
+
};
|
|
141
|
+
}, []);
|
|
142
|
+
const resetToShown = useCallback((left, top, direction) => {
|
|
143
|
+
const toValue =
|
|
144
|
+
//@ts-expect-error
|
|
145
|
+
[PanningProvider.Directions.LEFT, PanningProvider.Directions.RIGHT].includes(direction) ? 1 + left / hiddenLocation.current.left : 1 + top / hiddenLocation.current.top;
|
|
146
|
+
animateTo(toValue);
|
|
147
|
+
}, [animateTo]);
|
|
148
|
+
const onPanLocationChanged = useCallback(({
|
|
149
|
+
left = 0,
|
|
150
|
+
top = 0
|
|
151
|
+
}) => {
|
|
152
|
+
const endValue = {
|
|
153
|
+
x: Math.round(left),
|
|
154
|
+
y: Math.round(top)
|
|
155
|
+
};
|
|
156
|
+
if (isSwiping()) {
|
|
157
|
+
hide();
|
|
158
|
+
} else {
|
|
159
|
+
resetSwipe();
|
|
160
|
+
if (direction === PanningProvider.Directions.LEFT && endValue.x <= -thresholdX.current || direction === PanningProvider.Directions.RIGHT && endValue.x >= thresholdX.current || direction === PanningProvider.Directions.UP && endValue.y <= -thresholdY.current || direction === PanningProvider.Directions.DOWN && endValue.y >= thresholdY.current) {
|
|
161
|
+
hide();
|
|
162
|
+
} else {
|
|
163
|
+
resetToShown(left, top, direction);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}, [isSwiping, hide, resetSwipe, direction, resetToShown]);
|
|
167
|
+
return (
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
<View ref={containerRef} style={containerStyle} onLayout={onLayout}>
|
|
170
|
+
<PanResponderView
|
|
171
|
+
// !visible.current && styles.hidden is done to fix a bug is iOS
|
|
172
|
+
style={[style, getAnimationStyle(), !visible.current && styles.hidden]} isAnimated onPanLocationChanged={onPanLocationChanged}>
|
|
173
|
+
{children}
|
|
174
|
+
</PanResponderView>
|
|
175
|
+
</View>
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
DialogDismissibleView.displayName = 'IGNORE';
|
|
179
|
+
export default DialogDismissibleView;
|
|
180
|
+
const styles = StyleSheet.create({
|
|
181
|
+
hidden: {
|
|
182
|
+
opacity: 0
|
|
183
|
+
}
|
|
184
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
testID?: string;
|
|
4
|
+
dialogVisibility?: boolean;
|
|
5
|
+
modalVisibility?: boolean;
|
|
6
|
+
overlayBackgroundColor?: string;
|
|
7
|
+
onFadeDone?: () => void;
|
|
8
|
+
fadeOut?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const OverlayFadingBackground: {
|
|
11
|
+
({ testID, dialogVisibility, modalVisibility, overlayBackgroundColor, onFadeDone: propsOnFadeDone, fadeOut }: Props): React.JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export default OverlayFadingBackground;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
+
import View from "../view";
|
|
3
|
+
import { Animated } from 'react-native';
|
|
4
|
+
const OverlayFadingBackground = ({
|
|
5
|
+
testID,
|
|
6
|
+
dialogVisibility,
|
|
7
|
+
modalVisibility,
|
|
8
|
+
overlayBackgroundColor,
|
|
9
|
+
onFadeDone: propsOnFadeDone,
|
|
10
|
+
fadeOut
|
|
11
|
+
}) => {
|
|
12
|
+
const fadeAnimation = useRef(new Animated.Value(0)).current;
|
|
13
|
+
const isAnimating = useRef(false);
|
|
14
|
+
const onFadeDone = useCallback(() => {
|
|
15
|
+
isAnimating.current = false;
|
|
16
|
+
propsOnFadeDone?.();
|
|
17
|
+
}, [propsOnFadeDone]);
|
|
18
|
+
const animateFading = useCallback(toValue => {
|
|
19
|
+
isAnimating.current = true;
|
|
20
|
+
Animated.timing(fadeAnimation, {
|
|
21
|
+
toValue,
|
|
22
|
+
duration: 400,
|
|
23
|
+
useNativeDriver: true
|
|
24
|
+
}).start(onFadeDone);
|
|
25
|
+
}, [fadeAnimation, onFadeDone]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!isAnimating.current && (!dialogVisibility || fadeOut)) {
|
|
28
|
+
animateFading(0);
|
|
29
|
+
}
|
|
30
|
+
}, [dialogVisibility, animateFading, fadeOut]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (modalVisibility) {
|
|
33
|
+
animateFading(1);
|
|
34
|
+
}
|
|
35
|
+
}, [modalVisibility, animateFading]);
|
|
36
|
+
const style = useMemo(() => {
|
|
37
|
+
return {
|
|
38
|
+
opacity: fadeAnimation,
|
|
39
|
+
backgroundColor: overlayBackgroundColor
|
|
40
|
+
};
|
|
41
|
+
}, [overlayBackgroundColor, fadeAnimation]);
|
|
42
|
+
return <View testID={testID} absF animated style={style} pointerEvents="none" />;
|
|
43
|
+
};
|
|
44
|
+
OverlayFadingBackground.displayName = 'IGNORE';
|
|
45
|
+
export default OverlayFadingBackground;
|
|
@@ -2,53 +2,59 @@
|
|
|
2
2
|
"name": "Dialog",
|
|
3
3
|
"category": "overlays",
|
|
4
4
|
"description": "Component for displaying custom content inside a popup dialog",
|
|
5
|
-
"note": "Use alignment modifiers to control the dialog position (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center)
|
|
5
|
+
"note": "Use alignment modifiers to control the dialog position (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center)",
|
|
6
6
|
"modifiers": ["alignment"],
|
|
7
|
-
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.
|
|
7
|
+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.js",
|
|
8
|
+
"images": ["https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Dialog/Dialog.gif?raw=true"],
|
|
8
9
|
"props": [
|
|
9
|
-
{"name": "visible", "type": "boolean", "description": "
|
|
10
|
-
{"name": "
|
|
10
|
+
{"name": "visible", "type": "boolean", "description": "Control visibility of the component"},
|
|
11
|
+
{"name": "ignoreBackgroundPress", "type": "boolean", "description": "Whether or not to ignore background press"},
|
|
11
12
|
{
|
|
12
|
-
"name": "
|
|
13
|
-
"type": "
|
|
14
|
-
"description": "The
|
|
13
|
+
"name": "overlayBackgroundColor",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The color of the overlay background",
|
|
16
|
+
"default": "Colors.rgba(Colors.grey10, 0.6)"
|
|
15
17
|
},
|
|
18
|
+
{"name": "width", "type": "string | number", "description": "Width", "default": "90%"},
|
|
19
|
+
{"name": "height", "type": "string | number", "description": "Height", "default": "undefined"},
|
|
16
20
|
{
|
|
17
|
-
"name": "
|
|
18
|
-
"type": "
|
|
19
|
-
"description": "
|
|
21
|
+
"name": "panDirection",
|
|
22
|
+
"type": "UP | DOWN | LEFT | RIGHT",
|
|
23
|
+
"description": "The direction of the allowed pan",
|
|
24
|
+
"default": "PanningProvider.Directions.DOWN"
|
|
20
25
|
},
|
|
26
|
+
{"name": "onDismiss", "type": "(props?: any) => void", "description": "Called when clicking on the background"},
|
|
21
27
|
{
|
|
22
|
-
"name": "
|
|
23
|
-
"type": "(props
|
|
24
|
-
"description": "
|
|
28
|
+
"name": "onDialogDismissed",
|
|
29
|
+
"type": "(props: any) => void",
|
|
30
|
+
"description": "Called once the dialog has been dismissed completely"
|
|
25
31
|
},
|
|
26
32
|
{
|
|
27
|
-
"name": "
|
|
28
|
-
"type": "
|
|
29
|
-
"description": "
|
|
30
|
-
"
|
|
33
|
+
"name": "renderPannableHeader",
|
|
34
|
+
"type": "(props: any) => JSX.Element",
|
|
35
|
+
"description": "For scrollable content (the children of the dialog)",
|
|
36
|
+
"note": "If this is added only the header will be pannable. Props are transferred to the 'renderPannableHeader'"
|
|
31
37
|
},
|
|
32
38
|
{
|
|
33
|
-
"name": "
|
|
34
|
-
"type": "
|
|
35
|
-
"description": "
|
|
39
|
+
"name": "pannableHeaderProps",
|
|
40
|
+
"type": "any",
|
|
41
|
+
"description": "The props that will be passed to the pannable header"
|
|
36
42
|
},
|
|
37
|
-
{"name": "ignoreBackgroundPress", "type": "boolean", "description": "Whether or not to ignore background press."},
|
|
38
|
-
{"name": "modalProps", "type": "ModalProps", "description": "Pass props to the dialog modal"},
|
|
39
43
|
{
|
|
40
|
-
"name": "
|
|
41
|
-
"type": "
|
|
42
|
-
"description": "
|
|
43
|
-
}
|
|
44
|
+
"name": "useSafeArea",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "In iOS, use safe area, in case component attached to the bottom"
|
|
47
|
+
},
|
|
48
|
+
{"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"},
|
|
49
|
+
{"name": "testID", "type": "string", "description": "The test id for e2e tests"}
|
|
44
50
|
],
|
|
45
51
|
"snippet": [
|
|
46
|
-
"<Dialog",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
52
|
+
"<Dialog",
|
|
53
|
+
" visible={isVisible$1}",
|
|
54
|
+
" onDismiss={() => console.log('dismissed')$2}",
|
|
55
|
+
" panDirection={PanningProvider.Directions.DOWN$3}",
|
|
50
56
|
">",
|
|
51
|
-
"
|
|
57
|
+
" <Text text60>Content</Text>$4",
|
|
52
58
|
"</Dialog>"
|
|
53
59
|
]
|
|
54
60
|
}
|