react-native-ui-lib 7.45.0-snapshot.7266 → 7.46.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 -21
- package/lib/components/SafeArea/SafeAreaInsetsManager.js +31 -95
- 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/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +8 -52
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +7 -1
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +1 -1
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +41 -109
- package/lib/package.json +1 -1
- package/lib/react-native.config.js +3 -1
- package/metro.config.js +2 -2
- package/package.json +24 -24
- 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.driver.new.d.ts +1 -0
- package/src/components/button/Button.driver.new.js +4 -0
- 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 +4 -3
- 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.d.ts +3 -2
- package/src/components/picker/Picker.driver.new.js +3 -3
- 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/text/Text.driver.new.d.ts +2 -2
- package/src/components/text/Text.driver.new.js +2 -2
- package/src/components/textField/Input.js +1 -0
- package/src/components/textField/TextField.driver.new.d.ts +3 -2
- package/src/components/textField/TextField.driver.new.js +2 -2
- 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/Toast.driver.new.d.ts +1 -0
- 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/src/testkit/new/Component.driver.d.ts +1 -4
- package/src/testkit/new/Component.driver.js +3 -3
- 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 -274
- 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
|
@@ -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
|
}
|
|
@@ -1,15 +1,107 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle, ModalPropsIOS, AccessibilityProps, type DimensionValue } from 'react-native';
|
|
3
|
+
import { AlignmentModifiers } from '../../commons/modifiers';
|
|
4
|
+
import { ModalProps } from '../modal';
|
|
5
|
+
import { PanningDirections, PanningDirectionsEnum } from '../panningViews/panningProvider';
|
|
6
|
+
export { PanningDirections as DialogDirections, PanningDirectionsEnum as DialogDirectionsEnum };
|
|
7
|
+
interface RNPartialProps extends Pick<ModalPropsIOS, 'supportedOrientations'>, Pick<AccessibilityProps, 'accessibilityLabel'> {
|
|
8
|
+
}
|
|
9
|
+
export interface DialogProps extends AlignmentModifiers, RNPartialProps {
|
|
10
|
+
/**
|
|
11
|
+
* Control visibility of the dialog
|
|
12
|
+
*/
|
|
13
|
+
visible?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Dismiss callback for when clicking on the background
|
|
16
|
+
*/
|
|
17
|
+
onDismiss?: (props?: any) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether or not to ignore background press
|
|
20
|
+
*/
|
|
21
|
+
ignoreBackgroundPress?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The color of the overlay background
|
|
24
|
+
*/
|
|
25
|
+
overlayBackgroundColor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The dialog width (default: 90%)
|
|
28
|
+
*/
|
|
29
|
+
width?: DimensionValue;
|
|
30
|
+
/**
|
|
31
|
+
* The dialog height (default: undefined)
|
|
32
|
+
*/
|
|
33
|
+
height?: DimensionValue;
|
|
34
|
+
/**
|
|
35
|
+
* The direction of the allowed pan (default is DOWN).
|
|
36
|
+
* Types: UP, DOWN, LEFT and RIGHT (using PanningProvider.Directions.###).
|
|
37
|
+
* Pass null to remove pan.
|
|
38
|
+
*/
|
|
39
|
+
panDirection?: PanningDirections;
|
|
40
|
+
/**
|
|
41
|
+
* Whether or not to handle SafeArea
|
|
42
|
+
*/
|
|
43
|
+
useSafeArea?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Called once the dialog has been dismissed completely
|
|
46
|
+
*/
|
|
47
|
+
onDialogDismissed?: (props: any) => void;
|
|
48
|
+
/**
|
|
49
|
+
* If this is added only the header will be pannable;
|
|
50
|
+
* this allows for scrollable content (the children of the dialog)
|
|
51
|
+
* props are transferred to the renderPannableHeader
|
|
52
|
+
*/
|
|
53
|
+
renderPannableHeader?: (props: any) => JSX.Element;
|
|
54
|
+
/**
|
|
55
|
+
* The props that will be passed to the pannable header
|
|
56
|
+
*/
|
|
57
|
+
pannableHeaderProps?: any;
|
|
58
|
+
/**
|
|
59
|
+
* Additional props for the modal.
|
|
60
|
+
*/
|
|
61
|
+
modalProps?: ModalProps;
|
|
62
|
+
/**
|
|
63
|
+
* The Dialog`s container style
|
|
64
|
+
*/
|
|
65
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
66
|
+
/**
|
|
67
|
+
* Used as a testing identifier
|
|
68
|
+
*/
|
|
69
|
+
testID?: string;
|
|
13
70
|
children?: React.ReactNode;
|
|
14
|
-
}
|
|
71
|
+
}
|
|
72
|
+
interface DialogState {
|
|
73
|
+
alignments: AlignmentModifiers;
|
|
74
|
+
modalVisibility?: boolean;
|
|
75
|
+
dialogVisibility?: boolean;
|
|
76
|
+
fadeOut?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @description: Dialog component for displaying custom content inside a popup dialog
|
|
80
|
+
* @notes: Use alignment modifiers to control the dialog position
|
|
81
|
+
* (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center)
|
|
82
|
+
* @modifiers: alignment
|
|
83
|
+
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.js
|
|
84
|
+
* @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Dialog/Dialog.gif?raw=true
|
|
85
|
+
*/
|
|
86
|
+
declare class Dialog extends Component<DialogProps, DialogState> {
|
|
87
|
+
static displayName: string;
|
|
88
|
+
static directions: typeof PanningDirectionsEnum;
|
|
89
|
+
static defaultProps: {
|
|
90
|
+
overlayBackgroundColor: string | undefined;
|
|
91
|
+
};
|
|
92
|
+
private styles;
|
|
93
|
+
constructor(props: DialogProps);
|
|
94
|
+
UNSAFE_componentWillReceiveProps(nextProps: DialogProps): void;
|
|
95
|
+
setAlignment(): void;
|
|
96
|
+
onFadeDone: () => void;
|
|
97
|
+
_onDismiss: () => void;
|
|
98
|
+
onDismiss: () => void;
|
|
99
|
+
hideDialogView: () => void;
|
|
100
|
+
renderPannableHeader: (directions: PanningDirections[]) => React.JSX.Element | undefined;
|
|
101
|
+
getContainerType: () => React.ForwardRefExoticComponent<import("../view").ViewProps & React.RefAttributes<import("react-native").View>> | React.ComponentClass<import("../panningViews/panListenerView").PanListenerViewProps, any>;
|
|
102
|
+
renderDialogView: () => React.JSX.Element;
|
|
103
|
+
renderDialogContainer: () => React.JSX.Element;
|
|
104
|
+
render: () => React.JSX.Element;
|
|
105
|
+
}
|
|
106
|
+
declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<any>> & typeof Dialog;
|
|
15
107
|
export default _default;
|