react-native-ui-lib 7.46.3 → 8.0.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 +12 -0
- package/incubator.d.ts +2 -2
- package/incubator.js +0 -2
- package/index.js +1 -0
- package/lib/android/build.gradle +5 -5
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -2
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +31 -23
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +1 -1
- package/lib/components/{HighlighterOverlayView.d.ts → HighlighterOverlayView/index.d.ts} +1 -1
- package/lib/components/HighlighterOverlayView/index.js +49 -0
- package/lib/components/{HighlighterOverlayView.web.d.ts → HighlighterOverlayView/index.web.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.android.d.ts +5 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.js +51 -0
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.d.ts +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.js +3 -3
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.d.ts +3 -0
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.js +1 -1
- package/lib/components/Keyboard/{KeyboardInput/utils → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager}/__tests__/EventEmitterManager.spec.js +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/__tests__/KeyboardRegistry.spec.js +1 -1
- package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.d.ts → KeyboardAccessoryView/KeyboardRegistry/index.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.js → KeyboardAccessoryView/KeyboardRegistry/index.js} +1 -1
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/keyboardRegistry.api.json +9 -9
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.ts +26 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.js +91 -0
- package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.d.ts → KeyboardAccessoryView/index.d.ts} +11 -1
- package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.js → KeyboardAccessoryView/index.js} +31 -5
- package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/keyboardAccessoryView.api.json +5 -5
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.d.ts → KeyboardAwareInsetsView/index.d.ts} +1 -1
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.js → KeyboardAwareInsetsView/index.js} +1 -1
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.d.ts +1 -4
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.js +5 -8
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.d.ts +2 -2
- package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/keyboardTrackingView.api.json +11 -20
- package/lib/components/Keyboard/index.d.ts +6 -6
- package/lib/components/Keyboard/index.js +6 -6
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.ts +21 -7
- package/lib/components/SafeArea/SafeAreaInsetsManager.js +95 -31
- package/lib/components/SafeArea/SafeAreaSpacerView.d.ts +2 -2
- package/lib/components/SafeArea/SafeAreaSpacerView.js +63 -9
- package/lib/components/SafeArea/__tests__/SafeAreaInsetsManager.spec.js +274 -0
- package/lib/components/SafeArea/index.d.ts +10 -0
- package/lib/components/SafeArea/index.js +11 -0
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +56 -8
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +1 -7
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +1 -1
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +134 -44
- package/lib/package.json +3 -3
- package/lib/react-native.config.js +1 -3
- package/metro.config.js +2 -2
- package/package.json +33 -32
- package/panView.d.ts +2 -0
- package/panView.js +1 -0
- package/scripts/release/prReleaseNotesCommon.js +15 -4
- package/src/commons/Constants.js +2 -5
- package/src/commons/modifiers.d.ts +1 -0
- package/src/commons/modifiers.js +5 -2
- package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +5 -1
- package/src/components/actionSheet/index.d.ts +2 -12
- package/src/components/actionSheet/index.js +3 -42
- package/src/components/animatedImage/index.js +12 -2
- package/src/components/badge/index.d.ts +107 -47
- package/src/components/button/button.api.json +1 -1
- package/src/components/button/index.d.ts +53 -23
- package/src/components/button/types.d.ts +0 -1
- package/src/components/colorPicker/ColorPickerDialog.d.ts +1 -1
- package/src/components/colorPicker/ColorPickerDialog.js +1 -1
- package/src/components/dateTimePicker/index.d.ts +186 -5
- package/src/components/dateTimePicker/index.js +3 -4
- package/src/components/dialog/dialog.api.json +34 -35
- package/src/{incubator → components}/dialog/dialogHeader.api.json +2 -2
- package/src/components/dialog/index.d.ts +13 -105
- package/src/components/dialog/index.js +205 -212
- package/src/{incubator → components}/dialog/types.d.ts +7 -19
- package/src/{incubator → components}/dialog/types.js +1 -3
- package/src/{incubator → components}/dialog/useDialogContent.d.ts +1 -1
- package/src/components/drawer/Swipeable.js +1 -2
- package/src/components/drawer/index.js +31 -25
- package/src/components/fadedScrollView/index.js +7 -2
- package/src/components/featureHighlight/index.d.ts +1 -1
- package/src/components/hint/index.d.ts +0 -8
- package/src/components/hint/index.js +4 -6
- package/src/components/image/index.js +4 -0
- package/src/components/index.js +0 -19
- package/src/components/marquee/types.js +4 -1
- package/src/components/modal/index.d.ts +5 -0
- package/src/components/modal/index.js +14 -10
- package/src/components/modal/modal.api.json +5 -0
- package/src/{incubator → components}/panView/index.d.ts +3 -3
- package/src/{incubator → components}/panView/index.js +4 -4
- package/src/{incubator → components}/panView/usePanGesture.d.ts +1 -1
- package/src/components/picker/Picker.driver.new.d.ts +2 -2
- package/src/components/picker/Picker.driver.new.js +3 -3
- package/src/components/picker/PickerItem.js +6 -20
- package/src/components/picker/PickerPresenter.d.ts +0 -1
- package/src/components/picker/PickerPresenter.js +1 -23
- package/src/components/picker/api/picker.api.json +0 -1
- package/src/components/picker/api/pickerItem.api.json +0 -5
- package/src/components/picker/helpers/useFieldType.d.ts +53 -23
- package/src/components/picker/helpers/usePickerLabel.d.ts +1 -1
- package/src/components/picker/helpers/usePickerLabel.js +2 -3
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +1 -1
- package/src/components/picker/helpers/usePickerMigrationWarnings.js +0 -12
- package/src/components/picker/helpers/usePickerSearch.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSearch.js +4 -8
- package/src/components/picker/helpers/usePickerSelection.d.ts +1 -1
- package/src/components/picker/helpers/usePickerSelection.js +2 -10
- package/src/components/picker/index.js +4 -22
- package/src/components/picker/types.d.ts +1 -24
- package/src/components/segmentedControl/index.js +3 -3
- package/src/components/slider/GradientSlider.d.ts +1 -1
- package/src/components/slider/index.js +1 -1
- package/src/components/sortableGridList/SortableItem.js +13 -4
- package/src/components/sortableList/SortableListItem.js +13 -4
- package/src/components/stackAggregator/index.js +16 -11
- package/src/components/tabController/TabPage.js +18 -14
- package/src/components/text/Text.driver.new.d.ts +2 -2
- package/src/components/text/Text.driver.new.js +2 -2
- package/src/components/text/index.js +2 -3
- package/src/components/textField/Input.js +0 -1
- package/src/components/textField/TextField.driver.new.d.ts +2 -2
- package/src/components/textField/TextField.driver.new.js +2 -2
- package/src/components/textField/presets/outline.d.ts +106 -46
- package/src/components/textField/presets/underline.d.ts +106 -46
- package/src/components/textField/types.js +1 -0
- package/src/components/textField/usePreset.d.ts +72 -44
- package/src/components/timeline/types.js +3 -0
- package/src/{incubator/hooks/useHiddenLocation.web.d.ts → hooks/useHiddenLocation/index.d.ts} +1 -1
- package/src/{incubator/hooks/useHiddenLocation.d.ts → hooks/useHiddenLocation/index.web.d.ts} +1 -1
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.js +1 -1
- package/src/incubator/expandableOverlay/index.d.ts +42 -3
- package/src/incubator/expandableOverlay/index.js +1 -4
- package/src/incubator/index.d.ts +0 -2
- package/src/incubator/index.js +0 -2
- package/src/incubator/slider/SliderPresenter.js +2 -1
- package/src/incubator/toast/index.js +1 -1
- package/src/index.d.ts +3 -10
- package/src/index.js +42 -162
- package/src/testkit/index.d.ts +1 -1
- package/src/testkit/index.js +1 -1
- package/src/testkit/new/Component.driver.d.ts +4 -1
- package/src/testkit/new/Component.driver.js +3 -3
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReactHacks.java +0 -30
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java +0 -34
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/KeyListenerProxy.java +0 -53
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java +0 -54
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/ViewUtils.java +0 -36
- package/lib/components/HighlighterOverlayView.js +0 -40
- package/lib/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +0 -28
- package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +0 -11
- package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.js +0 -17
- package/panningViews.d.ts +0 -2
- package/panningViews.js +0 -1
- package/react-native.config.js +0 -22
- package/sharedTransition.d.ts +0 -2
- package/sharedTransition.js +0 -1
- package/src/components/dialog/DialogDismissibleView.d.ts +0 -34
- package/src/components/dialog/DialogDismissibleView.js +0 -184
- package/src/components/dialog/OverlayFadingBackground.d.ts +0 -14
- package/src/components/dialog/OverlayFadingBackground.js +0 -45
- package/src/components/panningViews/asPanViewConsumer.d.ts +0 -3
- package/src/components/panningViews/asPanViewConsumer.js +0 -16
- package/src/components/panningViews/panDismissibleView.d.ts +0 -51
- package/src/components/panningViews/panDismissibleView.js +0 -350
- package/src/components/panningViews/panGestureView.d.ts +0 -23
- package/src/components/panningViews/panGestureView.js +0 -156
- package/src/components/panningViews/panListenerView.d.ts +0 -66
- package/src/components/panningViews/panListenerView.js +0 -155
- package/src/components/panningViews/panResponderView.d.ts +0 -19
- package/src/components/panningViews/panResponderView.js +0 -79
- package/src/components/panningViews/panningContext.d.ts +0 -3
- package/src/components/panningViews/panningContext.js +0 -4
- package/src/components/panningViews/panningProvider.d.ts +0 -73
- package/src/components/panningViews/panningProvider.js +0 -101
- package/src/components/sharedTransition/ShareTransitionContext.js +0 -3
- package/src/components/sharedTransition/SharedArea.js +0 -153
- package/src/components/sharedTransition/SourceElement.js +0 -44
- package/src/components/sharedTransition/TargetElement.js +0 -38
- package/src/components/sharedTransition/index.js +0 -9
- package/src/incubator/dialog/dialog.api.json +0 -54
- package/src/incubator/dialog/index.d.ts +0 -15
- package/src/incubator/dialog/index.js +0 -218
- /package/lib/components/{HighlighterOverlayView.web.js → HighlighterOverlayView/index.web.js} +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.d.ts → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.ts} +0 -0
- /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.js → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.js} +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.js +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking → KeyboardAwareInsetsView}/keyboardAwareInsetsView.api.json +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.js +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.d.ts +0 -0
- /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.js +0 -0
- /package/src/{incubator → components}/dialog/Dialog.driver.new.d.ts +0 -0
- /package/src/{incubator → components}/dialog/Dialog.driver.new.js +0 -0
- /package/src/{incubator → components}/dialog/DialogHeader.d.ts +0 -0
- /package/src/{incubator → components}/dialog/DialogHeader.js +0 -0
- /package/src/{incubator → components}/dialog/useDialogContent.js +0 -0
- /package/src/{incubator → components}/panView/panningUtil.d.ts +0 -0
- /package/src/{incubator → components}/panView/panningUtil.js +0 -0
- /package/src/{incubator → components}/panView/usePanGesture.js +0 -0
- /package/src/{incubator/hooks/useHiddenLocation.js → hooks/useHiddenLocation/index.js} +0 -0
- /package/src/{incubator/hooks/useHiddenLocation.web.js → hooks/useHiddenLocation/index.web.js} +0 -0
|
@@ -45,7 +45,8 @@ export function validateValues(props) {
|
|
|
45
45
|
} = props;
|
|
46
46
|
if (minimumValue > maximumValue || useRange && initialMinimumValue && initialMaximumValue && initialMinimumValue > initialMaximumValue) {
|
|
47
47
|
LogService.forwardError({
|
|
48
|
-
|
|
48
|
+
// eslint-disable-next-line max-len
|
|
49
|
+
message: `Your passed values are invalid. Please check if minimum values are not higher than maximum values (minimumValue: ${minimumValue}, maximumValue: ${maximumValue}, initialMinimumValue: ${initialMinimumValue}, initialMaximumValue: ${initialMaximumValue})`
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
if (value !== undefined && minimumValue && maximumValue && !inRange(value, minimumValue, maximumValue)) {
|
|
@@ -7,7 +7,7 @@ import View from "../../components/view";
|
|
|
7
7
|
import Text from "../../components/text";
|
|
8
8
|
import Icon from "../../components/icon";
|
|
9
9
|
import Button from "../../components/button";
|
|
10
|
-
import PanView from "
|
|
10
|
+
import PanView from "../../components/panView";
|
|
11
11
|
import { ToastProps, ToastPresets } from "./types";
|
|
12
12
|
import useToastTimer from "./helpers/useToastTimer";
|
|
13
13
|
import useToastPresets from "./helpers/useToastPresets";
|
package/src/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export * from 'uilib-native';
|
|
|
6
6
|
export { asBaseComponent, Config, Constants, forwardRef, withScrollEnabler, WithScrollEnablerProps, withScrollReached, WithScrollReachedProps, UIComponent, BaseComponentInjectedProps, ForwardRefInjectedProps, ContainerModifiers, MarginModifiers, PaddingModifiers, TypographyModifiers, ColorsModifiers, BackgroundColorModifier } from './commons/new';
|
|
7
7
|
export { BaseComponent, PureBaseComponent } from './commons';
|
|
8
8
|
import * as Incubator from './incubator';
|
|
9
|
-
export { ExpandableOverlayProps, ExpandableOverlayMethods, ToastProps, ToastPresets
|
|
9
|
+
export { ExpandableOverlayProps, ExpandableOverlayMethods, ToastProps, ToastPresets } from './incubator';
|
|
10
10
|
import * as Hooks from './hooks';
|
|
11
11
|
import * as Modifiers from './commons/modifiers';
|
|
12
12
|
export { default as LogService } from './services/LogService';
|
|
@@ -32,7 +32,7 @@ export { default as ColorSwatch, ColorSwatchProps, ColorInfo } from './component
|
|
|
32
32
|
export { default as ConnectionStatusBar, ConnectionStatusBarProps } from './components/connectionStatusBar';
|
|
33
33
|
export { default as Dash, DashProps } from './components/dash';
|
|
34
34
|
export { default as DateTimePicker, DateTimePickerProps, DateTimePickerMode } from './components/dateTimePicker';
|
|
35
|
-
export { default as Dialog, DialogProps, DialogDirections, DialogDirectionsEnum } from './components/dialog';
|
|
35
|
+
export { default as Dialog, DialogProps, DialogHeaderProps, DialogStatics, DialogImperativeMethods, DialogDirections, DialogDirectionsEnum } from './components/dialog';
|
|
36
36
|
export { default as Drawer, DrawerProps, DrawerItemProps } from './components/drawer';
|
|
37
37
|
export { default as ExpandableSection, ExpandableSectionProps } from './components/expandableSection';
|
|
38
38
|
export { default as Fader, FaderProps, FaderPosition } from './components/fader';
|
|
@@ -60,14 +60,8 @@ export { default as Modal, ModalProps, ModalTopBarProps } from './components/mod
|
|
|
60
60
|
export { default as NumberInput, NumberInputProps, NumberInputData } from './components/numberInput';
|
|
61
61
|
export { default as Overlay, OverlayTypes } from './components/overlay';
|
|
62
62
|
export { default as PageControl, PageControlProps } from './components/pageControl';
|
|
63
|
-
export { default as PanDismissibleView, PanDismissibleViewProps, DismissibleAnimationProps } from './components/panningViews/panDismissibleView';
|
|
64
|
-
export { default as PanGestureView, PanGestureViewProps } from './components/panningViews/panGestureView';
|
|
65
|
-
export { default as PanListenerView, PanListenerViewProps } from './components/panningViews/panListenerView';
|
|
66
|
-
export { default as PanningContext } from './components/panningViews/panningContext';
|
|
67
|
-
export { default as PanningProvider, PanningDirections, PanLocationProps, PanAmountsProps, PanDirectionsProps } from './components/panningViews/panningProvider';
|
|
68
|
-
export { default as PanResponderView, PanResponderViewProps } from './components/panningViews/panResponderView';
|
|
69
|
-
export { default as asPanViewConsumer } from './components/panningViews/asPanViewConsumer';
|
|
70
63
|
export { default as Picker, PickerProps, PickerItemProps, PickerValue, PickerModes, PickerFieldTypes, PickerSearchStyle, RenderCustomModalProps, PickerItemsListProps, PickerMethods, PickerSelectionStatusProps } from './components/picker';
|
|
64
|
+
export { default as PanView, PanViewProps, PanningDirections, PanningDirectionsEnum, PanViewDirections, PanViewDirectionsEnum, PanViewDismissThreshold } from './components/panView';
|
|
71
65
|
export { default as PieChart, type PieChartProps, PieChartSegmentProps } from './components/pieChart';
|
|
72
66
|
export { default as ProgressBar, ProgressBarProps } from './components/progressBar';
|
|
73
67
|
export { default as ProgressiveImage, ProgressiveImageProps } from './components/progressiveImage';
|
|
@@ -79,7 +73,6 @@ export { default as ScrollBar, ScrollBarProps } from './components/scrollBar';
|
|
|
79
73
|
export { default as SearchInput, SearchInputProps, SearchInputRef } from './components/searchInput';
|
|
80
74
|
export { default as SectionsWheelPicker, SectionsWheelPickerProps } from './components/sectionsWheelPicker';
|
|
81
75
|
export { default as SegmentedControl, SegmentedControlProps, SegmentedControlItemProps, SegmentedControlPreset } from './components/segmentedControl';
|
|
82
|
-
export { default as SharedTransition } from './components/sharedTransition';
|
|
83
76
|
export { default as SkeletonView, SkeletonViewProps } from './components/skeletonView';
|
|
84
77
|
export { default as SortableGridList, SortableGridListProps } from './components/sortableGridList';
|
|
85
78
|
export { default as SortableList, SortableListProps, SortableListItemProps } from './components/sortableList';
|
package/src/index.js
CHANGED
|
@@ -28,9 +28,6 @@ var _exportNames = {
|
|
|
28
28
|
ExpandableOverlayMethods: true,
|
|
29
29
|
ToastProps: true,
|
|
30
30
|
ToastPresets: true,
|
|
31
|
-
PanViewProps: true,
|
|
32
|
-
PanViewDirections: true,
|
|
33
|
-
PanViewDismissThreshold: true,
|
|
34
31
|
Incubator: true,
|
|
35
32
|
Hooks: true,
|
|
36
33
|
Modifiers: true,
|
|
@@ -84,6 +81,9 @@ var _exportNames = {
|
|
|
84
81
|
DateTimePickerMode: true,
|
|
85
82
|
Dialog: true,
|
|
86
83
|
DialogProps: true,
|
|
84
|
+
DialogHeaderProps: true,
|
|
85
|
+
DialogStatics: true,
|
|
86
|
+
DialogImperativeMethods: true,
|
|
87
87
|
DialogDirections: true,
|
|
88
88
|
DialogDirectionsEnum: true,
|
|
89
89
|
Drawer: true,
|
|
@@ -140,22 +140,6 @@ var _exportNames = {
|
|
|
140
140
|
OverlayTypes: true,
|
|
141
141
|
PageControl: true,
|
|
142
142
|
PageControlProps: true,
|
|
143
|
-
PanDismissibleView: true,
|
|
144
|
-
PanDismissibleViewProps: true,
|
|
145
|
-
DismissibleAnimationProps: true,
|
|
146
|
-
PanGestureView: true,
|
|
147
|
-
PanGestureViewProps: true,
|
|
148
|
-
PanListenerView: true,
|
|
149
|
-
PanListenerViewProps: true,
|
|
150
|
-
PanningContext: true,
|
|
151
|
-
PanningProvider: true,
|
|
152
|
-
PanningDirections: true,
|
|
153
|
-
PanLocationProps: true,
|
|
154
|
-
PanAmountsProps: true,
|
|
155
|
-
PanDirectionsProps: true,
|
|
156
|
-
PanResponderView: true,
|
|
157
|
-
PanResponderViewProps: true,
|
|
158
|
-
asPanViewConsumer: true,
|
|
159
143
|
Picker: true,
|
|
160
144
|
PickerProps: true,
|
|
161
145
|
PickerItemProps: true,
|
|
@@ -167,6 +151,13 @@ var _exportNames = {
|
|
|
167
151
|
PickerItemsListProps: true,
|
|
168
152
|
PickerMethods: true,
|
|
169
153
|
PickerSelectionStatusProps: true,
|
|
154
|
+
PanView: true,
|
|
155
|
+
PanViewProps: true,
|
|
156
|
+
PanningDirections: true,
|
|
157
|
+
PanningDirectionsEnum: true,
|
|
158
|
+
PanViewDirections: true,
|
|
159
|
+
PanViewDirectionsEnum: true,
|
|
160
|
+
PanViewDismissThreshold: true,
|
|
170
161
|
PieChart: true,
|
|
171
162
|
PieChartSegmentProps: true,
|
|
172
163
|
ProgressBar: true,
|
|
@@ -188,7 +179,6 @@ var _exportNames = {
|
|
|
188
179
|
SegmentedControlProps: true,
|
|
189
180
|
SegmentedControlItemProps: true,
|
|
190
181
|
SegmentedControlPreset: true,
|
|
191
|
-
SharedTransition: true,
|
|
192
182
|
SkeletonView: true,
|
|
193
183
|
SkeletonViewProps: true,
|
|
194
184
|
SortableGridList: true,
|
|
@@ -589,16 +579,28 @@ Object.defineProperty(exports, "DialogDirectionsEnum", {
|
|
|
589
579
|
return _dialog().DialogDirectionsEnum;
|
|
590
580
|
}
|
|
591
581
|
});
|
|
582
|
+
Object.defineProperty(exports, "DialogHeaderProps", {
|
|
583
|
+
enumerable: true,
|
|
584
|
+
get: function () {
|
|
585
|
+
return _dialog().DialogHeaderProps;
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
Object.defineProperty(exports, "DialogImperativeMethods", {
|
|
589
|
+
enumerable: true,
|
|
590
|
+
get: function () {
|
|
591
|
+
return _dialog().DialogImperativeMethods;
|
|
592
|
+
}
|
|
593
|
+
});
|
|
592
594
|
Object.defineProperty(exports, "DialogProps", {
|
|
593
595
|
enumerable: true,
|
|
594
596
|
get: function () {
|
|
595
597
|
return _dialog().DialogProps;
|
|
596
598
|
}
|
|
597
599
|
});
|
|
598
|
-
Object.defineProperty(exports, "
|
|
600
|
+
Object.defineProperty(exports, "DialogStatics", {
|
|
599
601
|
enumerable: true,
|
|
600
602
|
get: function () {
|
|
601
|
-
return
|
|
603
|
+
return _dialog().DialogStatics;
|
|
602
604
|
}
|
|
603
605
|
});
|
|
604
606
|
Object.defineProperty(exports, "Drawer", {
|
|
@@ -964,106 +966,46 @@ Object.defineProperty(exports, "PageControlProps", {
|
|
|
964
966
|
return _pageControl().PageControlProps;
|
|
965
967
|
}
|
|
966
968
|
});
|
|
967
|
-
Object.defineProperty(exports, "
|
|
968
|
-
enumerable: true,
|
|
969
|
-
get: function () {
|
|
970
|
-
return _panningProvider().PanAmountsProps;
|
|
971
|
-
}
|
|
972
|
-
});
|
|
973
|
-
Object.defineProperty(exports, "PanDirectionsProps", {
|
|
974
|
-
enumerable: true,
|
|
975
|
-
get: function () {
|
|
976
|
-
return _panningProvider().PanDirectionsProps;
|
|
977
|
-
}
|
|
978
|
-
});
|
|
979
|
-
Object.defineProperty(exports, "PanDismissibleView", {
|
|
980
|
-
enumerable: true,
|
|
981
|
-
get: function () {
|
|
982
|
-
return _panDismissibleView().default;
|
|
983
|
-
}
|
|
984
|
-
});
|
|
985
|
-
Object.defineProperty(exports, "PanDismissibleViewProps", {
|
|
986
|
-
enumerable: true,
|
|
987
|
-
get: function () {
|
|
988
|
-
return _panDismissibleView().PanDismissibleViewProps;
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
Object.defineProperty(exports, "PanGestureView", {
|
|
992
|
-
enumerable: true,
|
|
993
|
-
get: function () {
|
|
994
|
-
return _panGestureView().default;
|
|
995
|
-
}
|
|
996
|
-
});
|
|
997
|
-
Object.defineProperty(exports, "PanGestureViewProps", {
|
|
998
|
-
enumerable: true,
|
|
999
|
-
get: function () {
|
|
1000
|
-
return _panGestureView().PanGestureViewProps;
|
|
1001
|
-
}
|
|
1002
|
-
});
|
|
1003
|
-
Object.defineProperty(exports, "PanListenerView", {
|
|
1004
|
-
enumerable: true,
|
|
1005
|
-
get: function () {
|
|
1006
|
-
return _panListenerView().default;
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
1009
|
-
Object.defineProperty(exports, "PanListenerViewProps", {
|
|
1010
|
-
enumerable: true,
|
|
1011
|
-
get: function () {
|
|
1012
|
-
return _panListenerView().PanListenerViewProps;
|
|
1013
|
-
}
|
|
1014
|
-
});
|
|
1015
|
-
Object.defineProperty(exports, "PanLocationProps", {
|
|
1016
|
-
enumerable: true,
|
|
1017
|
-
get: function () {
|
|
1018
|
-
return _panningProvider().PanLocationProps;
|
|
1019
|
-
}
|
|
1020
|
-
});
|
|
1021
|
-
Object.defineProperty(exports, "PanResponderView", {
|
|
969
|
+
Object.defineProperty(exports, "PanView", {
|
|
1022
970
|
enumerable: true,
|
|
1023
971
|
get: function () {
|
|
1024
|
-
return
|
|
972
|
+
return _panView().default;
|
|
1025
973
|
}
|
|
1026
974
|
});
|
|
1027
|
-
Object.defineProperty(exports, "
|
|
975
|
+
Object.defineProperty(exports, "PanViewDirections", {
|
|
1028
976
|
enumerable: true,
|
|
1029
977
|
get: function () {
|
|
1030
|
-
return
|
|
978
|
+
return _panView().PanViewDirections;
|
|
1031
979
|
}
|
|
1032
980
|
});
|
|
1033
|
-
Object.defineProperty(exports, "
|
|
981
|
+
Object.defineProperty(exports, "PanViewDirectionsEnum", {
|
|
1034
982
|
enumerable: true,
|
|
1035
983
|
get: function () {
|
|
1036
|
-
return
|
|
984
|
+
return _panView().PanViewDirectionsEnum;
|
|
1037
985
|
}
|
|
1038
986
|
});
|
|
1039
987
|
Object.defineProperty(exports, "PanViewDismissThreshold", {
|
|
1040
988
|
enumerable: true,
|
|
1041
989
|
get: function () {
|
|
1042
|
-
return
|
|
990
|
+
return _panView().PanViewDismissThreshold;
|
|
1043
991
|
}
|
|
1044
992
|
});
|
|
1045
993
|
Object.defineProperty(exports, "PanViewProps", {
|
|
1046
994
|
enumerable: true,
|
|
1047
995
|
get: function () {
|
|
1048
|
-
return
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
|
-
Object.defineProperty(exports, "PanningContext", {
|
|
1052
|
-
enumerable: true,
|
|
1053
|
-
get: function () {
|
|
1054
|
-
return _panningContext().default;
|
|
996
|
+
return _panView().PanViewProps;
|
|
1055
997
|
}
|
|
1056
998
|
});
|
|
1057
999
|
Object.defineProperty(exports, "PanningDirections", {
|
|
1058
1000
|
enumerable: true,
|
|
1059
1001
|
get: function () {
|
|
1060
|
-
return
|
|
1002
|
+
return _panView().PanningDirections;
|
|
1061
1003
|
}
|
|
1062
1004
|
});
|
|
1063
|
-
Object.defineProperty(exports, "
|
|
1005
|
+
Object.defineProperty(exports, "PanningDirectionsEnum", {
|
|
1064
1006
|
enumerable: true,
|
|
1065
1007
|
get: function () {
|
|
1066
|
-
return
|
|
1008
|
+
return _panView().PanningDirectionsEnum;
|
|
1067
1009
|
}
|
|
1068
1010
|
});
|
|
1069
1011
|
Object.defineProperty(exports, "Picker", {
|
|
@@ -1270,12 +1212,6 @@ Object.defineProperty(exports, "SegmentedControlProps", {
|
|
|
1270
1212
|
return _segmentedControl().SegmentedControlProps;
|
|
1271
1213
|
}
|
|
1272
1214
|
});
|
|
1273
|
-
Object.defineProperty(exports, "SharedTransition", {
|
|
1274
|
-
enumerable: true,
|
|
1275
|
-
get: function () {
|
|
1276
|
-
return _sharedTransition().default;
|
|
1277
|
-
}
|
|
1278
|
-
});
|
|
1279
1215
|
Object.defineProperty(exports, "SkeletonView", {
|
|
1280
1216
|
enumerable: true,
|
|
1281
1217
|
get: function () {
|
|
@@ -1660,12 +1596,6 @@ Object.defineProperty(exports, "asBaseComponent", {
|
|
|
1660
1596
|
return _new().asBaseComponent;
|
|
1661
1597
|
}
|
|
1662
1598
|
});
|
|
1663
|
-
Object.defineProperty(exports, "asPanViewConsumer", {
|
|
1664
|
-
enumerable: true,
|
|
1665
|
-
get: function () {
|
|
1666
|
-
return _asPanViewConsumer().default;
|
|
1667
|
-
}
|
|
1668
|
-
});
|
|
1669
1599
|
Object.defineProperty(exports, "forwardRef", {
|
|
1670
1600
|
enumerable: true,
|
|
1671
1601
|
get: function () {
|
|
@@ -2123,58 +2053,16 @@ function _pageControl() {
|
|
|
2123
2053
|
};
|
|
2124
2054
|
return data;
|
|
2125
2055
|
}
|
|
2126
|
-
function
|
|
2127
|
-
const data = _interopRequireWildcard(require("./components/
|
|
2128
|
-
|
|
2129
|
-
return data;
|
|
2130
|
-
};
|
|
2131
|
-
return data;
|
|
2132
|
-
}
|
|
2133
|
-
function _panGestureView() {
|
|
2134
|
-
const data = _interopRequireWildcard(require("./components/panningViews/panGestureView"));
|
|
2135
|
-
_panGestureView = function () {
|
|
2136
|
-
return data;
|
|
2137
|
-
};
|
|
2138
|
-
return data;
|
|
2139
|
-
}
|
|
2140
|
-
function _panListenerView() {
|
|
2141
|
-
const data = _interopRequireWildcard(require("./components/panningViews/panListenerView"));
|
|
2142
|
-
_panListenerView = function () {
|
|
2143
|
-
return data;
|
|
2144
|
-
};
|
|
2145
|
-
return data;
|
|
2146
|
-
}
|
|
2147
|
-
function _panningContext() {
|
|
2148
|
-
const data = _interopRequireDefault(require("./components/panningViews/panningContext"));
|
|
2149
|
-
_panningContext = function () {
|
|
2150
|
-
return data;
|
|
2151
|
-
};
|
|
2152
|
-
return data;
|
|
2153
|
-
}
|
|
2154
|
-
function _panningProvider() {
|
|
2155
|
-
const data = _interopRequireWildcard(require("./components/panningViews/panningProvider"));
|
|
2156
|
-
_panningProvider = function () {
|
|
2157
|
-
return data;
|
|
2158
|
-
};
|
|
2159
|
-
return data;
|
|
2160
|
-
}
|
|
2161
|
-
function _panResponderView() {
|
|
2162
|
-
const data = _interopRequireWildcard(require("./components/panningViews/panResponderView"));
|
|
2163
|
-
_panResponderView = function () {
|
|
2164
|
-
return data;
|
|
2165
|
-
};
|
|
2166
|
-
return data;
|
|
2167
|
-
}
|
|
2168
|
-
function _asPanViewConsumer() {
|
|
2169
|
-
const data = _interopRequireDefault(require("./components/panningViews/asPanViewConsumer"));
|
|
2170
|
-
_asPanViewConsumer = function () {
|
|
2056
|
+
function _picker() {
|
|
2057
|
+
const data = _interopRequireWildcard(require("./components/picker"));
|
|
2058
|
+
_picker = function () {
|
|
2171
2059
|
return data;
|
|
2172
2060
|
};
|
|
2173
2061
|
return data;
|
|
2174
2062
|
}
|
|
2175
|
-
function
|
|
2176
|
-
const data = _interopRequireWildcard(require("./components/
|
|
2177
|
-
|
|
2063
|
+
function _panView() {
|
|
2064
|
+
const data = _interopRequireWildcard(require("./components/panView"));
|
|
2065
|
+
_panView = function () {
|
|
2178
2066
|
return data;
|
|
2179
2067
|
};
|
|
2180
2068
|
return data;
|
|
@@ -2242,13 +2130,6 @@ function _segmentedControl() {
|
|
|
2242
2130
|
};
|
|
2243
2131
|
return data;
|
|
2244
2132
|
}
|
|
2245
|
-
function _sharedTransition() {
|
|
2246
|
-
const data = _interopRequireDefault(require("./components/sharedTransition"));
|
|
2247
|
-
_sharedTransition = function () {
|
|
2248
|
-
return data;
|
|
2249
|
-
};
|
|
2250
|
-
return data;
|
|
2251
|
-
}
|
|
2252
2133
|
function _skeletonView() {
|
|
2253
2134
|
const data = _interopRequireWildcard(require("./components/skeletonView"));
|
|
2254
2135
|
_skeletonView = function () {
|
|
@@ -2368,6 +2249,5 @@ function _WheelPicker() {
|
|
|
2368
2249
|
};
|
|
2369
2250
|
return data;
|
|
2370
2251
|
}
|
|
2371
|
-
function
|
|
2372
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
2252
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
2373
2253
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/src/testkit/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { TextDriver } from '../components/text/Text.driver.new';
|
|
|
10
10
|
export { TextFieldDriver } from '../components/textField/TextField.driver.new';
|
|
11
11
|
export { ViewDriver } from '../components/view/View.driver.new';
|
|
12
12
|
export { ModalDriver } from '../components/modal/Modal.driver.new';
|
|
13
|
-
export { DialogDriver } from '../
|
|
13
|
+
export { DialogDriver } from '../components/dialog/Dialog.driver.new';
|
|
14
14
|
export { ButtonDriver } from '../components/button/Button.driver.new';
|
|
15
15
|
export { ImageDriver } from '../components/image/Image.driver.new';
|
|
16
16
|
export { SwitchDriver } from '../components/switch/switch.driver';
|
package/src/testkit/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export { TextDriver } from "../components/text/Text.driver.new";
|
|
|
10
10
|
export { TextFieldDriver } from "../components/textField/TextField.driver.new";
|
|
11
11
|
export { ViewDriver } from "../components/view/View.driver.new";
|
|
12
12
|
export { ModalDriver } from "../components/modal/Modal.driver.new";
|
|
13
|
-
export { DialogDriver } from "../
|
|
13
|
+
export { DialogDriver } from "../components/dialog/Dialog.driver.new";
|
|
14
14
|
export { ButtonDriver } from "../components/button/Button.driver.new";
|
|
15
15
|
export { ImageDriver } from "../components/image/Image.driver.new";
|
|
16
16
|
export { SwitchDriver } from "../components/switch/switch.driver";
|
|
@@ -9,5 +9,8 @@ export interface ComponentDriverResult {
|
|
|
9
9
|
queryElement: () => ReactTestInstance | undefined;
|
|
10
10
|
exists: () => boolean;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type ComponentDriverOptions = {
|
|
13
|
+
includeHiddenElements?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const useComponentDriver: (props: ComponentProps, options?: ComponentDriverOptions) => ComponentDriverResult;
|
|
13
16
|
export declare const ComponentDriver: (props: ComponentProps) => ComponentDriverResult;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export const useComponentDriver = props => {
|
|
1
|
+
export const useComponentDriver = (props, options) => {
|
|
2
2
|
const {
|
|
3
3
|
renderTree,
|
|
4
4
|
testID
|
|
5
5
|
} = props;
|
|
6
6
|
const getElement = () => {
|
|
7
|
-
const elements = renderTree.queryAllByTestId(testID);
|
|
7
|
+
const elements = renderTree.queryAllByTestId(testID, options);
|
|
8
8
|
if (elements.length > 1) {
|
|
9
9
|
throw new Error(`Found more than one element with testID: ${testID}`);
|
|
10
10
|
}
|
|
@@ -16,7 +16,7 @@ export const useComponentDriver = props => {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
const queryElement = () => {
|
|
19
|
-
const elements = renderTree.queryAllByTestId(testID);
|
|
19
|
+
const elements = renderTree.queryAllByTestId(testID, options);
|
|
20
20
|
if (elements.length > 1) {
|
|
21
21
|
console.warn(`Found more than one element with testID: ${testID}`);
|
|
22
22
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import androidx.annotation.Nullable;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
|
7
|
-
import com.facebook.react.uimanager.UIBlock;
|
|
8
|
-
import com.facebook.react.uimanager.UIManagerModule;
|
|
9
|
-
import com.facebook.react.uimanager.UIViewOperationQueue;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* ¯\_(ツ)_/¯
|
|
13
|
-
*/
|
|
14
|
-
public class ReactHacks {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* {@link NativeViewHierarchyManager} is used to resolve a native view by RN tag ({@link NativeViewHierarchyManager#resolveView}). The only way of obtaining it is by
|
|
18
|
-
* posting {@link UIBlock} which can take a noticeable amount of time to execute.
|
|
19
|
-
*/
|
|
20
|
-
@Nullable
|
|
21
|
-
public static NativeViewHierarchyManager getNativeViewHierarchyManager(UIManagerModule uiManager) {
|
|
22
|
-
try {
|
|
23
|
-
UIViewOperationQueue mOperationsQueue = (UIViewOperationQueue) ReflectionUtils.getDeclaredField(uiManager.getUIImplementation(), "mOperationsQueue");
|
|
24
|
-
return (NativeViewHierarchyManager) ReflectionUtils.getDeclaredField(mOperationsQueue, "mNativeViewHierarchyManager");
|
|
25
|
-
} catch (Exception e) {
|
|
26
|
-
e.printStackTrace();
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.highlighterview;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import androidx.annotation.Nullable;
|
|
5
|
-
|
|
6
|
-
import java.lang.reflect.Field;
|
|
7
|
-
|
|
8
|
-
class ReflectionUtils {
|
|
9
|
-
|
|
10
|
-
@Nullable
|
|
11
|
-
static Object getDeclaredField(Object obj, String fieldName) {
|
|
12
|
-
try {
|
|
13
|
-
Field f = getField(obj.getClass(), fieldName);
|
|
14
|
-
if (f == null) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
f.setAccessible(true);
|
|
18
|
-
return f.get(obj);
|
|
19
|
-
} catch (Exception e) {
|
|
20
|
-
e.printStackTrace();
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
private static Field getField(Class clazz, String name) {
|
|
26
|
-
try {
|
|
27
|
-
return clazz.getDeclaredField(name);
|
|
28
|
-
} catch (NoSuchFieldException nsfe) {
|
|
29
|
-
return getField(clazz.getSuperclass(), name);
|
|
30
|
-
} catch (Exception e) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.textinput;
|
|
2
|
-
|
|
3
|
-
import android.text.Editable;
|
|
4
|
-
import android.text.InputType;
|
|
5
|
-
import android.text.method.KeyListener;
|
|
6
|
-
import android.view.KeyEvent;
|
|
7
|
-
import android.view.View;
|
|
8
|
-
|
|
9
|
-
class DefaultKeyListener implements KeyListener {
|
|
10
|
-
@Override
|
|
11
|
-
public int getInputType() {
|
|
12
|
-
return InputType.TYPE_NULL;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Override
|
|
16
|
-
public boolean onKeyDown(View view, Editable text, int keyCode, KeyEvent event) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@Override
|
|
21
|
-
public boolean onKeyUp(View view, Editable text, int keyCode, KeyEvent event) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@Override
|
|
26
|
-
public boolean onKeyOther(View view, Editable text, KeyEvent event) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
public void clearMetaKeyState(View view, Editable content, int states) {
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.textinput;
|
|
2
|
-
|
|
3
|
-
import android.text.Editable;
|
|
4
|
-
import android.text.method.KeyListener;
|
|
5
|
-
import android.view.KeyEvent;
|
|
6
|
-
import android.view.View;
|
|
7
|
-
|
|
8
|
-
import com.facebook.react.bridge.Arguments;
|
|
9
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
10
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
11
|
-
|
|
12
|
-
public class KeyListenerProxy implements KeyListener {
|
|
13
|
-
|
|
14
|
-
final private ReactApplicationContext mContext;
|
|
15
|
-
final private KeyListener mKeyListener;
|
|
16
|
-
|
|
17
|
-
KeyListenerProxy(ReactApplicationContext context, KeyListener keyListener) {
|
|
18
|
-
mContext = context;
|
|
19
|
-
mKeyListener = keyListener == null ? new DefaultKeyListener() : keyListener;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@Override
|
|
23
|
-
public int getInputType() {
|
|
24
|
-
return mKeyListener.getInputType();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@Override
|
|
28
|
-
public boolean onKeyDown(View view, Editable text, int keyCode, KeyEvent event) {
|
|
29
|
-
return mKeyListener.onKeyDown(view, text, keyCode, event);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@Override
|
|
33
|
-
public boolean onKeyUp(View view, Editable text, int keyCode, KeyEvent event) {
|
|
34
|
-
if (keyCode == KeyEvent.KEYCODE_DEL) {
|
|
35
|
-
emitBackspacePressEvent();
|
|
36
|
-
}
|
|
37
|
-
return mKeyListener.onKeyUp(view, text, keyCode, event);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@Override
|
|
41
|
-
public boolean onKeyOther(View view, Editable text, KeyEvent event) {
|
|
42
|
-
return mKeyListener.onKeyOther(view, text, event);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Override
|
|
46
|
-
public void clearMetaKeyState(View view, Editable content, int states) {
|
|
47
|
-
mKeyListener.clearMetaKeyState(view, content, states);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private void emitBackspacePressEvent() {
|
|
51
|
-
mContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("onBackspacePress", Arguments.createMap());
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib.textinput;
|
|
2
|
-
|
|
3
|
-
import android.util.Log;
|
|
4
|
-
import android.view.View;
|
|
5
|
-
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
8
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
9
|
-
import com.facebook.react.uimanager.IllegalViewOperationException;
|
|
10
|
-
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
|
11
|
-
import com.facebook.react.uimanager.UIBlock;
|
|
12
|
-
import com.facebook.react.uimanager.UIManagerModule;
|
|
13
|
-
import com.facebook.react.views.textinput.ReactEditText;
|
|
14
|
-
|
|
15
|
-
public class TextInputDelKeyHandlerModule extends ReactContextBaseJavaModule {
|
|
16
|
-
|
|
17
|
-
private final static String REACT_CLASS = "TextInputDelKeyHandler";
|
|
18
|
-
|
|
19
|
-
TextInputDelKeyHandlerModule(ReactApplicationContext reactContext) {
|
|
20
|
-
super(reactContext);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@Override
|
|
24
|
-
public String getName() {
|
|
25
|
-
return REACT_CLASS;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@ReactMethod
|
|
29
|
-
public void register(final Integer textInputTag) {
|
|
30
|
-
final ReactApplicationContext reactContext = this.getReactApplicationContext();
|
|
31
|
-
final UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
|
|
32
|
-
|
|
33
|
-
uiManager.addUIBlock(new UIBlock() {
|
|
34
|
-
public void execute(NativeViewHierarchyManager viewHierarchyManager) {
|
|
35
|
-
Log.d("ReactNativeJS","registering tag = " + textInputTag);
|
|
36
|
-
final View view;
|
|
37
|
-
try {
|
|
38
|
-
view = viewHierarchyManager.resolveView(textInputTag);
|
|
39
|
-
} catch (IllegalViewOperationException e) {
|
|
40
|
-
Log.d("ReactNativeJS","no view for tag = " + textInputTag);
|
|
41
|
-
e.printStackTrace();
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
final ReactEditText editText = ViewUtils.getEditTextInView(view);
|
|
45
|
-
|
|
46
|
-
if (editText != null) {
|
|
47
|
-
Log.d("ReactNativeJS","has editText for tag = " + textInputTag);
|
|
48
|
-
final KeyListenerProxy keyListenerProxy = new KeyListenerProxy(reactContext, editText.getKeyListener());
|
|
49
|
-
editText.setKeyListener(keyListenerProxy);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|