@onekeyfe/react-native-pager-view 6.7.0-alpha.432 → 6.7.0-alpha.435
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/CollapsiblePagerViewNativeComponent.ts +41 -46
- package/lib/module/NativeScroller.web.js +3 -0
- package/lib/module/NativeScrollerNativeComponent.ts +43 -46
- package/lib/module/PagerViewNativeComponent.ts +20 -25
- package/lib/typescript/src/CollapsiblePagerView.d.ts +1 -1
- package/lib/typescript/src/CollapsiblePagerView.web.d.ts +1 -1
- package/lib/typescript/src/CollapsiblePagerViewNativeComponent.d.ts +41 -42
- package/lib/typescript/src/NativeScroller.d.ts +5 -3
- package/lib/typescript/src/NativeScroller.web.d.ts +1 -1
- package/lib/typescript/src/NativeScrollerNativeComponent.d.ts +47 -48
- package/lib/typescript/src/PagerView.d.ts +1 -1
- package/lib/typescript/src/PagerView.web.d.ts +1 -1
- package/lib/typescript/src/PagerViewNativeComponent.d.ts +20 -21
- package/lib/typescript/src/WebCollapsiblePagerPage.d.ts +1 -1
- package/lib/typescript/src/usePagerView.d.ts +2 -2
- package/lib/typescript/src/utils.d.ts +2 -2
- package/package.json +5 -5
- package/src/CollapsiblePagerViewNativeComponent.ts +41 -46
- package/src/NativeScroller.tsx +14 -3
- package/src/NativeScroller.web.tsx +15 -1
- package/src/NativeScrollerNativeComponent.ts +43 -46
- package/src/PagerViewNativeComponent.ts +20 -25
|
@@ -2,25 +2,20 @@ import type * as React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
codegenNativeCommands,
|
|
4
4
|
codegenNativeComponent,
|
|
5
|
+
type CodegenTypes,
|
|
5
6
|
type ColorValue,
|
|
6
7
|
type HostComponent,
|
|
7
8
|
type ViewProps,
|
|
8
9
|
} from "react-native";
|
|
9
10
|
|
|
10
|
-
import type {
|
|
11
|
-
DirectEventHandler,
|
|
12
|
-
Double,
|
|
13
|
-
Int32,
|
|
14
|
-
WithDefault,
|
|
15
|
-
} from "react-native/Libraries/Types/CodegenTypes";
|
|
16
11
|
|
|
17
12
|
export type OnPageScrollEventData = Readonly<{
|
|
18
|
-
position: Double;
|
|
19
|
-
offset: Double;
|
|
13
|
+
position: CodegenTypes.Double;
|
|
14
|
+
offset: CodegenTypes.Double;
|
|
20
15
|
}>;
|
|
21
16
|
|
|
22
17
|
export type OnPageSelectedEventData = Readonly<{
|
|
23
|
-
position: Double;
|
|
18
|
+
position: CodegenTypes.Double;
|
|
24
19
|
}>;
|
|
25
20
|
|
|
26
21
|
export type OnPageScrollStateChangedEventData = Readonly<{
|
|
@@ -28,11 +23,11 @@ export type OnPageScrollStateChangedEventData = Readonly<{
|
|
|
28
23
|
}>;
|
|
29
24
|
|
|
30
25
|
export type OnCollapsibleStateChangedEventData = Readonly<{
|
|
31
|
-
position: Int32;
|
|
32
|
-
headerOffset: Double;
|
|
33
|
-
nativePageCount: Int32;
|
|
34
|
-
attachedPageCount: Int32;
|
|
35
|
-
observedScrollableCount: Int32;
|
|
26
|
+
position: CodegenTypes.Int32;
|
|
27
|
+
headerOffset: CodegenTypes.Double;
|
|
28
|
+
nativePageCount: CodegenTypes.Int32;
|
|
29
|
+
attachedPageCount: CodegenTypes.Int32;
|
|
30
|
+
observedScrollableCount: CodegenTypes.Int32;
|
|
36
31
|
retainedPages: string;
|
|
37
32
|
reason: string;
|
|
38
33
|
pageKey: string;
|
|
@@ -40,7 +35,7 @@ export type OnCollapsibleStateChangedEventData = Readonly<{
|
|
|
40
35
|
}>;
|
|
41
36
|
|
|
42
37
|
export type OnNativeTabPressEventData = Readonly<{
|
|
43
|
-
position: Int32;
|
|
38
|
+
position: CodegenTypes.Int32;
|
|
44
39
|
key: string;
|
|
45
40
|
}>;
|
|
46
41
|
export type OnScrollEdgeCapabilityEventData = Readonly<{ available: boolean }>;
|
|
@@ -50,45 +45,45 @@ export type OnScrollEdgeCapabilityEventData = Readonly<{ available: boolean }>;
|
|
|
50
45
|
* CollapsiblePagerView instead of mounting this host component directly.
|
|
51
46
|
*/
|
|
52
47
|
export interface NativeProps extends ViewProps {
|
|
53
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
54
|
-
layoutDirection?: WithDefault<"ltr" | "rtl", "ltr">;
|
|
55
|
-
initialPage?: Int32;
|
|
56
|
-
offscreenPageLimit?: Int32;
|
|
48
|
+
scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
49
|
+
layoutDirection?: CodegenTypes.WithDefault<"ltr" | "rtl", "ltr">;
|
|
50
|
+
initialPage?: CodegenTypes.Int32;
|
|
51
|
+
offscreenPageLimit?: CodegenTypes.Int32;
|
|
57
52
|
// OneKey patch: Preserve nested pager gesture coordination for collapsible pages.
|
|
58
|
-
nestedScrollEnabled?: WithDefault<boolean, false>;
|
|
59
|
-
nativeSmoothHeaderScrollEnabled?: WithDefault<boolean, false>;
|
|
60
|
-
headerHeight?: Int32;
|
|
61
|
-
stickyHeaderHeight?: Int32;
|
|
62
|
-
topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
|
|
53
|
+
nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
54
|
+
nativeSmoothHeaderScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
55
|
+
headerHeight?: CodegenTypes.Int32;
|
|
56
|
+
stickyHeaderHeight?: CodegenTypes.Int32;
|
|
57
|
+
topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
|
|
63
58
|
topOverlayColorScheme?: string;
|
|
64
|
-
topOverlayHeight?: WithDefault<Double, 0>;
|
|
65
|
-
externalTopOverlayTag?: WithDefault<Int32, 0>;
|
|
59
|
+
topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
60
|
+
externalTopOverlayTag?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
|
|
66
61
|
pageKeys?: string;
|
|
67
62
|
retainedPages?: string;
|
|
68
63
|
nativeTabBarItems?: string;
|
|
69
|
-
nativeTabBarHeight?: Double;
|
|
64
|
+
nativeTabBarHeight?: CodegenTypes.Double;
|
|
70
65
|
nativeTabBarVariant?: string;
|
|
71
|
-
nativeTabBarTrailingReservedWidth?: WithDefault<Double, 0>;
|
|
72
|
-
nativeTabBarContentPaddingHorizontal?: Double;
|
|
73
|
-
nativeTabBarContentPaddingVertical?: Double;
|
|
74
|
-
nativeTabBarItemSpacing?: Double;
|
|
75
|
-
nativeTabBarFontSize?: Double;
|
|
66
|
+
nativeTabBarTrailingReservedWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
67
|
+
nativeTabBarContentPaddingHorizontal?: CodegenTypes.Double;
|
|
68
|
+
nativeTabBarContentPaddingVertical?: CodegenTypes.Double;
|
|
69
|
+
nativeTabBarItemSpacing?: CodegenTypes.Double;
|
|
70
|
+
nativeTabBarFontSize?: CodegenTypes.Double;
|
|
76
71
|
nativeTabBarFontFamily?: string;
|
|
77
72
|
nativeTabBarBackgroundColor?: ColorValue;
|
|
78
73
|
nativeTabBarActiveTextColor?: ColorValue;
|
|
79
74
|
nativeTabBarInactiveTextColor?: ColorValue;
|
|
80
75
|
nativeTabBarIndicatorColor?: ColorValue;
|
|
81
|
-
nativeTabBarIndicatorHeight?: Double;
|
|
82
|
-
nativeTabBarIndicatorBottom?: Double;
|
|
76
|
+
nativeTabBarIndicatorHeight?: CodegenTypes.Double;
|
|
77
|
+
nativeTabBarIndicatorBottom?: CodegenTypes.Double;
|
|
83
78
|
nativeSubHeaderConfig?: string;
|
|
84
79
|
nativeSubHeaderSelectedBackgroundColor?: ColorValue;
|
|
85
|
-
onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
|
|
86
|
-
onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
|
|
87
|
-
onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
88
|
-
onCollapsibleStateChanged?: DirectEventHandler<OnCollapsibleStateChangedEventData>;
|
|
89
|
-
onNativeTabPress?: DirectEventHandler<OnNativeTabPressEventData>;
|
|
90
|
-
onNativeSubHeaderPress?: DirectEventHandler<OnNativeTabPressEventData>;
|
|
91
|
-
onScrollEdgeCapability?: DirectEventHandler<OnScrollEdgeCapabilityEventData>;
|
|
80
|
+
onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
|
|
81
|
+
onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
|
|
82
|
+
onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
83
|
+
onCollapsibleStateChanged?: CodegenTypes.DirectEventHandler<OnCollapsibleStateChangedEventData>;
|
|
84
|
+
onNativeTabPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
|
|
85
|
+
onNativeSubHeaderPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
|
|
86
|
+
onScrollEdgeCapability?: CodegenTypes.DirectEventHandler<OnScrollEdgeCapabilityEventData>;
|
|
92
87
|
}
|
|
93
88
|
|
|
94
89
|
type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
|
|
@@ -96,24 +91,24 @@ type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
|
|
|
96
91
|
export interface NativeCommands {
|
|
97
92
|
scrollHeaderToOffset: (
|
|
98
93
|
viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
|
|
99
|
-
offset: Double
|
|
94
|
+
offset: CodegenTypes.Double
|
|
100
95
|
) => void;
|
|
101
96
|
scrollHeaderBy: (
|
|
102
97
|
viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
|
|
103
|
-
delta: Double
|
|
98
|
+
delta: CodegenTypes.Double
|
|
104
99
|
) => void;
|
|
105
100
|
scrollToTop: (
|
|
106
101
|
viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
|
|
107
|
-
target: Int32,
|
|
102
|
+
target: CodegenTypes.Int32,
|
|
108
103
|
animated: boolean
|
|
109
104
|
) => void;
|
|
110
105
|
setPage: (
|
|
111
106
|
viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
|
|
112
|
-
selectedPage: Int32
|
|
107
|
+
selectedPage: CodegenTypes.Int32
|
|
113
108
|
) => void;
|
|
114
109
|
setPageWithoutAnimation: (
|
|
115
110
|
viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
|
|
116
|
-
selectedPage: Int32
|
|
111
|
+
selectedPage: CodegenTypes.Int32
|
|
117
112
|
) => void;
|
|
118
113
|
setScrollEnabledImperatively: (
|
|
119
114
|
viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
|
|
@@ -9,8 +9,10 @@ export const NativeScroller = /*#__PURE__*/React.forwardRef(function NativeScrol
|
|
|
9
9
|
pagerScrollKey,
|
|
10
10
|
topOverlay: _topOverlay,
|
|
11
11
|
topScrollEdgeEffect: _topScrollEdgeEffect,
|
|
12
|
+
keyboardShouldPersistTaps,
|
|
12
13
|
...props
|
|
13
14
|
} = inputProps;
|
|
15
|
+
const persistTaps = keyboardShouldPersistTaps === true ? "always" : keyboardShouldPersistTaps === false ? "never" : keyboardShouldPersistTaps;
|
|
14
16
|
const scrollRef = React.useRef(null);
|
|
15
17
|
const setRef = React.useCallback(node => {
|
|
16
18
|
scrollRef.current = node;
|
|
@@ -32,6 +34,7 @@ export const NativeScroller = /*#__PURE__*/React.forwardRef(function NativeScrol
|
|
|
32
34
|
};
|
|
33
35
|
return /*#__PURE__*/_jsx(ScrollView, {
|
|
34
36
|
...props,
|
|
37
|
+
keyboardShouldPersistTaps: persistTaps,
|
|
35
38
|
ref: setRef,
|
|
36
39
|
...webDataProps
|
|
37
40
|
});
|
|
@@ -2,69 +2,66 @@ import type * as React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
codegenNativeCommands,
|
|
4
4
|
codegenNativeComponent,
|
|
5
|
+
type CodegenTypes,
|
|
5
6
|
type ColorValue,
|
|
6
7
|
type HostComponent,
|
|
7
8
|
type ViewProps,
|
|
8
9
|
} from "react-native";
|
|
9
|
-
|
|
10
|
-
DirectEventHandler,
|
|
11
|
-
Double,
|
|
12
|
-
WithDefault,
|
|
13
|
-
} from "react-native/Libraries/Types/CodegenTypes";
|
|
10
|
+
|
|
14
11
|
|
|
15
12
|
export type NativeScrollerScrollEvent = Readonly<{
|
|
16
13
|
contentInset: Readonly<{
|
|
17
|
-
top: Double;
|
|
18
|
-
right: Double;
|
|
19
|
-
bottom: Double;
|
|
20
|
-
left: Double;
|
|
14
|
+
top: CodegenTypes.Double;
|
|
15
|
+
right: CodegenTypes.Double;
|
|
16
|
+
bottom: CodegenTypes.Double;
|
|
17
|
+
left: CodegenTypes.Double;
|
|
21
18
|
}>;
|
|
22
|
-
contentOffset: Readonly<{ x: Double; y: Double }>;
|
|
23
|
-
contentSize: Readonly<{ width: Double; height: Double }>;
|
|
24
|
-
layoutMeasurement: Readonly<{ width: Double; height: Double }>;
|
|
25
|
-
velocity: Readonly<{ x: Double; y: Double }>;
|
|
26
|
-
targetContentOffset: Readonly<{ x: Double; y: Double }>;
|
|
27
|
-
zoomScale: Double;
|
|
19
|
+
contentOffset: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double }>;
|
|
20
|
+
contentSize: Readonly<{ width: CodegenTypes.Double; height: CodegenTypes.Double }>;
|
|
21
|
+
layoutMeasurement: Readonly<{ width: CodegenTypes.Double; height: CodegenTypes.Double }>;
|
|
22
|
+
velocity: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double }>;
|
|
23
|
+
targetContentOffset: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double }>;
|
|
24
|
+
zoomScale: CodegenTypes.Double;
|
|
28
25
|
}>;
|
|
29
26
|
|
|
30
27
|
export interface NativeProps extends ViewProps {
|
|
31
|
-
contentWidth?: WithDefault<Double, 0>;
|
|
32
|
-
contentHeight?: WithDefault<Double, 0>;
|
|
33
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
34
|
-
nestedScrollEnabled?: WithDefault<boolean, true>;
|
|
35
|
-
showsVerticalScrollIndicator?: WithDefault<boolean, true>;
|
|
36
|
-
showsHorizontalScrollIndicator?: WithDefault<boolean, false>;
|
|
37
|
-
bounces?: WithDefault<boolean, true>;
|
|
38
|
-
alwaysBounceVertical?: WithDefault<boolean, true>;
|
|
39
|
-
keyboardDismissMode?: WithDefault<"none" | "on-drag" | "interactive", "none">;
|
|
40
|
-
keyboardShouldPersistTaps?: WithDefault<
|
|
28
|
+
contentWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
29
|
+
contentHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
30
|
+
scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
31
|
+
nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
32
|
+
showsVerticalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
|
|
33
|
+
showsHorizontalScrollIndicator?: CodegenTypes.WithDefault<boolean, false>;
|
|
34
|
+
bounces?: CodegenTypes.WithDefault<boolean, true>;
|
|
35
|
+
alwaysBounceVertical?: CodegenTypes.WithDefault<boolean, true>;
|
|
36
|
+
keyboardDismissMode?: CodegenTypes.WithDefault<"none" | "on-drag" | "interactive", "none">;
|
|
37
|
+
keyboardShouldPersistTaps?: CodegenTypes.WithDefault<
|
|
41
38
|
"never" | "always" | "handled",
|
|
42
39
|
"never"
|
|
43
40
|
>;
|
|
44
|
-
scrollEventThrottle?: WithDefault<Double, 0>;
|
|
45
|
-
decelerationRate?: WithDefault<Double, 0.998>;
|
|
46
|
-
contentInsetTop?: WithDefault<Double, 0>;
|
|
47
|
-
contentInsetRight?: WithDefault<Double, 0>;
|
|
48
|
-
contentInsetBottom?: WithDefault<Double, 0>;
|
|
49
|
-
contentInsetLeft?: WithDefault<Double, 0>;
|
|
50
|
-
topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
|
|
51
|
-
topOverlayHeight?: WithDefault<Double, 0>;
|
|
52
|
-
refreshEnabled?: WithDefault<boolean, false>;
|
|
53
|
-
refreshing?: WithDefault<boolean, false>;
|
|
41
|
+
scrollEventThrottle?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
42
|
+
decelerationRate?: CodegenTypes.WithDefault<CodegenTypes.Double, 0.998>;
|
|
43
|
+
contentInsetTop?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
44
|
+
contentInsetRight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
45
|
+
contentInsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
46
|
+
contentInsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
47
|
+
topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
|
|
48
|
+
topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
49
|
+
refreshEnabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
50
|
+
refreshing?: CodegenTypes.WithDefault<boolean, false>;
|
|
54
51
|
refreshTintColor?: ColorValue;
|
|
55
52
|
refreshColors?: ReadonlyArray<ColorValue>;
|
|
56
53
|
refreshProgressBackgroundColor?: ColorValue;
|
|
57
|
-
refreshProgressViewOffset?: WithDefault<Double, 0>;
|
|
54
|
+
refreshProgressViewOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
58
55
|
refreshTitle?: string;
|
|
59
56
|
refreshTitleColor?: ColorValue;
|
|
60
|
-
refreshSize?: WithDefault<"default" | "large", "default">;
|
|
61
|
-
onContentViewportChange?: DirectEventHandler<Readonly<{ height: Double }>>;
|
|
62
|
-
onRefresh?: DirectEventHandler<null>;
|
|
63
|
-
onScroll?: DirectEventHandler<NativeScrollerScrollEvent>;
|
|
64
|
-
onScrollBeginDrag?: DirectEventHandler<NativeScrollerScrollEvent>;
|
|
65
|
-
onScrollEndDrag?: DirectEventHandler<NativeScrollerScrollEvent>;
|
|
66
|
-
onMomentumScrollBegin?: DirectEventHandler<NativeScrollerScrollEvent>;
|
|
67
|
-
onMomentumScrollEnd?: DirectEventHandler<NativeScrollerScrollEvent>;
|
|
57
|
+
refreshSize?: CodegenTypes.WithDefault<"default" | "large", "default">;
|
|
58
|
+
onContentViewportChange?: CodegenTypes.DirectEventHandler<Readonly<{ height: CodegenTypes.Double }>>;
|
|
59
|
+
onRefresh?: CodegenTypes.DirectEventHandler<null>;
|
|
60
|
+
onScroll?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
|
|
61
|
+
onScrollBeginDrag?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
|
|
62
|
+
onScrollEndDrag?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
|
|
63
|
+
onMomentumScrollBegin?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
|
|
64
|
+
onMomentumScrollEnd?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
type NativeScrollerHost = HostComponent<NativeProps>;
|
|
@@ -72,8 +69,8 @@ type NativeScrollerHost = HostComponent<NativeProps>;
|
|
|
72
69
|
export interface NativeCommands {
|
|
73
70
|
scrollTo: (
|
|
74
71
|
viewRef: React.ElementRef<NativeScrollerHost>,
|
|
75
|
-
x: Double,
|
|
76
|
-
y: Double,
|
|
72
|
+
x: CodegenTypes.Double,
|
|
73
|
+
y: CodegenTypes.Double,
|
|
77
74
|
animated: boolean
|
|
78
75
|
) => void;
|
|
79
76
|
scrollToEnd: (
|
|
@@ -2,24 +2,19 @@ import type * as React from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
codegenNativeCommands,
|
|
4
4
|
codegenNativeComponent,
|
|
5
|
+
type CodegenTypes,
|
|
5
6
|
type HostComponent,
|
|
6
7
|
type ViewProps,
|
|
7
8
|
} from 'react-native';
|
|
8
9
|
|
|
9
|
-
import type {
|
|
10
|
-
DirectEventHandler,
|
|
11
|
-
Double,
|
|
12
|
-
Int32,
|
|
13
|
-
WithDefault,
|
|
14
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
15
10
|
|
|
16
11
|
export type OnPageScrollEventData = Readonly<{
|
|
17
|
-
position: Double;
|
|
18
|
-
offset: Double;
|
|
12
|
+
position: CodegenTypes.Double;
|
|
13
|
+
offset: CodegenTypes.Double;
|
|
19
14
|
}>;
|
|
20
15
|
|
|
21
16
|
export type OnPageSelectedEventData = Readonly<{
|
|
22
|
-
position: Double;
|
|
17
|
+
position: CodegenTypes.Double;
|
|
23
18
|
}>;
|
|
24
19
|
|
|
25
20
|
export type OnPageScrollStateChangedEventData = Readonly<{
|
|
@@ -27,32 +22,32 @@ export type OnPageScrollStateChangedEventData = Readonly<{
|
|
|
27
22
|
}>;
|
|
28
23
|
|
|
29
24
|
export interface NativeProps extends ViewProps {
|
|
30
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
31
|
-
layoutDirection?: WithDefault<'ltr' | 'rtl', 'ltr'>;
|
|
32
|
-
initialPage?: Int32;
|
|
33
|
-
orientation?: WithDefault<'horizontal' | 'vertical', 'horizontal'>;
|
|
34
|
-
offscreenPageLimit?: Int32;
|
|
35
|
-
pageMargin?: Int32;
|
|
36
|
-
overScrollMode?: WithDefault<'auto' | 'always' | 'never', 'auto'>;
|
|
37
|
-
overdrag?: WithDefault<boolean, false>;
|
|
38
|
-
keyboardDismissMode?: WithDefault<'none' | 'on-drag', 'none'>;
|
|
25
|
+
scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
26
|
+
layoutDirection?: CodegenTypes.WithDefault<'ltr' | 'rtl', 'ltr'>;
|
|
27
|
+
initialPage?: CodegenTypes.Int32;
|
|
28
|
+
orientation?: CodegenTypes.WithDefault<'horizontal' | 'vertical', 'horizontal'>;
|
|
29
|
+
offscreenPageLimit?: CodegenTypes.Int32;
|
|
30
|
+
pageMargin?: CodegenTypes.Int32;
|
|
31
|
+
overScrollMode?: CodegenTypes.WithDefault<'auto' | 'always' | 'never', 'auto'>;
|
|
32
|
+
overdrag?: CodegenTypes.WithDefault<boolean, false>;
|
|
33
|
+
keyboardDismissMode?: CodegenTypes.WithDefault<'none' | 'on-drag', 'none'>;
|
|
39
34
|
/**
|
|
40
35
|
* Controls the sensitivity of scroll gestures on Android.
|
|
41
36
|
* Higher values make scrolling less sensitive.
|
|
42
37
|
* Valid range: 2 - 8
|
|
43
38
|
* @platform android
|
|
44
39
|
*/
|
|
45
|
-
scrollSensitivity?: Int32;
|
|
40
|
+
scrollSensitivity?: CodegenTypes.Int32;
|
|
46
41
|
/**
|
|
47
42
|
* When true on an inner PagerView, enables gesture coordination with
|
|
48
43
|
* a parent (outer) PagerView. At sub-tab boundaries the inner pager's
|
|
49
44
|
* gesture recognizer will not begin, allowing the outer pager to take over.
|
|
50
45
|
* @platform ios
|
|
51
46
|
*/
|
|
52
|
-
nestedScrollEnabled?: WithDefault<boolean, false>;
|
|
53
|
-
onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
|
|
54
|
-
onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
|
|
55
|
-
onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
47
|
+
nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
48
|
+
onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
|
|
49
|
+
onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
|
|
50
|
+
onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
56
51
|
}
|
|
57
52
|
|
|
58
53
|
type PagerViewViewType = HostComponent<NativeProps>;
|
|
@@ -60,11 +55,11 @@ type PagerViewViewType = HostComponent<NativeProps>;
|
|
|
60
55
|
export interface NativeCommands {
|
|
61
56
|
setPage: (
|
|
62
57
|
viewRef: React.ElementRef<PagerViewViewType>,
|
|
63
|
-
selectedPage: Int32
|
|
58
|
+
selectedPage: CodegenTypes.Int32
|
|
64
59
|
) => void;
|
|
65
60
|
setPageWithoutAnimation: (
|
|
66
61
|
viewRef: React.ElementRef<PagerViewViewType>,
|
|
67
|
-
selectedPage: Int32
|
|
62
|
+
selectedPage: CodegenTypes.Int32
|
|
68
63
|
) => void;
|
|
69
64
|
setScrollEnabledImperatively: (
|
|
70
65
|
viewRef: React.ElementRef<PagerViewViewType>,
|
|
@@ -147,7 +147,7 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
|
|
|
147
147
|
private onPageScrollStateChanged;
|
|
148
148
|
private onNativeTabPress;
|
|
149
149
|
private onNativeSubHeaderPress;
|
|
150
|
-
render():
|
|
150
|
+
render(): React.JSX.Element;
|
|
151
151
|
}
|
|
152
152
|
export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
|
|
153
153
|
export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
|
|
@@ -180,7 +180,7 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
|
|
|
180
180
|
private onTouchMove;
|
|
181
181
|
private onTouchEnd;
|
|
182
182
|
private onTouchCancel;
|
|
183
|
-
render():
|
|
183
|
+
render(): React.JSX.Element;
|
|
184
184
|
}
|
|
185
185
|
export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
|
|
186
186
|
export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import type * as React from "react";
|
|
2
|
-
import { type ColorValue, type HostComponent, type ViewProps } from "react-native";
|
|
3
|
-
import type { DirectEventHandler, Double, Int32, WithDefault } from "react-native/Libraries/Types/CodegenTypes";
|
|
2
|
+
import { type CodegenTypes, type ColorValue, type HostComponent, type ViewProps } from "react-native";
|
|
4
3
|
export type OnPageScrollEventData = Readonly<{
|
|
5
|
-
position: Double;
|
|
6
|
-
offset: Double;
|
|
4
|
+
position: CodegenTypes.Double;
|
|
5
|
+
offset: CodegenTypes.Double;
|
|
7
6
|
}>;
|
|
8
7
|
export type OnPageSelectedEventData = Readonly<{
|
|
9
|
-
position: Double;
|
|
8
|
+
position: CodegenTypes.Double;
|
|
10
9
|
}>;
|
|
11
10
|
export type OnPageScrollStateChangedEventData = Readonly<{
|
|
12
11
|
pageScrollState: "idle" | "dragging" | "settling";
|
|
13
12
|
}>;
|
|
14
13
|
export type OnCollapsibleStateChangedEventData = Readonly<{
|
|
15
|
-
position: Int32;
|
|
16
|
-
headerOffset: Double;
|
|
17
|
-
nativePageCount: Int32;
|
|
18
|
-
attachedPageCount: Int32;
|
|
19
|
-
observedScrollableCount: Int32;
|
|
14
|
+
position: CodegenTypes.Int32;
|
|
15
|
+
headerOffset: CodegenTypes.Double;
|
|
16
|
+
nativePageCount: CodegenTypes.Int32;
|
|
17
|
+
attachedPageCount: CodegenTypes.Int32;
|
|
18
|
+
observedScrollableCount: CodegenTypes.Int32;
|
|
20
19
|
retainedPages: string;
|
|
21
20
|
reason: string;
|
|
22
21
|
pageKey: string;
|
|
23
22
|
headerSettledAtTop: boolean;
|
|
24
23
|
}>;
|
|
25
24
|
export type OnNativeTabPressEventData = Readonly<{
|
|
26
|
-
position: Int32;
|
|
25
|
+
position: CodegenTypes.Int32;
|
|
27
26
|
key: string;
|
|
28
27
|
}>;
|
|
29
28
|
export type OnScrollEdgeCapabilityEventData = Readonly<{
|
|
@@ -34,52 +33,52 @@ export type OnScrollEdgeCapabilityEventData = Readonly<{
|
|
|
34
33
|
* CollapsiblePagerView instead of mounting this host component directly.
|
|
35
34
|
*/
|
|
36
35
|
export interface NativeProps extends ViewProps {
|
|
37
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
38
|
-
layoutDirection?: WithDefault<"ltr" | "rtl", "ltr">;
|
|
39
|
-
initialPage?: Int32;
|
|
40
|
-
offscreenPageLimit?: Int32;
|
|
41
|
-
nestedScrollEnabled?: WithDefault<boolean, false>;
|
|
42
|
-
nativeSmoothHeaderScrollEnabled?: WithDefault<boolean, false>;
|
|
43
|
-
headerHeight?: Int32;
|
|
44
|
-
stickyHeaderHeight?: Int32;
|
|
45
|
-
topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
|
|
36
|
+
scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
|
|
37
|
+
layoutDirection?: CodegenTypes.WithDefault<"ltr" | "rtl", "ltr">;
|
|
38
|
+
initialPage?: CodegenTypes.Int32;
|
|
39
|
+
offscreenPageLimit?: CodegenTypes.Int32;
|
|
40
|
+
nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
41
|
+
nativeSmoothHeaderScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
42
|
+
headerHeight?: CodegenTypes.Int32;
|
|
43
|
+
stickyHeaderHeight?: CodegenTypes.Int32;
|
|
44
|
+
topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
|
|
46
45
|
topOverlayColorScheme?: string;
|
|
47
|
-
topOverlayHeight?: WithDefault<Double, 0>;
|
|
48
|
-
externalTopOverlayTag?: WithDefault<Int32, 0>;
|
|
46
|
+
topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
47
|
+
externalTopOverlayTag?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
|
|
49
48
|
pageKeys?: string;
|
|
50
49
|
retainedPages?: string;
|
|
51
50
|
nativeTabBarItems?: string;
|
|
52
|
-
nativeTabBarHeight?: Double;
|
|
51
|
+
nativeTabBarHeight?: CodegenTypes.Double;
|
|
53
52
|
nativeTabBarVariant?: string;
|
|
54
|
-
nativeTabBarTrailingReservedWidth?: WithDefault<Double, 0>;
|
|
55
|
-
nativeTabBarContentPaddingHorizontal?: Double;
|
|
56
|
-
nativeTabBarContentPaddingVertical?: Double;
|
|
57
|
-
nativeTabBarItemSpacing?: Double;
|
|
58
|
-
nativeTabBarFontSize?: Double;
|
|
53
|
+
nativeTabBarTrailingReservedWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
54
|
+
nativeTabBarContentPaddingHorizontal?: CodegenTypes.Double;
|
|
55
|
+
nativeTabBarContentPaddingVertical?: CodegenTypes.Double;
|
|
56
|
+
nativeTabBarItemSpacing?: CodegenTypes.Double;
|
|
57
|
+
nativeTabBarFontSize?: CodegenTypes.Double;
|
|
59
58
|
nativeTabBarFontFamily?: string;
|
|
60
59
|
nativeTabBarBackgroundColor?: ColorValue;
|
|
61
60
|
nativeTabBarActiveTextColor?: ColorValue;
|
|
62
61
|
nativeTabBarInactiveTextColor?: ColorValue;
|
|
63
62
|
nativeTabBarIndicatorColor?: ColorValue;
|
|
64
|
-
nativeTabBarIndicatorHeight?: Double;
|
|
65
|
-
nativeTabBarIndicatorBottom?: Double;
|
|
63
|
+
nativeTabBarIndicatorHeight?: CodegenTypes.Double;
|
|
64
|
+
nativeTabBarIndicatorBottom?: CodegenTypes.Double;
|
|
66
65
|
nativeSubHeaderConfig?: string;
|
|
67
66
|
nativeSubHeaderSelectedBackgroundColor?: ColorValue;
|
|
68
|
-
onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
|
|
69
|
-
onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
|
|
70
|
-
onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
71
|
-
onCollapsibleStateChanged?: DirectEventHandler<OnCollapsibleStateChangedEventData>;
|
|
72
|
-
onNativeTabPress?: DirectEventHandler<OnNativeTabPressEventData>;
|
|
73
|
-
onNativeSubHeaderPress?: DirectEventHandler<OnNativeTabPressEventData>;
|
|
74
|
-
onScrollEdgeCapability?: DirectEventHandler<OnScrollEdgeCapabilityEventData>;
|
|
67
|
+
onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
|
|
68
|
+
onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
|
|
69
|
+
onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
70
|
+
onCollapsibleStateChanged?: CodegenTypes.DirectEventHandler<OnCollapsibleStateChangedEventData>;
|
|
71
|
+
onNativeTabPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
|
|
72
|
+
onNativeSubHeaderPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
|
|
73
|
+
onScrollEdgeCapability?: CodegenTypes.DirectEventHandler<OnScrollEdgeCapabilityEventData>;
|
|
75
74
|
}
|
|
76
75
|
type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
|
|
77
76
|
export interface NativeCommands {
|
|
78
|
-
scrollHeaderToOffset: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, offset: Double) => void;
|
|
79
|
-
scrollHeaderBy: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, delta: Double) => void;
|
|
80
|
-
scrollToTop: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, target: Int32, animated: boolean) => void;
|
|
81
|
-
setPage: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: Int32) => void;
|
|
82
|
-
setPageWithoutAnimation: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: Int32) => void;
|
|
77
|
+
scrollHeaderToOffset: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, offset: CodegenTypes.Double) => void;
|
|
78
|
+
scrollHeaderBy: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, delta: CodegenTypes.Double) => void;
|
|
79
|
+
scrollToTop: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, target: CodegenTypes.Int32, animated: boolean) => void;
|
|
80
|
+
setPage: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: CodegenTypes.Int32) => void;
|
|
81
|
+
setPageWithoutAnimation: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: CodegenTypes.Int32) => void;
|
|
83
82
|
setScrollEnabledImperatively: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, scrollEnabled: boolean) => void;
|
|
84
83
|
}
|
|
85
84
|
export declare const Commands: NativeCommands;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type
|
|
2
|
+
import { type HostInstance, type RefreshControlProps, type ScrollView, type ScrollViewProps, type ViewProps } from "react-native";
|
|
3
3
|
import NativeScrollerHost from "./NativeScrollerNativeComponent";
|
|
4
4
|
import type { ScrollEdgeEffect } from "./ScrollEdgeEffect";
|
|
5
5
|
export declare const NATIVE_SCROLLER_NATIVE_ID_PREFIX = "rnc-collapsible-pager-native-scroller";
|
|
6
6
|
/** Supported vertical subset; horizontal, snapping, zoom and sticky rows are not supported. */
|
|
7
|
-
export interface NativeScrollerProps extends ViewProps, Pick<ScrollViewProps, "contentContainerStyle" | "onContentSizeChange" | "scrollEnabled" | "nestedScrollEnabled" | "showsVerticalScrollIndicator" | "showsHorizontalScrollIndicator" | "bounces" | "alwaysBounceVertical" | "contentInset" | "keyboardDismissMode" | "
|
|
7
|
+
export interface NativeScrollerProps extends ViewProps, Pick<ScrollViewProps, "contentContainerStyle" | "onContentSizeChange" | "scrollEnabled" | "nestedScrollEnabled" | "showsVerticalScrollIndicator" | "showsHorizontalScrollIndicator" | "bounces" | "alwaysBounceVertical" | "contentInset" | "keyboardDismissMode" | "scrollEventThrottle" | "decelerationRate" | "onScroll" | "onScrollBeginDrag" | "onScrollEndDrag" | "onMomentumScrollBegin" | "onMomentumScrollEnd"> {
|
|
8
8
|
pagerScrollKey?: string;
|
|
9
9
|
/** Fixed overlay above scrolling content on iOS 26 and newer. */
|
|
10
10
|
topOverlay?: React.ReactNode;
|
|
@@ -14,9 +14,11 @@ export interface NativeScrollerProps extends ViewProps, Pick<ScrollViewProps, "c
|
|
|
14
14
|
decelerationRate?: ScrollViewProps["decelerationRate"];
|
|
15
15
|
/** Standard RefreshControl props are mapped to the independently owned native controller. */
|
|
16
16
|
refreshControl?: React.ReactElement<RefreshControlProps>;
|
|
17
|
+
/** Boolean values are deprecated compatibility aliases (`true` -> `always`, `false` -> `never`). */
|
|
18
|
+
keyboardShouldPersistTaps?: ScrollViewProps["keyboardShouldPersistTaps"] | boolean;
|
|
17
19
|
}
|
|
18
20
|
type HostRef = React.ElementRef<typeof NativeScrollerHost>;
|
|
19
|
-
export interface NativeScrollerRef extends
|
|
21
|
+
export interface NativeScrollerRef extends Pick<HostInstance, "measure" | "measureInWindow" | "measureLayout" | "setNativeProps" | "focus" | "blur">, Pick<React.ElementRef<typeof ScrollView>, "scrollTo" | "scrollToEnd" | "flashScrollIndicators"> {
|
|
20
22
|
getNativeScrollRef(): HostRef | null;
|
|
21
23
|
getScrollableNode(): number | null;
|
|
22
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { NativeScrollerProps } from "./NativeScroller";
|
|
3
|
-
export declare const NativeScroller: React.ForwardRefExoticComponent<NativeScrollerProps & React.RefAttributes<import("react-native
|
|
3
|
+
export declare const NativeScroller: React.ForwardRefExoticComponent<NativeScrollerProps & React.RefAttributes<import("react-native").ScrollViewInstance>>;
|
|
4
4
|
export type { NativeScrollerProps } from "./NativeScroller";
|
|
5
5
|
//# sourceMappingURL=NativeScroller.web.d.ts.map
|