@onekeyfe/react-native-pager-view 6.7.0-alpha.378 → 6.7.0-alpha.382

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.
@@ -580,6 +580,23 @@ export class CollapsiblePagerView extends React.PureComponent<
580
580
  this.scrollCurrentPageToTop(0, options?.animated ?? true);
581
581
  };
582
582
 
583
+ public scrollHeaderBy = (delta: number) => {
584
+ if (!Number.isFinite(delta)) return;
585
+ const offset = Math.min(
586
+ this.headerHeight,
587
+ Math.max(0, this.sharedHeaderOffset + delta)
588
+ );
589
+ this.scrollCurrentPageToTop(offset, false);
590
+ };
591
+
592
+ public scrollHeaderToOffset = (offset: number) => {
593
+ if (!Number.isFinite(offset)) return;
594
+ this.scrollCurrentPageToTop(
595
+ Math.min(this.headerHeight, Math.max(0, offset)),
596
+ false
597
+ );
598
+ };
599
+
583
600
  public scrollToStickyTop = (options?: Readonly<{ animated?: boolean }>) => {
584
601
  this.scrollCurrentPageToTop(
585
602
  this.headerHeight,
@@ -674,10 +691,10 @@ export class CollapsiblePagerView extends React.PureComponent<
674
691
  )
675
692
  return;
676
693
  this.pageOffsets.set(key, 0);
677
- this.sharedHeaderOffset = offset;
694
+ this.sharedHeaderOffset = Math.min(this.headerHeight, Math.max(0, offset));
678
695
  this.bodyAlignment = { element, key };
679
696
  scrollElementTo(element, {
680
- top: offset,
697
+ top: this.sharedHeaderOffset,
681
698
  behavior: animated ? "smooth" : "instant",
682
699
  });
683
700
  this.syncFallbackHeader();
@@ -67,7 +67,10 @@ export interface NativeProps extends ViewProps {
67
67
  retainedPages?: string;
68
68
  nativeTabBarItems?: string;
69
69
  nativeTabBarHeight?: Double;
70
+ nativeTabBarVariant?: string;
71
+ nativeTabBarTrailingReservedWidth?: WithDefault<Double, 0>;
70
72
  nativeTabBarContentPaddingHorizontal?: Double;
73
+ nativeTabBarContentPaddingVertical?: Double;
71
74
  nativeTabBarItemSpacing?: Double;
72
75
  nativeTabBarFontSize?: Double;
73
76
  nativeTabBarFontFamily?: string;
@@ -91,6 +94,14 @@ export interface NativeProps extends ViewProps {
91
94
  type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
92
95
 
93
96
  export interface NativeCommands {
97
+ scrollHeaderToOffset: (
98
+ viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
99
+ offset: Double
100
+ ) => void;
101
+ scrollHeaderBy: (
102
+ viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
103
+ delta: Double
104
+ ) => void;
94
105
  scrollToTop: (
95
106
  viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
96
107
  target: Int32,
@@ -112,6 +123,8 @@ export interface NativeCommands {
112
123
 
113
124
  export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
114
125
  supportedCommands: [
126
+ "scrollHeaderToOffset",
127
+ "scrollHeaderBy",
115
128
  "scrollToTop",
116
129
  "setPage",
117
130
  "setPageWithoutAnimation",