@lodev09/react-native-true-sheet 0.1.0 → 0.2.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/ios/TrueSheetView.swift +87 -89
- package/ios/TrueSheetViewController.swift +30 -16
- package/ios/TrueSheetViewManager.m +0 -1
- package/lib/commonjs/TrueSheet.js +7 -11
- package/lib/commonjs/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.js +7 -11
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +0 -2
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheet.tsx +3 -21
package/ios/TrueSheetView.swift
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
11
11
|
// MARK: - React properties
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var sizes: [Any] = ["medium", "large"]
|
|
14
14
|
|
|
15
15
|
// Events
|
|
16
16
|
@objc var onDismiss: RCTDirectEventBlock?
|
|
@@ -33,19 +33,22 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
33
33
|
private var footerView: UIView?
|
|
34
34
|
private var rctScrollView: RCTScrollView?
|
|
35
35
|
|
|
36
|
-
private var isContentMounted: Bool {
|
|
37
|
-
return contentView != nil
|
|
38
|
-
}
|
|
39
|
-
|
|
40
36
|
// Content height minus the footer height for `auto` layout
|
|
41
37
|
private var contentHeight: CGFloat {
|
|
42
38
|
guard let contentView else { return 0 }
|
|
43
39
|
|
|
40
|
+
var height = contentView.frame.height
|
|
41
|
+
|
|
42
|
+
// Add footer view's height
|
|
43
|
+
if let footerContent = footerView?.subviews.first {
|
|
44
|
+
height += footerContent.bounds.height
|
|
45
|
+
}
|
|
46
|
+
|
|
44
47
|
// Exclude bottom safe area for consistency with a Scrollable content
|
|
45
48
|
let window = UIApplication.shared.windows.first(where: { $0.isKeyWindow })
|
|
46
49
|
let bottomInset = window?.safeAreaInsets.bottom ?? 0
|
|
47
50
|
|
|
48
|
-
return
|
|
51
|
+
return height - bottomInset
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
// MARK: - Setup
|
|
@@ -67,31 +70,6 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
67
70
|
fatalError("init(coder:) has not been implemented")
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
func viewDidChangeWidth(_ width: CGFloat) {
|
|
71
|
-
guard let containerView else { return }
|
|
72
|
-
|
|
73
|
-
let size = CGSize(width: width, height: containerView.bounds.height)
|
|
74
|
-
bridge.uiManager.setSize(size, for: containerView)
|
|
75
|
-
|
|
76
|
-
if let footerView {
|
|
77
|
-
bridge.uiManager.setSize(size, for: footerView)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
func didDismiss() {
|
|
82
|
-
isPresented = false
|
|
83
|
-
activeIndex = nil
|
|
84
|
-
|
|
85
|
-
onDismiss?(nil)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
func didChangeSize(_ value: CGFloat, at index: Int) {
|
|
89
|
-
if index != activeIndex {
|
|
90
|
-
activeIndex = index
|
|
91
|
-
onSizeChange?(["index": index, "value": value])
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
73
|
override func insertReactSubview(_ subview: UIView!, at index: Int) {
|
|
96
74
|
super.insertReactSubview(subview, at: index)
|
|
97
75
|
|
|
@@ -101,8 +79,6 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
101
79
|
}
|
|
102
80
|
|
|
103
81
|
viewController.view.insertSubview(subview, at: 0)
|
|
104
|
-
viewController.view.backgroundColor = backgroundColor ?? .white
|
|
105
|
-
backgroundColor = .clear
|
|
106
82
|
|
|
107
83
|
containerView = subview
|
|
108
84
|
touchHandler.attach(to: subview)
|
|
@@ -131,29 +107,59 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
131
107
|
super.layoutSubviews()
|
|
132
108
|
|
|
133
109
|
if let containerView, contentView == nil {
|
|
134
|
-
contentView = containerView.subviews
|
|
135
|
-
|
|
110
|
+
contentView = containerView.subviews[0]
|
|
111
|
+
footerView = containerView.subviews[1]
|
|
112
|
+
|
|
113
|
+
containerView.pinTo(view: viewController.view)
|
|
114
|
+
|
|
115
|
+
// Setup content constraints
|
|
116
|
+
setupContent()
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// MARK: - ViewController delegate
|
|
121
|
+
|
|
122
|
+
func viewControllerDidChangeWidth(_ width: CGFloat) {
|
|
123
|
+
guard let containerView else { return }
|
|
124
|
+
|
|
125
|
+
let size = CGSize(width: width, height: containerView.bounds.height)
|
|
126
|
+
bridge.uiManager.setSize(size, for: containerView)
|
|
127
|
+
|
|
128
|
+
if let footerView {
|
|
129
|
+
bridge.uiManager.setSize(size, for: footerView)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
func viewControllerWillAppear() {
|
|
134
|
+
setupContent()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
func viewControllerDidDismiss() {
|
|
138
|
+
isPresented = false
|
|
139
|
+
activeIndex = nil
|
|
140
|
+
|
|
141
|
+
onDismiss?(nil)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
func viewControllerSheetDidChangeSize(_ value: CGFloat, at index: Int) {
|
|
145
|
+
if index != activeIndex {
|
|
146
|
+
activeIndex = index
|
|
147
|
+
onSizeChange?(["index": index, "value": value])
|
|
136
148
|
}
|
|
137
149
|
}
|
|
138
150
|
|
|
139
151
|
// MARK: - Prop setters
|
|
140
152
|
|
|
141
153
|
@objc
|
|
142
|
-
func
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
setupContentIfNeeded()
|
|
154
|
+
func setSizes(_ sizes: [Any]) {
|
|
155
|
+
self.sizes = sizes
|
|
156
|
+
configureSheetIfPresented()
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
@objc
|
|
149
|
-
func
|
|
150
|
-
let view = bridge.uiManager.view(forReactTag: tag)
|
|
151
|
-
|
|
152
|
-
setupContentIfNeeded()
|
|
153
|
-
|
|
154
|
-
if #available(iOS 16.0, *) {
|
|
155
|
-
viewController.sheet?.invalidateDetents()
|
|
156
|
-
}
|
|
160
|
+
func setScrollableHandle(_ tag: NSNumber?) {
|
|
161
|
+
let view = bridge.uiManager.view(forReactTag: tag) as? RCTScrollView
|
|
162
|
+
rctScrollView = view
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
func invalidate() {
|
|
@@ -162,13 +168,26 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
162
168
|
|
|
163
169
|
// MARK: - Methods
|
|
164
170
|
|
|
165
|
-
func
|
|
166
|
-
|
|
171
|
+
func configureSheetIfPresented() {
|
|
172
|
+
// Resize sheet
|
|
173
|
+
if #available(iOS 15.0, *), isPresented {
|
|
174
|
+
viewController.configureSheet(for: sizes, at: activeIndex ?? 0, with: contentHeight, nil)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
167
177
|
|
|
168
|
-
|
|
178
|
+
func dismiss(promise: Promise) {
|
|
179
|
+
if isPresented {
|
|
180
|
+
viewController.dismiss(animated: true) {
|
|
181
|
+
promise.resolve(true)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
func setupContent() {
|
|
187
|
+
guard let contentView, let containerView else { return }
|
|
169
188
|
|
|
170
189
|
// Add constraints to fix weirdness and support ScrollView
|
|
171
|
-
if let
|
|
190
|
+
if let rctScrollView {
|
|
172
191
|
contentView.pinTo(view: containerView)
|
|
173
192
|
rctScrollView.pinTo(view: contentView)
|
|
174
193
|
}
|
|
@@ -176,18 +195,14 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
176
195
|
// Pin footer at the bottom
|
|
177
196
|
if let footerView {
|
|
178
197
|
containerView.bringSubviewToFront(footerView)
|
|
179
|
-
footerView.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
func dismiss(promise: Promise) {
|
|
188
|
-
if isPresented {
|
|
189
|
-
viewController.dismiss(animated: true) {
|
|
190
|
-
promise.resolve(true)
|
|
198
|
+
if let footerContent = footerView.subviews.first {
|
|
199
|
+
footerView.pinTo(
|
|
200
|
+
view: viewController.view,
|
|
201
|
+
from: [.bottom, .left, .right],
|
|
202
|
+
with: footerContent.bounds.height
|
|
203
|
+
)
|
|
204
|
+
} else {
|
|
205
|
+
footerView.removeConstraints(footerView.constraints)
|
|
191
206
|
}
|
|
192
207
|
}
|
|
193
208
|
}
|
|
@@ -200,37 +215,20 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
|
|
|
200
215
|
return
|
|
201
216
|
}
|
|
202
217
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
promise.reject(message: "Size at \(index) is not configured.")
|
|
208
|
-
return
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
var identifier: UISheetPresentationController.Detent.Identifier = .medium
|
|
212
|
-
|
|
213
|
-
if sheet.detents.indices.contains(index) {
|
|
214
|
-
let detent = sheet.detents[index]
|
|
215
|
-
if #available(iOS 16.0, *) {
|
|
216
|
-
identifier = detent.identifier
|
|
217
|
-
} else if detent == .large() {
|
|
218
|
-
identifier = .large
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if isPresented {
|
|
223
|
-
sheet.animateChanges {
|
|
224
|
-
sheet.selectedDetentIdentifier = identifier
|
|
218
|
+
guard sizes.indices.contains(index) else {
|
|
219
|
+
promise.reject(message: "Size at \(index) is not configured.")
|
|
220
|
+
return
|
|
221
|
+
}
|
|
225
222
|
|
|
223
|
+
if #available(iOS 15.0, *) {
|
|
224
|
+
viewController.configureSheet(for: sizes, at: index, with: contentHeight) {
|
|
225
|
+
if self.isPresented {
|
|
226
226
|
// Notify when size is changed programatically
|
|
227
|
-
let info = viewController.detentValues.first(where: { $0.value.index == index })
|
|
227
|
+
let info = self.viewController.detentValues.first(where: { $0.value.index == index })
|
|
228
228
|
if let sizeValue = info?.value.value {
|
|
229
|
-
self.
|
|
229
|
+
self.viewControllerSheetDidChangeSize(sizeValue, at: index)
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
} else {
|
|
233
|
-
sheet.selectedDetentIdentifier = identifier
|
|
234
232
|
}
|
|
235
233
|
}
|
|
236
234
|
|
|
@@ -16,14 +16,10 @@ struct SizeInfo {
|
|
|
16
16
|
// MARK: - TrueSheetViewControllerDelegate
|
|
17
17
|
|
|
18
18
|
protocol TrueSheetViewControllerDelegate: AnyObject {
|
|
19
|
-
|
|
20
|
-
func
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
func didDismiss()
|
|
24
|
-
|
|
25
|
-
/// Notify when size has changed from dragging the Sheet
|
|
26
|
-
func didChangeSize(_ value: CGFloat, at index: Int)
|
|
19
|
+
func viewControllerDidChangeWidth(_ width: CGFloat)
|
|
20
|
+
func viewControllerDidDismiss()
|
|
21
|
+
func viewControllerSheetDidChangeSize(_ value: CGFloat, at index: Int)
|
|
22
|
+
func viewControllerWillAppear()
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
// MARK: - TrueSheetViewController
|
|
@@ -47,13 +43,18 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
47
43
|
func sheetPresentationControllerDidChangeSelectedDetentIdentifier(_ sheet: UISheetPresentationController) {
|
|
48
44
|
if let identifer = sheet.selectedDetentIdentifier,
|
|
49
45
|
let size = detentValues[identifer.rawValue] {
|
|
50
|
-
delegate?.
|
|
46
|
+
delegate?.viewControllerSheetDidChangeSize(size.value, at: size.index)
|
|
51
47
|
}
|
|
52
48
|
}
|
|
53
49
|
|
|
50
|
+
override func viewWillAppear(_ animated: Bool) {
|
|
51
|
+
super.viewWillAppear(animated)
|
|
52
|
+
delegate?.viewControllerWillAppear()
|
|
53
|
+
}
|
|
54
|
+
|
|
54
55
|
override func viewDidDisappear(_ animated: Bool) {
|
|
55
56
|
super.viewDidDisappear(animated)
|
|
56
|
-
delegate?.
|
|
57
|
+
delegate?.viewControllerDidDismiss()
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
/// This is called multiple times while sheet is being dragged.
|
|
@@ -62,7 +63,7 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
62
63
|
super.viewDidLayoutSubviews()
|
|
63
64
|
|
|
64
65
|
if lastViewWidth != view.frame.width {
|
|
65
|
-
delegate?.
|
|
66
|
+
delegate?.viewControllerDidChangeWidth(view.bounds.width)
|
|
66
67
|
lastViewWidth = view.frame.width
|
|
67
68
|
}
|
|
68
69
|
}
|
|
@@ -70,17 +71,14 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
70
71
|
/// Prepares the view controller for sheet presentation
|
|
71
72
|
/// Do nothing on IOS 14 and below... sad
|
|
72
73
|
@available(iOS 15.0, *)
|
|
73
|
-
func configureSheet(for sizes: [Any], with height: CGFloat) {
|
|
74
|
+
func configureSheet(for sizes: [Any], at index: Int = 0, with height: CGFloat, _ completion: (() -> Void)?) {
|
|
74
75
|
guard let sheet else { return }
|
|
75
76
|
|
|
76
77
|
detentValues = [:]
|
|
77
78
|
|
|
78
79
|
var detents: [UISheetPresentationController.Detent] = []
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
let sheetSizes = sizes.isEmpty ? ["medium", "large"] : sizes
|
|
82
|
-
|
|
83
|
-
for (index, size) in sheetSizes.enumerated() {
|
|
81
|
+
for (index, size) in sizes.enumerated() {
|
|
84
82
|
let detent = detentFor(size, with: height) { id, value in
|
|
85
83
|
self.detentValues[id] = SizeInfo(index: index, value: value)
|
|
86
84
|
}
|
|
@@ -94,5 +92,21 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
|
|
|
94
92
|
// sheet.prefersScrollingExpandsWhenScrolledToEdge = false
|
|
95
93
|
|
|
96
94
|
sheet.delegate = self
|
|
95
|
+
|
|
96
|
+
var identifier: UISheetPresentationController.Detent.Identifier = .medium
|
|
97
|
+
|
|
98
|
+
if sheet.detents.indices.contains(index) {
|
|
99
|
+
let detent = sheet.detents[index]
|
|
100
|
+
if #available(iOS 16.0, *) {
|
|
101
|
+
identifier = detent.identifier
|
|
102
|
+
} else if detent == .large() {
|
|
103
|
+
identifier = .large
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
sheet.animateChanges {
|
|
108
|
+
sheet.selectedDetentIdentifier = identifier
|
|
109
|
+
completion?()
|
|
110
|
+
}
|
|
97
111
|
}
|
|
98
112
|
}
|
|
@@ -23,13 +23,11 @@ class TrueSheet extends _react.PureComponent {
|
|
|
23
23
|
constructor(props) {
|
|
24
24
|
super(props);
|
|
25
25
|
this.ref = /*#__PURE__*/(0, _react.createRef)();
|
|
26
|
-
this.footerRef = /*#__PURE__*/(0, _react.createRef)();
|
|
27
26
|
this.onDismiss = this.onDismiss.bind(this);
|
|
28
27
|
this.onPresent = this.onPresent.bind(this);
|
|
29
28
|
this.onSizeChange = this.onSizeChange.bind(this);
|
|
30
29
|
this.state = {
|
|
31
|
-
scrollableHandle: null
|
|
32
|
-
footerHandle: null
|
|
30
|
+
scrollableHandle: null
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
get handle() {
|
|
@@ -41,9 +39,7 @@ class TrueSheet extends _react.PureComponent {
|
|
|
41
39
|
}
|
|
42
40
|
updateHandles() {
|
|
43
41
|
const scrollableHandle = this.props.scrollRef?.current ? (0, _reactNative.findNodeHandle)(this.props.scrollRef.current) : null;
|
|
44
|
-
const footerHandle = (0, _reactNative.findNodeHandle)(this.footerRef.current);
|
|
45
42
|
this.setState({
|
|
46
|
-
footerHandle,
|
|
47
43
|
scrollableHandle
|
|
48
44
|
});
|
|
49
45
|
}
|
|
@@ -83,17 +79,17 @@ class TrueSheet extends _react.PureComponent {
|
|
|
83
79
|
ref: this.ref,
|
|
84
80
|
style: $nativeSheet,
|
|
85
81
|
scrollableHandle: this.state.scrollableHandle,
|
|
86
|
-
footerHandle: this.state.footerHandle,
|
|
87
82
|
sizes: this.props.sizes ?? ['medium', 'large'],
|
|
88
|
-
backgroundColor: this.props.backgroundColor,
|
|
89
83
|
onPresent: this.onPresent,
|
|
90
84
|
onDismiss: this.onDismiss,
|
|
91
85
|
onSizeChange: this.onSizeChange
|
|
92
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View,
|
|
86
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
87
|
+
style: {
|
|
88
|
+
backgroundColor: this.props.backgroundColor ?? 'white'
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
93
91
|
style: this.props.style
|
|
94
|
-
}, this.props.children), !!FooterComponent && /*#__PURE__*/_react.default.createElement(
|
|
95
|
-
ref: this.footerRef
|
|
96
|
-
}, /*#__PURE__*/_react.default.createElement(FooterComponent, null))));
|
|
92
|
+
}, this.props.children), /*#__PURE__*/_react.default.createElement(_reactNative.View, null, !!FooterComponent && /*#__PURE__*/_react.default.createElement(FooterComponent, null))));
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
exports.TrueSheet = TrueSheet;
|
|
@@ -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","LINKING_ERROR","Platform","select","ios","ComponentName","TrueSheetNativeView","requireNativeComponent","Error","TrueSheet","PureComponent","displayName","constructor","props","ref","createRef","
|
|
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","LINKING_ERROR","Platform","select","ios","ComponentName","TrueSheetNativeView","requireNativeComponent","Error","TrueSheet","PureComponent","displayName","constructor","props","ref","createRef","onDismiss","bind","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","findNodeHandle","current","updateHandles","scrollRef","setState","event","nativeEvent","componentDidMount","componentDidUpdate","present","index","TrueSheetModule","dismiss","render","FooterComponent","createElement","style","$nativeSheet","sizes","View","backgroundColor","children","exports","position","zIndex"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAYA,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,wBAA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|
package/lib/module/TrueSheet.js
CHANGED
|
@@ -15,13 +15,11 @@ export class TrueSheet extends PureComponent {
|
|
|
15
15
|
constructor(props) {
|
|
16
16
|
super(props);
|
|
17
17
|
this.ref = /*#__PURE__*/createRef();
|
|
18
|
-
this.footerRef = /*#__PURE__*/createRef();
|
|
19
18
|
this.onDismiss = this.onDismiss.bind(this);
|
|
20
19
|
this.onPresent = this.onPresent.bind(this);
|
|
21
20
|
this.onSizeChange = this.onSizeChange.bind(this);
|
|
22
21
|
this.state = {
|
|
23
|
-
scrollableHandle: null
|
|
24
|
-
footerHandle: null
|
|
22
|
+
scrollableHandle: null
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
25
|
get handle() {
|
|
@@ -33,9 +31,7 @@ export class TrueSheet extends PureComponent {
|
|
|
33
31
|
}
|
|
34
32
|
updateHandles() {
|
|
35
33
|
const scrollableHandle = this.props.scrollRef?.current ? findNodeHandle(this.props.scrollRef.current) : null;
|
|
36
|
-
const footerHandle = findNodeHandle(this.footerRef.current);
|
|
37
34
|
this.setState({
|
|
38
|
-
footerHandle,
|
|
39
35
|
scrollableHandle
|
|
40
36
|
});
|
|
41
37
|
}
|
|
@@ -75,17 +71,17 @@ export class TrueSheet extends PureComponent {
|
|
|
75
71
|
ref: this.ref,
|
|
76
72
|
style: $nativeSheet,
|
|
77
73
|
scrollableHandle: this.state.scrollableHandle,
|
|
78
|
-
footerHandle: this.state.footerHandle,
|
|
79
74
|
sizes: this.props.sizes ?? ['medium', 'large'],
|
|
80
|
-
backgroundColor: this.props.backgroundColor,
|
|
81
75
|
onPresent: this.onPresent,
|
|
82
76
|
onDismiss: this.onDismiss,
|
|
83
77
|
onSizeChange: this.onSizeChange
|
|
84
|
-
}, /*#__PURE__*/React.createElement(View,
|
|
78
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
79
|
+
style: {
|
|
80
|
+
backgroundColor: this.props.backgroundColor ?? 'white'
|
|
81
|
+
}
|
|
82
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
85
83
|
style: this.props.style
|
|
86
|
-
}, this.props.children), !!FooterComponent && /*#__PURE__*/React.createElement(
|
|
87
|
-
ref: this.footerRef
|
|
88
|
-
}, /*#__PURE__*/React.createElement(FooterComponent, null))));
|
|
84
|
+
}, this.props.children), /*#__PURE__*/React.createElement(View, null, !!FooterComponent && /*#__PURE__*/React.createElement(FooterComponent, null))));
|
|
89
85
|
}
|
|
90
86
|
}
|
|
91
87
|
const $nativeSheet = {
|
|
@@ -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","
|
|
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","updateHandles","scrollRef","setState","event","nativeEvent","componentDidMount","componentDidUpdate","present","index","dismiss","render","FooterComponent","createElement","style","$nativeSheet","sizes","backgroundColor","children","position","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,QAKC,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;AAYrC,MAAMC,mBAAmB,GAAGV,sBAAsB,CAA2BS,aAA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AAM,GAAE,IAAI,CAACxB,KAAK,CAAC4B,QAAe,CAAC,eAC3D9C,KAAA,CAAAyC,aAAA,CAACnC,IAAI,QAAE,CAAC,CAACkC,eAAe,iBAAIxC,KAAA,CAAAyC,aAAA,CAACD,eAAe,MAAE,CAAQ,CAClD,CACa,CAAC;EAE1B;AACF;AAEA,MAAMG,YAAuB,GAAG;EAC9BI,QAAQ,EAAE,UAAU;EACpBC,MAAM,EAAE,CAAC;AACX,CAAC","ignoreList":[]}
|
|
@@ -2,12 +2,10 @@ import { PureComponent, type ReactNode } from 'react';
|
|
|
2
2
|
import type { TrueSheetProps } from './types';
|
|
3
3
|
interface TrueSheetState {
|
|
4
4
|
scrollableHandle: number | null;
|
|
5
|
-
footerHandle: number | null;
|
|
6
5
|
}
|
|
7
6
|
export declare class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
8
7
|
displayName: string;
|
|
9
8
|
private readonly ref;
|
|
10
|
-
private readonly footerRef;
|
|
11
9
|
constructor(props: TrueSheetProps);
|
|
12
10
|
private get handle();
|
|
13
11
|
private updateHandles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TrueSheet.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAYlG,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAA;AA6B9D,UAAU,cAAc;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;CAChC;AAED,qBAAa,SAAU,SAAQ,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC;IAC1E,WAAW,SAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;gBAE9B,KAAK,EAAE,cAAc;IAcjC,OAAO,KAAK,MAAM,GAOjB;IAED,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,SAAS;IAIjB,iBAAiB,IAAI,IAAI;IAIzB,kBAAkB,IAAI,IAAI;IAI1B;;;OAGG;IACU,OAAO,CAAC,KAAK,GAAE,MAAU;IAItC;;OAEG;IACU,OAAO;IAIpB,MAAM,IAAI,SAAS;CAoBpB"}
|
package/package.json
CHANGED
package/src/TrueSheet.tsx
CHANGED
|
@@ -3,13 +3,11 @@ import {
|
|
|
3
3
|
requireNativeComponent,
|
|
4
4
|
Platform,
|
|
5
5
|
findNodeHandle,
|
|
6
|
+
View,
|
|
6
7
|
type NativeMethods,
|
|
7
8
|
type ViewStyle,
|
|
8
|
-
View,
|
|
9
|
-
type ViewProps,
|
|
10
9
|
type NativeSyntheticEvent,
|
|
11
10
|
type StyleProp,
|
|
12
|
-
type ColorValue,
|
|
13
11
|
} from 'react-native'
|
|
14
12
|
|
|
15
13
|
import type { TrueSheetProps, SizeChangeEvent } from './types'
|
|
@@ -25,12 +23,10 @@ const ComponentName = 'TrueSheetView'
|
|
|
25
23
|
|
|
26
24
|
interface TrueSheetNativeViewProps {
|
|
27
25
|
scrollableHandle: number | null
|
|
28
|
-
footerHandle: number | null
|
|
29
26
|
onDismiss: () => void
|
|
30
27
|
onPresent: (event: NativeSyntheticEvent<{ index: number }>) => void
|
|
31
28
|
onSizeChange: (event: NativeSyntheticEvent<SizeChangeEvent>) => void
|
|
32
29
|
children: ReactNode
|
|
33
|
-
backgroundColor?: ColorValue
|
|
34
30
|
style: StyleProp<ViewStyle>
|
|
35
31
|
sizes: TrueSheetProps['sizes']
|
|
36
32
|
}
|
|
@@ -42,24 +38,20 @@ if (!TrueSheetNativeView) {
|
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
type NativeRef = Component<TrueSheetNativeViewProps> & Readonly<NativeMethods>
|
|
45
|
-
type FooterRef = Component<ViewProps> & Readonly<NativeMethods>
|
|
46
41
|
|
|
47
42
|
interface TrueSheetState {
|
|
48
43
|
scrollableHandle: number | null
|
|
49
|
-
footerHandle: number | null
|
|
50
44
|
}
|
|
51
45
|
|
|
52
46
|
export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
53
47
|
displayName = 'TrueSheet'
|
|
54
48
|
|
|
55
49
|
private readonly ref: RefObject<NativeRef>
|
|
56
|
-
private readonly footerRef: RefObject<FooterRef>
|
|
57
50
|
|
|
58
51
|
constructor(props: TrueSheetProps) {
|
|
59
52
|
super(props)
|
|
60
53
|
|
|
61
54
|
this.ref = createRef<NativeRef>()
|
|
62
|
-
this.footerRef = createRef<FooterRef>()
|
|
63
55
|
|
|
64
56
|
this.onDismiss = this.onDismiss.bind(this)
|
|
65
57
|
this.onPresent = this.onPresent.bind(this)
|
|
@@ -67,7 +59,6 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
67
59
|
|
|
68
60
|
this.state = {
|
|
69
61
|
scrollableHandle: null,
|
|
70
|
-
footerHandle: null,
|
|
71
62
|
}
|
|
72
63
|
}
|
|
73
64
|
|
|
@@ -85,10 +76,7 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
85
76
|
? findNodeHandle(this.props.scrollRef.current)
|
|
86
77
|
: null
|
|
87
78
|
|
|
88
|
-
const footerHandle = findNodeHandle(this.footerRef.current)
|
|
89
|
-
|
|
90
79
|
this.setState({
|
|
91
|
-
footerHandle,
|
|
92
80
|
scrollableHandle,
|
|
93
81
|
})
|
|
94
82
|
}
|
|
@@ -136,20 +124,14 @@ export class TrueSheet extends PureComponent<TrueSheetProps, TrueSheetState> {
|
|
|
136
124
|
ref={this.ref}
|
|
137
125
|
style={$nativeSheet}
|
|
138
126
|
scrollableHandle={this.state.scrollableHandle}
|
|
139
|
-
footerHandle={this.state.footerHandle}
|
|
140
127
|
sizes={this.props.sizes ?? ['medium', 'large']}
|
|
141
|
-
backgroundColor={this.props.backgroundColor}
|
|
142
128
|
onPresent={this.onPresent}
|
|
143
129
|
onDismiss={this.onDismiss}
|
|
144
130
|
onSizeChange={this.onSizeChange}
|
|
145
131
|
>
|
|
146
|
-
<View>
|
|
132
|
+
<View style={{ backgroundColor: this.props.backgroundColor ?? 'white' }}>
|
|
147
133
|
<View style={this.props.style}>{this.props.children}</View>
|
|
148
|
-
{!!FooterComponent &&
|
|
149
|
-
<View ref={this.footerRef}>
|
|
150
|
-
<FooterComponent />
|
|
151
|
-
</View>
|
|
152
|
-
)}
|
|
134
|
+
<View>{!!FooterComponent && <FooterComponent />}</View>
|
|
153
135
|
</View>
|
|
154
136
|
</TrueSheetNativeView>
|
|
155
137
|
)
|