react-native-ui-lib 8.5.1 → 8.5.2-snapshot.8005
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/KeyboardRegistry/index.js +5 -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 +6 -2
- package/lib/components/Keyboard/KeyboardTrackingView/index.js +5 -4
- package/lib/components/Keyboard/index.d.ts +2 -1
- package/lib/package.json +20 -21
- package/lib/react-native.config.js +1 -1
- package/package.json +161 -164
- package/src/commons/asBaseComponent.js +2 -1
- package/src/commons/baseComponent.js +0 -8
- package/src/commons/forwardRef.js +1 -4
- 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 -0
- 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/checkbox/index.d.ts +1 -1
- package/src/components/chip/index.d.ts +1 -1
- package/src/components/colorPalette/index.d.ts +1 -1
- package/src/components/colorPicker/ColorPickerPresenter.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/dialog/useDialogContent.d.ts +1 -1
- 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 +7 -5
- 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/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 +36 -36
- package/src/components/timeline/index.js +1 -1
- package/src/components/toast/index.js +0 -69
- 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/helpers/AvatarHelper.d.ts +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/index.d.ts +1 -0
- package/src/incubator/index.js +2 -1
- package/src/{components → incubator}/marquee/index.js +2 -2
- package/src/{components → incubator}/marquee/marquee.api.json +1 -1
- package/src/{components → incubator}/marquee/types.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/index.d.ts +1 -2
- package/src/index.js +4 -18
- package/src/testkit/Component.driver.d.ts +1 -0
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +1 -0
- package/src/typings/module.d.ts +12 -3
- package/ReactNativeUiLib.podspec +0 -22
- package/marquee.d.ts +0 -2
- package/marquee.js +0 -1
- 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
- /package/src/{components → incubator}/marquee/index.d.ts +0 -0
- /package/src/{components → incubator}/marquee/types.js +0 -0
|
@@ -2,7 +2,7 @@ export declare function getInitialsTypography(size: number): import("react-nativ
|
|
|
2
2
|
export declare function hashStringToNumber(str?: string): number;
|
|
3
3
|
export declare function getAvatarColors(): string[];
|
|
4
4
|
export declare function getColorById(id: string, avatarColors?: string[]): string;
|
|
5
|
-
export declare function getInitials(name?: string, limit?: number):
|
|
5
|
+
export declare function getInitials(name?: string, limit?: number): string;
|
|
6
6
|
export declare function getBackgroundColor(name?: string, avatarColors?: string[], hashFunction?: (name?: string) => number, defaultColor?: string): string | undefined;
|
|
7
7
|
export declare function isGravatarUrl(url: string): boolean;
|
|
8
8
|
export declare function isBlankGravatarUrl(url: string): boolean;
|
|
@@ -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
|
*/
|
package/src/incubator/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { default as Slider, SliderRef, SliderProps } from './slider';
|
|
|
7
7
|
export { default as ChipsInput, ChipsInputProps, ChipsInputChangeReason, ChipsInputChipProps } from '../components/chipsInput';
|
|
8
8
|
export { default as WheelPicker, WheelPickerProps, WheelPickerItemProps, WheelPickerAlign, WheelPickerItemValue } from '../components/WheelPicker';
|
|
9
9
|
export { default as Gradient, GradientProps } from './gradient';
|
|
10
|
+
export { default as Marquee, MarqueeDirections, MarqueeProps } from './marquee';
|
package/src/incubator/index.js
CHANGED
|
@@ -8,4 +8,5 @@ export { default as Slider, SliderRef, SliderProps } from "./slider";
|
|
|
8
8
|
// TODO: delete exports after fully removing from private
|
|
9
9
|
export { default as ChipsInput, ChipsInputProps, ChipsInputChangeReason, ChipsInputChipProps } from "../components/chipsInput";
|
|
10
10
|
export { default as WheelPicker, WheelPickerProps, WheelPickerItemProps, WheelPickerAlign, WheelPickerItemValue } from "../components/WheelPicker";
|
|
11
|
-
export { default as Gradient, GradientProps } from "./gradient";
|
|
11
|
+
export { default as Gradient, GradientProps } from "./gradient";
|
|
12
|
+
export { default as Marquee, MarqueeDirections, MarqueeProps } from "./marquee";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import { useSharedValue, useAnimatedStyle, withTiming, withRepeat, Easing } from 'react-native-reanimated';
|
|
4
|
-
import View from "
|
|
5
|
-
import Text from "
|
|
4
|
+
import View from "../../components/view";
|
|
5
|
+
import Text from "../../components/text";
|
|
6
6
|
import { MarqueeDirections, MarqueeProps } from "./types";
|
|
7
7
|
const DEFAULT_DURATION = 3000;
|
|
8
8
|
const DEFAULT_DURATION_PER_WORD = 250;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "Marquee",
|
|
3
3
|
"category": "media",
|
|
4
4
|
"description": "Marquee component for sliding text",
|
|
5
|
-
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/
|
|
5
|
+
"example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/IncubatorMarqueeScreen.tsx",
|
|
6
6
|
"props": [
|
|
7
7
|
{"name": "label", "type": "string", "description": "Marquee label"},
|
|
8
8
|
{"name": "labelStyle", "type": "TextProps['style']", "description": "Marquee label style"},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import { TextProps } from '
|
|
3
|
-
import { ViewProps } from '
|
|
2
|
+
import { TextProps } from '../../components/text';
|
|
3
|
+
import { ViewProps } from '../../components/view';
|
|
4
4
|
export declare enum MarqueeDirections {
|
|
5
5
|
RIGHT = "RIGHT",
|
|
6
6
|
LEFT = "LEFT",
|
|
@@ -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/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 } from './incubator';
|
|
9
|
+
export { ExpandableOverlayProps, ExpandableOverlayMethods, ToastProps, ToastPresets, MarqueeDirections, MarqueeProps } 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';
|
|
@@ -56,7 +56,6 @@ export { default as KeyboardAwareFlatList } from './components/KeyboardAwareScro
|
|
|
56
56
|
export { default as ListItem, ListItemProps } from './components/listItem';
|
|
57
57
|
export { default as LoaderScreen, LoaderScreenProps } from './components/loaderScreen';
|
|
58
58
|
export { default as MaskedInput, MaskedInputProps } from './components/maskedInput';
|
|
59
|
-
export { default as Marquee, MarqueeDirections, MarqueeProps } from './components/marquee';
|
|
60
59
|
export { default as Modal, ModalProps, ModalTopBarProps } from './components/modal';
|
|
61
60
|
export { default as NumberInput, NumberInputProps, NumberInputData } from './components/numberInput';
|
|
62
61
|
export { default as Overlay, OverlayTypes } from './components/overlay';
|
package/src/index.js
CHANGED
|
@@ -28,6 +28,8 @@ var _exportNames = {
|
|
|
28
28
|
ExpandableOverlayMethods: true,
|
|
29
29
|
ToastProps: true,
|
|
30
30
|
ToastPresets: true,
|
|
31
|
+
MarqueeDirections: true,
|
|
32
|
+
MarqueeProps: true,
|
|
31
33
|
Incubator: true,
|
|
32
34
|
Hooks: true,
|
|
33
35
|
Modifiers: true,
|
|
@@ -139,9 +141,6 @@ var _exportNames = {
|
|
|
139
141
|
LoaderScreenProps: true,
|
|
140
142
|
MaskedInput: true,
|
|
141
143
|
MaskedInputProps: true,
|
|
142
|
-
Marquee: true,
|
|
143
|
-
MarqueeDirections: true,
|
|
144
|
-
MarqueeProps: true,
|
|
145
144
|
Modal: true,
|
|
146
145
|
ModalProps: true,
|
|
147
146
|
ModalTopBarProps: true,
|
|
@@ -911,22 +910,16 @@ Object.defineProperty(exports, "MarginModifiers", {
|
|
|
911
910
|
return _new().MarginModifiers;
|
|
912
911
|
}
|
|
913
912
|
});
|
|
914
|
-
Object.defineProperty(exports, "Marquee", {
|
|
915
|
-
enumerable: true,
|
|
916
|
-
get: function () {
|
|
917
|
-
return _marquee().default;
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
913
|
Object.defineProperty(exports, "MarqueeDirections", {
|
|
921
914
|
enumerable: true,
|
|
922
915
|
get: function () {
|
|
923
|
-
return
|
|
916
|
+
return Incubator().MarqueeDirections;
|
|
924
917
|
}
|
|
925
918
|
});
|
|
926
919
|
Object.defineProperty(exports, "MarqueeProps", {
|
|
927
920
|
enumerable: true,
|
|
928
921
|
get: function () {
|
|
929
|
-
return
|
|
922
|
+
return Incubator().MarqueeProps;
|
|
930
923
|
}
|
|
931
924
|
});
|
|
932
925
|
Object.defineProperty(exports, "MaskedInput", {
|
|
@@ -2109,13 +2102,6 @@ function _maskedInput() {
|
|
|
2109
2102
|
};
|
|
2110
2103
|
return data;
|
|
2111
2104
|
}
|
|
2112
|
-
function _marquee() {
|
|
2113
|
-
const data = _interopRequireWildcard(require("./components/marquee"));
|
|
2114
|
-
_marquee = function () {
|
|
2115
|
-
return data;
|
|
2116
|
-
};
|
|
2117
|
-
return data;
|
|
2118
|
-
}
|
|
2119
2105
|
function _modal() {
|
|
2120
2106
|
const data = _interopRequireWildcard(require("./components/modal"));
|
|
2121
2107
|
_modal = function () {
|
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
|
package/marquee.d.ts
DELETED
package/marquee.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('./src/components/marquee').default;
|
|
@@ -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);
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import {StyleSheet, Keyboard} from 'react-native';
|
|
5
|
-
import {ViewPropTypes} from 'deprecated-react-native-prop-types';
|
|
6
|
-
import BaseInput from '../baseInput';
|
|
7
|
-
import TextField from '../textFieldOld';
|
|
8
|
-
import View from '../view';
|
|
9
|
-
import Text from '../text';
|
|
10
|
-
import TouchableOpacity from '../touchableOpacity';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @description: Mask Input to create custom looking inputs with custom formats
|
|
14
|
-
* @gif: https://camo.githubusercontent.com/61eedb65e968845d5eac713dcd21a69691571fb1/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f4b5a5a7446666f486f454b334b2f67697068792e676966
|
|
15
|
-
* @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/MaskedInputScreen.tsx
|
|
16
|
-
*/
|
|
17
|
-
export default class MaskedInput extends BaseInput {
|
|
18
|
-
static displayName = 'MaskedInput';
|
|
19
|
-
static propTypes = {
|
|
20
|
-
...TextField.propTypes,
|
|
21
|
-
/**
|
|
22
|
-
* callback for rendering the custom input out of the value returns from the actual input
|
|
23
|
-
*/
|
|
24
|
-
renderMaskedText: PropTypes.elementType.isRequired,
|
|
25
|
-
/**
|
|
26
|
-
* container style for the masked input container
|
|
27
|
-
*/
|
|
28
|
-
containerStyle: ViewPropTypes.style
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
componentDidMount() {
|
|
32
|
-
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
|
|
33
|
-
if (_.invoke(this, 'isFocused')) {
|
|
34
|
-
_.invoke(this, 'blur');
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
componentWillUnmount() {
|
|
40
|
-
this.keyboardDidHideListener.remove();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
clear() {
|
|
44
|
-
this.setState({value: ''});
|
|
45
|
-
this.input.clear();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
renderMaskedText() {
|
|
49
|
-
const {renderMaskedText} = this.props;
|
|
50
|
-
const {value} = this.state;
|
|
51
|
-
|
|
52
|
-
if (_.isFunction(renderMaskedText)) {
|
|
53
|
-
return renderMaskedText(value);
|
|
54
|
-
}
|
|
55
|
-
return <Text>{value}</Text>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
render() {
|
|
59
|
-
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
60
|
-
const {containerStyle, style} = this.props;
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<TouchableOpacity style={containerStyle} activeOpacity={1} onPress={() => this.input.focus()}>
|
|
64
|
-
<TextField
|
|
65
|
-
ref={r => (this.input = r)}
|
|
66
|
-
containerStyle={styles.hiddenInputContainer}
|
|
67
|
-
style={styles.hiddenInput}
|
|
68
|
-
enableErrors={false}
|
|
69
|
-
hideUnderline
|
|
70
|
-
placeholder=""
|
|
71
|
-
{...this.props}
|
|
72
|
-
caretHidden
|
|
73
|
-
multiline={false}
|
|
74
|
-
onChangeText={this.onChangeText}
|
|
75
|
-
/>
|
|
76
|
-
<View style={styles.maskedInputWrapper}>{this.renderMaskedText()}</View>
|
|
77
|
-
</TouchableOpacity>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const styles = StyleSheet.create({
|
|
83
|
-
hiddenInputContainer: {
|
|
84
|
-
...StyleSheet.absoluteFillObject,
|
|
85
|
-
zIndex: 1
|
|
86
|
-
},
|
|
87
|
-
hiddenInput: {
|
|
88
|
-
color: 'transparent',
|
|
89
|
-
backgroundColor: 'transparent',
|
|
90
|
-
height: undefined
|
|
91
|
-
},
|
|
92
|
-
maskedInputWrapper: {
|
|
93
|
-
zIndex: 0
|
|
94
|
-
}
|
|
95
|
-
});
|