react-native-tab-view 5.0.0-alpha.0 → 5.0.0-alpha.10
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/module/DefaultAdapter.android.js +4 -0
- package/lib/module/DefaultAdapter.android.js.map +1 -0
- package/lib/module/DefaultAdapter.ios.js +4 -0
- package/lib/module/DefaultAdapter.ios.js.map +1 -0
- package/lib/module/DefaultAdapter.js +5 -0
- package/lib/module/DefaultAdapter.js.map +1 -0
- package/lib/module/PagerViewAdapter.native.js +29 -13
- package/lib/module/PagerViewAdapter.native.js.map +1 -1
- package/lib/module/PanResponderAdapter.js +3 -0
- package/lib/module/PanResponderAdapter.js.map +1 -1
- package/lib/module/PlatformPressable.js +1 -1
- package/lib/module/PlatformPressable.js.map +1 -1
- package/lib/module/SceneMap.js +12 -6
- package/lib/module/SceneMap.js.map +1 -1
- package/lib/module/SceneView.js +25 -1
- package/lib/module/SceneView.js.map +1 -1
- package/lib/module/ScrollViewAdapter.js +49 -18
- package/lib/module/ScrollViewAdapter.js.map +1 -1
- package/lib/module/TabBar.js +279 -169
- package/lib/module/TabBar.js.map +1 -1
- package/lib/module/TabBarIndicator.js +314 -90
- package/lib/module/TabBarIndicator.js.map +1 -1
- package/lib/module/TabBarItem.js +94 -44
- package/lib/module/TabBarItem.js.map +1 -1
- package/lib/module/TabBarItemLabel.js +3 -2
- package/lib/module/TabBarItemLabel.js.map +1 -1
- package/lib/module/TabView.js +2 -2
- package/lib/module/TabView.js.map +1 -1
- package/lib/module/constants.js +10 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/useLayoutWidths.js +46 -0
- package/lib/module/useLayoutWidths.js.map +1 -0
- package/lib/typescript/src/DefaultAdapter.android.d.ts +2 -0
- package/lib/typescript/src/DefaultAdapter.android.d.ts.map +1 -0
- package/lib/typescript/src/DefaultAdapter.d.ts +6 -0
- package/lib/typescript/src/DefaultAdapter.d.ts.map +1 -0
- package/lib/typescript/src/DefaultAdapter.ios.d.ts +2 -0
- package/lib/typescript/src/DefaultAdapter.ios.d.ts.map +1 -0
- package/lib/typescript/src/PagerViewAdapter.d.ts +1 -1
- package/lib/typescript/src/PagerViewAdapter.d.ts.map +1 -1
- package/lib/typescript/src/PagerViewAdapter.native.d.ts +2 -2
- package/lib/typescript/src/PagerViewAdapter.native.d.ts.map +1 -1
- package/lib/typescript/src/PanResponderAdapter.d.ts +1 -1
- package/lib/typescript/src/PanResponderAdapter.d.ts.map +1 -1
- package/lib/typescript/src/PlatformPressable.d.ts +5 -5
- package/lib/typescript/src/PlatformPressable.d.ts.map +1 -1
- package/lib/typescript/src/SceneMap.d.ts +2 -2
- package/lib/typescript/src/SceneMap.d.ts.map +1 -1
- package/lib/typescript/src/SceneView.d.ts +2 -2
- package/lib/typescript/src/SceneView.d.ts.map +1 -1
- package/lib/typescript/src/ScrollViewAdapter.d.ts +2 -3
- package/lib/typescript/src/ScrollViewAdapter.d.ts.map +1 -1
- package/lib/typescript/src/TabBar.d.ts +26 -25
- package/lib/typescript/src/TabBar.d.ts.map +1 -1
- package/lib/typescript/src/TabBarIndicator.d.ts +5 -7
- package/lib/typescript/src/TabBarIndicator.d.ts.map +1 -1
- package/lib/typescript/src/TabBarItem.d.ts +17 -10
- package/lib/typescript/src/TabBarItem.d.ts.map +1 -1
- package/lib/typescript/src/TabBarItemLabel.d.ts +4 -3
- package/lib/typescript/src/TabBarItemLabel.d.ts.map +1 -1
- package/lib/typescript/src/TabView.d.ts +111 -17
- package/lib/typescript/src/TabView.d.ts.map +1 -1
- package/lib/typescript/src/constants.d.ts +8 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +13 -12
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +31 -31
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useLayoutWidths.d.ts +2 -0
- package/lib/typescript/src/useLayoutWidths.d.ts.map +1 -0
- package/lib/typescript/src/useMeasureLayout.d.ts +1 -1
- package/lib/typescript/src/useMeasureLayout.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/DefaultAdapter.android.tsx +1 -0
- package/src/DefaultAdapter.ios.tsx +1 -0
- package/src/DefaultAdapter.tsx +13 -0
- package/src/PagerViewAdapter.native.tsx +36 -18
- package/src/PanResponderAdapter.tsx +4 -0
- package/src/PlatformPressable.tsx +11 -7
- package/src/SceneMap.tsx +17 -9
- package/src/SceneView.tsx +41 -2
- package/src/ScrollViewAdapter.tsx +88 -22
- package/src/TabBar.tsx +440 -235
- package/src/TabBarIndicator.tsx +389 -124
- package/src/TabBarItem.tsx +107 -46
- package/src/TabBarItemLabel.tsx +5 -4
- package/src/TabView.tsx +118 -20
- package/src/constants.tsx +8 -0
- package/src/index.tsx +5 -1
- package/src/types.tsx +40 -36
- package/src/useLayoutWidths.tsx +51 -0
- package/lib/module/Pager.android.js +0 -4
- package/lib/module/Pager.android.js.map +0 -1
- package/lib/module/Pager.ios.js +0 -4
- package/lib/module/Pager.ios.js.map +0 -1
- package/lib/module/Pager.js +0 -4
- package/lib/module/Pager.js.map +0 -1
- package/lib/typescript/src/Pager.android.d.ts +0 -2
- package/lib/typescript/src/Pager.android.d.ts.map +0 -1
- package/lib/typescript/src/Pager.d.ts +0 -2
- package/lib/typescript/src/Pager.d.ts.map +0 -1
- package/lib/typescript/src/Pager.ios.d.ts +0 -2
- package/lib/typescript/src/Pager.ios.d.ts.map +0 -1
- package/src/Pager.android.tsx +0 -1
- package/src/Pager.ios.tsx +0 -1
- package/src/Pager.tsx +0 -1
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ColorValue, type PressableAndroidRippleConfig, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import { type Props as IndicatorProps } from './TabBarIndicator';
|
|
4
|
-
import { type Props as TabBarItemProps } from './TabBarItem';
|
|
5
|
-
import type { Event, EventEmitterProps, LocaleDirection, NavigationState, Route, Scene, SceneRendererProps, TabDescriptor } from './types';
|
|
3
|
+
import { type Props as IndicatorProps } from './TabBarIndicator.js';
|
|
4
|
+
import { type Props as TabBarItemProps } from './TabBarItem.js';
|
|
5
|
+
import type { Event, EventEmitterProps, LocaleDirection, NavigationState, Route, Scene, SceneRendererProps, TabDescriptor } from './types.js';
|
|
6
6
|
export type Props<T extends Route> = SceneRendererProps & EventEmitterProps & {
|
|
7
|
+
variant?: 'primary' | 'secondary' | undefined;
|
|
7
8
|
navigationState: NavigationState<T>;
|
|
8
|
-
scrollEnabled?: boolean;
|
|
9
|
-
bounces?: boolean;
|
|
10
|
-
activeColor?: ColorValue;
|
|
11
|
-
inactiveColor?: ColorValue;
|
|
12
|
-
pressColor?: ColorValue;
|
|
13
|
-
pressOpacity?: number;
|
|
14
|
-
options?: Record<string, TabDescriptor<T
|
|
15
|
-
renderIndicator?: (props: IndicatorProps<T>) => React.ReactNode;
|
|
16
|
-
renderTabBarItem?: (props: TabBarItemProps<T> & {
|
|
9
|
+
scrollEnabled?: boolean | undefined;
|
|
10
|
+
bounces?: boolean | undefined;
|
|
11
|
+
activeColor?: ColorValue | undefined;
|
|
12
|
+
inactiveColor?: ColorValue | undefined;
|
|
13
|
+
pressColor?: ColorValue | undefined;
|
|
14
|
+
pressOpacity?: number | undefined;
|
|
15
|
+
options?: Record<string, TabDescriptor<T>> | undefined;
|
|
16
|
+
renderIndicator?: ((props: IndicatorProps<T>) => React.ReactNode) | undefined;
|
|
17
|
+
renderTabBarItem?: ((props: TabBarItemProps<T> & {
|
|
17
18
|
key: string;
|
|
18
|
-
}) => React.ReactElement;
|
|
19
|
-
onTabPress?: (scene: Scene<T> & Event) => void;
|
|
20
|
-
onTabLongPress?: (scene: Scene<T>) => void;
|
|
21
|
-
tabStyle?: StyleProp<ViewStyle
|
|
22
|
-
indicatorStyle?: StyleProp<ViewStyle
|
|
23
|
-
indicatorContainerStyle?: StyleProp<ViewStyle
|
|
24
|
-
contentContainerStyle?: StyleProp<ViewStyle
|
|
25
|
-
style?: StyleProp<ViewStyle
|
|
26
|
-
direction?: LocaleDirection;
|
|
27
|
-
gap?: number;
|
|
28
|
-
testID?: string;
|
|
29
|
-
android_ripple?: PressableAndroidRippleConfig;
|
|
19
|
+
}) => React.ReactElement) | undefined;
|
|
20
|
+
onTabPress?: ((scene: Scene<T> & Event) => void) | undefined;
|
|
21
|
+
onTabLongPress?: ((scene: Scene<T>) => void) | undefined;
|
|
22
|
+
tabStyle?: StyleProp<ViewStyle> | undefined;
|
|
23
|
+
indicatorStyle?: StyleProp<ViewStyle> | undefined;
|
|
24
|
+
indicatorContainerStyle?: StyleProp<ViewStyle> | undefined;
|
|
25
|
+
contentContainerStyle?: StyleProp<ViewStyle> | undefined;
|
|
26
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
27
|
+
direction?: LocaleDirection | undefined;
|
|
28
|
+
gap?: number | undefined;
|
|
29
|
+
testID?: string | undefined;
|
|
30
|
+
android_ripple?: PressableAndroidRippleConfig | undefined;
|
|
30
31
|
};
|
|
31
|
-
export declare function TabBar<T extends Route>({ renderIndicator, gap, scrollEnabled, jumpTo, navigationState, position, activeColor, bounces, contentContainerStyle, inactiveColor, indicatorContainerStyle, indicatorStyle, onTabLongPress, onTabPress, pressColor, pressOpacity, direction, renderTabBarItem, style, tabStyle, testID, android_ripple, options, }: Props<T>):
|
|
32
|
+
export declare function TabBar<T extends Route>({ variant, renderIndicator, gap, scrollEnabled, jumpTo, navigationState, position, activeColor, bounces, contentContainerStyle, inactiveColor, indicatorContainerStyle, indicatorStyle, onTabLongPress, onTabPress, pressColor, pressOpacity, direction, renderTabBarItem, style, tabStyle, testID, android_ripple, options, }: Props<T>): React.JSX.Element;
|
|
32
33
|
//# sourceMappingURL=TabBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../../src/TabBar.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ACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,SAA4D,EAC5D,gBAAgB,EAChB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,cAAc,EACd,OAAO,GACR,EAAE,KAAK,CAAC,CAAC,CAAC,qBAoXV"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import type { LocaleDirection, NavigationState, Route, SceneRendererProps } from './types';
|
|
4
|
-
export type GetTabWidth = (index: number) => number;
|
|
3
|
+
import type { LocaleDirection, NavigationState, Route, SceneRendererProps } from './types.js';
|
|
5
4
|
export type Props<T extends Route> = SceneRendererProps & {
|
|
5
|
+
variant?: 'primary' | 'secondary' | undefined;
|
|
6
6
|
navigationState: NavigationState<T>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
widths: number[];
|
|
8
|
+
offsets: number[];
|
|
9
9
|
direction: LocaleDirection;
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
11
|
-
gap?: number;
|
|
12
|
-
children?: React.ReactNode;
|
|
13
11
|
};
|
|
14
|
-
export declare function TabBarIndicator<T extends Route>({
|
|
12
|
+
export declare function TabBarIndicator<T extends Route>({ variant, widths, offsets, navigationState, position, direction, style, }: Props<T>): React.JSX.Element;
|
|
15
13
|
//# sourceMappingURL=TabBarIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarIndicator.d.ts","sourceRoot":"","sources":["../../../src/TabBarIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TabBarIndicator.d.ts","sourceRoot":"","sources":["../../../src/TabBarIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,KAAK,EACL,kBAAkB,EACnB,MAAM,YAAS,CAAC;AAajB,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,KAAK,IAAI,kBAAkB,GAAG;IACxD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,SAAS,KAAK,EAAE,EAC/C,OAAmB,EACnB,MAAM,EACN,OAAO,EACP,eAAe,EACf,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,KAAK,CAAC,CAAC,CAAC,qBAmYV"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Animated, type ColorValue, type PressableAndroidRippleConfig, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { NavigationState, Route, TabDescriptor } from './types.js';
|
|
4
|
+
type Layout = {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
3
8
|
export type Props<T extends Route> = TabDescriptor<T> & {
|
|
9
|
+
variant?: 'primary' | 'secondary' | undefined;
|
|
4
10
|
position: Animated.AnimatedInterpolation<number>;
|
|
5
11
|
route: T;
|
|
6
12
|
navigationState: NavigationState<T>;
|
|
7
|
-
activeColor?: ColorValue;
|
|
8
|
-
inactiveColor?: ColorValue;
|
|
9
|
-
pressColor?: ColorValue;
|
|
10
|
-
pressOpacity?: number;
|
|
11
|
-
|
|
13
|
+
activeColor?: ColorValue | undefined;
|
|
14
|
+
inactiveColor?: ColorValue | undefined;
|
|
15
|
+
pressColor?: ColorValue | undefined;
|
|
16
|
+
pressOpacity?: number | undefined;
|
|
17
|
+
onMeasureLayout: (layout: Layout) => void;
|
|
18
|
+
onMeasureLabelLayout: (layout: Layout) => void;
|
|
12
19
|
onPress: () => void;
|
|
13
20
|
onLongPress: () => void;
|
|
14
|
-
defaultTabWidth?: number;
|
|
15
21
|
style: StyleProp<ViewStyle>;
|
|
16
|
-
android_ripple?: PressableAndroidRippleConfig;
|
|
22
|
+
android_ripple?: PressableAndroidRippleConfig | undefined;
|
|
17
23
|
};
|
|
18
|
-
export declare function TabBarItem<T extends Route>(
|
|
24
|
+
export declare function TabBarItem<T extends Route>({ variant, onPress, onLongPress, onMeasureLayout, onMeasureLabelLayout, navigationState, route, ...rest }: Props<T>): React.JSX.Element;
|
|
25
|
+
export {};
|
|
19
26
|
//# sourceMappingURL=TabBarItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarItem.d.ts","sourceRoot":"","sources":["../../../src/TabBarItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabBarItem.d.ts","sourceRoot":"","sources":["../../../src/TabBarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,KAAK,UAAU,EAGf,KAAK,4BAA4B,EACjC,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAUtB,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC;AAErE,KAAK,MAAM,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,KAAK,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG;IACtD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,QAAQ,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACjD,KAAK,EAAE,CAAC,CAAC;IACT,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACrC,aAAa,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACvC,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,cAAc,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAC;CAC3D,CAAC;AAqQF,wBAAgB,UAAU,CAAC,CAAC,SAAS,KAAK,EAAE,EAC1C,OAAmB,EACnB,OAAO,EACP,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,KAAK,EACL,GAAG,IAAI,EACR,EAAE,KAAK,CAAC,CAAC,CAAC,qBAsBV"}
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import type { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
interface TabBarItemLabelProps {
|
|
4
4
|
color: ColorValue;
|
|
5
|
-
label
|
|
6
|
-
style: StyleProp<ViewStyle>;
|
|
5
|
+
label: string | undefined;
|
|
7
6
|
icon: React.ReactNode;
|
|
7
|
+
style: StyleProp<ViewStyle>;
|
|
8
|
+
allowFontScaling?: boolean | undefined;
|
|
8
9
|
}
|
|
9
|
-
export declare const TabBarItemLabel: React.MemoExoticComponent<({ color, label, style, icon }: TabBarItemLabelProps) =>
|
|
10
|
+
export declare const TabBarItemLabel: React.MemoExoticComponent<({ color, label, style, icon, allowFontScaling }: TabBarItemLabelProps) => React.JSX.Element | null>;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=TabBarItemLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarItemLabel.d.ts","sourceRoot":"","sources":["../../../src/TabBarItemLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrE,UAAU,oBAAoB;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"TabBarItemLabel.d.ts","sourceRoot":"","sources":["../../../src/TabBarItemLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGrE,UAAU,oBAAoB;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,8EACwB,oBAAoB,8BAmBvE,CAAC"}
|
|
@@ -1,33 +1,127 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import type { AdapterCommonProps, AdapterProps, EventEmitterProps, LocaleDirection, NavigationState, Route, SceneRendererProps, TabDescriptor } from './types';
|
|
3
|
+
import type { AdapterCommonProps, AdapterProps, EventEmitterProps, LocaleDirection, NavigationState, Route, SceneRendererProps, TabDescriptor } from './types.js';
|
|
4
4
|
export type Props<T extends Route> = AdapterCommonProps & {
|
|
5
|
+
/**
|
|
6
|
+
* Callback which is called when the index of the active tab changes.
|
|
7
|
+
* Must update the `navigationState.index` prop to the new index.
|
|
8
|
+
*
|
|
9
|
+
* Example:
|
|
10
|
+
* ```js
|
|
11
|
+
* onIndexChange={(index) => setState({ ...state, index })}
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
5
14
|
onIndexChange: (index: number) => void;
|
|
6
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Callback which is called when the tab navigation animation ends.
|
|
17
|
+
* Useful for side effects that should run after the tab change animation.
|
|
18
|
+
*
|
|
19
|
+
* Unlike `onIndexChange`, this is called regardless of whether the index changed or not.
|
|
20
|
+
*/
|
|
21
|
+
onTabSelect?: ((props: {
|
|
7
22
|
index: number;
|
|
8
|
-
}) => void;
|
|
23
|
+
}) => void) | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* State for the tab view containing the current index and routes.
|
|
26
|
+
*
|
|
27
|
+
* Example:
|
|
28
|
+
* ```js
|
|
29
|
+
* {
|
|
30
|
+
* index: 0,
|
|
31
|
+
* routes: [
|
|
32
|
+
* { key: 'first' },
|
|
33
|
+
* { key: 'second' },
|
|
34
|
+
* ],
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
9
38
|
navigationState: NavigationState<T>;
|
|
10
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Callback which returns a custom placeholder element.
|
|
41
|
+
* The placeholder is shown when a scene is not yet loaded when `lazy` is enabled.
|
|
42
|
+
*/
|
|
43
|
+
renderLazyPlaceholder?: ((props: {
|
|
11
44
|
route: T;
|
|
12
|
-
}) => React.ReactNode;
|
|
13
|
-
|
|
45
|
+
}) => React.ReactNode) | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Callback which returns a custom tab bar element to display.
|
|
48
|
+
*/
|
|
49
|
+
renderTabBar?: ((props: SceneRendererProps & EventEmitterProps & {
|
|
14
50
|
navigationState: NavigationState<T>;
|
|
15
51
|
options: Record<string, TabDescriptor<T>> | undefined;
|
|
16
|
-
}) => React.ReactNode;
|
|
17
|
-
|
|
18
|
-
|
|
52
|
+
}) => React.ReactNode) | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Callback which returns a custom adapter to use for the tab view.
|
|
55
|
+
* Adapters are responsible for handling gestures and animations between tabs.
|
|
56
|
+
*
|
|
57
|
+
* The following adapters are provided out of the box:
|
|
58
|
+
* - `PagerViewAdapter`: Uses `react-native-pager-view` for native experience.
|
|
59
|
+
* - `PanResponderAdapter`: Uses `PanResponder` for a JS-based implementation.
|
|
60
|
+
* - `ScrollViewAdapter`: Uses `ScrollView` for an implementation based on `ScrollView`.
|
|
61
|
+
*
|
|
62
|
+
* Defaults to `PagerViewAdapter` on Android and iOS, and `PanResponderAdapter` on other platforms.
|
|
63
|
+
*/
|
|
64
|
+
renderAdapter?: ((props: AdapterProps) => React.ReactElement) | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Position of the tab bar in the tab view.
|
|
67
|
+
* Defaults to `'top'`.
|
|
68
|
+
*/
|
|
69
|
+
tabBarPosition?: 'top' | 'bottom' | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Whether to lazily render the scenes.
|
|
72
|
+
* When enabled, scenes are rendered only when they come into view.
|
|
73
|
+
*
|
|
74
|
+
* Can be a boolean or a function that receives the route and returns a boolean.
|
|
75
|
+
* Defaults to `false`.
|
|
76
|
+
*/
|
|
19
77
|
lazy?: ((props: {
|
|
20
78
|
route: T;
|
|
21
|
-
}) => boolean) | boolean;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
79
|
+
}) => boolean) | boolean | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* How many screens to preload when `lazy` is enabled.
|
|
82
|
+
*
|
|
83
|
+
* Defaults to `0`.
|
|
84
|
+
*/
|
|
85
|
+
lazyPreloadDistance?: number | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The layout direction of the tab view.
|
|
88
|
+
*
|
|
89
|
+
* Defaults to the app's locale direction (RTL or LTR).
|
|
90
|
+
*/
|
|
91
|
+
direction?: LocaleDirection | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Style to apply to the pager container.
|
|
94
|
+
*/
|
|
95
|
+
pagerStyle?: StyleProp<ViewStyle> | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Style to apply to the tab view container.
|
|
98
|
+
*/
|
|
99
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Callback which returns a React element to render for each route.
|
|
102
|
+
*/
|
|
26
103
|
renderScene: (props: SceneRendererProps & {
|
|
27
104
|
route: T;
|
|
28
105
|
}) => React.ReactNode;
|
|
29
|
-
|
|
30
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Options for individual tabs, keyed by route key.
|
|
108
|
+
*
|
|
109
|
+
* Example:
|
|
110
|
+
* ```js
|
|
111
|
+
* {
|
|
112
|
+
* first: { labelText: 'First Tab' },
|
|
113
|
+
* second: { labelText: 'Second Tab' },
|
|
114
|
+
* }
|
|
115
|
+
*
|
|
116
|
+
* These options are merged with `commonOptions`.
|
|
117
|
+
*/
|
|
118
|
+
options?: Record<string, TabDescriptor<T>> | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Options that apply to all tabs.
|
|
121
|
+
*
|
|
122
|
+
* Individual tab options from `options` will override these.
|
|
123
|
+
*/
|
|
124
|
+
commonOptions?: TabDescriptor<T> | undefined;
|
|
31
125
|
};
|
|
32
|
-
export declare function TabView<T extends Route>({ onIndexChange, onTabSelect, navigationState, renderScene, keyboardDismissMode, lazy, lazyPreloadDistance, onSwipeStart, onSwipeEnd, renderLazyPlaceholder, renderTabBar, renderAdapter, pagerStyle, style, direction, swipeEnabled, tabBarPosition, animationEnabled, options: sceneOptions, commonOptions, }: Props<T>):
|
|
126
|
+
export declare function TabView<T extends Route>({ onIndexChange, onTabSelect, navigationState, renderScene, keyboardDismissMode, lazy, lazyPreloadDistance, onSwipeStart, onSwipeEnd, renderLazyPlaceholder, renderTabBar, renderAdapter, pagerStyle, style, direction, swipeEnabled, tabBarPosition, animationEnabled, options: sceneOptions, commonOptions, }: Props<T>): React.JSX.Element;
|
|
33
127
|
//# sourceMappingURL=TabView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../src/TabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,KAAK,EACL,kBAAkB,EAClB,aAAa,EACd,MAAM,
|
|
1
|
+
{"version":3,"file":"TabView.d.ts","sourceRoot":"","sources":["../../../src/TabView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,KAAK,SAAS,EAGd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,KAAK,EACL,kBAAkB,EAClB,aAAa,EACd,MAAM,YAAS,CAAC;AAEjB,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,KAAK,IAAI,kBAAkB,GAAG;IACxD;;;;;;;;OAQG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,K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QAAE,KAAK,EAAE,CAAC,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAC3E;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACvD;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CAC9C,CAAC;AAIF,wBAAgB,OAAO,CAAC,CAAC,SAAS,KAAK,EAAE,EACvC,aAAa,EACb,WAAW,EACX,eAAe,EACf,WAAW,EACX,mBAA4B,EAC5B,IAAY,EACZ,mBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,qBAAoD,EAEpD,YAA+C,EAE/C,aAAwD,EACxD,UAAU,EACV,KAAK,EACL,SAA4D,EAC5D,YAAmB,EACnB,cAAsB,EACtB,gBAAuB,EACvB,OAAO,EAAE,YAAY,EACrB,aAAa,GACd,EAAE,KAAK,CAAC,CAAC,CAAC,qBAgGV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TAB_BAR_PRIMARY_ACTIVE_COLOR = "#6750a4";
|
|
2
|
+
export declare const TAB_BAR_SECONDARY_ACTIVE_COLOR = "#1d1b20";
|
|
3
|
+
export declare const TAB_BAR_INACTIVE_COLOR = "#49454f";
|
|
4
|
+
export declare const TAB_BAR_BACKGROUND_COLOR = "#fef7ff";
|
|
5
|
+
export declare const TAB_BAR_BORDER_COLOR = "#cac4d0";
|
|
6
|
+
export declare const PRIMARY_INDICATOR_MIN_WIDTH = 24;
|
|
7
|
+
export declare const TAB_MIN_WIDTH = 90;
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,YAAY,CAAC;AACtD,eAAO,MAAM,8BAA8B,YAAY,CAAC;AACxD,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,aAAa,KAAK,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
export { DefaultAdapter, type DefaultAdapterProps } from './DefaultAdapter';
|
|
1
2
|
export { PagerViewAdapter, type PagerViewAdapterProps, } from './PagerViewAdapter';
|
|
2
|
-
export { PanResponderAdapter } from './PanResponderAdapter';
|
|
3
|
-
export { SceneMap } from './SceneMap';
|
|
4
|
-
export { ScrollViewAdapter, type ScrollViewAdapterProps, } from './ScrollViewAdapter';
|
|
5
|
-
export type { Props as TabBarProps } from './TabBar';
|
|
6
|
-
export { TabBar } from './TabBar';
|
|
7
|
-
export type { Props as TabBarIndicatorProps } from './TabBarIndicator';
|
|
8
|
-
export { TabBarIndicator } from './TabBarIndicator';
|
|
9
|
-
export type { Props as TabBarItemProps } from './TabBarItem';
|
|
10
|
-
export { TabBarItem } from './TabBarItem';
|
|
11
|
-
export type { Props as TabViewProps } from './TabView';
|
|
12
|
-
export { TabView } from './TabView';
|
|
13
|
-
export type { AdapterProps, NavigationState, Route, SceneRendererProps, TabDescriptor, } from './types';
|
|
3
|
+
export { PanResponderAdapter, type PanResponderAdapterProps, } from './PanResponderAdapter.js';
|
|
4
|
+
export { SceneMap } from './SceneMap.js';
|
|
5
|
+
export { ScrollViewAdapter, type ScrollViewAdapterProps, } from './ScrollViewAdapter.js';
|
|
6
|
+
export type { Props as TabBarProps } from './TabBar.js';
|
|
7
|
+
export { TabBar } from './TabBar.js';
|
|
8
|
+
export type { Props as TabBarIndicatorProps } from './TabBarIndicator.js';
|
|
9
|
+
export { TabBarIndicator } from './TabBarIndicator.js';
|
|
10
|
+
export type { Props as TabBarItemProps } from './TabBarItem.js';
|
|
11
|
+
export { TabBarItem } from './TabBarItem.js';
|
|
12
|
+
export type { Props as TabViewProps } from './TabView.js';
|
|
13
|
+
export { TabView } from './TabView.js';
|
|
14
|
+
export type { AdapterProps, NavigationState, Route, SceneRendererProps, TabDescriptor, } from './types.js';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAY,CAAC;AACtC,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,wBAAqB,CAAC;AAC7B,YAAY,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,aAAU,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAU,CAAC;AAClC,YAAY,EAAE,KAAK,IAAI,oBAAoB,EAAE,MAAM,sBAAmB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AACpD,YAAY,EAAE,KAAK,IAAI,eAAe,EAAE,MAAM,iBAAc,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAC1C,YAAY,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,cAAW,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAW,CAAC;AACpC,YAAY,EACV,YAAY,EACZ,eAAe,EACf,KAAK,EACL,kBAAkB,EAClB,aAAa,GACd,MAAM,YAAS,CAAC"}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Animated, ColorValue, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
3
|
export type TabDescriptor<T extends Route> = {
|
|
4
|
-
accessibilityLabel?: string;
|
|
5
|
-
accessible?: boolean;
|
|
6
|
-
testID?: string;
|
|
7
|
-
labelText?: string;
|
|
8
|
-
labelAllowFontScaling?: boolean;
|
|
9
|
-
href?: string;
|
|
10
|
-
label?: (props: {
|
|
4
|
+
accessibilityLabel?: string | undefined;
|
|
5
|
+
accessible?: boolean | undefined;
|
|
6
|
+
testID?: string | undefined;
|
|
7
|
+
labelText?: string | undefined;
|
|
8
|
+
labelAllowFontScaling?: boolean | undefined;
|
|
9
|
+
href?: string | undefined;
|
|
10
|
+
label?: ((props: {
|
|
11
11
|
route: T;
|
|
12
|
-
labelText?: string;
|
|
12
|
+
labelText?: string | undefined;
|
|
13
13
|
focused: boolean;
|
|
14
14
|
color: ColorValue;
|
|
15
|
-
allowFontScaling?: boolean;
|
|
16
|
-
style?: StyleProp<TextStyle
|
|
17
|
-
}) => React.ReactNode;
|
|
18
|
-
labelStyle?: StyleProp<TextStyle
|
|
19
|
-
icon?: (props: {
|
|
15
|
+
allowFontScaling?: boolean | undefined;
|
|
16
|
+
style?: StyleProp<TextStyle> | undefined;
|
|
17
|
+
}) => React.ReactNode) | undefined;
|
|
18
|
+
labelStyle?: StyleProp<TextStyle> | undefined;
|
|
19
|
+
icon?: ((props: {
|
|
20
20
|
route: T;
|
|
21
21
|
focused: boolean;
|
|
22
22
|
color: ColorValue;
|
|
23
23
|
size: number;
|
|
24
|
-
}) => React.ReactNode;
|
|
25
|
-
badge?: (props: {
|
|
24
|
+
}) => React.ReactNode) | undefined;
|
|
25
|
+
badge?: ((props: {
|
|
26
26
|
route: T;
|
|
27
|
-
}) => React.ReactElement;
|
|
28
|
-
sceneStyle?: StyleProp<ViewStyle
|
|
27
|
+
}) => React.ReactElement) | undefined;
|
|
28
|
+
sceneStyle?: StyleProp<ViewStyle> | undefined;
|
|
29
29
|
};
|
|
30
30
|
export type LocaleDirection = 'ltr' | 'rtl';
|
|
31
31
|
export type Route = {
|
|
32
32
|
key: string;
|
|
33
|
-
icon?: string;
|
|
34
|
-
title?: string;
|
|
35
|
-
accessible?: boolean;
|
|
36
|
-
accessibilityLabel?: string;
|
|
37
|
-
testID?: string;
|
|
33
|
+
icon?: string | undefined;
|
|
34
|
+
title?: string | undefined;
|
|
35
|
+
accessible?: boolean | undefined;
|
|
36
|
+
accessibilityLabel?: string | undefined;
|
|
37
|
+
testID?: string | undefined;
|
|
38
38
|
};
|
|
39
39
|
export type Event = {
|
|
40
40
|
defaultPrevented: boolean;
|
|
@@ -69,35 +69,35 @@ export type AdapterCommonProps = {
|
|
|
69
69
|
* - 'on-drag' - the keyboard is dismissed when a drag begins
|
|
70
70
|
* - 'none' - drags and tab changes do not dismiss the keyboard
|
|
71
71
|
*/
|
|
72
|
-
keyboardDismissMode?: 'none' | 'on-drag' | 'auto';
|
|
72
|
+
keyboardDismissMode?: 'none' | 'on-drag' | 'auto' | undefined;
|
|
73
73
|
/**
|
|
74
74
|
* Whether swiping between tabs is enabled.
|
|
75
75
|
*/
|
|
76
|
-
swipeEnabled?: boolean;
|
|
76
|
+
swipeEnabled?: boolean | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* Whether the tab switch animation is enabled.
|
|
79
79
|
* If set to false, the tab switch will happen immediately without animation.
|
|
80
80
|
*/
|
|
81
|
-
animationEnabled?: boolean;
|
|
81
|
+
animationEnabled?: boolean | undefined;
|
|
82
82
|
/**
|
|
83
83
|
* Callback that is called when the swipe gesture starts.
|
|
84
84
|
*/
|
|
85
|
-
onSwipeStart?: () => void;
|
|
85
|
+
onSwipeStart?: (() => void) | undefined;
|
|
86
86
|
/**
|
|
87
87
|
* Callback that is called when the swipe gesture ends.
|
|
88
88
|
*/
|
|
89
|
-
onSwipeEnd?: () => void;
|
|
89
|
+
onSwipeEnd?: (() => void) | undefined;
|
|
90
90
|
/**
|
|
91
91
|
* Callback that is called when a tab is selected.
|
|
92
92
|
* This is called regardless of whether the index has changed or not.
|
|
93
93
|
*/
|
|
94
|
-
onTabSelect?: (props: {
|
|
94
|
+
onTabSelect?: ((props: {
|
|
95
95
|
index: number;
|
|
96
|
-
}) => void;
|
|
96
|
+
}) => void) | undefined;
|
|
97
97
|
/**
|
|
98
98
|
* Style for the pager adapter.
|
|
99
99
|
*/
|
|
100
|
-
style?: StyleProp<ViewStyle
|
|
100
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
101
101
|
};
|
|
102
102
|
export type AdapterRendererProps = {
|
|
103
103
|
/**
|
|
@@ -112,7 +112,7 @@ export type AdapterRendererProps = {
|
|
|
112
112
|
* The writing direction of the layout.
|
|
113
113
|
* This can be 'ltr' or 'rtl' based on tab view's `direction` prop.
|
|
114
114
|
*/
|
|
115
|
-
layoutDirection?: LocaleDirection;
|
|
115
|
+
layoutDirection?: LocaleDirection | undefined;
|
|
116
116
|
/**
|
|
117
117
|
* Render callback that should render the pages of the tab view.
|
|
118
118
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,KAAK,IAAI;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,M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B,KACE,KAAK,CAAC,YAAY,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLayoutWidths.d.ts","sourceRoot":"","sources":["../../../src/useLayoutWidths.tsx"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,2CAkBL,MAAM,SAAS,MAAM,iBA4BrE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type LayoutChangeEvent, type View } from 'react-native';
|
|
3
|
-
import type { Layout } from './types';
|
|
3
|
+
import type { Layout } from './types.js';
|
|
4
4
|
export declare function useMeasureLayout(ref: React.RefObject<View | null>, onMeasure?: (layout: Layout) => void): readonly [Layout, (event: LayoutChangeEvent) => void];
|
|
5
5
|
//# sourceMappingURL=useMeasureLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMeasureLayout.d.ts","sourceRoot":"","sources":["../../../src/useMeasureLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAGjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useMeasureLayout.d.ts","sourceRoot":"","sources":["../../../src/useMeasureLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAGjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAS,CAAC;AAEtC,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,EACjC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,6BAoBO,iBAAiB,WAK7D"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tab-view",
|
|
3
3
|
"description": "Tab view component for React Native",
|
|
4
|
-
"version": "5.0.0-alpha.
|
|
4
|
+
"version": "5.0.0-alpha.10",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -44,21 +44,22 @@
|
|
|
44
44
|
"clean": "del lib"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"use-latest-callback": "^0.3.
|
|
47
|
+
"use-latest-callback": "^0.3.4"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@jest/globals": "^
|
|
51
|
-
"@testing-library/react-native": "^
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"react
|
|
55
|
-
"react-native
|
|
50
|
+
"@jest/globals": "^29.7.0",
|
|
51
|
+
"@testing-library/react-native": "^14.0.0",
|
|
52
|
+
"@types/react": "~19.2.17",
|
|
53
|
+
"del-cli": "^7.0.0",
|
|
54
|
+
"react": "19.2.0",
|
|
55
|
+
"react-native": "0.83.6",
|
|
56
|
+
"react-native-builder-bob": "^0.42.1",
|
|
56
57
|
"react-native-pager-view": "^8.0.0",
|
|
57
|
-
"
|
|
58
|
-
"typescript": "^
|
|
58
|
+
"test-renderer": "1.2.0",
|
|
59
|
+
"typescript": "^6.0.3"
|
|
59
60
|
},
|
|
60
61
|
"peerDependencies": {
|
|
61
|
-
"react": ">= 19.
|
|
62
|
+
"react": ">= 19.2.0",
|
|
62
63
|
"react-native": "*",
|
|
63
64
|
"react-native-pager-view": ">= 7.0.0"
|
|
64
65
|
},
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
]
|
|
81
82
|
]
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "9c6b764c575fdf7e3c27df37f820899dda9d4259"
|
|
84
85
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PagerViewAdapter as DefaultAdapter } from './PagerViewAdapter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PagerViewAdapter as DefaultAdapter } from './PagerViewAdapter';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { PagerViewAdapterProps } from './PagerViewAdapter';
|
|
4
|
+
import {
|
|
5
|
+
PanResponderAdapter,
|
|
6
|
+
type PanResponderAdapterProps,
|
|
7
|
+
} from './PanResponderAdapter';
|
|
8
|
+
|
|
9
|
+
export type DefaultAdapterProps = PagerViewAdapterProps &
|
|
10
|
+
PanResponderAdapterProps;
|
|
11
|
+
|
|
12
|
+
export const DefaultAdapter: React.ComponentType<DefaultAdapterProps> =
|
|
13
|
+
PanResponderAdapter;
|