@onekeyfe/react-native-pager-view 3.0.113 → 3.0.114
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/README.md +0 -40
- package/android/src/main/java/com/reactnativepagerview/PagerViewViewPackage.kt +1 -1
- package/lib/module/index.js +1 -2
- package/lib/module/usePagerView.js +1 -1
- package/lib/typescript/src/index.d.ts +4 -5
- package/package.json +2 -5
- package/src/index.tsx +4 -5
- package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerHost.kt +0 -503
- package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerViewManager.kt +0 -215
- package/android/src/main/java/com/reactnativepagerview/event/CollapsibleStateChangedEvent.kt +0 -39
- package/ios/RNCCollapsiblePagerViewComponentView.h +0 -9
- package/ios/RNCCollapsiblePagerViewComponentView.mm +0 -738
- package/lib/module/CollapsiblePagerView.js +0 -152
- package/lib/module/CollapsiblePagerView.web.js +0 -364
- package/lib/module/CollapsiblePagerViewNativeComponent.ts +0 -85
- package/lib/module/PagerView.web.js +0 -177
- package/lib/module/index.web.js +0 -6
- package/lib/typescript/src/CollapsiblePagerView.d.ts +0 -58
- package/lib/typescript/src/CollapsiblePagerView.web.d.ts +0 -93
- package/lib/typescript/src/CollapsiblePagerViewNativeComponent.d.ts +0 -50
- package/lib/typescript/src/PagerView.web.d.ts +0 -55
- package/lib/typescript/src/index.web.d.ts +0 -5
- package/src/CollapsiblePagerView.tsx +0 -258
- package/src/CollapsiblePagerView.web.tsx +0 -559
- package/src/CollapsiblePagerViewNativeComponent.ts +0 -85
- package/src/PagerView.web.tsx +0 -280
- package/src/index.web.tsx +0 -12
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { I18nManager, Keyboard, StyleSheet, View } from "react-native";
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
/**
|
|
7
|
-
* Web fallback for the ordinary PagerView API. All pages stay mounted, matching
|
|
8
|
-
* the package's pre-existing PagerView lifetime contract.
|
|
9
|
-
*/
|
|
10
|
-
export class PagerView extends React.Component {
|
|
11
|
-
state = {
|
|
12
|
-
selectedPage: Math.max(0, Math.trunc(this.props.initialPage ?? 0)),
|
|
13
|
-
animateTransition: true
|
|
14
|
-
};
|
|
15
|
-
pointerStart = null;
|
|
16
|
-
scrollEnabled = this.props.scrollEnabled ?? true;
|
|
17
|
-
componentDidUpdate(previousProps) {
|
|
18
|
-
if (previousProps.scrollEnabled !== this.props.scrollEnabled) {
|
|
19
|
-
this.scrollEnabled = this.props.scrollEnabled ?? true;
|
|
20
|
-
}
|
|
21
|
-
const pageCount = React.Children.count(this.props.children);
|
|
22
|
-
if (pageCount > 0 && this.state.selectedPage >= pageCount) {
|
|
23
|
-
this.setState({
|
|
24
|
-
selectedPage: pageCount - 1,
|
|
25
|
-
animateTransition: false
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
setPage = selectedPage => {
|
|
30
|
-
this.selectPage(selectedPage, true);
|
|
31
|
-
};
|
|
32
|
-
setPageWithoutAnimation = selectedPage => {
|
|
33
|
-
this.selectPage(selectedPage, false);
|
|
34
|
-
};
|
|
35
|
-
setScrollEnabled = scrollEnabled => {
|
|
36
|
-
this.scrollEnabled = scrollEnabled;
|
|
37
|
-
};
|
|
38
|
-
nativeEvent(nativeEvent) {
|
|
39
|
-
return {
|
|
40
|
-
nativeEvent
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
selectPage(selectedPage, animated) {
|
|
44
|
-
const pageCount = React.Children.count(this.props.children);
|
|
45
|
-
const position = Math.trunc(selectedPage);
|
|
46
|
-
if (position < 0 || position >= pageCount || position === this.state.selectedPage) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.props.onPageScrollStateChanged?.(this.nativeEvent({
|
|
50
|
-
pageScrollState: animated ? "settling" : "idle"
|
|
51
|
-
}));
|
|
52
|
-
this.setState({
|
|
53
|
-
selectedPage: position,
|
|
54
|
-
animateTransition: animated
|
|
55
|
-
}, () => {
|
|
56
|
-
this.props.onPageScroll?.(this.nativeEvent({
|
|
57
|
-
position,
|
|
58
|
-
offset: 0
|
|
59
|
-
}));
|
|
60
|
-
this.props.onPageSelected?.(this.nativeEvent({
|
|
61
|
-
position
|
|
62
|
-
}));
|
|
63
|
-
if (animated) {
|
|
64
|
-
this.props.onPageScrollStateChanged?.(this.nativeEvent({
|
|
65
|
-
pageScrollState: "idle"
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
onTouchStart = event => {
|
|
71
|
-
if (!this.scrollEnabled) return;
|
|
72
|
-
this.pointerStart = {
|
|
73
|
-
x: event.nativeEvent.pageX,
|
|
74
|
-
y: event.nativeEvent.pageY
|
|
75
|
-
};
|
|
76
|
-
if (this.props.keyboardDismissMode === "on-drag") Keyboard.dismiss();
|
|
77
|
-
this.props.onPageScrollStateChanged?.(this.nativeEvent({
|
|
78
|
-
pageScrollState: "dragging"
|
|
79
|
-
}));
|
|
80
|
-
};
|
|
81
|
-
onTouchEnd = event => {
|
|
82
|
-
const start = this.pointerStart;
|
|
83
|
-
this.pointerStart = null;
|
|
84
|
-
if (!start || !this.scrollEnabled) return;
|
|
85
|
-
const vertical = this.props.orientation === "vertical";
|
|
86
|
-
const delta = vertical ? event.nativeEvent.pageY - start.y : event.nativeEvent.pageX - start.x;
|
|
87
|
-
const isRTL = !vertical && (this.props.layoutDirection === "rtl" || (!this.props.layoutDirection || this.props.layoutDirection === "locale") && I18nManager.isRTL);
|
|
88
|
-
const direction = Math.abs(delta) >= 40 ? delta < 0 ? 1 : -1 : 0;
|
|
89
|
-
const next = this.state.selectedPage + (isRTL ? -direction : direction);
|
|
90
|
-
if (direction === 0 || next < 0 || next >= React.Children.count(this.props.children)) {
|
|
91
|
-
this.props.onPageScrollStateChanged?.(this.nativeEvent({
|
|
92
|
-
pageScrollState: "idle"
|
|
93
|
-
}));
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
this.selectPage(next, true);
|
|
97
|
-
};
|
|
98
|
-
render() {
|
|
99
|
-
const {
|
|
100
|
-
children,
|
|
101
|
-
style,
|
|
102
|
-
orientation = "horizontal",
|
|
103
|
-
pageMargin = 0,
|
|
104
|
-
scrollEnabled: _scrollEnabled,
|
|
105
|
-
initialPage: _initialPage,
|
|
106
|
-
layoutDirection: _layoutDirection,
|
|
107
|
-
offscreenPageLimit: _offscreenPageLimit,
|
|
108
|
-
overScrollMode: _overScrollMode,
|
|
109
|
-
overdrag: _overdrag,
|
|
110
|
-
keyboardDismissMode: _keyboardDismissMode,
|
|
111
|
-
scrollSensitivity: _scrollSensitivity,
|
|
112
|
-
nestedScrollEnabled: _nestedScrollEnabled,
|
|
113
|
-
onPageScroll: _onPageScroll,
|
|
114
|
-
onPageSelected: _onPageSelected,
|
|
115
|
-
onPageScrollStateChanged: _onPageScrollStateChanged,
|
|
116
|
-
...viewProps
|
|
117
|
-
} = this.props;
|
|
118
|
-
const pages = React.Children.toArray(children);
|
|
119
|
-
const vertical = orientation === "vertical";
|
|
120
|
-
const pageExtent = pages.length > 0 ? `${100 / pages.length}%` : "100%";
|
|
121
|
-
const transform = vertical ? [{
|
|
122
|
-
translateY: `${-this.state.selectedPage * 100 / Math.max(1, pages.length)}%`
|
|
123
|
-
}] : [{
|
|
124
|
-
translateX: `${-this.state.selectedPage * 100 / Math.max(1, pages.length)}%`
|
|
125
|
-
}];
|
|
126
|
-
return /*#__PURE__*/_jsx(View, {
|
|
127
|
-
...viewProps,
|
|
128
|
-
style: [styles.root, style],
|
|
129
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
130
|
-
style: [styles.track, vertical ? styles.verticalTrack : styles.horizontalTrack, vertical ? {
|
|
131
|
-
height: `${Math.max(1, pages.length) * 100}%`
|
|
132
|
-
} : {
|
|
133
|
-
width: `${Math.max(1, pages.length) * 100}%`
|
|
134
|
-
}, {
|
|
135
|
-
transform,
|
|
136
|
-
transitionProperty: "transform",
|
|
137
|
-
transitionDuration: this.state.animateTransition ? "240ms" : "0ms"
|
|
138
|
-
}],
|
|
139
|
-
onTouchStart: this.onTouchStart,
|
|
140
|
-
onTouchEnd: this.onTouchEnd,
|
|
141
|
-
children: pages.map((page, index) => /*#__PURE__*/_jsx(View, {
|
|
142
|
-
style: [styles.page, vertical ? {
|
|
143
|
-
height: pageExtent,
|
|
144
|
-
paddingVertical: pageMargin / 2
|
|
145
|
-
} : {
|
|
146
|
-
width: pageExtent,
|
|
147
|
-
paddingHorizontal: pageMargin / 2
|
|
148
|
-
}],
|
|
149
|
-
children: page
|
|
150
|
-
}, /*#__PURE__*/React.isValidElement(page) ? page.key ?? index : index))
|
|
151
|
-
})
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
const styles = StyleSheet.create({
|
|
156
|
-
root: {
|
|
157
|
-
overflow: "hidden"
|
|
158
|
-
},
|
|
159
|
-
track: {
|
|
160
|
-
flex: 1
|
|
161
|
-
},
|
|
162
|
-
horizontalTrack: {
|
|
163
|
-
flexDirection: "row",
|
|
164
|
-
height: "100%"
|
|
165
|
-
},
|
|
166
|
-
verticalTrack: {
|
|
167
|
-
flexDirection: "column",
|
|
168
|
-
width: "100%"
|
|
169
|
-
},
|
|
170
|
-
page: {
|
|
171
|
-
flexShrink: 0,
|
|
172
|
-
minWidth: 0,
|
|
173
|
-
minHeight: 0,
|
|
174
|
-
overflow: "hidden"
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
//# sourceMappingURL=PagerView.web.js.map
|
package/lib/module/index.web.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type * as ReactNative from "react-native";
|
|
3
|
-
import { type NativeProps, type OnCollapsibleStateChangedEventData } from "./CollapsiblePagerViewNativeComponent";
|
|
4
|
-
import type { OnPageScrollEventData, OnPageScrollStateChangedEventData, OnPageSelectedEventData } from "./PagerViewNativeComponent";
|
|
5
|
-
export type CollapsiblePagerDiagnostics = ReactNative.NativeSyntheticEvent<OnCollapsibleStateChangedEventData>;
|
|
6
|
-
export type CollapsiblePagerMountState = Readonly<{
|
|
7
|
-
position: number;
|
|
8
|
-
mountedPages: readonly number[];
|
|
9
|
-
pageKeys: readonly string[];
|
|
10
|
-
}>;
|
|
11
|
-
export interface CollapsiblePagerViewProps extends Omit<NativeProps, "children" | "headerHeight" | "stickyHeaderHeight" | "pageKeys" | "retainedPages" | "layoutDirection"> {
|
|
12
|
-
/** Collapsible content rendered above the sticky bar. */
|
|
13
|
-
header: React.ReactNode;
|
|
14
|
-
/** Bar which remains pinned after the header has collapsed. */
|
|
15
|
-
stickyHeader: React.ReactNode;
|
|
16
|
-
/** Measured header height. It may be updated after an onLayout measurement. */
|
|
17
|
-
headerHeight: number;
|
|
18
|
-
/** Measured sticky bar height. */
|
|
19
|
-
stickyHeaderHeight: number;
|
|
20
|
-
/**
|
|
21
|
-
* Number of pages retained on either side of the selected page. Page slots
|
|
22
|
-
* remain stable, while distant React/native list subtrees are really
|
|
23
|
-
* unmounted. Defaults to one adjacent page.
|
|
24
|
-
*/
|
|
25
|
-
pageRetentionDistance?: number;
|
|
26
|
-
layoutDirection?: "ltr" | "rtl" | "locale";
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
onMountedPagesChanged?: (state: CollapsiblePagerMountState) => void;
|
|
29
|
-
}
|
|
30
|
-
type State = {
|
|
31
|
-
selectedPage: number;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Pager variant whose vertical header coordination is performed by the native
|
|
35
|
-
* scrolling containers. React participates only at settled page boundaries to
|
|
36
|
-
* retain the selected/adjacent heavy page subtrees.
|
|
37
|
-
*/
|
|
38
|
-
export declare class CollapsiblePagerView extends React.PureComponent<CollapsiblePagerViewProps, State> {
|
|
39
|
-
state: State;
|
|
40
|
-
private nativeRef;
|
|
41
|
-
private lastMountSignature;
|
|
42
|
-
componentDidMount(): void;
|
|
43
|
-
componentDidUpdate(): void;
|
|
44
|
-
setPage: (selectedPage: number) => void;
|
|
45
|
-
setPageWithoutAnimation: (selectedPage: number) => void;
|
|
46
|
-
setScrollEnabled: (scrollEnabled: boolean) => void;
|
|
47
|
-
private pages;
|
|
48
|
-
private retentionDistance;
|
|
49
|
-
private mountedPages;
|
|
50
|
-
private notifyMountedPagesChanged;
|
|
51
|
-
private onPageSelected;
|
|
52
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
}
|
|
54
|
-
export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
|
|
55
|
-
export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
|
|
56
|
-
export type CollapsiblePagerViewOnPageScrollStateChangedEvent = ReactNative.NativeSyntheticEvent<OnPageScrollStateChangedEventData>;
|
|
57
|
-
export {};
|
|
58
|
-
//# sourceMappingURL=CollapsiblePagerView.d.ts.map
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type * as ReactNative from "react-native";
|
|
3
|
-
export type OnPageScrollEventData = Readonly<{
|
|
4
|
-
position: number;
|
|
5
|
-
offset: number;
|
|
6
|
-
}>;
|
|
7
|
-
export type OnPageSelectedEventData = Readonly<{
|
|
8
|
-
position: number;
|
|
9
|
-
}>;
|
|
10
|
-
export type OnPageScrollStateChangedEventData = Readonly<{
|
|
11
|
-
pageScrollState: "idle" | "dragging" | "settling";
|
|
12
|
-
}>;
|
|
13
|
-
export type OnCollapsibleStateChangedEventData = Readonly<{
|
|
14
|
-
position: number;
|
|
15
|
-
headerOffset: number;
|
|
16
|
-
nativePageCount: number;
|
|
17
|
-
attachedPageCount: number;
|
|
18
|
-
observedScrollableCount: number;
|
|
19
|
-
retainedPages: string;
|
|
20
|
-
reason: string;
|
|
21
|
-
}>;
|
|
22
|
-
interface WebCollapsiblePagerNativeProps extends ReactNative.ViewProps {
|
|
23
|
-
scrollEnabled?: boolean;
|
|
24
|
-
initialPage?: number;
|
|
25
|
-
offscreenPageLimit?: number;
|
|
26
|
-
onPageScroll?: (event: ReactNative.NativeSyntheticEvent<OnPageScrollEventData>) => void;
|
|
27
|
-
onPageSelected?: (event: ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>) => void;
|
|
28
|
-
onPageScrollStateChanged?: (event: ReactNative.NativeSyntheticEvent<OnPageScrollStateChangedEventData>) => void;
|
|
29
|
-
onCollapsibleStateChanged?: (event: ReactNative.NativeSyntheticEvent<OnCollapsibleStateChangedEventData>) => void;
|
|
30
|
-
}
|
|
31
|
-
export type CollapsiblePagerDiagnostics = ReactNative.NativeSyntheticEvent<OnCollapsibleStateChangedEventData>;
|
|
32
|
-
export type CollapsiblePagerMountState = Readonly<{
|
|
33
|
-
position: number;
|
|
34
|
-
mountedPages: readonly number[];
|
|
35
|
-
pageKeys: readonly string[];
|
|
36
|
-
}>;
|
|
37
|
-
export interface CollapsiblePagerViewProps extends Omit<WebCollapsiblePagerNativeProps, "children" | "headerHeight" | "stickyHeaderHeight" | "pageKeys" | "retainedPages" | "layoutDirection"> {
|
|
38
|
-
header: React.ReactNode;
|
|
39
|
-
stickyHeader: React.ReactNode;
|
|
40
|
-
headerHeight: number;
|
|
41
|
-
stickyHeaderHeight: number;
|
|
42
|
-
pageRetentionDistance?: number;
|
|
43
|
-
layoutDirection?: "ltr" | "rtl" | "locale";
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
onMountedPagesChanged?: (state: CollapsiblePagerMountState) => void;
|
|
46
|
-
}
|
|
47
|
-
type State = {
|
|
48
|
-
selectedPage: number;
|
|
49
|
-
animateTransition: boolean;
|
|
50
|
-
};
|
|
51
|
-
/** Web counterpart of the native collapsible pager contract. */
|
|
52
|
-
export declare class CollapsiblePagerView extends React.PureComponent<CollapsiblePagerViewProps, State> {
|
|
53
|
-
state: State;
|
|
54
|
-
private root;
|
|
55
|
-
private touchStartX;
|
|
56
|
-
private touchStartY;
|
|
57
|
-
private pageOffsets;
|
|
58
|
-
private pageHosts;
|
|
59
|
-
private sharedHeaderOffset;
|
|
60
|
-
private scrollEnabled;
|
|
61
|
-
private lastMountSignature;
|
|
62
|
-
private configureFrame;
|
|
63
|
-
private configuredScrollElement;
|
|
64
|
-
private readonly timelineName;
|
|
65
|
-
componentDidMount(): void;
|
|
66
|
-
componentDidUpdate(previousProps: CollapsiblePagerViewProps): void;
|
|
67
|
-
componentWillUnmount(): void;
|
|
68
|
-
setPage: (selectedPage: number) => void;
|
|
69
|
-
setPageWithoutAnimation: (selectedPage: number) => void;
|
|
70
|
-
setScrollEnabled: (scrollEnabled: boolean) => void;
|
|
71
|
-
private pages;
|
|
72
|
-
private retentionDistance;
|
|
73
|
-
private mountedPages;
|
|
74
|
-
private nativeEvent;
|
|
75
|
-
private pageScrollElement;
|
|
76
|
-
private restoreConfiguredScrollElement;
|
|
77
|
-
private configureActiveScrollElement;
|
|
78
|
-
private scheduleScrollConfiguration;
|
|
79
|
-
private onVerticalScrollSettled;
|
|
80
|
-
private savePageOffset;
|
|
81
|
-
private restorePageOffset;
|
|
82
|
-
private selectPage;
|
|
83
|
-
private notifyMountedPagesChanged;
|
|
84
|
-
private emitDiagnostics;
|
|
85
|
-
private onTouchStart;
|
|
86
|
-
private onTouchEnd;
|
|
87
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
88
|
-
}
|
|
89
|
-
export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
|
|
90
|
-
export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
|
|
91
|
-
export type CollapsiblePagerViewOnPageScrollStateChangedEvent = ReactNative.NativeSyntheticEvent<OnPageScrollStateChangedEventData>;
|
|
92
|
-
export {};
|
|
93
|
-
//# sourceMappingURL=CollapsiblePagerView.web.d.ts.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type * as React from "react";
|
|
2
|
-
import { type HostComponent, type ViewProps } from "react-native";
|
|
3
|
-
import type { DirectEventHandler, Double, Int32, WithDefault } from "react-native/Libraries/Types/CodegenTypes";
|
|
4
|
-
export type OnPageScrollEventData = Readonly<{
|
|
5
|
-
position: Double;
|
|
6
|
-
offset: Double;
|
|
7
|
-
}>;
|
|
8
|
-
export type OnPageSelectedEventData = Readonly<{
|
|
9
|
-
position: Double;
|
|
10
|
-
}>;
|
|
11
|
-
export type OnPageScrollStateChangedEventData = Readonly<{
|
|
12
|
-
pageScrollState: "idle" | "dragging" | "settling";
|
|
13
|
-
}>;
|
|
14
|
-
export type OnCollapsibleStateChangedEventData = Readonly<{
|
|
15
|
-
position: Int32;
|
|
16
|
-
headerOffset: Double;
|
|
17
|
-
nativePageCount: Int32;
|
|
18
|
-
attachedPageCount: Int32;
|
|
19
|
-
observedScrollableCount: Int32;
|
|
20
|
-
retainedPages: string;
|
|
21
|
-
reason: string;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Internal native props. Consumers should use CollapsiblePagerViewProps from
|
|
25
|
-
* CollapsiblePagerView instead of mounting this host component directly.
|
|
26
|
-
*/
|
|
27
|
-
export interface NativeProps extends ViewProps {
|
|
28
|
-
scrollEnabled?: WithDefault<boolean, true>;
|
|
29
|
-
layoutDirection?: WithDefault<"ltr" | "rtl", "ltr">;
|
|
30
|
-
initialPage?: Int32;
|
|
31
|
-
offscreenPageLimit?: Int32;
|
|
32
|
-
headerHeight?: Int32;
|
|
33
|
-
stickyHeaderHeight?: Int32;
|
|
34
|
-
pageKeys?: string;
|
|
35
|
-
retainedPages?: string;
|
|
36
|
-
onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
|
|
37
|
-
onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
|
|
38
|
-
onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
|
|
39
|
-
onCollapsibleStateChanged?: DirectEventHandler<OnCollapsibleStateChangedEventData>;
|
|
40
|
-
}
|
|
41
|
-
type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
|
|
42
|
-
export interface NativeCommands {
|
|
43
|
-
setPage: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: Int32) => void;
|
|
44
|
-
setPageWithoutAnimation: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: Int32) => void;
|
|
45
|
-
setScrollEnabledImperatively: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, scrollEnabled: boolean) => void;
|
|
46
|
-
}
|
|
47
|
-
export declare const Commands: NativeCommands;
|
|
48
|
-
declare const _default: HostComponent<NativeProps>;
|
|
49
|
-
export default _default;
|
|
50
|
-
//# sourceMappingURL=CollapsiblePagerViewNativeComponent.d.ts.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type * as ReactNative from "react-native";
|
|
3
|
-
export type PagerViewOnPageScrollEventData = Readonly<{
|
|
4
|
-
position: number;
|
|
5
|
-
offset: number;
|
|
6
|
-
}>;
|
|
7
|
-
export type PagerViewOnPageSelectedEventData = Readonly<{
|
|
8
|
-
position: number;
|
|
9
|
-
}>;
|
|
10
|
-
export type PageScrollStateChangedNativeEventData = Readonly<{
|
|
11
|
-
pageScrollState: "idle" | "dragging" | "settling";
|
|
12
|
-
}>;
|
|
13
|
-
export interface PagerViewProps extends ReactNative.ViewProps {
|
|
14
|
-
scrollEnabled?: boolean;
|
|
15
|
-
layoutDirection?: "ltr" | "rtl" | "locale";
|
|
16
|
-
initialPage?: number;
|
|
17
|
-
orientation?: "horizontal" | "vertical";
|
|
18
|
-
offscreenPageLimit?: number;
|
|
19
|
-
pageMargin?: number;
|
|
20
|
-
overScrollMode?: "auto" | "always" | "never";
|
|
21
|
-
overdrag?: boolean;
|
|
22
|
-
keyboardDismissMode?: "none" | "on-drag";
|
|
23
|
-
scrollSensitivity?: number;
|
|
24
|
-
nestedScrollEnabled?: boolean;
|
|
25
|
-
onPageScroll?: (event: ReactNative.NativeSyntheticEvent<PagerViewOnPageScrollEventData>) => void;
|
|
26
|
-
onPageSelected?: (event: ReactNative.NativeSyntheticEvent<PagerViewOnPageSelectedEventData>) => void;
|
|
27
|
-
onPageScrollStateChanged?: (event: ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>) => void;
|
|
28
|
-
}
|
|
29
|
-
type State = Readonly<{
|
|
30
|
-
selectedPage: number;
|
|
31
|
-
animateTransition: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Web fallback for the ordinary PagerView API. All pages stay mounted, matching
|
|
35
|
-
* the package's pre-existing PagerView lifetime contract.
|
|
36
|
-
*/
|
|
37
|
-
export declare class PagerView extends React.Component<PagerViewProps, State> {
|
|
38
|
-
state: State;
|
|
39
|
-
private pointerStart;
|
|
40
|
-
private scrollEnabled;
|
|
41
|
-
componentDidUpdate(previousProps: PagerViewProps): void;
|
|
42
|
-
setPage: (selectedPage: number) => void;
|
|
43
|
-
setPageWithoutAnimation: (selectedPage: number) => void;
|
|
44
|
-
setScrollEnabled: (scrollEnabled: boolean) => void;
|
|
45
|
-
private nativeEvent;
|
|
46
|
-
private selectPage;
|
|
47
|
-
private onTouchStart;
|
|
48
|
-
private onTouchEnd;
|
|
49
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
}
|
|
51
|
-
export type PagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageScrollEventData>;
|
|
52
|
-
export type PagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageSelectedEventData>;
|
|
53
|
-
export type PageScrollStateChangedNativeEvent = ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=PagerView.web.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { PagerView as default, PagerView } from "./PagerView.web";
|
|
2
|
-
export type { PagerViewProps, PagerViewOnPageScrollEvent, PagerViewOnPageScrollEventData, PagerViewOnPageSelectedEvent, PagerViewOnPageSelectedEventData, PageScrollStateChangedNativeEvent, PageScrollStateChangedNativeEventData, } from "./PagerView.web";
|
|
3
|
-
export * from "./usePagerView";
|
|
4
|
-
export * from "./CollapsiblePagerView.web";
|
|
5
|
-
//# sourceMappingURL=index.web.d.ts.map
|