@lodev09/react-native-true-sheet 0.6.0 → 0.7.0
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 +5 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +5 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +5 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBehavior.kt +1 -2
- package/ios/TrueSheetView.swift +52 -36
- package/ios/TrueSheetViewController.swift +10 -36
- package/ios/TrueSheetViewManager.m +1 -0
- package/lib/commonjs/TrueSheet.js +7 -6
- package/lib/commonjs/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.js +7 -6
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/typescript/src/types.d.ts +8 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheet.tsx +7 -7
- package/src/types.ts +9 -0
package/README.md
CHANGED
|
@@ -55,14 +55,15 @@ Extended from `ViewProps`
|
|
|
55
55
|
| Prop | Type | Default | Description | 🍎 | 🤖 |
|
|
56
56
|
| - | - | - | - | - | - |
|
|
57
57
|
| sizes | [`SheetSize`](#sheetsize) | `['medium', 'large']` | The sizes you want the Sheet to support. Maximum of _**3 sizes**_ only! **_collapsed_**, **_half-expanded_** and **_expanded_**. Example: `size={['auto', '60%', 'large']}`| ✅ | ✅ |
|
|
58
|
-
| backgroundColor | `ColorValue` |
|
|
58
|
+
| backgroundColor | `ColorValue` | `white` | Main sheet background color. | ✅ | ✅ |
|
|
59
59
|
| cornerRadius | `number` | - | The sheet corner radius. | ✅ | ✅ |
|
|
60
60
|
| maxHeight | `number` | - | Overrides `large` or `100%` height. | ✅ | ✅ |
|
|
61
61
|
| contentContainerStyle | `StyleProp<ViewStyle>` | - | Optional content container styles. | ✅ | ✅ |
|
|
62
62
|
| FooterComponent | `ReactNode` | - | A component that floats at the bottom of the Sheet. | ✅ | ✅ |
|
|
63
|
-
|
|
|
63
|
+
| dismissible | `boolean` | `true` | Prevents interactive dismissal of the Sheet. | ✅ | ✅ |
|
|
64
|
+
| grabber | `boolean` | `true` | Shows native grabber (or handle) on iOS. | ✅ | |
|
|
64
65
|
| blurTint | [`BlurTint`](#blurTint) | - | The blur effect style on iOS. Overrides `backgroundColor` if set. Example: `light`, `dark`, etc. | ✅ | |
|
|
65
|
-
| scrollRef | `RefObject<...>` | - | The main scrollable ref that Sheet should handle on
|
|
66
|
+
| scrollRef | `RefObject<...>` | - | The main scrollable ref that Sheet should handle on iOS. | ✅ | |
|
|
66
67
|
|
|
67
68
|
## Methods
|
|
68
69
|
|
|
@@ -135,7 +136,7 @@ return (
|
|
|
135
136
|
|
|
136
137
|
### `BlurTint`
|
|
137
138
|
|
|
138
|
-
Blur
|
|
139
|
+
Blur tint that is mapped into native values in iOS.
|
|
139
140
|
|
|
140
141
|
```ts
|
|
141
142
|
<TrueSheet blurTint="dark">
|
|
@@ -215,6 +215,11 @@ class TrueSheetView(context: Context) :
|
|
|
215
215
|
sheetBehavior.configure()
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
fun setDismissible(dismissible: Boolean) {
|
|
219
|
+
sheetBehavior.isHideable = dismissible
|
|
220
|
+
sheetDialog.setCancelable(dismissible)
|
|
221
|
+
}
|
|
222
|
+
|
|
218
223
|
fun setSizes(newSizes: Array<Any>) {
|
|
219
224
|
sheetBehavior.sizes = newSizes
|
|
220
225
|
sheetBehavior.configure()
|
|
@@ -34,6 +34,11 @@ class TrueSheetViewManager : ViewGroupManager<TrueSheetView>() {
|
|
|
34
34
|
view.setMaxHeight(Utils.toPixel(height))
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
@ReactProp(name = "dismissible")
|
|
38
|
+
fun setDismissible(view: TrueSheetView, dismissible: Boolean) {
|
|
39
|
+
view.setDismissible(dismissible)
|
|
40
|
+
}
|
|
41
|
+
|
|
37
42
|
@ReactProp(name = "sizes")
|
|
38
43
|
fun setSizes(view: TrueSheetView, sizes: ReadableArray) {
|
|
39
44
|
val result = ArrayList<Any>()
|
|
@@ -108,7 +108,6 @@ class TrueSheetBehavior : BottomSheetBehavior<ViewGroup>() {
|
|
|
108
108
|
// Configure sheet sizes
|
|
109
109
|
apply {
|
|
110
110
|
isFitToContents = true
|
|
111
|
-
isHideable = true
|
|
112
111
|
skipCollapsed = false
|
|
113
112
|
|
|
114
113
|
when (sizes.size) {
|
|
@@ -134,7 +133,7 @@ class TrueSheetBehavior : BottomSheetBehavior<ViewGroup>() {
|
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
135
|
|
|
137
|
-
fun getStateForIndex(index: Int) =
|
|
136
|
+
private fun getStateForIndex(index: Int) =
|
|
138
137
|
when (sizes.size) {
|
|
139
138
|
1 -> STATE_EXPANDED
|
|
140
139
|
|
package/ios/TrueSheetView.swift
CHANGED
|
@@ -147,8 +147,17 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
func invalidate() {
|
|
151
|
+
viewController.dismiss(animated: true)
|
|
152
|
+
}
|
|
153
|
+
|
|
150
154
|
// MARK: - Prop setters
|
|
151
155
|
|
|
156
|
+
@objc
|
|
157
|
+
func setDismissible(_ dismissible: Bool) {
|
|
158
|
+
viewController.isModalInPresentation = !dismissible
|
|
159
|
+
}
|
|
160
|
+
|
|
152
161
|
@objc
|
|
153
162
|
func setMaxHeight(_ height: NSNumber) {
|
|
154
163
|
viewController.maxHeight = CGFloat(height.floatValue)
|
|
@@ -172,18 +181,28 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
172
181
|
}
|
|
173
182
|
|
|
174
183
|
@objc
|
|
175
|
-
func
|
|
176
|
-
|
|
184
|
+
func setCornerRadius(_ radius: NSNumber?) {
|
|
185
|
+
var cornerRadius: CGFloat?
|
|
186
|
+
if let radius {
|
|
187
|
+
cornerRadius = CGFloat(radius.floatValue)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
viewController.cornerRadius = cornerRadius
|
|
191
|
+
if #available(iOS 15.0, *) {
|
|
192
|
+
configureSheetIfPresented { sheet in
|
|
193
|
+
sheet.preferredCornerRadius = viewController.cornerRadius
|
|
194
|
+
}
|
|
195
|
+
}
|
|
177
196
|
}
|
|
178
197
|
|
|
179
198
|
@objc
|
|
180
|
-
func
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
199
|
+
func setGrabber(_ visible: Bool) {
|
|
200
|
+
viewController.grabber = visible
|
|
201
|
+
if #available(iOS 15.0, *) {
|
|
202
|
+
configureSheetIfPresented { sheet in
|
|
203
|
+
sheet.prefersGrabberVisible = visible
|
|
204
|
+
}
|
|
184
205
|
}
|
|
185
|
-
|
|
186
|
-
viewController.cornerRadius = CGFloat(radius.floatValue)
|
|
187
206
|
}
|
|
188
207
|
|
|
189
208
|
@objc
|
|
@@ -192,10 +211,6 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
192
211
|
rctScrollView = view
|
|
193
212
|
}
|
|
194
213
|
|
|
195
|
-
func invalidate() {
|
|
196
|
-
viewController.dismiss(animated: true)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
214
|
// MARK: - Methods
|
|
200
215
|
|
|
201
216
|
private func sizeInfoData(from sizeInfo: SizeInfo?) -> [String: Any] {
|
|
@@ -206,9 +221,19 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
206
221
|
return ["index": sizeInfo.index, "value": sizeInfo.value]
|
|
207
222
|
}
|
|
208
223
|
|
|
224
|
+
/// Use to customize some properties of the Sheet
|
|
225
|
+
@available(iOS 15.0, *)
|
|
226
|
+
func configureSheetIfPresented(completion: (UISheetPresentationController) -> Void) {
|
|
227
|
+
guard isPresented, let sheet = viewController.sheetPresentationController else {
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
completion(sheet)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/// Full reconfiguration of the Sheet
|
|
209
235
|
func configureSheetIfPresented() {
|
|
210
|
-
|
|
211
|
-
if #available(iOS 15.0, *), isPresented {
|
|
236
|
+
if isPresented {
|
|
212
237
|
viewController.configureSheet(at: activeIndex ?? 0, with: contentHeight, nil)
|
|
213
238
|
}
|
|
214
239
|
}
|
|
@@ -261,31 +286,22 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
261
286
|
return
|
|
262
287
|
}
|
|
263
288
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
if isPresented {
|
|
273
|
-
promise.resolve(nil)
|
|
274
|
-
} else {
|
|
275
|
-
// Keep track of the active index
|
|
276
|
-
activeIndex = index
|
|
277
|
-
|
|
278
|
-
rvc.present(viewController, animated: true) {
|
|
279
|
-
self.isPresented = true
|
|
289
|
+
viewController.configureSheet(at: index, with: contentHeight) { sizeInfo in
|
|
290
|
+
// Trigger onSizeChange event when size is changed while presenting
|
|
291
|
+
if self.isPresented {
|
|
292
|
+
self.viewControllerSheetDidChangeSize(sizeInfo)
|
|
293
|
+
promise.resolve(nil)
|
|
294
|
+
} else {
|
|
295
|
+
// Keep track of the active index
|
|
296
|
+
self.activeIndex = index
|
|
280
297
|
|
|
281
|
-
|
|
298
|
+
rvc.present(self.viewController, animated: true) {
|
|
299
|
+
self.isPresented = true
|
|
282
300
|
|
|
283
|
-
|
|
284
|
-
|
|
301
|
+
let data = self.sizeInfoData(from: sizeInfo)
|
|
302
|
+
self.onPresent?(data)
|
|
303
|
+
promise.resolve(nil)
|
|
285
304
|
}
|
|
286
|
-
|
|
287
|
-
self.onPresent?(data)
|
|
288
|
-
promise.resolve(nil)
|
|
289
305
|
}
|
|
290
306
|
}
|
|
291
307
|
}
|
|
@@ -35,36 +35,8 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
35
35
|
|
|
36
36
|
var sizes: [Any] = ["medium", "large"]
|
|
37
37
|
var maxHeight: CGFloat?
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
didSet {
|
|
41
|
-
if #available(iOS 15.0, *) {
|
|
42
|
-
sheet?.preferredCornerRadius = cornerRadius
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
var grabber = true {
|
|
48
|
-
didSet {
|
|
49
|
-
if #available(iOS 15.0, *) {
|
|
50
|
-
sheet?.prefersGrabberVisible = grabber
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@available(iOS 15.0, *)
|
|
56
|
-
var sheet: UISheetPresentationController? {
|
|
57
|
-
return sheetPresentationController
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@available(iOS 15.0, *)
|
|
61
|
-
var selectedSizeInfo: SizeInfo? {
|
|
62
|
-
guard let rawValue = sheet?.selectedDetentIdentifier?.rawValue else {
|
|
63
|
-
return nil
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return detentValues[rawValue]
|
|
67
|
-
}
|
|
38
|
+
var cornerRadius: CGFloat?
|
|
39
|
+
var grabber = true
|
|
68
40
|
|
|
69
41
|
// MARK: - Setup
|
|
70
42
|
|
|
@@ -115,10 +87,13 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
115
87
|
}
|
|
116
88
|
|
|
117
89
|
/// Prepares the view controller for sheet presentation
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
guard let sheet else {
|
|
90
|
+
func configureSheet(at index: Int = 0, with contentHeight: CGFloat, _ completion: ((SizeInfo) -> Void)?) {
|
|
91
|
+
let defaultSizeInfo = SizeInfo(index: index, value: view.bounds.height)
|
|
92
|
+
|
|
93
|
+
guard #available(iOS 15.0, *), let sheet = sheetPresentationController else {
|
|
94
|
+
completion?(defaultSizeInfo)
|
|
95
|
+
return
|
|
96
|
+
}
|
|
122
97
|
|
|
123
98
|
detentValues = [:]
|
|
124
99
|
|
|
@@ -136,7 +111,6 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
136
111
|
sheet.prefersEdgeAttachedInCompactHeight = true
|
|
137
112
|
sheet.prefersGrabberVisible = grabber
|
|
138
113
|
sheet.preferredCornerRadius = cornerRadius
|
|
139
|
-
|
|
140
114
|
sheet.delegate = self
|
|
141
115
|
|
|
142
116
|
var identifier: UISheetPresentationController.Detent.Identifier = .medium
|
|
@@ -152,7 +126,7 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
152
126
|
|
|
153
127
|
sheet.animateChanges {
|
|
154
128
|
sheet.selectedDetentIdentifier = identifier
|
|
155
|
-
completion?()
|
|
129
|
+
completion?(self.detentValues[identifier.rawValue] ?? defaultSizeInfo)
|
|
156
130
|
}
|
|
157
131
|
}
|
|
158
132
|
}
|
|
@@ -88,10 +88,11 @@ class TrueSheet extends _react.PureComponent {
|
|
|
88
88
|
render() {
|
|
89
89
|
const {
|
|
90
90
|
sizes,
|
|
91
|
-
backgroundColor,
|
|
91
|
+
backgroundColor = 'white',
|
|
92
|
+
grabber = true,
|
|
93
|
+
dismissible = true,
|
|
92
94
|
blurTint,
|
|
93
95
|
cornerRadius,
|
|
94
|
-
grabber,
|
|
95
96
|
maxHeight,
|
|
96
97
|
FooterComponent,
|
|
97
98
|
style,
|
|
@@ -99,7 +100,6 @@ class TrueSheet extends _react.PureComponent {
|
|
|
99
100
|
children,
|
|
100
101
|
...rest
|
|
101
102
|
} = this.props;
|
|
102
|
-
const wrapperBackgroundColor = backgroundColor ?? 'white';
|
|
103
103
|
return /*#__PURE__*/_react.default.createElement(TrueSheetNativeView, {
|
|
104
104
|
ref: this.ref,
|
|
105
105
|
style: $nativeSheet,
|
|
@@ -107,7 +107,8 @@ class TrueSheet extends _react.PureComponent {
|
|
|
107
107
|
sizes: sizes ?? ['medium', 'large'],
|
|
108
108
|
blurTint: blurTint,
|
|
109
109
|
cornerRadius: cornerRadius,
|
|
110
|
-
grabber: grabber
|
|
110
|
+
grabber: grabber,
|
|
111
|
+
dismissible: dismissible,
|
|
111
112
|
maxHeight: maxHeight,
|
|
112
113
|
onPresent: this.onPresent,
|
|
113
114
|
onDismiss: this.onDismiss,
|
|
@@ -123,8 +124,8 @@ class TrueSheet extends _react.PureComponent {
|
|
|
123
124
|
borderTopRightRadius: cornerRadius,
|
|
124
125
|
// Remove backgroundColor if `blurTint` is set on iOS
|
|
125
126
|
backgroundColor: _reactNative.Platform.select({
|
|
126
|
-
ios: blurTint ? undefined :
|
|
127
|
-
android:
|
|
127
|
+
ios: blurTint ? undefined : backgroundColor,
|
|
128
|
+
android: backgroundColor
|
|
128
129
|
})
|
|
129
130
|
}, style]
|
|
130
131
|
}, rest), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_TrueSheetModule","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","LINKING_ERROR","Platform","select","ios","ComponentName","TrueSheetNativeView","requireNativeComponent","Error","TrueSheet","PureComponent","displayName","constructor","props","ref","createRef","onDismiss","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","findNodeHandle","current","updateState","scrollRef","setState","event","nativeEvent","componentDidMount","sizes","console","warn","componentDidUpdate","present","index","TrueSheetModule","resize","dismiss","render","backgroundColor","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_TrueSheetModule","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","LINKING_ERROR","Platform","select","ios","ComponentName","TrueSheetNativeView","requireNativeComponent","Error","TrueSheet","PureComponent","displayName","constructor","props","ref","createRef","onDismiss","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","findNodeHandle","current","updateState","scrollRef","setState","event","nativeEvent","componentDidMount","sizes","console","warn","componentDidUpdate","present","index","TrueSheetModule","resize","dismiss","render","backgroundColor","grabber","dismissible","blurTint","cornerRadius","maxHeight","FooterComponent","style","contentContainerStyle","children","rest","createElement","$nativeSheet","View","collapsable","overflow","undefined","android","borderTopLeftRadius","borderTopRightRadius","exports","position","left","zIndex"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,gBAAA,GAAAF,OAAA;AAAmD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAA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QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,CAAC,IAAI;EACXC,MAAM,EAAE,CAAC;AACX,CAAC","ignoreList":[]}
|
package/lib/module/TrueSheet.js
CHANGED
|
@@ -80,10 +80,11 @@ export class TrueSheet extends PureComponent {
|
|
|
80
80
|
render() {
|
|
81
81
|
const {
|
|
82
82
|
sizes,
|
|
83
|
-
backgroundColor,
|
|
83
|
+
backgroundColor = 'white',
|
|
84
|
+
grabber = true,
|
|
85
|
+
dismissible = true,
|
|
84
86
|
blurTint,
|
|
85
87
|
cornerRadius,
|
|
86
|
-
grabber,
|
|
87
88
|
maxHeight,
|
|
88
89
|
FooterComponent,
|
|
89
90
|
style,
|
|
@@ -91,7 +92,6 @@ export class TrueSheet extends PureComponent {
|
|
|
91
92
|
children,
|
|
92
93
|
...rest
|
|
93
94
|
} = this.props;
|
|
94
|
-
const wrapperBackgroundColor = backgroundColor ?? 'white';
|
|
95
95
|
return /*#__PURE__*/React.createElement(TrueSheetNativeView, {
|
|
96
96
|
ref: this.ref,
|
|
97
97
|
style: $nativeSheet,
|
|
@@ -99,7 +99,8 @@ export class TrueSheet extends PureComponent {
|
|
|
99
99
|
sizes: sizes ?? ['medium', 'large'],
|
|
100
100
|
blurTint: blurTint,
|
|
101
101
|
cornerRadius: cornerRadius,
|
|
102
|
-
grabber: grabber
|
|
102
|
+
grabber: grabber,
|
|
103
|
+
dismissible: dismissible,
|
|
103
104
|
maxHeight: maxHeight,
|
|
104
105
|
onPresent: this.onPresent,
|
|
105
106
|
onDismiss: this.onDismiss,
|
|
@@ -115,8 +116,8 @@ export class TrueSheet extends PureComponent {
|
|
|
115
116
|
borderTopRightRadius: cornerRadius,
|
|
116
117
|
// Remove backgroundColor if `blurTint` is set on iOS
|
|
117
118
|
backgroundColor: Platform.select({
|
|
118
|
-
ios: blurTint ? undefined :
|
|
119
|
-
android:
|
|
119
|
+
ios: blurTint ? undefined : backgroundColor,
|
|
120
|
+
android: backgroundColor
|
|
120
121
|
})
|
|
121
122
|
}, style]
|
|
122
123
|
}, rest), /*#__PURE__*/React.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","PureComponent","createRef","requireNativeComponent","Platform","findNodeHandle","View","TrueSheetModule","LINKING_ERROR","select","ios","default","ComponentName","TrueSheetNativeView","Error","TrueSheet","displayName","constructor","props","ref","onDismiss","bind","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","current","updateState","scrollRef","setState","event","nativeEvent","componentDidMount","sizes","length","console","warn","componentDidUpdate","present","index","resize","dismiss","render","backgroundColor","
|
|
1
|
+
{"version":3,"names":["React","PureComponent","createRef","requireNativeComponent","Platform","findNodeHandle","View","TrueSheetModule","LINKING_ERROR","select","ios","default","ComponentName","TrueSheetNativeView","Error","TrueSheet","displayName","constructor","props","ref","onDismiss","bind","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","current","updateState","scrollRef","setState","event","nativeEvent","componentDidMount","sizes","length","console","warn","componentDidUpdate","present","index","resize","dismiss","render","backgroundColor","grabber","dismissible","blurTint","cornerRadius","maxHeight","FooterComponent","style","contentContainerStyle","children","rest","createElement","$nativeSheet","_extends","collapsable","overflow","undefined","android","borderTopLeftRadius","borderTopRightRadius","position","left","zIndex"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,aAAa,EAA6BC,SAAS,QAAwB,OAAO;AAClG,SACEC,sBAAsB,EACtBC,QAAQ,EACRC,cAAc,EACdC,IAAI,QAIC,cAAc;AAGrB,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,MAAMC,aAAa,GAChB,2FAA0F,GAC3FJ,QAAQ,CAACK,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,aAAa,GAAG,eAAe;AAQrC,MAAMC,mBAAmB,GAAGV,sBAAsB,CAA2BS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,CAAC","ignoreList":[]}
|
|
@@ -72,8 +72,16 @@ export interface TrueSheetProps extends ViewProps {
|
|
|
72
72
|
* @default ['medium', 'large']
|
|
73
73
|
*/
|
|
74
74
|
sizes?: SheetSize[];
|
|
75
|
+
/**
|
|
76
|
+
* Prevents interactive dismissal of the Sheet.
|
|
77
|
+
*
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
dismissible?: boolean;
|
|
75
81
|
/**
|
|
76
82
|
* Main sheet background color
|
|
83
|
+
*
|
|
84
|
+
* @default white
|
|
77
85
|
*/
|
|
78
86
|
backgroundColor?: ColorValue;
|
|
79
87
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE/E,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,MAAM,GACN,SAAS,GACT,YAAY,GACZ,SAAS,GACT,WAAW,GACX,yBAAyB,GACzB,oBAAoB,GACpB,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,GACtB,8BAA8B,GAC9B,yBAAyB,GACzB,qBAAqB,GACrB,0BAA0B,GAC1B,2BAA2B,GAC3B,6BAA6B,GAC7B,wBAAwB,GACxB,oBAAoB,GACpB,yBAAyB,GACzB,0BAA0B,CAAA;AAE9B;;;;;GAKG;AACH,MAAM,MAAM,SAAS;AACnB;;;;;GAKG;AACD,MAAM;AAER;;;;;GAKG;GACD,MAAM;AAER;;;;;GAKG;GACD,GAAG,MAAM,GAAG;AAEd;;;;;GA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;;;;OAIG;IACH,eAAe,CAAC,EAAE,UAAU,CAAA;IAE5B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB;;OAEG;IACH,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAEzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAExC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;IAEpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAA;CACxC"}
|
package/package.json
CHANGED
package/src/TrueSheet.tsx
CHANGED
|
@@ -128,10 +128,11 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
128
128
|
render(): ReactNode {
|
|
129
129
|
const {
|
|
130
130
|
sizes,
|
|
131
|
-
backgroundColor,
|
|
131
|
+
backgroundColor = 'white',
|
|
132
|
+
grabber = true,
|
|
133
|
+
dismissible = true,
|
|
132
134
|
blurTint,
|
|
133
135
|
cornerRadius,
|
|
134
|
-
grabber,
|
|
135
136
|
maxHeight,
|
|
136
137
|
FooterComponent,
|
|
137
138
|
style,
|
|
@@ -140,8 +141,6 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
140
141
|
...rest
|
|
141
142
|
} = this.props
|
|
142
143
|
|
|
143
|
-
const wrapperBackgroundColor = backgroundColor ?? 'white'
|
|
144
|
-
|
|
145
144
|
return (
|
|
146
145
|
<TrueSheetNativeView
|
|
147
146
|
ref={this.ref}
|
|
@@ -150,7 +149,8 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
150
149
|
sizes={sizes ?? ['medium', 'large']}
|
|
151
150
|
blurTint={blurTint}
|
|
152
151
|
cornerRadius={cornerRadius}
|
|
153
|
-
grabber={grabber
|
|
152
|
+
grabber={grabber}
|
|
153
|
+
dismissible={dismissible}
|
|
154
154
|
maxHeight={maxHeight}
|
|
155
155
|
onPresent={this.onPresent}
|
|
156
156
|
onDismiss={this.onDismiss}
|
|
@@ -166,8 +166,8 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
166
166
|
|
|
167
167
|
// Remove backgroundColor if `blurTint` is set on iOS
|
|
168
168
|
backgroundColor: Platform.select({
|
|
169
|
-
ios: blurTint ? undefined :
|
|
170
|
-
android:
|
|
169
|
+
ios: blurTint ? undefined : backgroundColor,
|
|
170
|
+
android: backgroundColor,
|
|
171
171
|
}),
|
|
172
172
|
},
|
|
173
173
|
style,
|
package/src/types.ts
CHANGED
|
@@ -103,8 +103,17 @@ export interface TrueSheetProps extends ViewProps {
|
|
|
103
103
|
*/
|
|
104
104
|
sizes?: SheetSize[]
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Prevents interactive dismissal of the Sheet.
|
|
108
|
+
*
|
|
109
|
+
* @default true
|
|
110
|
+
*/
|
|
111
|
+
dismissible?: boolean
|
|
112
|
+
|
|
106
113
|
/**
|
|
107
114
|
* Main sheet background color
|
|
115
|
+
*
|
|
116
|
+
* @default white
|
|
108
117
|
*/
|
|
109
118
|
backgroundColor?: ColorValue
|
|
110
119
|
|