@nativescript-community/ui-bottomsheet 0.0.0-stage → 1.0.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/CHANGELOG.md +22 -0
- package/LICENSE +201 -0
- package/README.md +213 -2
- package/index-common.d.ts +93 -0
- package/index-common.js +140 -0
- package/index-common.js.map +1 -0
- package/index.android.d.ts +44 -0
- package/index.android.js +475 -0
- package/index.android.js.map +1 -0
- package/index.d.ts +100 -0
- package/index.ios.d.ts +114 -0
- package/index.ios.js +678 -0
- package/index.ios.js.map +1 -0
- package/ios-layout.d.ts +64 -0
- package/ios-layout.js +356 -0
- package/ios-layout.js.map +1 -0
- package/package.json +49 -5
- package/platforms/android/include.gradle +6 -0
- package/platforms/android/java/com/nativescript/ui/bottomsheet/BottomSheetDialog.java +38 -0
- package/platforms/android/java/com/nativescript/ui/bottomsheet/BottomSheetDialogFragment.java +73 -0
- package/platforms/android/native-api-usage.json +36 -0
- package/platforms/ios/native-api-usage.json +11 -0
- package/svelte/index.d.ts +24 -0
- package/svelte/index.js +48 -0
- package/svelte/index.js.map +1 -0
- package/tsconfig.tsbuildinfo +1 -0
package/index.ios.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { View } from '@nativescript/core';
|
|
2
|
+
import { BottomSheetOptions } from './index-common';
|
|
3
|
+
import { ViewWithBottomSheetBase } from './index-common';
|
|
4
|
+
export { ViewWithBottomSheetBase } from './index-common';
|
|
5
|
+
/**
|
|
6
|
+
* iOS: native UISheetPresentationController (iOS 15+, custom detents for iOS 16+).
|
|
7
|
+
* Supported: peekHeight, skipCollapsedState, dismissOnBackgroundTap/dismissOnDraggingDownSheet, canTouchBehind,
|
|
8
|
+
* disableDimBackground, transparent, backgroundOpacity, ignoreTopSafeArea/ignoreBottomSafeArea, onChangeState (COLLAPSED/EXPANDED/CLOSED).
|
|
9
|
+
* No-op: continuous DRAGGING state, ignoreKeyboardHeight, trackingScrollView (UIKit tracks the scrolling content by itself).
|
|
10
|
+
* UIKit does not allow to dismiss on background tap and on dragging independently: if one is disabled, both are.
|
|
11
|
+
*/
|
|
12
|
+
declare class SheetDelegateImpl extends NSObject {
|
|
13
|
+
static ObjCProtocols: {
|
|
14
|
+
prototype: UISheetPresentationControllerDelegate;
|
|
15
|
+
}[];
|
|
16
|
+
_owner: WeakRef<ViewWithBottomSheet>;
|
|
17
|
+
static initWithOwner(owner: ViewWithBottomSheet): SheetDelegateImpl;
|
|
18
|
+
sheetPresentationControllerDidChangeSelectedDetentIdentifier(sheet: UISheetPresentationController): void;
|
|
19
|
+
presentationControllerShouldDismiss(presentationController: UIPresentationController): boolean;
|
|
20
|
+
presentationControllerDidAttemptToDismiss(presentationController: UIPresentationController): void;
|
|
21
|
+
presentationControllerDidDismiss(presentationController: UIPresentationController): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* With an undimmed detent UIKit has no dimming view, so there is no tap outside to dismiss the sheet: this recognizer replaces it
|
|
25
|
+
*/
|
|
26
|
+
declare class OutsideTapTarget extends NSObject {
|
|
27
|
+
_owner: WeakRef<ViewWithBottomSheet>;
|
|
28
|
+
static initWithOwner(owner: ViewWithBottomSheet): OutsideTapTarget;
|
|
29
|
+
outsideTapped(): void;
|
|
30
|
+
static ObjCExposedMethods: {
|
|
31
|
+
outsideTapped: {
|
|
32
|
+
returns: interop.Type<void>;
|
|
33
|
+
params: any[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Catalyst card: a pan on the card moves it between its detents (like the scroll of its content, which is pinned while the card moves),
|
|
39
|
+
* a tap on the grabber goes to the next detent
|
|
40
|
+
*/
|
|
41
|
+
declare class CatalystCardTarget extends NSObject {
|
|
42
|
+
static ObjCProtocols: {
|
|
43
|
+
prototype: UIGestureRecognizerDelegate;
|
|
44
|
+
}[];
|
|
45
|
+
_owner: WeakRef<ViewWithBottomSheet>;
|
|
46
|
+
static initWithOwner(owner: ViewWithBottomSheet): CatalystCardTarget;
|
|
47
|
+
cardPanned(recognizer: UIPanGestureRecognizer): void;
|
|
48
|
+
cardScrolled(recognizer: UIPanGestureRecognizer): void;
|
|
49
|
+
grabberTapped(): void;
|
|
50
|
+
gestureRecognizerShouldBegin(recognizer: UIGestureRecognizer): boolean;
|
|
51
|
+
gestureRecognizerShouldReceiveTouch(recognizer: UIGestureRecognizer, touch: UITouch): boolean;
|
|
52
|
+
gestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer(recognizer: UIGestureRecognizer, other: UIGestureRecognizer): boolean;
|
|
53
|
+
static ObjCExposedMethods: {
|
|
54
|
+
cardPanned: {
|
|
55
|
+
returns: interop.Type<void>;
|
|
56
|
+
params: interop.Type<any>[];
|
|
57
|
+
};
|
|
58
|
+
cardScrolled: {
|
|
59
|
+
returns: interop.Type<void>;
|
|
60
|
+
params: interop.Type<any>[];
|
|
61
|
+
};
|
|
62
|
+
grabberTapped: {
|
|
63
|
+
returns: interop.Type<void>;
|
|
64
|
+
params: any[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export declare class ViewWithBottomSheet extends ViewWithBottomSheetBase {
|
|
69
|
+
bottomSheetDelegate: SheetDelegateImpl;
|
|
70
|
+
_detentIds: string[];
|
|
71
|
+
_onDetentChange: (index: number) => void;
|
|
72
|
+
_onWillDismiss: () => boolean | void;
|
|
73
|
+
_onDismissAttempt: () => void;
|
|
74
|
+
_outsideTapRecognizer: UITapGestureRecognizer;
|
|
75
|
+
_outsideTapTarget: OutsideTapTarget;
|
|
76
|
+
_outsideTapView: UIView;
|
|
77
|
+
_catalystTarget: CatalystCardTarget;
|
|
78
|
+
_catalystOptions: BottomSheetOptions;
|
|
79
|
+
_catalystPan: {
|
|
80
|
+
startHeight: number;
|
|
81
|
+
scrollView: UIScrollView;
|
|
82
|
+
startOffsetY: number;
|
|
83
|
+
};
|
|
84
|
+
_onOutsideTap(): void;
|
|
85
|
+
bottomSheetController: UIViewController;
|
|
86
|
+
protected _showNativeBottomSheet(parent: View, options: BottomSheetOptions): void;
|
|
87
|
+
private configureCatalystCard;
|
|
88
|
+
private styleCatalystCard;
|
|
89
|
+
_isInCatalystCard(view: UIView): boolean;
|
|
90
|
+
_shouldBeginCatalystPan(recognizer: UIPanGestureRecognizer): boolean;
|
|
91
|
+
private _findCatalystScrollView;
|
|
92
|
+
private _snapCatalystCard;
|
|
93
|
+
/**
|
|
94
|
+
* Moves the card to a visible `height` (dip), from closed to the largest detent, without any layout
|
|
95
|
+
*/
|
|
96
|
+
private _dragCatalystCard;
|
|
97
|
+
_onCatalystPan(recognizer: UIPanGestureRecognizer): void;
|
|
98
|
+
_onCatalystScroll(recognizer: UIPanGestureRecognizer): void;
|
|
99
|
+
private _visibleCatalystHeight;
|
|
100
|
+
/**
|
|
101
|
+
* @returns false when the card cannot be dismissed (it then goes back to a detent)
|
|
102
|
+
*/
|
|
103
|
+
private _dismissCatalystCard;
|
|
104
|
+
private _applyCatalystDetent;
|
|
105
|
+
_cycleCatalystDetent(): void;
|
|
106
|
+
private configureSheet;
|
|
107
|
+
setBottomSheetDetentIndex(index: number, animated?: boolean): void;
|
|
108
|
+
getBottomSheetDetentIndex(): number;
|
|
109
|
+
_bottomSheetClosed(): void;
|
|
110
|
+
protected _hideNativeBottomSheet(parent: View, whenClosedCallback: () => void): void;
|
|
111
|
+
_unloadBottomSheet(): void;
|
|
112
|
+
}
|
|
113
|
+
export declare function overrideBottomSheet(): void;
|
|
114
|
+
export declare function install(): void;
|