@react-native-ohos/react-native-pager-view 6.7.2-rc.1 → 7.0.3-rc.1
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.OpenSource +10 -10
- package/README.md +1 -1
- package/harmony/pager_view/oh-package.json5 +1 -1
- package/harmony/pager_view/src/main/cpp/SwiperNode.cpp +3 -0
- package/harmony/pager_view/src/main/cpp/SwiperNode.h +2 -0
- package/harmony/pager_view/src/main/cpp/ViewPagerComponentInstance.cpp +4 -1
- package/harmony/pager_view.har +0 -0
- package/lib/commonjs/PagerView.js +88 -66
- package/lib/commonjs/PagerView.js.map +1 -1
- package/lib/commonjs/PagerViewNativeComponent.js +24 -0
- package/lib/commonjs/PagerViewNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +23 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/usePagerView.js +25 -4
- package/lib/commonjs/usePagerView.js.map +1 -1
- package/lib/commonjs/utils.js +36 -7
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/PagerView.js +89 -67
- package/lib/module/PagerView.js.map +1 -1
- package/lib/module/PagerViewNativeComponent.js +26 -0
- package/lib/module/PagerViewNativeComponent.js.map +1 -1
- package/lib/module/index.js +26 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/usePagerView.js +27 -4
- package/lib/module/usePagerView.js.map +1 -1
- package/lib/module/utils.js +37 -7
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/PagerView.d.ts +24 -0
- package/lib/typescript/PagerView.d.ts.map +1 -0
- package/lib/typescript/PagerViewNativeComponent.d.ts +24 -0
- package/lib/typescript/PagerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +24 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/usePagerView.d.ts +25 -1
- package/lib/typescript/usePagerView.d.ts.map +1 -0
- package/lib/typescript/utils.d.ts +24 -0
- package/lib/typescript/utils.d.ts.map +1 -0
- package/package.json +18 -18
- package/src/PagerView.tsx +23 -0
- package/src/PagerViewNativeComponent.ts +23 -0
- package/src/index.tsx +23 -0
- package/src/usePagerView.ts +23 -0
- package/src/utils.tsx +27 -1
- package/harmony/pager_view/LICENSE +0 -21
- package/harmony/pager_view/NOTICE +0 -33
- package/harmony/pager_view/OAT.xml +0 -38
- package/harmony/pager_view/README.OpenSource +0 -11
- package/harmony/pager_view/README.md +0 -236
package/lib/module/PagerView.js
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
5
26
|
import React from 'react';
|
|
6
27
|
import { Platform, Keyboard } from 'react-native';
|
|
7
28
|
import { I18nManager } from 'react-native';
|
|
@@ -49,68 +70,10 @@ import PagerViewNativeComponent, { Commands as PagerViewNativeCommands } from '.
|
|
|
49
70
|
* }
|
|
50
71
|
* ```
|
|
51
72
|
*/
|
|
52
|
-
|
|
73
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
53
74
|
export class PagerView extends React.Component {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_defineProperty(this, "isScrolling", false);
|
|
57
|
-
_defineProperty(this, "pagerView", null);
|
|
58
|
-
_defineProperty(this, "_onPageScroll", e => {
|
|
59
|
-
if (this.props.onPageScroll) {
|
|
60
|
-
this.props.onPageScroll(e);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Not implemented on iOS yet
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
if (Platform.OS === 'android' || Platform.OS === 'harmony') {
|
|
66
|
-
if (this.props.keyboardDismissMode === 'on-drag') {
|
|
67
|
-
Keyboard.dismiss();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
_defineProperty(this, "_onPageScrollStateChanged", e => {
|
|
72
|
-
if (this.props.onPageScrollStateChanged) {
|
|
73
|
-
this.props.onPageScrollStateChanged(e);
|
|
74
|
-
}
|
|
75
|
-
this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
76
|
-
});
|
|
77
|
-
_defineProperty(this, "_onPageSelected", e => {
|
|
78
|
-
if (this.props.onPageSelected) {
|
|
79
|
-
this.props.onPageSelected(e);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
_defineProperty(this, "_onMoveShouldSetResponderCapture", () => {
|
|
83
|
-
return this.isScrolling;
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* A helper function to scroll to a specific page in the PagerView.
|
|
87
|
-
* The transition between pages will be animated.
|
|
88
|
-
*/
|
|
89
|
-
_defineProperty(this, "setPage", selectedPage => {
|
|
90
|
-
if (this.pagerView) {
|
|
91
|
-
PagerViewNativeCommands.setPage(this.pagerView, selectedPage);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
/**
|
|
95
|
-
* A helper function to scroll to a specific page in the PagerView.
|
|
96
|
-
* The transition between pages will *not* be animated.
|
|
97
|
-
*/
|
|
98
|
-
_defineProperty(this, "setPageWithoutAnimation", selectedPage => {
|
|
99
|
-
if (this.pagerView) {
|
|
100
|
-
PagerViewNativeCommands.setPageWithoutAnimation(this.pagerView, selectedPage);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
/**
|
|
104
|
-
* A helper function to enable/disable scroll imperatively
|
|
105
|
-
* The recommended way is using the scrollEnabled prop, however, there might be a case where a
|
|
106
|
-
* imperative solution is more useful (e.g. for not blocking an animation)
|
|
107
|
-
*/
|
|
108
|
-
_defineProperty(this, "setScrollEnabled", scrollEnabled => {
|
|
109
|
-
if (this.pagerView) {
|
|
110
|
-
PagerViewNativeCommands.setScrollEnabledImperatively(this.pagerView, scrollEnabled);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
75
|
+
isScrolling = false;
|
|
76
|
+
pagerView = null;
|
|
114
77
|
get deducedLayoutDirection() {
|
|
115
78
|
if (!this.props.layoutDirection ||
|
|
116
79
|
//@ts-ignore fix it
|
|
@@ -120,8 +83,67 @@ export class PagerView extends React.Component {
|
|
|
120
83
|
return this.props.layoutDirection;
|
|
121
84
|
}
|
|
122
85
|
}
|
|
86
|
+
_onPageScroll = e => {
|
|
87
|
+
if (this.props.onPageScroll) {
|
|
88
|
+
this.props.onPageScroll(e);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Not implemented on iOS yet
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
if (Platform.OS === 'android' || Platform.OS === 'harmony') {
|
|
94
|
+
if (this.props.keyboardDismissMode === 'on-drag') {
|
|
95
|
+
Keyboard.dismiss();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
_onPageScrollStateChanged = e => {
|
|
100
|
+
if (this.props.onPageScrollStateChanged) {
|
|
101
|
+
this.props.onPageScrollStateChanged(e);
|
|
102
|
+
}
|
|
103
|
+
this.isScrolling = e.nativeEvent.pageScrollState === 'dragging';
|
|
104
|
+
};
|
|
105
|
+
_onPageSelected = e => {
|
|
106
|
+
if (this.props.onPageSelected) {
|
|
107
|
+
this.props.onPageSelected(e);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
_onMoveShouldSetResponderCapture = () => {
|
|
111
|
+
return this.isScrolling;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A helper function to scroll to a specific page in the PagerView.
|
|
116
|
+
* The transition between pages will be animated.
|
|
117
|
+
*/
|
|
118
|
+
setPage = selectedPage => {
|
|
119
|
+
if (this.pagerView) {
|
|
120
|
+
PagerViewNativeCommands.setPage(this.pagerView, selectedPage);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* A helper function to scroll to a specific page in the PagerView.
|
|
126
|
+
* The transition between pages will *not* be animated.
|
|
127
|
+
*/
|
|
128
|
+
setPageWithoutAnimation = selectedPage => {
|
|
129
|
+
if (this.pagerView) {
|
|
130
|
+
PagerViewNativeCommands.setPageWithoutAnimation(this.pagerView, selectedPage);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A helper function to enable/disable scroll imperatively
|
|
136
|
+
* The recommended way is using the scrollEnabled prop, however, there might be a case where a
|
|
137
|
+
* imperative solution is more useful (e.g. for not blocking an animation)
|
|
138
|
+
*/
|
|
139
|
+
setScrollEnabled = scrollEnabled => {
|
|
140
|
+
if (this.pagerView) {
|
|
141
|
+
PagerViewNativeCommands.setScrollEnabledImperatively(this.pagerView, scrollEnabled);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
123
144
|
render() {
|
|
124
|
-
return /*#__PURE__*/
|
|
145
|
+
return /*#__PURE__*/_jsx(PagerViewNativeComponent, {
|
|
146
|
+
...this.props,
|
|
125
147
|
ref: ref => {
|
|
126
148
|
this.pagerView = ref;
|
|
127
149
|
},
|
|
@@ -132,7 +154,7 @@ export class PagerView extends React.Component {
|
|
|
132
154
|
onPageSelected: this._onPageSelected,
|
|
133
155
|
onMoveShouldSetResponderCapture: this._onMoveShouldSetResponderCapture,
|
|
134
156
|
children: childrenWithOverriddenStyle(this.props.children)
|
|
135
|
-
})
|
|
157
|
+
});
|
|
136
158
|
}
|
|
137
159
|
}
|
|
138
160
|
//# sourceMappingURL=PagerView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Keyboard","I18nManager","childrenWithOverriddenStyle","PagerViewNativeComponent","Commands","PagerViewNativeCommands","
|
|
1
|
+
{"version":3,"names":["React","Platform","Keyboard","I18nManager","childrenWithOverriddenStyle","PagerViewNativeComponent","Commands","PagerViewNativeCommands","jsx","_jsx","PagerView","Component","isScrolling","pagerView","deducedLayoutDirection","props","layoutDirection","isRTL","_onPageScroll","e","onPageScroll","OS","keyboardDismissMode","dismiss","_onPageScrollStateChanged","onPageScrollStateChanged","nativeEvent","pageScrollState","_onPageSelected","onPageSelected","_onMoveShouldSetResponderCapture","setPage","selectedPage","setPageWithoutAnimation","setScrollEnabled","scrollEnabled","setScrollEnabledImperatively","render","ref","style","onMoveShouldSetResponderCapture","children"],"sourceRoot":"../../src","sources":["PagerView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,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AuB;MAC7CM,YAAY,EAAE,IAAI,CAACF,aAAc;MACjCO,wBAAwB,EAAE,IAAI,CAACD,yBAA0B;MACzDK,cAAc,EAAE,IAAI,CAACD,eAAgB;MACrCY,+BAA+B,EAC7B,IAAI,CAACV,gCACN;MACDW,QAAQ,EAAErC,2BAA2B,CAAC,IAAI,CAACW,KAAK,CAAC0B,QAAQ;IAAE,CAC5D,CAAC;EAER;AACF","ignoreList":[]}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
1
27
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
2
28
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
29
|
export const Commands = codegenNativeCommands({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands"],"
|
|
1
|
+
{"version":3,"names":["codegenNativeCommands","codegenNativeComponent","Commands","supportedCommands"],"sourceRoot":"../../src","sources":["PagerViewNativeComponent.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,OAAOA,qBAAqB,MAAM,wDAAwD;AAC1F,OAAOC,sBAAsB,MAAM,yDAAyD;AAsD5F,OAAO,MAAMC,QAAwB,GAAGF,qBAAqB,CAAiB;EAC5EG,iBAAiB,EAAE,CACjB,SAAS,EACT,yBAAyB,EACzB,8BAA8B;AAElC,CAAC,CAAC;AAEF,eAAeF,sBAAsB,CACnC,cACF,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
1
27
|
import { PagerView } from './PagerView';
|
|
2
28
|
export default PagerView;
|
|
3
29
|
export * from './usePagerView';
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PagerView"],"
|
|
1
|
+
{"version":3,"names":["PagerView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,QAAQ,aAAa;AACvC,eAAeA,SAAS;AACxB,cAAc,gBAAgB","ignoreList":[]}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
1
27
|
import { PagerView } from './PagerView';
|
|
2
28
|
import { Animated } from 'react-native';
|
|
3
29
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
@@ -21,10 +47,7 @@ export function usePagerView({
|
|
|
21
47
|
const onPageScrollOffset = useRef(new Animated.Value(0)).current;
|
|
22
48
|
const onPageScrollPosition = useRef(new Animated.Value(0)).current;
|
|
23
49
|
const onPageSelectedPosition = useRef(new Animated.Value(0)).current;
|
|
24
|
-
const setPage = useCallback(page =>
|
|
25
|
-
var _ref$current, _ref$current2;
|
|
26
|
-
return isAnimated ? (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.setPage(page) : (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.setPageWithoutAnimation(page);
|
|
27
|
-
}, [isAnimated]);
|
|
50
|
+
const setPage = useCallback(page => isAnimated ? ref.current?.setPage(page) : ref.current?.setPageWithoutAnimation(page), [isAnimated]);
|
|
28
51
|
const addPage = useCallback(() => {
|
|
29
52
|
setPages(prevPages => {
|
|
30
53
|
return [...prevPages, prevPages.length];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PagerView","Animated","useCallback","useMemo","useRef","useState","AnimatedPagerView","createAnimatedComponent","usePagerView","pagesAmount","ref","pages","setPages","Array","fill","map","_v","index","activePage","setActivePage","isAnimated","setIsAnimated","overdragEnabled","setOverdragEnabled","scrollEnabled","setScrollEnabled","scrollState","setScrollState","progress","setProgress","position","offset","onPageScrollOffset","Value","current","onPageScrollPosition","onPageSelectedPosition","setPage","page","
|
|
1
|
+
{"version":3,"names":["PagerView","Animated","useCallback","useMemo","useRef","useState","AnimatedPagerView","createAnimatedComponent","usePagerView","pagesAmount","ref","pages","setPages","Array","fill","map","_v","index","activePage","setActivePage","isAnimated","setIsAnimated","overdragEnabled","setOverdragEnabled","scrollEnabled","setScrollEnabled","scrollState","setScrollState","progress","setProgress","position","offset","onPageScrollOffset","Value","current","onPageScrollPosition","onPageSelectedPosition","setPage","page","setPageWithoutAnimation","addPage","prevPages","length","removePage","slice","toggleAnimation","animated","toggleScroll","enabled","toggleOverdrag","onPageScroll","event","nativeEvent","listener","useNativeDriver","onPageSelected","onPageScrollStateChanged","e","pageScrollState"],"sourceRoot":"../../src","sources":["usePagerView.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA,SAASA,SAAS,QAAQ,aAAa;AAEvC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAI9D,MAAMC,iBAAiB,GAAGL,QAAQ,C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AAE;QAAErB,MAAM;QAAED;MAAS;IAAE,CAAC,KAAK;MACnDD,WAAW,CAAC;QACVC,QAAQ;QACRC;MACF,CAAC,CAAC;IACJ,CAAC;IACDuB,eAAe,EAAE;EACnB,CACF,CAAC;EACH;EACA,EACF,CAAC;EAED,MAAMC,cAAc,GAAGpD,OAAO,CAC5B,MACEF,QAAQ,CAACkD,KAAK,CACZ,CAAC;IAAEC,WAAW,EAAE;MAAEtB,QAAQ,EAAEM;IAAuB;EAAE,CAAC,CAAC,EACvD;IACEiB,QAAQ,EAAEA,CAAC;MAAED,WAAW,EAAE;QAAEtB;MAAS;IAAE,CAAC,KAAK;MAC3CX,aAAa,CAACW,QAAQ,CAAC;IACzB,CAAC;IACDwB,eAAe,EAAE;EACnB,CACF,CAAC;EACH;EACA,EACF,CAAC;EAED,MAAME,wBAAwB,GAAGtD,WAAW,CACzCuD,CAAoC,IAAK;IACxC9B,cAAc,CAAC8B,CAAC,CAACL,WAAW,CAACM,eAAe,CAAC;EAC/C,CAAC,EACD,EACF,CAAC;EAED,OAAO;IACLhD,GAAG;IACHQ,UAAU;IACVE,UAAU;IACVT,KAAK;IACLe,WAAW;IACXF,aAAa;IACbI,QAAQ;IACRN,eAAe;IACfe,OAAO;IACPG,OAAO;IACPG,UAAU;IACVI,YAAY;IACZF,eAAe;IACfhB,WAAW;IACXqB,YAAY;IACZK,cAAc;IACdC,wBAAwB;IACxBP,cAAc;IACd3C,iBAAiB;IACjBN;EACF,CAAC;AACH","ignoreList":[]}
|
package/lib/module/utils.js
CHANGED
|
@@ -1,19 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
1
26
|
import React, { Children } from 'react';
|
|
2
27
|
import { StyleSheet, View } from 'react-native';
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
29
|
export const childrenWithOverriddenStyle = children => {
|
|
4
30
|
return Children.map(children, child => {
|
|
31
|
+
if (child == null || ! /*#__PURE__*/React.isValidElement(child)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
5
34
|
const element = child;
|
|
6
35
|
return (
|
|
7
36
|
/*#__PURE__*/
|
|
8
37
|
// Add a wrapper to ensure layout is calculated correctly
|
|
9
|
-
|
|
38
|
+
_jsx(View, {
|
|
10
39
|
style: StyleSheet.absoluteFill,
|
|
11
|
-
collapsable: false
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
40
|
+
collapsable: false,
|
|
41
|
+
children: /*#__PURE__*/React.cloneElement(element, {
|
|
42
|
+
...element.props,
|
|
43
|
+
// Override styles so that each page will fill the parent.
|
|
44
|
+
style: [element.props.style, StyleSheet.absoluteFill]
|
|
45
|
+
})
|
|
46
|
+
})
|
|
17
47
|
);
|
|
18
48
|
});
|
|
19
49
|
};
|
package/lib/module/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Children","StyleSheet","View","childrenWithOverriddenStyle","children","map","child","
|
|
1
|
+
{"version":3,"names":["React","Children","StyleSheet","View","jsx","_jsx","childrenWithOverriddenStyle","children","map","child","isValidElement","element","style","absoluteFill","collapsable","cloneElement","props"],"sourceRoot":"../../src","sources":["utils.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,QAAQ,QAAmB,OAAO;AAClD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEhD,OAAO,MAAMC,2BAA2B,GAAIC,QAAoB,IAAK;EACnE,OAAON,QAAQ,CAACO,GAAG,CAACD,QAAQ,EAAGE,KAAK,IAAK;IACvC,IAAIA,KAAK,IAAI,IAAI,IAAI,eAACT,KAAK,CAACU,cAAc,CAACD,KAAK,CAAC,EAAE;MACjD,OAAO,IAAI;IACb;IACA,MAAME,OAAO,GAAGF,KAAgC;IAChD;MAAA;MACE;MACAJ,IAAA,CAACF,IAAI;QAACS,KAAK,EAAEV,UAAU,CAACW,YAAa;QAACC,WAAW,EAAE,KAAM;QAAAP,QAAA,eAEtDP,KAAK,CAACe,YAAY,CAACJ,OAAO,EAAE;UAC3B,GAAGA,OAAO,CAACK,KAAK;UAChB;UACAJ,KAAK,EAAE,CAACD,OAAO,CAACK,KAAK,CAACJ,KAAK,EAAEV,UAAU,CAACW,YAAY;QACtD,CAAC;MAAC,CACE;IAAC;EAEX,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
1
24
|
import React from 'react';
|
|
2
25
|
import PagerViewNativeComponent, { NativeProps } from './PagerViewNativeComponent';
|
|
3
26
|
/**
|
|
@@ -67,3 +90,4 @@ export declare class PagerView extends React.Component<NativeProps> {
|
|
|
67
90
|
setScrollEnabled: (scrollEnabled: boolean) => void;
|
|
68
91
|
render(): React.JSX.Element;
|
|
69
92
|
}
|
|
93
|
+
//# sourceMappingURL=PagerView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PagerView.d.ts","sourceRoot":"","sources":["../../src/PagerView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,wBAAwB,EAAE,EAK/B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAGpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACzD,OAAO,CAAC,WAAW,CAAS;IAC5B,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC,GAAG,IAAI,CAAQ;IAG3E,OAAO,KAAK,sBAAsB,GAUjC;IAED,OAAO,CAAC,aAAa,CAcnB;IAEF,OAAO,CAAC,yBAAyB,CAO/B;IAEF,OAAO,CAAC,eAAe,CAMrB;IAEF,OAAO,CAAC,gCAAgC,CAEtC;IAEF;;;OAGG;IACI,OAAO,iBAAkB,MAAM,UAIpC;IAEF;;;OAGG;IACI,uBAAuB,iBAAkB,MAAM,UAOpD;IAEF;;;;OAIG;IACI,gBAAgB,kBAAmB,OAAO,UAO/C;IAEF,MAAM;CAmBP"}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
1
24
|
import type * as React from 'react';
|
|
2
25
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
3
26
|
import type { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
@@ -34,3 +57,4 @@ export interface NativeCommands {
|
|
|
34
57
|
export declare const Commands: NativeCommands;
|
|
35
58
|
declare const _default: HostComponent<NativeProps>;
|
|
36
59
|
export default _default;
|
|
60
|
+
//# sourceMappingURL=PagerViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PagerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../src/PagerViewNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,OAAO,KAAK,EACV,kBAA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aAAa,CAAC,WAAW,CAAC,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,CACP,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC5C,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;IACV,uBAAuB,EAAE,CACvB,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC5C,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;IACV,4BAA4B,EAAE,CAC5B,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC5C,aAAa,EAAE,OAAO,KACnB,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,EAAE,cAMrB,CAAC;;AAEH,wBAEgC"}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
1
24
|
import type * as ReactNative from 'react-native';
|
|
2
25
|
import { PagerView } from './PagerView';
|
|
3
26
|
export default PagerView;
|
|
@@ -7,3 +30,4 @@ export type { PagerViewOnPageScrollEventData, PagerViewOnPageSelectedEventData,
|
|
|
7
30
|
export type PagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageScrollEventData>;
|
|
8
31
|
export type PagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageSelectedEventData>;
|
|
9
32
|
export type PageScrollStateChangedNativeEvent = ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,KAAK,WAAW,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,eAAe,SAAS,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,KAAK,EACV,qBAAqB,IAAI,8BAA8B,EACvD,uBAAuB,IAAI,gCAAgC,EAC3D,iCAAiC,IAAI,qCAAqC,EAC1E,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,8BAA8B,EAC9B,gCAAgC,EAChC,qCAAqC,EACrC,WAAW,IAAI,cAAc,GAC9B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GACpC,WAAW,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;AAEnE,MAAM,MAAM,4BAA4B,GACtC,WAAW,CAAC,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;AAErE,MAAM,MAAM,iCAAiC,GAC3C,WAAW,CAAC,oBAAoB,CAAC,qCAAqC,CAAC,CAAC"}
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
2
25
|
import type * as ReactNative from 'react-native';
|
|
3
26
|
import type { OnPageScrollStateChangedEventData as PageScrollStateChangedNativeEventData } from './PagerViewNativeComponent';
|
|
4
27
|
type PageScrollStateChangedNativeEvent = ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>;
|
|
@@ -9,7 +32,7 @@ type UsePagerViewParams = {
|
|
|
9
32
|
pagesAmount: number;
|
|
10
33
|
};
|
|
11
34
|
export declare function usePagerView({ pagesAmount }?: UsePagerViewParams): {
|
|
12
|
-
ref: import("react").RefObject<PagerView>;
|
|
35
|
+
ref: import("react").RefObject<PagerView | null>;
|
|
13
36
|
activePage: number;
|
|
14
37
|
isAnimated: boolean;
|
|
15
38
|
pages: number[];
|
|
@@ -37,3 +60,4 @@ export declare function usePagerView({ pagesAmount }?: UsePagerViewParams): {
|
|
|
37
60
|
PagerView: typeof PagerView;
|
|
38
61
|
};
|
|
39
62
|
export {};
|
|
63
|
+
//# sourceMappingURL=usePagerView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagerView.d.ts","sourceRoot":"","sources":["../../src/usePagerView.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,KAAK,WAAW,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAGV,iCAAiC,IAAI,qCAAqC,EAC3E,MAAM,4BAA4B,CAAC;AAEpC,KAAK,iCAAiC,GACpC,WAAW,CAAC,oBAAoB,CAAC,qCAAqC,CAAC,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAIhE,KAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAC1B,EAAE,WAAW,EAAE,GAAE,kBAAuC;;;;;;;;;;;;oBAiB/C,MAAM;;;;;;;;;;;;;;;EA0GhB"}
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
1
24
|
import React, { ReactNode } from 'react';
|
|
2
25
|
export declare const childrenWithOverriddenStyle: (children?: ReactNode) => React.JSX.Element[] | null | undefined;
|
|
26
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AAGnD,eAAO,MAAM,2BAA2B,cAAe,SAAS,2CAkB/D,CAAC"}
|