react-native-ui-lib 8.1.8-snapshot.7613 → 8.1.8-snapshot.7626
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/lib/components/HighlighterOverlayView/index.d.ts +2 -2
- package/lib/components/HighlighterOverlayView/index.web.d.ts +2 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.ts +1 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.ts +2 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/index.js +3 -1
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.js +3 -1
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.ts +1 -1
- package/lib/components/Keyboard/index.d.ts +1 -1
- package/lib/package.json +3 -4
- package/package.json +17 -19
- package/src/commons/asBaseComponent.js +2 -1
- package/src/commons/baseComponent.js +0 -8
- package/src/commons/forwardRef.js +0 -5
- package/src/commons/modifiers.d.ts +0 -6
- package/src/commons/modifiers.js +0 -18
- package/src/commons/withScrollEnabler.js +0 -4
- package/src/commons/withScrollReached.js +0 -4
- package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +0 -7
- package/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +0 -6
- package/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +0 -6
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +2 -2
- package/src/components/WheelPicker/index.d.ts +2 -2
- package/src/components/WheelPicker/index.js +1 -1
- package/src/components/WheelPicker/usePresenter.d.ts +1 -1
- package/src/components/actionSheet/index.d.ts +1 -1
- package/src/components/animatedImage/index.d.ts +1 -1
- package/src/components/animatedScanner/index.js +0 -37
- package/src/components/avatar/index.d.ts +1 -1
- package/src/components/badge/index.d.ts +4 -4
- package/src/components/baseInput/index.d.ts +0 -1
- package/src/components/baseInput/index.js +1 -49
- package/src/components/button/index.d.ts +4 -4
- package/src/components/button/types.d.ts +2 -2
- package/src/components/carousel/index.d.ts +8 -8
- package/src/components/carousel/types.d.ts +4 -1
- package/src/components/carousel/types.js +0 -2
- package/src/components/chip/index.d.ts +1 -1
- package/src/components/colorPalette/index.d.ts +1 -1
- package/src/components/dateTimePicker/index.d.ts +2 -2
- package/src/components/dateTimePicker/index.js +2 -2
- package/src/components/dialog/types.d.ts +4 -4
- package/src/components/drawer/index.d.ts +1 -1
- package/src/components/expandableSection/index.d.ts +2 -2
- package/src/components/fadedScrollView/index.js +1 -1
- package/src/components/featureHighlight/index.js +5 -7
- package/src/components/gridListItem/index.d.ts +7 -7
- package/src/components/gridView/index.d.ts +1 -1
- package/src/components/hint/HintBubble.d.ts +1 -1
- package/src/components/hint/HintOld.d.ts +10 -10
- package/src/components/hint/hooks/useHintLayout.d.ts +1 -1
- package/src/components/hint/index.d.ts +2 -2
- package/src/components/hint/types.d.ts +2 -2
- package/src/components/icon/index.js +0 -3
- package/src/components/image/index.d.ts +1 -1
- package/src/components/image/index.js +20 -17
- package/src/components/loaderScreen/index.d.ts +1 -1
- package/src/components/loaderScreen/types.d.ts +1 -1
- package/src/components/maskedInput/index.d.ts +21 -4
- package/src/components/maskedInput/index.js +78 -16
- package/src/components/maskedInput/maskedInput.api.json +0 -1
- package/src/components/modal/index.d.ts +3 -3
- package/src/components/numberInput/index.js +2 -2
- package/src/components/overlay/index.d.ts +1 -1
- package/src/components/picker/PickerDialog.android.js +0 -15
- package/src/components/picker/PickerDialog.js +0 -7
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +1 -1
- package/src/components/picker/helpers/useImperativePickerHandle.js +1 -1
- package/src/components/picker/types.d.ts +9 -9
- package/src/components/progressBar/index.d.ts +2 -2
- package/src/components/scrollBar/index.d.ts +11 -4
- package/src/components/searchInput/index.js +1 -1
- package/src/components/searchInput/types.d.ts +2 -2
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +2 -2
- package/src/components/skeletonView/index.d.ts +4 -4
- package/src/components/slider/Thumb.d.ts +1 -1
- package/src/components/slider/types.d.ts +1 -1
- package/src/components/stackAggregator/index.d.ts +1 -1
- package/src/components/tabController/TabBarItem.d.ts +2 -2
- package/src/components/tabController/TabBarItem.js +1 -1
- package/src/components/tabController/TabPage.d.ts +2 -2
- package/src/components/tabController/useScrollToItem.d.ts +1 -1
- package/src/components/text/Text.driver.d.ts +1 -1
- package/src/components/textArea/index.js +0 -6
- package/src/components/textField/index.js +22 -1
- package/src/components/textField/types.d.ts +4 -4
- package/src/components/textField/useImperativeInputHandle.d.ts +1 -1
- package/src/components/textField/useImperativeInputHandle.js +1 -1
- package/src/components/textField/usePreset.d.ts +20 -20
- package/src/components/timeline/index.js +1 -1
- package/src/components/toast/index.js +0 -69
- package/src/components/view/index.js +2 -5
- package/src/components/wizard/index.d.ts +1 -1
- package/src/components/wizard/types.d.ts +1 -1
- package/src/components/wizard/wizard.api.json +1 -1
- package/src/hooks/useCombinedRefs/index.js +1 -2
- package/src/hooks/useDebounce/index.js +1 -1
- package/src/hooks/useHiddenLocation/index.js +2 -2
- package/src/hooks/useHiddenLocation/index.web.js +2 -2
- package/src/hooks/useMeasure/index.d.ts +1 -1
- package/src/hooks/useMeasure/index.js +1 -1
- package/src/hooks/useScrollTo/index.d.ts +2 -2
- package/src/incubator/calendar/index.js +1 -1
- package/src/incubator/calendar/types.d.ts +2 -2
- package/src/incubator/expandableOverlay/index.d.ts +2 -2
- package/src/incubator/slider/Track.d.ts +1 -1
- package/src/incubator/slider/index.d.ts +1 -1
- package/src/incubator/toast/helpers/useToastTimer.js +1 -1
- package/src/incubator/toast/index.js +1 -1
- package/src/incubator/toast/types.d.ts +2 -2
- package/src/testkit/Component.driver.d.ts +1 -1
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +1 -1
- package/src/typings/module.d.ts +12 -3
- package/ReactNativeUiLib.podspec +0 -22
- package/src/components/maskedInput/new.d.ts +0 -22
- package/src/components/maskedInput/new.js +0 -85
- package/src/components/maskedInput/old.js +0 -95
- package/src/components/textFieldOld/index.d.ts +0 -71
- package/src/components/textFieldOld/index.js +0 -807
- package/src/helpers/DocsGenerator.js +0 -61
- package/textFieldOld.d.ts +0 -2
- package/textFieldOld.js +0 -1
|
@@ -34,16 +34,14 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
34
34
|
children?: import("react").ReactNode;
|
|
35
35
|
style?: import("react-native/types").StyleProp<import("react-native/types").TextStyle>;
|
|
36
36
|
testID?: string | undefined;
|
|
37
|
-
removeClippedSubviews?: boolean | undefined;
|
|
38
|
-
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
39
|
-
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
40
|
-
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
41
37
|
scrollEnabled?: boolean | undefined;
|
|
38
|
+
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
39
|
+
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
42
40
|
hitSlop?: number | import("react-native/types").Insets | null | undefined;
|
|
43
41
|
id?: string | undefined;
|
|
44
42
|
needsOffscreenAlphaCompositing?: boolean | undefined;
|
|
43
|
+
removeClippedSubviews?: boolean | undefined;
|
|
45
44
|
nativeID?: string | undefined;
|
|
46
|
-
experimental_layoutConformance?: "strict" | "classic" | undefined;
|
|
47
45
|
collapsable?: boolean | undefined;
|
|
48
46
|
collapsableChildren?: boolean | undefined;
|
|
49
47
|
renderToHardwareTextureAndroid?: boolean | undefined;
|
|
@@ -154,6 +152,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
154
152
|
onEndEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputEndEditingEventData>) => void) | undefined;
|
|
155
153
|
onSelectionChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSelectionChangeEventData>) => void) | undefined;
|
|
156
154
|
onSubmitEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSubmitEditingEventData>) => void) | undefined;
|
|
155
|
+
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
157
156
|
onKeyPress?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputKeyPressEventData>) => void) | undefined;
|
|
158
157
|
placeholder?: string | undefined;
|
|
159
158
|
readOnly?: boolean | undefined;
|
|
@@ -162,6 +161,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
162
161
|
secureTextEntry?: boolean | undefined;
|
|
163
162
|
selectTextOnFocus?: boolean | undefined;
|
|
164
163
|
inputAccessoryViewID?: string | undefined;
|
|
164
|
+
disableKeyboardShortcuts?: boolean | undefined;
|
|
165
165
|
clearButtonMode?: "always" | "never" | "while-editing" | "unless-editing" | undefined;
|
|
166
166
|
clearTextOnFocus?: boolean | undefined;
|
|
167
167
|
dataDetectorTypes?: import("react-native/types").DataDetectorTypes | import("react-native/types").DataDetectorTypes[] | undefined;
|
|
@@ -505,16 +505,14 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
505
505
|
children?: import("react").ReactNode;
|
|
506
506
|
style?: import("react-native/types").StyleProp<import("react-native/types").TextStyle>;
|
|
507
507
|
testID?: string | undefined;
|
|
508
|
-
removeClippedSubviews?: boolean | undefined;
|
|
509
|
-
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
510
|
-
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
511
|
-
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
512
508
|
scrollEnabled?: boolean | undefined;
|
|
509
|
+
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
510
|
+
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
513
511
|
hitSlop?: number | import("react-native/types").Insets | null | undefined;
|
|
514
512
|
id?: string | undefined;
|
|
515
513
|
needsOffscreenAlphaCompositing?: boolean | undefined;
|
|
514
|
+
removeClippedSubviews?: boolean | undefined;
|
|
516
515
|
nativeID?: string | undefined;
|
|
517
|
-
experimental_layoutConformance?: "strict" | "classic" | undefined;
|
|
518
516
|
collapsable?: boolean | undefined;
|
|
519
517
|
collapsableChildren?: boolean | undefined;
|
|
520
518
|
renderToHardwareTextureAndroid?: boolean | undefined;
|
|
@@ -625,6 +623,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
625
623
|
onEndEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputEndEditingEventData>) => void) | undefined;
|
|
626
624
|
onSelectionChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSelectionChangeEventData>) => void) | undefined;
|
|
627
625
|
onSubmitEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSubmitEditingEventData>) => void) | undefined;
|
|
626
|
+
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
628
627
|
onKeyPress?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputKeyPressEventData>) => void) | undefined;
|
|
629
628
|
placeholder?: string | undefined;
|
|
630
629
|
readOnly?: boolean | undefined;
|
|
@@ -633,6 +632,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
633
632
|
secureTextEntry?: boolean | undefined;
|
|
634
633
|
selectTextOnFocus?: boolean | undefined;
|
|
635
634
|
inputAccessoryViewID?: string | undefined;
|
|
635
|
+
disableKeyboardShortcuts?: boolean | undefined;
|
|
636
636
|
clearButtonMode?: "always" | "never" | "while-editing" | "unless-editing" | undefined;
|
|
637
637
|
clearTextOnFocus?: boolean | undefined;
|
|
638
638
|
dataDetectorTypes?: import("react-native/types").DataDetectorTypes | import("react-native/types").DataDetectorTypes[] | undefined;
|
|
@@ -992,16 +992,14 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
992
992
|
children?: import("react").ReactNode;
|
|
993
993
|
style: false | "" | import("react-native/types").TextStyle | import("react-native/types").RegisteredStyle<import("react-native/types").TextStyle> | import("react-native/types").RecursiveArray<import("react-native/types").TextStyle | import("react-native/types").Falsy | import("react-native/types").RegisteredStyle<import("react-native/types").TextStyle>> | null;
|
|
994
994
|
testID?: string | undefined;
|
|
995
|
-
removeClippedSubviews?: boolean | undefined;
|
|
996
|
-
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
997
|
-
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
998
|
-
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
999
995
|
scrollEnabled?: boolean | undefined;
|
|
996
|
+
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
997
|
+
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
1000
998
|
hitSlop?: number | import("react-native/types").Insets | null | undefined;
|
|
1001
999
|
id?: string | undefined;
|
|
1002
1000
|
needsOffscreenAlphaCompositing?: boolean | undefined;
|
|
1001
|
+
removeClippedSubviews?: boolean | undefined;
|
|
1003
1002
|
nativeID?: string | undefined;
|
|
1004
|
-
experimental_layoutConformance?: "strict" | "classic" | undefined;
|
|
1005
1003
|
collapsable?: boolean | undefined;
|
|
1006
1004
|
collapsableChildren?: boolean | undefined;
|
|
1007
1005
|
renderToHardwareTextureAndroid?: boolean | undefined;
|
|
@@ -1112,6 +1110,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
1112
1110
|
onEndEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputEndEditingEventData>) => void) | undefined;
|
|
1113
1111
|
onSelectionChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSelectionChangeEventData>) => void) | undefined;
|
|
1114
1112
|
onSubmitEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSubmitEditingEventData>) => void) | undefined;
|
|
1113
|
+
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
1115
1114
|
onKeyPress?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputKeyPressEventData>) => void) | undefined;
|
|
1116
1115
|
placeholder?: string | undefined;
|
|
1117
1116
|
readOnly?: boolean | undefined;
|
|
@@ -1120,6 +1119,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
1120
1119
|
secureTextEntry?: boolean | undefined;
|
|
1121
1120
|
selectTextOnFocus?: boolean | undefined;
|
|
1122
1121
|
inputAccessoryViewID?: string | undefined;
|
|
1122
|
+
disableKeyboardShortcuts?: boolean | undefined;
|
|
1123
1123
|
clearButtonMode?: "always" | "never" | "while-editing" | "unless-editing" | undefined;
|
|
1124
1124
|
clearTextOnFocus?: boolean | undefined;
|
|
1125
1125
|
dataDetectorTypes?: import("react-native/types").DataDetectorTypes | import("react-native/types").DataDetectorTypes[] | undefined;
|
|
@@ -1490,16 +1490,14 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
1490
1490
|
children?: import("react").ReactNode;
|
|
1491
1491
|
style: false | "" | import("react-native/types").TextStyle | import("react-native/types").RegisteredStyle<import("react-native/types").TextStyle> | import("react-native/types").RecursiveArray<import("react-native/types").TextStyle | import("react-native/types").Falsy | import("react-native/types").RegisteredStyle<import("react-native/types").TextStyle>> | null;
|
|
1492
1492
|
testID?: string | undefined;
|
|
1493
|
-
removeClippedSubviews?: boolean | undefined;
|
|
1494
|
-
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
1495
|
-
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
1496
|
-
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
1497
1493
|
scrollEnabled?: boolean | undefined;
|
|
1494
|
+
onContentSizeChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputContentSizeChangeEventData>) => void) | undefined;
|
|
1495
|
+
onLayout?: ((event: import("react-native/types").LayoutChangeEvent) => void) | undefined;
|
|
1498
1496
|
hitSlop?: number | import("react-native/types").Insets | null | undefined;
|
|
1499
1497
|
id?: string | undefined;
|
|
1500
1498
|
needsOffscreenAlphaCompositing?: boolean | undefined;
|
|
1499
|
+
removeClippedSubviews?: boolean | undefined;
|
|
1501
1500
|
nativeID?: string | undefined;
|
|
1502
|
-
experimental_layoutConformance?: "strict" | "classic" | undefined;
|
|
1503
1501
|
collapsable?: boolean | undefined;
|
|
1504
1502
|
collapsableChildren?: boolean | undefined;
|
|
1505
1503
|
renderToHardwareTextureAndroid?: boolean | undefined;
|
|
@@ -1610,6 +1608,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
1610
1608
|
onEndEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputEndEditingEventData>) => void) | undefined;
|
|
1611
1609
|
onSelectionChange?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSelectionChangeEventData>) => void) | undefined;
|
|
1612
1610
|
onSubmitEditing?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputSubmitEditingEventData>) => void) | undefined;
|
|
1611
|
+
onScroll?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputScrollEventData>) => void) | undefined;
|
|
1613
1612
|
onKeyPress?: ((e: import("react-native/types").NativeSyntheticEvent<import("react-native/types").TextInputKeyPressEventData>) => void) | undefined;
|
|
1614
1613
|
placeholder?: string | undefined;
|
|
1615
1614
|
readOnly?: boolean | undefined;
|
|
@@ -1618,6 +1617,7 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
|
|
|
1618
1617
|
secureTextEntry?: boolean | undefined;
|
|
1619
1618
|
selectTextOnFocus?: boolean | undefined;
|
|
1620
1619
|
inputAccessoryViewID?: string | undefined;
|
|
1620
|
+
disableKeyboardShortcuts?: boolean | undefined;
|
|
1621
1621
|
clearButtonMode?: "always" | "never" | "while-editing" | "unless-editing" | undefined;
|
|
1622
1622
|
clearTextOnFocus?: boolean | undefined;
|
|
1623
1623
|
dataDetectorTypes?: import("react-native/types").DataDetectorTypes | import("react-native/types").DataDetectorTypes[] | undefined;
|
|
@@ -21,7 +21,7 @@ const Timeline = props => {
|
|
|
21
21
|
const [anchorMeasurements, setAnchorMeasurements] = useState();
|
|
22
22
|
const [contentContainerMeasurements, setContentContainerMeasurements] = useState();
|
|
23
23
|
const [pointMeasurements, setPointMeasurements] = useState();
|
|
24
|
-
const contentContainerRef = useRef();
|
|
24
|
+
const contentContainerRef = useRef(undefined);
|
|
25
25
|
const onMeasure = (x, y, width, height) => {
|
|
26
26
|
setAnchorMeasurements({
|
|
27
27
|
x,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import {AccessibilityInfo, findNodeHandle, StyleSheet, Animated, Easing, ActivityIndicator} from 'react-native';
|
|
5
4
|
import {PureBaseComponent} from '../../commons';
|
|
@@ -21,74 +20,6 @@ const COLOR = Colors.white;
|
|
|
21
20
|
export default class Toast extends PureBaseComponent {
|
|
22
21
|
static displayName = 'Toast';
|
|
23
22
|
|
|
24
|
-
static propTypes = {
|
|
25
|
-
/**
|
|
26
|
-
* Whether to show or hide the toast
|
|
27
|
-
*/
|
|
28
|
-
visible: PropTypes.bool,
|
|
29
|
-
/**
|
|
30
|
-
* The position of the toast. 'top' or 'bottom'.
|
|
31
|
-
*/
|
|
32
|
-
position: PropTypes.oneOf(['top', 'bottom']),
|
|
33
|
-
/**
|
|
34
|
-
* custom zIndex for toast
|
|
35
|
-
*/
|
|
36
|
-
zIndex: PropTypes.number,
|
|
37
|
-
/**
|
|
38
|
-
* The background color of the toast
|
|
39
|
-
*/
|
|
40
|
-
backgroundColor: PropTypes.string,
|
|
41
|
-
/**
|
|
42
|
-
* the toast content color (message, actions labels)
|
|
43
|
-
*/
|
|
44
|
-
color: PropTypes.string,
|
|
45
|
-
/**
|
|
46
|
-
* the toast message
|
|
47
|
-
*/
|
|
48
|
-
message: PropTypes.string,
|
|
49
|
-
/**
|
|
50
|
-
* should message be centered in the toast
|
|
51
|
-
*/
|
|
52
|
-
centerMessage: PropTypes.bool,
|
|
53
|
-
/**
|
|
54
|
-
* a left icon
|
|
55
|
-
*/
|
|
56
|
-
icon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]),
|
|
57
|
-
/**
|
|
58
|
-
* a single action for the user
|
|
59
|
-
*/
|
|
60
|
-
action: PropTypes.shape(Button.propTypes),
|
|
61
|
-
/**
|
|
62
|
-
* should show a loader (showDismiss must be false)
|
|
63
|
-
*/
|
|
64
|
-
showLoader: PropTypes.bool,
|
|
65
|
-
/**
|
|
66
|
-
* callback for dismiss action
|
|
67
|
-
*/
|
|
68
|
-
onDismiss: PropTypes.func,
|
|
69
|
-
/**
|
|
70
|
-
* number of milliseconds to automatically invoke the onDismiss callback
|
|
71
|
-
*/
|
|
72
|
-
autoDismiss: PropTypes.number,
|
|
73
|
-
/**
|
|
74
|
-
* show dismiss action (right 'X' button)
|
|
75
|
-
*/
|
|
76
|
-
showDismiss: PropTypes.bool,
|
|
77
|
-
/**
|
|
78
|
-
* callback for end of component animation
|
|
79
|
-
*/
|
|
80
|
-
onAnimationEnd: PropTypes.func,
|
|
81
|
-
/**
|
|
82
|
-
* render a custom view that will appear permanently above or below a Toast,
|
|
83
|
-
* depends on the Toast's position, and animate with it when the Toast is made visible or dismissed
|
|
84
|
-
*/
|
|
85
|
-
renderAttachment: PropTypes.elementType,
|
|
86
|
-
/**
|
|
87
|
-
* render a custom loader component instead of the default when passing showLoader
|
|
88
|
-
*/
|
|
89
|
-
customLoader: PropTypes.func
|
|
90
|
-
};
|
|
91
|
-
|
|
92
23
|
static defaultProps = {
|
|
93
24
|
position: 'top',
|
|
94
25
|
zIndex: 100
|
|
@@ -89,11 +89,8 @@ function View(props, ref) {
|
|
|
89
89
|
if (!ready) {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
return
|
|
93
|
-
//@ts-expect-error
|
|
94
|
-
<ViewContainer accessibilityElementsHidden={inaccessible} importantForAccessibility={inaccessible ? 'no-hide-descendants' : undefined} fsTagName={recorderTag} {...others} style={_style} ref={ref}>
|
|
92
|
+
return <ViewContainer accessibilityElementsHidden={inaccessible} importantForAccessibility={inaccessible ? 'no-hide-descendants' : undefined} fsTagName={recorderTag} {...others} style={_style} ref={ref}>
|
|
95
93
|
{children}
|
|
96
|
-
</ViewContainer
|
|
97
|
-
);
|
|
94
|
+
</ViewContainer>;
|
|
98
95
|
}
|
|
99
96
|
export default React.forwardRef(View);
|
|
@@ -24,7 +24,7 @@ declare class Wizard extends Component<WizardProps, State> {
|
|
|
24
24
|
componentWillUnmount(): void;
|
|
25
25
|
onOrientationChange: () => void;
|
|
26
26
|
getMaxWidth(): number;
|
|
27
|
-
renderChildren(): React.DetailedReactHTMLElement<
|
|
27
|
+
renderChildren(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLElement>, HTMLElement>[] | null | undefined;
|
|
28
28
|
render(): React.JSX.Element;
|
|
29
29
|
}
|
|
30
30
|
declare const _default: React.ForwardRefExoticComponent<WizardProps & React.RefAttributes<any>> & typeof Wizard;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
const useCombinedRefs = (...refs) => {
|
|
3
|
-
const targetRef = React.useRef();
|
|
3
|
+
const targetRef = React.useRef(undefined);
|
|
4
4
|
React.useEffect(() => {
|
|
5
5
|
refs.forEach(ref => {
|
|
6
6
|
if (!ref) {
|
|
@@ -9,7 +9,6 @@ const useCombinedRefs = (...refs) => {
|
|
|
9
9
|
if (typeof ref === 'function') {
|
|
10
10
|
ref(targetRef.current);
|
|
11
11
|
} else {
|
|
12
|
-
// @ts-expect-error
|
|
13
12
|
ref.current = targetRef.current;
|
|
14
13
|
}
|
|
15
14
|
});
|
|
@@ -4,7 +4,7 @@ import { useCallback, useRef } from 'react';
|
|
|
4
4
|
* This hook is used to debounce a function call
|
|
5
5
|
*/
|
|
6
6
|
function useDebounce(func, timeout = 300) {
|
|
7
|
-
const handler = useRef();
|
|
7
|
+
const handler = useRef(undefined);
|
|
8
8
|
const debouncedFunction = useCallback(args => {
|
|
9
9
|
if (handler.current) {
|
|
10
10
|
clearTimeout(handler.current);
|
|
@@ -20,8 +20,8 @@ export default function useHiddenLocation() {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
const [hiddenLocation, setHiddenLocation] = useState(getHiddenLocation({}));
|
|
23
|
-
const ref = useRef();
|
|
24
|
-
const layoutData = useRef();
|
|
23
|
+
const ref = useRef(undefined);
|
|
24
|
+
const layoutData = useRef(undefined);
|
|
25
25
|
const wasMeasured = useRef(wasMeasuredDefaultValue);
|
|
26
26
|
const measure = useCallback(() => {
|
|
27
27
|
if (ref.current && layoutData.current && layoutData.current.width > 0 && layoutData.current.height > 0) {
|
|
@@ -16,8 +16,8 @@ export default function useHiddenLocation() {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
const [hiddenLocation, setHiddenLocation] = useState(getHiddenLocation({}));
|
|
19
|
-
const ref = useRef();
|
|
20
|
-
const layoutData = useRef();
|
|
19
|
+
const ref = useRef(undefined);
|
|
20
|
+
const layoutData = useRef(undefined);
|
|
21
21
|
const wasMeasured = useRef(wasMeasuredDefaultValue);
|
|
22
22
|
const measure = useCallback(() => {
|
|
23
23
|
if (ref.current) {
|
|
@@ -9,7 +9,7 @@ interface Measurements {
|
|
|
9
9
|
pageY: number;
|
|
10
10
|
}
|
|
11
11
|
declare const _default: () => {
|
|
12
|
-
ref: import("react").
|
|
12
|
+
ref: import("react").RefObject<RNView | undefined>;
|
|
13
13
|
measurements: Measurements | undefined;
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
export default () => {
|
|
3
|
-
const ref = useRef();
|
|
3
|
+
const ref = useRef(undefined);
|
|
4
4
|
const [measurements, setMeasurements] = useState();
|
|
5
5
|
const onMeasure = (x, y, width, height, pageX, pageY) => {
|
|
6
6
|
setMeasurements({
|
|
@@ -5,7 +5,7 @@ export type ScrollToProps<T extends ScrollToSupportedViews> = {
|
|
|
5
5
|
/**
|
|
6
6
|
* A reference to the ScrollView (or FlatList) which the items are in
|
|
7
7
|
*/
|
|
8
|
-
scrollViewRef?: RefObject<T>;
|
|
8
|
+
scrollViewRef?: RefObject<T | null>;
|
|
9
9
|
/**
|
|
10
10
|
* Is the scroll view horizontal (default is true)
|
|
11
11
|
*/
|
|
@@ -15,7 +15,7 @@ export type ScrollToResultProps<T extends ScrollToSupportedViews> = {
|
|
|
15
15
|
/**
|
|
16
16
|
* A reference to the ScrollView (or FlatList) which the items are in (from the props or a created one)
|
|
17
17
|
*/
|
|
18
|
-
scrollViewRef: RefObject<T>;
|
|
18
|
+
scrollViewRef: RefObject<T | null>;
|
|
19
19
|
/**
|
|
20
20
|
* scrollTo callback.
|
|
21
21
|
* offset - the x or y to scroll to.
|
|
@@ -42,7 +42,7 @@ function Calendar(props) {
|
|
|
42
42
|
}
|
|
43
43
|
return -1;
|
|
44
44
|
}, [monthItems]);
|
|
45
|
-
const flashListRef = useRef();
|
|
45
|
+
const flashListRef = useRef(undefined);
|
|
46
46
|
const current = useSharedValue(new Date(initialDate).setHours(0, 0, 0, 0));
|
|
47
47
|
const initialMonthIndex = useRef(getItemIndex(current.value));
|
|
48
48
|
const lastUpdateSource = useSharedValue(UpdateSource.INIT);
|
|
@@ -111,8 +111,8 @@ export interface CalendarProps {
|
|
|
111
111
|
showExtraDays?: boolean;
|
|
112
112
|
}
|
|
113
113
|
export interface AgendaProps {
|
|
114
|
-
renderEvent?: (event: Event) => React.ReactElement | null;
|
|
115
|
-
renderHeader?: (header: DateSectionHeader) => React.ReactElement | null;
|
|
114
|
+
renderEvent?: (event: Event) => React.ReactElement<any> | null;
|
|
115
|
+
renderHeader?: (header: DateSectionHeader) => React.ReactElement<any> | null;
|
|
116
116
|
showLoader?: boolean;
|
|
117
117
|
onEndReached?: (date: number) => void;
|
|
118
118
|
}
|
|
@@ -14,7 +14,7 @@ export type ExpandableOverlayProps = TouchableOpacityProps & PropsWithChildren<{
|
|
|
14
14
|
/**
|
|
15
15
|
* The content to render inside the expandable modal/dialog
|
|
16
16
|
*/
|
|
17
|
-
expandableContent?: React.ReactElement
|
|
17
|
+
expandableContent?: React.ReactElement<any>;
|
|
18
18
|
/**
|
|
19
19
|
* Whether to use a dialog as expandable container (by default the container will be a full screen modal)
|
|
20
20
|
*/
|
|
@@ -38,7 +38,7 @@ export type ExpandableOverlayProps = TouchableOpacityProps & PropsWithChildren<{
|
|
|
38
38
|
/**
|
|
39
39
|
* A custom overlay to render instead of Modal or Dialog components
|
|
40
40
|
*/
|
|
41
|
-
renderCustomOverlay?: (props: RenderCustomOverlayProps) => React.ReactElement | undefined | null;
|
|
41
|
+
renderCustomOverlay?: (props: RenderCustomOverlayProps) => React.ReactElement<any> | undefined | null;
|
|
42
42
|
/**
|
|
43
43
|
* Disabled opening expandable overlay
|
|
44
44
|
*/
|
|
@@ -6,7 +6,7 @@ export interface Props extends ViewProps {
|
|
|
6
6
|
maximumTrackTintColor?: string;
|
|
7
7
|
minimumTrackTintColor?: string;
|
|
8
8
|
trackStyle?: StyleProp<ViewStyle>;
|
|
9
|
-
renderTrack?: () => ReactElement | ReactElement[];
|
|
9
|
+
renderTrack?: () => ReactElement<any> | ReactElement<any>[];
|
|
10
10
|
onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
|
11
11
|
}
|
|
12
12
|
declare const Track: (props: Props) => React.JSX.Element;
|
|
@@ -62,7 +62,7 @@ export interface SliderProps extends AccessibilityProps {
|
|
|
62
62
|
/**
|
|
63
63
|
* Custom render instead of rendering the track
|
|
64
64
|
*/
|
|
65
|
-
renderTrack?: () => ReactElement | ReactElement[];
|
|
65
|
+
renderTrack?: () => ReactElement<any> | ReactElement<any>[];
|
|
66
66
|
/**
|
|
67
67
|
* The thumb style
|
|
68
68
|
*/
|
|
@@ -43,7 +43,7 @@ const Toast = props => {
|
|
|
43
43
|
testID
|
|
44
44
|
} = props;
|
|
45
45
|
const directions = useRef([props.position === 'bottom' ? PanView.directions.DOWN : PanView.directions.UP, PanView.directions.LEFT, PanView.directions.RIGHT]);
|
|
46
|
-
const viewRef = useRef();
|
|
46
|
+
const viewRef = useRef(undefined);
|
|
47
47
|
const [toastHeight, setToastHeight] = useState();
|
|
48
48
|
const {
|
|
49
49
|
clearTimer,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode, type JSX } from 'react';
|
|
2
2
|
import { ImageSourcePropType, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
3
|
import { ButtonProps } from '../../components/button';
|
|
4
4
|
import { TextProps } from '../../components/text';
|
|
@@ -52,7 +52,7 @@ export interface ToastProps {
|
|
|
52
52
|
/**
|
|
53
53
|
* should show a loader
|
|
54
54
|
*/
|
|
55
|
-
loaderElement?: ReactElement
|
|
55
|
+
loaderElement?: ReactElement<any>;
|
|
56
56
|
/**
|
|
57
57
|
* callback for dismiss action
|
|
58
58
|
*/
|
package/src/typings/module.d.ts
CHANGED
|
@@ -3,11 +3,20 @@ declare namespace globalThis {
|
|
|
3
3
|
var _UILIB_TESTING: boolean;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
declare global {
|
|
7
|
+
// eslint-disable-next-line no-var
|
|
8
|
+
var _UILIB_TESTING: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
// This support importing png files, typing wise
|
|
7
12
|
declare module '*.png';
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
import 'react';
|
|
15
|
+
|
|
16
|
+
declare module 'react' {
|
|
17
|
+
namespace JSX {
|
|
18
|
+
interface IntrinsicAttributes {
|
|
19
|
+
fsTagName?: string;
|
|
20
|
+
}
|
|
12
21
|
}
|
|
13
22
|
}
|
package/ReactNativeUiLib.podspec
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, 'lib/package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "ReactNativeUiLib"
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = "React Native UI Library"
|
|
9
|
-
|
|
10
|
-
s.authors = "Wix.com"
|
|
11
|
-
s.homepage = package['homepage']
|
|
12
|
-
s.license = package['license']
|
|
13
|
-
s.platforms = { :ios => "9.0", :tvos => "9.2" }
|
|
14
|
-
|
|
15
|
-
s.module_name = 'ReactNativeUiLib'
|
|
16
|
-
|
|
17
|
-
s.source = { :git => "https://github.com/wix/react-native-ui-lib.git", :tag => "#{s.version}" }
|
|
18
|
-
s.source_files = "lib/ios/**/*.{h,m}"
|
|
19
|
-
|
|
20
|
-
s.dependency 'React'
|
|
21
|
-
s.frameworks = 'UIKit'
|
|
22
|
-
end
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextInputProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
export interface MaskedInputProps extends Omit<TextInputProps, 'value'> {
|
|
4
|
-
/**
|
|
5
|
-
* Initial value to pass to masked input
|
|
6
|
-
*/
|
|
7
|
-
initialValue?: string;
|
|
8
|
-
/**
|
|
9
|
-
* callback for rendering the custom input out of the value returns from the actual input
|
|
10
|
-
*/
|
|
11
|
-
renderMaskedText?: (value?: string) => JSX.Element | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Custom formatter for the input value
|
|
14
|
-
*/
|
|
15
|
-
formatter?: (value?: string) => string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* container style for the masked input container
|
|
18
|
-
*/
|
|
19
|
-
containerStyle?: StyleProp<ViewStyle>;
|
|
20
|
-
}
|
|
21
|
-
declare const _default: React.ForwardRefExoticComponent<MaskedInputProps & React.RefAttributes<any>>;
|
|
22
|
-
export default _default;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import _isFunction from "lodash/isFunction";
|
|
2
|
-
import _identity from "lodash/identity";
|
|
3
|
-
import React, { useCallback, useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
|
|
4
|
-
import { StyleSheet, Keyboard, TextInput } from 'react-native';
|
|
5
|
-
import View from "../view";
|
|
6
|
-
import Text from "../text";
|
|
7
|
-
import TouchableOpacity from "../touchableOpacity";
|
|
8
|
-
/**
|
|
9
|
-
* @description: Mask Input to create custom looking inputs with custom formats
|
|
10
|
-
* @gif: https://camo.githubusercontent.com/61eedb65e968845d5eac713dcd21a69691571fb1/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f4b5a5a7446666f486f454b334b2f67697068792e676966
|
|
11
|
-
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/MaskedInputScreen.tsx
|
|
12
|
-
*/
|
|
13
|
-
function MaskedInput(props, ref) {
|
|
14
|
-
const {
|
|
15
|
-
initialValue,
|
|
16
|
-
formatter = _identity,
|
|
17
|
-
containerStyle,
|
|
18
|
-
renderMaskedText,
|
|
19
|
-
onChangeText,
|
|
20
|
-
...others
|
|
21
|
-
} = props;
|
|
22
|
-
const [value, setValue] = useState(initialValue);
|
|
23
|
-
const inputRef = useRef();
|
|
24
|
-
const keyboardDidHideListener = useRef();
|
|
25
|
-
useImperativeHandle(ref, () => {
|
|
26
|
-
return {
|
|
27
|
-
isFocused: () => inputRef.current?.isFocused(),
|
|
28
|
-
focus,
|
|
29
|
-
blur: () => inputRef.current?.blur(),
|
|
30
|
-
clear: () => {
|
|
31
|
-
inputRef.current?.clear();
|
|
32
|
-
setValue('');
|
|
33
|
-
// NOTE: This fixes an RN issue - when triggering imperative clear method, it doesn't call onChangeText
|
|
34
|
-
onChangeText?.('');
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
if (initialValue !== value) {
|
|
40
|
-
setValue(initialValue);
|
|
41
|
-
}
|
|
42
|
-
}, [initialValue]);
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
keyboardDidHideListener.current = Keyboard.addListener('keyboardDidHide', () => {
|
|
45
|
-
if (inputRef.current?.isFocused()) {
|
|
46
|
-
inputRef.current?.blur();
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return () => keyboardDidHideListener.current.remove();
|
|
50
|
-
}, []);
|
|
51
|
-
const _onChangeText = useCallback(value => {
|
|
52
|
-
const formattedValue = formatter(value) ?? '';
|
|
53
|
-
setValue(formattedValue);
|
|
54
|
-
onChangeText?.(formattedValue);
|
|
55
|
-
}, [onChangeText, formatter]);
|
|
56
|
-
const focus = useCallback(() => {
|
|
57
|
-
inputRef.current?.focus();
|
|
58
|
-
}, []);
|
|
59
|
-
const _renderMaskedText = () => {
|
|
60
|
-
if (_isFunction(renderMaskedText)) {
|
|
61
|
-
return renderMaskedText(value);
|
|
62
|
-
}
|
|
63
|
-
return <Text>{value}</Text>;
|
|
64
|
-
};
|
|
65
|
-
return <TouchableOpacity style={containerStyle} activeOpacity={1} onPress={focus}>
|
|
66
|
-
<TextInput {...others} value={value}
|
|
67
|
-
// @ts-expect-error
|
|
68
|
-
ref={inputRef} style={styles.hiddenInput} enableErrors={false} hideUnderline placeholder="" caretHidden multiline={false} onChangeText={_onChangeText} />
|
|
69
|
-
<View style={styles.maskedInputWrapper}>{_renderMaskedText()}</View>
|
|
70
|
-
</TouchableOpacity>;
|
|
71
|
-
}
|
|
72
|
-
const styles = StyleSheet.create({
|
|
73
|
-
hiddenInput: {
|
|
74
|
-
...StyleSheet.absoluteFillObject,
|
|
75
|
-
zIndex: 1,
|
|
76
|
-
color: 'transparent',
|
|
77
|
-
backgroundColor: 'transparent',
|
|
78
|
-
height: undefined
|
|
79
|
-
},
|
|
80
|
-
maskedInputWrapper: {
|
|
81
|
-
zIndex: 0
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
MaskedInput.displayName = 'MaskedInput';
|
|
85
|
-
export default forwardRef(MaskedInput);
|