@draftbit/core 46.10.3-7db6c9.2 → 46.10.3-84bbff.2
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/lib/commonjs/components/AnimatedCircularProgress.js +12 -1
- package/lib/commonjs/components/Banner.js +23 -4
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +22 -4
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +127 -111
- package/lib/commonjs/components/Button.js +33 -10
- package/lib/commonjs/components/Checkbox/Checkbox.js +3 -4
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -4
- package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/FAB.js +18 -4
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/commonjs/components/Portal/Portal.js +27 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Pressable.js +15 -2
- package/lib/commonjs/components/ScreenContainer.js +24 -6
- package/lib/commonjs/components/Shadow.js +15 -2
- package/lib/commonjs/components/Slider.js +21 -4
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/TabView/TabView.js +13 -7
- package/lib/commonjs/components/Table/Table.js +123 -0
- package/lib/commonjs/components/Table/TableCell.js +49 -0
- package/lib/commonjs/components/Table/TableCommon.js +30 -0
- package/lib/commonjs/components/Table/TableRow.js +60 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/components/Text.js +50 -4
- package/lib/commonjs/components/TextField.js +76 -28
- package/lib/commonjs/components/ToggleButton.js +15 -2
- package/lib/commonjs/components/Touchable.js +15 -2
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +19 -7
- package/lib/commonjs/mappings/FieldSearchBarFull.js +3 -1
- package/lib/commonjs/mappings/NativeBase/Layout.js +2 -11
- package/lib/commonjs/mappings/StarRating.js +6 -2
- package/lib/commonjs/mappings/Table.js +140 -0
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/module/components/Accordion/AccordionItem.js +25 -4
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/AspectRatio.js +18 -1
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +124 -111
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/DeprecatedButton.js +21 -3
- package/lib/module/components/DeprecatedCardWrapper.js +18 -1
- package/lib/module/components/Picker/PickerComponent.android.js +21 -3
- package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/module/components/Portal/PortalHost.js +45 -15
- package/lib/module/components/RadioButton/RadioButton.js +13 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
- package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/TabView/TabView.js +17 -7
- package/lib/module/components/Table/Table.js +114 -0
- package/lib/module/components/Table/TableCell.js +41 -0
- package/lib/module/components/Table/TableCommon.js +21 -0
- package/lib/module/components/Table/TableRow.js +53 -0
- package/lib/module/components/Table/index.js +3 -0
- package/lib/module/components/Touchable.js +15 -2
- package/lib/module/constants.js +1 -0
- package/lib/module/hooks.js +1 -2
- package/lib/module/index.js +1 -1
- package/lib/module/mappings/NativeBase/Layout.js +3 -12
- package/lib/module/mappings/Table.js +133 -0
- package/lib/typescript/src/components/Table/Table.d.ts +19 -0
- package/lib/typescript/src/components/Table/Table.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts +9 -0
- package/lib/typescript/src/components/Table/TableCell.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts +20 -0
- package/lib/typescript/src/components/Table/TableCommon.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts +14 -0
- package/lib/typescript/src/components/Table/TableRow.d.ts.map +1 -0
- package/lib/typescript/src/components/Table/index.d.ts +4 -0
- package/lib/typescript/src/components/Table/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts +4 -27
- package/lib/typescript/src/mappings/NativeBase/Layout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Table.d.ts +337 -0
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/components/Table/Table.js +93 -0
- package/src/components/Table/Table.tsx +176 -0
- package/src/components/Table/TableCell.js +31 -0
- package/src/components/Table/TableCell.tsx +63 -0
- package/src/components/Table/TableCommon.js +12 -0
- package/src/components/Table/TableCommon.ts +40 -0
- package/src/components/Table/TableRow.js +37 -0
- package/src/components/Table/TableRow.tsx +77 -0
- package/src/components/Table/index.js +3 -0
- package/src/components/Table/index.tsx +3 -0
- package/src/index.js +1 -1
- package/src/index.tsx +2 -1
- package/src/mappings/NativeBase/Layout.js +9 -11
- package/src/mappings/NativeBase/Layout.ts +8 -11
- package/src/mappings/Table.js +150 -0
- package/src/mappings/Table.ts +170 -0
- package/lib/commonjs/components/Container.js +0 -93
- package/lib/module/components/Container.js +0 -83
- package/lib/typescript/src/components/Container.d.ts +0 -21
- package/lib/typescript/src/components/Container.d.ts.map +0 -1
- package/src/components/Container.js +0 -43
- package/src/components/Container.tsx +0 -116
|
@@ -10,7 +10,6 @@ var _CircularProgress = _interopRequireDefault(require("./CircularProgress"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
13
|
const AnimatedProgress = _reactNative.Animated.createAnimatedComponent(_CircularProgress.default);
|
|
15
14
|
const AnimatedCircularProgress = _ref => {
|
|
16
15
|
let {
|
|
@@ -55,6 +54,18 @@ const AnimatedCircularProgress = _ref => {
|
|
|
55
54
|
React.useEffect(() => {
|
|
56
55
|
animate();
|
|
57
56
|
}, [fill, animate]);
|
|
57
|
+
return /*#__PURE__*/React.createElement(AnimatedProgress, {
|
|
58
|
+
...other,
|
|
59
|
+
style: other.style,
|
|
60
|
+
childrenContainerStyle: other.childrenContainerStyle,
|
|
61
|
+
fill: fillAnimation,
|
|
62
|
+
tintColor: animateColor()
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var _default = AnimatedCircularProgress;
|
|
66
|
+
exports.default = _default;ect(() => {
|
|
67
|
+
animate();
|
|
68
|
+
}, [fill, animate]);
|
|
58
69
|
return /*#__PURE__*/React.createElement(AnimatedProgress, _extends({}, other, {
|
|
59
70
|
style: other.style,
|
|
60
71
|
childrenContainerStyle: other.childrenContainerStyle,
|
|
@@ -12,7 +12,6 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
15
|
const ELEVATION = 1;
|
|
17
16
|
const DEFAULT_MAX_WIDTH = 960;
|
|
18
17
|
const Banner = _ref => {
|
|
@@ -70,7 +69,6 @@ const Banner = _ref => {
|
|
|
70
69
|
measured: true
|
|
71
70
|
});
|
|
72
71
|
};
|
|
73
|
-
|
|
74
72
|
// The banner animation has 2 parts:
|
|
75
73
|
// 1. Blank spacer element which animates its height to move the content
|
|
76
74
|
// 2. Actual banner which animates its translateY
|
|
@@ -80,9 +78,10 @@ const Banner = _ref => {
|
|
|
80
78
|
// However we can't animated banner's height directly as it'll also resize the content inside
|
|
81
79
|
const height = _reactNative.Animated.multiply(position, layout.height);
|
|
82
80
|
const translateY = _reactNative.Animated.multiply(_reactNative.Animated.add(position, -1), layout.height);
|
|
83
|
-
return /*#__PURE__*/React.createElement(_Surface.default,
|
|
81
|
+
return /*#__PURE__*/React.createElement(_Surface.default, {
|
|
82
|
+
...rest,
|
|
84
83
|
style: [styles.container, (0, _shadow.default)(ELEVATION), style]
|
|
85
|
-
}
|
|
84
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
86
85
|
style: [styles.wrapper, contentStyle]
|
|
87
86
|
}, /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
88
87
|
style: {
|
|
@@ -164,4 +163,24 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
164
163
|
}
|
|
165
164
|
});
|
|
166
165
|
var _default = (0, _theming.withTheme)(Banner);
|
|
166
|
+
exports.default = _default;",
|
|
167
|
+
justifyContent: "flex-start",
|
|
168
|
+
marginHorizontal: 8,
|
|
169
|
+
marginTop: 16,
|
|
170
|
+
marginBottom: 0
|
|
171
|
+
},
|
|
172
|
+
icon: {
|
|
173
|
+
margin: 8
|
|
174
|
+
},
|
|
175
|
+
message: {
|
|
176
|
+
flex: 1,
|
|
177
|
+
margin: 8
|
|
178
|
+
},
|
|
179
|
+
actions: {
|
|
180
|
+
flexDirection: "row",
|
|
181
|
+
justifyContent: "flex-end",
|
|
182
|
+
margin: 8
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
var _default = (0, _theming.withTheme)(Banner);
|
|
167
186
|
exports.default = _default;
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _BottomSheetComponent = _interopRequireDefault(require("./BottomSheetComponent"));
|
|
10
10
|
var _theming = require("../../theming");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
12
|
const BottomSheet = _ref => {
|
|
14
13
|
let {
|
|
15
14
|
theme,
|
|
@@ -29,7 +28,7 @@ const BottomSheet = _ref => {
|
|
|
29
28
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
30
29
|
style: styles.parentContainer,
|
|
31
30
|
pointerEvents: "box-none"
|
|
32
|
-
}, /*#__PURE__*/_react.default.createElement(_BottomSheetComponent.default,
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_BottomSheetComponent.default, {
|
|
33
32
|
componentType: "ScrollView",
|
|
34
33
|
snapPoints: snapPoints,
|
|
35
34
|
initialSnapIndex: initialSnapIndex,
|
|
@@ -52,8 +51,9 @@ const BottomSheet = _ref => {
|
|
|
52
51
|
borderWidth,
|
|
53
52
|
borderColor
|
|
54
53
|
}]),
|
|
55
|
-
onSettle: onSettle
|
|
56
|
-
|
|
54
|
+
onSettle: onSettle,
|
|
55
|
+
...rest
|
|
56
|
+
}, children));
|
|
57
57
|
};
|
|
58
58
|
const styles = _reactNative.StyleSheet.create({
|
|
59
59
|
//Render on top of everything
|
|
@@ -85,4 +85,22 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
var _default = (0, _theming.withTheme)(BottomSheet);
|
|
88
|
+
exports.default = _default; paddingHorizontal: 16,
|
|
89
|
+
paddingVertical: 10
|
|
90
|
+
},
|
|
91
|
+
containerStyle: {
|
|
92
|
+
flex: 1,
|
|
93
|
+
overflow: "hidden"
|
|
94
|
+
},
|
|
95
|
+
handleContainer: {
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
paddingVertical: 20
|
|
98
|
+
},
|
|
99
|
+
handle: {
|
|
100
|
+
width: 40,
|
|
101
|
+
height: 2,
|
|
102
|
+
borderRadius: 4
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
var _default = (0, _theming.withTheme)(BottomSheet);
|
|
88
106
|
exports.default = _default;
|
|
@@ -10,10 +10,19 @@ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reani
|
|
|
10
10
|
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Slightly modfied version as taken from https://github.com/rgommezz/react-native-scroll-bottom-sheet
|
|
15
|
+
* Main previously breaking change:
|
|
16
|
+
* const node = this.props.innerRef.current?.getNode() ==> const node = this.props.innerRef.current as any
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Copyright (c) 2020 Raul Gomez Acuna
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the MIT license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
|
|
17
26
|
const {
|
|
18
27
|
//@ts-ignore
|
|
19
28
|
interpolate: interpolateDeprecated,
|
|
@@ -73,85 +82,42 @@ const imperativeScrollOptions = {
|
|
|
73
82
|
}
|
|
74
83
|
};
|
|
75
84
|
class ScrollBottomSheet extends _react.Component {
|
|
76
|
-
/**
|
|
77
|
-
* Gesture Handler references
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* ScrollView prop
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Pan gesture handler events for drawer handle and content
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Main Animated Value that drives the top position of the UI drawer at any point in time
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Animated value that keeps track of the position: 0 => closed, 1 => opened
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Flag to indicate imperative snapping
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Manual snapping amount
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Keeps track of the current index
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Deceleration rate of the scroll component. This is used only on Android to
|
|
110
|
-
* compensate the unexpected glide it gets sometimes.
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
85
|
constructor(props) {
|
|
114
|
-
var
|
|
86
|
+
var _this;
|
|
87
|
+
var _a;
|
|
115
88
|
super(props);
|
|
116
89
|
_this = this;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
_defineProperty(this, "didScrollUpAndPullDown", void 0);
|
|
149
|
-
_defineProperty(this, "setTranslationY", void 0);
|
|
150
|
-
_defineProperty(this, "extraOffset", void 0);
|
|
151
|
-
_defineProperty(this, "calculateNextSnapPoint", void 0);
|
|
152
|
-
_defineProperty(this, "scrollComponent", void 0);
|
|
153
|
-
_defineProperty(this, "convertPercentageToDp", str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100);
|
|
154
|
-
_defineProperty(this, "getNormalisedSnapPoints", () => {
|
|
90
|
+
/**
|
|
91
|
+
* Gesture Handler references
|
|
92
|
+
*/
|
|
93
|
+
this.masterDrawer = /*#__PURE__*/_react.default.createRef();
|
|
94
|
+
this.drawerHandleRef = /*#__PURE__*/_react.default.createRef();
|
|
95
|
+
this.drawerContentRef = /*#__PURE__*/_react.default.createRef();
|
|
96
|
+
this.scrollComponentRef = /*#__PURE__*/_react.default.createRef();
|
|
97
|
+
/**
|
|
98
|
+
* Flag to indicate imperative snapping
|
|
99
|
+
*/
|
|
100
|
+
this.isManuallySetValue = new _reactNativeReanimated.Value(0);
|
|
101
|
+
/**
|
|
102
|
+
* Manual snapping amount
|
|
103
|
+
*/
|
|
104
|
+
this.manualYOffset = new _reactNativeReanimated.Value(0);
|
|
105
|
+
this.prevSnapIndex = -1;
|
|
106
|
+
this.dragY = new _reactNativeReanimated.Value(0);
|
|
107
|
+
this.prevDragY = new _reactNativeReanimated.Value(0);
|
|
108
|
+
this.tempDestSnapPoint = new _reactNativeReanimated.Value(0);
|
|
109
|
+
this.isAndroid = new _reactNativeReanimated.Value(Number(_reactNative.Platform.OS === "android"));
|
|
110
|
+
this.animationClock = new _reactNativeReanimated.Clock();
|
|
111
|
+
this.animationPosition = new _reactNativeReanimated.Value(0);
|
|
112
|
+
this.animationFinished = new _reactNativeReanimated.Value(0);
|
|
113
|
+
this.animationFrameTime = new _reactNativeReanimated.Value(0);
|
|
114
|
+
this.velocityY = new _reactNativeReanimated.Value(0);
|
|
115
|
+
this.lastStartScrollY = new _reactNativeReanimated.Value(0);
|
|
116
|
+
this.destSnapPoint = new _reactNativeReanimated.Value(0);
|
|
117
|
+
this.dragWithHandle = new _reactNativeReanimated.Value(0);
|
|
118
|
+
this.scrollUpAndPullDown = new _reactNativeReanimated.Value(0);
|
|
119
|
+
this.convertPercentageToDp = str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100;
|
|
120
|
+
this.getNormalisedSnapPoints = () => {
|
|
155
121
|
return this.props.snapPoints.map(p => {
|
|
156
122
|
if (typeof p === "string") {
|
|
157
123
|
return this.convertPercentageToDp(p);
|
|
@@ -160,8 +126,8 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
160
126
|
}
|
|
161
127
|
throw new Error("Invalid type for value ".concat(p, ": ").concat(typeof p, ". It should be either a percentage string or a number"));
|
|
162
128
|
});
|
|
163
|
-
}
|
|
164
|
-
|
|
129
|
+
};
|
|
130
|
+
this.getScrollComponent = () => {
|
|
165
131
|
switch (this.props.componentType) {
|
|
166
132
|
case "FlatList":
|
|
167
133
|
return _reactNative.FlatList;
|
|
@@ -172,33 +138,32 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
172
138
|
default:
|
|
173
139
|
throw new Error("Component type not supported: it should be one of `FlatList`, `ScrollView` or `SectionList`");
|
|
174
140
|
}
|
|
175
|
-
}
|
|
176
|
-
|
|
141
|
+
};
|
|
142
|
+
this.snapTo = index => {
|
|
177
143
|
const snapPoints = this.getNormalisedSnapPoints();
|
|
178
144
|
this.isManuallySetValue.setValue(1);
|
|
179
145
|
this.manualYOffset.setValue(snapPoints[index]);
|
|
180
146
|
this.nextSnapIndex.setValue(index);
|
|
181
|
-
}
|
|
147
|
+
};
|
|
182
148
|
const {
|
|
183
149
|
initialSnapIndex,
|
|
184
150
|
animationType
|
|
185
151
|
} = props;
|
|
186
152
|
const animationDriver = animationType === "timing" ? 0 : 1;
|
|
187
|
-
const animationDuration = props.animationType === "timing" && ((
|
|
153
|
+
const animationDuration = props.animationType === "timing" && ((_a = props.animationConfig) === null || _a === void 0 ? void 0 : _a.duration) || DEFAULT_ANIMATION_DURATION;
|
|
188
154
|
const ScrollComponent = this.getScrollComponent();
|
|
189
155
|
// @ts-ignore
|
|
190
156
|
this.scrollComponent = _reactNativeReanimated.default.createAnimatedComponent(ScrollComponent);
|
|
191
|
-
const
|
|
192
|
-
const openPosition =
|
|
193
|
-
const closedPosition = this.props.enableOverScroll ? windowHeight :
|
|
194
|
-
const initialSnap =
|
|
157
|
+
const snapPoints = this.getNormalisedSnapPoints();
|
|
158
|
+
const openPosition = snapPoints[0];
|
|
159
|
+
const closedPosition = this.props.enableOverScroll ? windowHeight : snapPoints[snapPoints.length - 1];
|
|
160
|
+
const initialSnap = snapPoints[initialSnapIndex];
|
|
195
161
|
this.nextSnapIndex = new _reactNativeReanimated.Value(initialSnapIndex);
|
|
196
162
|
const initialDecelerationRate = _reactNative.Platform.select({
|
|
197
163
|
android: props.initialSnapIndex === 0 ? ANDROID_NORMAL_DECELERATION_RATE : 0,
|
|
198
164
|
ios: IOS_NORMAL_DECELERATION_RATE
|
|
199
165
|
});
|
|
200
166
|
this.decelerationRate = new _reactNativeReanimated.Value(initialDecelerationRate);
|
|
201
|
-
|
|
202
167
|
//@ts-ignore
|
|
203
168
|
const handleGestureState = new _reactNativeReanimated.Value(-1);
|
|
204
169
|
//@ts-ignore
|
|
@@ -237,29 +202,27 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
237
202
|
const didHandleGestureBegin = (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.ACTIVE);
|
|
238
203
|
const isAnimationInterrupted = (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.or)((0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.BEGAN), (0, _reactNativeReanimated.eq)(drawerGestureState, _reactNativeGestureHandler.State.BEGAN), (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.isAndroid, 0), (0, _reactNativeReanimated.eq)(animationDriver, 1), (0, _reactNativeReanimated.or)((0, _reactNativeReanimated.eq)(drawerGestureState, _reactNativeGestureHandler.State.ACTIVE), (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.ACTIVE)))), (0, _reactNativeReanimated.clockRunning)(this.animationClock));
|
|
239
204
|
this.didGestureFinish = (0, _reactNativeReanimated.or)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(handleOldGestureState, _reactNativeGestureHandler.State.ACTIVE), (0, _reactNativeReanimated.eq)(handleGestureState, _reactNativeGestureHandler.State.END)), (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(drawerOldGestureState, _reactNativeGestureHandler.State.ACTIVE), (0, _reactNativeReanimated.eq)(drawerGestureState, _reactNativeGestureHandler.State.END)));
|
|
240
|
-
|
|
241
205
|
// Function that determines if the last snap point is in the range {snapPoints}
|
|
242
206
|
// In the case of interruptions in the middle of an animation, we'll get
|
|
243
207
|
// lastSnap values outside the range
|
|
244
208
|
const isLastSnapPointInRange = function () {
|
|
245
209
|
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
246
|
-
return i ===
|
|
210
|
+
return i === snapPoints.length ? lastSnapInRange : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(_this.lastSnap, snapPoints[i]), [(0, _reactNativeReanimated.set)(lastSnapInRange, 1)], isLastSnapPointInRange(i + 1));
|
|
247
211
|
};
|
|
248
|
-
const scrollY = [(0, _reactNativeReanimated.set)(lastSnapInRange, 0), isLastSnapPointInRange(), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.or)(didHandleGestureBegin, (0, _reactNativeReanimated.and)(this.isManuallySetValue, (0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.manualYOffset,
|
|
212
|
+
const scrollY = [(0, _reactNativeReanimated.set)(lastSnapInRange, 0), isLastSnapPointInRange(), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.or)(didHandleGestureBegin, (0, _reactNativeReanimated.and)(this.isManuallySetValue, (0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.manualYOffset, snapPoints[0])))), [(0, _reactNativeReanimated.set)(this.dragWithHandle, 1), 0]), (0, _reactNativeReanimated.cond)(
|
|
249
213
|
// This is to account for a continuous scroll on the drawer from a snap point
|
|
250
214
|
// Different than top, bringing the drawer to the top position, so that if we
|
|
251
215
|
// change scroll direction without releasing the gesture, it doesn't pull down the drawer again
|
|
252
|
-
(0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), (0, _reactNativeReanimated.greaterThan)(
|
|
216
|
+
(0, _reactNativeReanimated.and)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), (0, _reactNativeReanimated.greaterThan)(snapPoints[0], (0, _reactNativeReanimated.add)(this.lastSnap, this.dragY)), (0, _reactNativeReanimated.and)((0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.lastSnap, snapPoints[0])), lastSnapInRange)), [(0, _reactNativeReanimated.set)(this.lastSnap, snapPoints[0]), (0, _reactNativeReanimated.set)(this.dragWithHandle, 0), this.lastStartScrollY], (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.dragWithHandle, 1), 0, this.lastStartScrollY))];
|
|
253
217
|
this.didScrollUpAndPullDown = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.greaterOrEq)(this.dragY, this.lastStartScrollY), (0, _reactNativeReanimated.greaterThan)(this.lastStartScrollY, 0)), (0, _reactNativeReanimated.set)(this.scrollUpAndPullDown, 1));
|
|
254
218
|
this.setTranslationY = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.not)(this.dragWithHandle), (0, _reactNativeReanimated.not)((0, _reactNativeReanimated.greaterOrEq)(this.dragY, this.lastStartScrollY))), (0, _reactNativeReanimated.set)(this.translationY, (0, _reactNativeReanimated.sub)(this.dragY, this.lastStartScrollY)), (0, _reactNativeReanimated.set)(this.translationY, this.dragY));
|
|
255
219
|
this.extraOffset = (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0);
|
|
256
220
|
const endOffsetY = (0, _reactNativeReanimated.add)(this.lastSnap, this.translationY, (0, _reactNativeReanimated.multiply)(1 - props.friction, this.velocityY));
|
|
257
221
|
this.calculateNextSnapPoint = function () {
|
|
258
222
|
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
259
|
-
return i ===
|
|
223
|
+
return i === snapPoints.length ? _this.tempDestSnapPoint : (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.greaterThan)((0, _reactNativeReanimated.abs)((0, _reactNativeReanimated.sub)(_this.tempDestSnapPoint, endOffsetY)), (0, _reactNativeReanimated.abs)((0, _reactNativeReanimated.sub)((0, _reactNativeReanimated.add)(snapPoints[i], _this.extraOffset), endOffsetY))), [(0, _reactNativeReanimated.set)(_this.tempDestSnapPoint, (0, _reactNativeReanimated.add)(snapPoints[i], _this.extraOffset)), (0, _reactNativeReanimated.set)(_this.nextSnapIndex, i), _this.calculateNextSnapPoint(i + 1)], _this.calculateNextSnapPoint(i + 1));
|
|
260
224
|
};
|
|
261
225
|
const runAnimation = _ref => {
|
|
262
|
-
var _props$animationConfi2;
|
|
263
226
|
let {
|
|
264
227
|
clock,
|
|
265
228
|
from,
|
|
@@ -269,6 +232,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
269
232
|
velocity,
|
|
270
233
|
frameTime
|
|
271
234
|
} = _ref;
|
|
235
|
+
var _a;
|
|
272
236
|
const state = {
|
|
273
237
|
finished,
|
|
274
238
|
velocity: new _reactNativeReanimated.Value(0),
|
|
@@ -278,7 +242,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
278
242
|
};
|
|
279
243
|
const timingConfig = {
|
|
280
244
|
duration: animationDuration,
|
|
281
|
-
easing: props.animationType === "timing" && ((
|
|
245
|
+
easing: props.animationType === "timing" && ((_a = props.animationConfig) === null || _a === void 0 ? void 0 : _a.easing) || DEFAULT_EASING,
|
|
282
246
|
toValue: new _reactNativeReanimated.Value(0)
|
|
283
247
|
};
|
|
284
248
|
const springConfig = {
|
|
@@ -294,14 +258,14 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
294
258
|
//@ts-ignore
|
|
295
259
|
(0, _reactNativeReanimated.timing)(clock, state, timingConfig), (0, _reactNativeReanimated.spring)(clock, state, springConfig)), (0, _reactNativeReanimated.cond)(state.finished, [(0, _reactNativeReanimated.call)([this.nextSnapIndex], _ref2 => {
|
|
296
260
|
let [value] = _ref2;
|
|
261
|
+
var _a, _b;
|
|
297
262
|
if (value !== this.prevSnapIndex) {
|
|
298
|
-
|
|
299
|
-
(_this$props$onSettle = (_this$props = this.props).onSettle) === null || _this$props$onSettle === void 0 ? void 0 : _this$props$onSettle.call(_this$props, value);
|
|
263
|
+
(_b = (_a = this.props).onSettle) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
300
264
|
}
|
|
301
265
|
this.prevSnapIndex = value;
|
|
302
266
|
}),
|
|
303
267
|
// Resetting appropriate values
|
|
304
|
-
(0, _reactNativeReanimated.set)(drawerOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(handleOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(this.prevTranslateYOffset, state.position), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), [(0, _reactNativeReanimated.set)(this.prevTranslateYOffset, (0, _reactNativeReanimated.sub)(this.prevTranslateYOffset, this.lastStartScrollY)), (0, _reactNativeReanimated.set)(this.lastStartScrollY, 0), (0, _reactNativeReanimated.set)(this.scrollUpAndPullDown, 0)]), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.destSnapPoint,
|
|
268
|
+
(0, _reactNativeReanimated.set)(drawerOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(handleOldGestureState, _reactNativeGestureHandler.State.END), (0, _reactNativeReanimated.set)(this.prevTranslateYOffset, state.position), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), [(0, _reactNativeReanimated.set)(this.prevTranslateYOffset, (0, _reactNativeReanimated.sub)(this.prevTranslateYOffset, this.lastStartScrollY)), (0, _reactNativeReanimated.set)(this.lastStartScrollY, 0), (0, _reactNativeReanimated.set)(this.scrollUpAndPullDown, 0)]), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.destSnapPoint, snapPoints[0]), [(0, _reactNativeReanimated.set)(this.dragWithHandle, 0)]), (0, _reactNativeReanimated.set)(this.isManuallySetValue, 0), (0, _reactNativeReanimated.set)(this.manualYOffset, 0), (0, _reactNativeReanimated.stopClock)(clock), this.prevTranslateYOffset],
|
|
305
269
|
// We made the block return the updated position,
|
|
306
270
|
state.position)];
|
|
307
271
|
};
|
|
@@ -330,7 +294,7 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
330
294
|
extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
|
|
331
295
|
});
|
|
332
296
|
this.position = interpolate(this.translateY, {
|
|
333
|
-
inputRange: [openPosition,
|
|
297
|
+
inputRange: [openPosition, snapPoints[snapPoints.length - 1]],
|
|
334
298
|
outputRange: [1, 0],
|
|
335
299
|
extrapolate: _reactNativeReanimated.Extrapolate.CLAMP
|
|
336
300
|
});
|
|
@@ -371,26 +335,25 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
371
335
|
ref: this.scrollComponentRef,
|
|
372
336
|
waitFor: this.masterDrawer,
|
|
373
337
|
simultaneousHandlers: this.drawerContentRef
|
|
374
|
-
}, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent,
|
|
338
|
+
}, /*#__PURE__*/_react.default.createElement(AnimatedScrollableComponent, {
|
|
375
339
|
overScrollMode: "never",
|
|
376
|
-
bounces: false
|
|
377
|
-
|
|
378
|
-
ref: this.props.innerRef
|
|
340
|
+
bounces: false,
|
|
341
|
+
...rest,
|
|
342
|
+
ref: this.props.innerRef,
|
|
379
343
|
// @ts-ignore
|
|
380
|
-
,
|
|
381
344
|
decelerationRate: this.decelerationRate,
|
|
382
345
|
onScrollBeginDrag: this.onScrollBeginDrag,
|
|
383
346
|
scrollEventThrottle: 1,
|
|
384
347
|
contentContainerStyle: [rest.contentContainerStyle, {
|
|
385
348
|
paddingBottom: this.getNormalisedSnapPoints()[0]
|
|
386
349
|
}]
|
|
387
|
-
}))))
|
|
350
|
+
})))), this.props.animatedPosition && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
388
351
|
exec: (0, _reactNativeReanimated.onChange)(this.position, (0, _reactNativeReanimated.set)(this.props.animatedPosition, this.position))
|
|
389
352
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
390
353
|
exec: (0, _reactNativeReanimated.onChange)(this.dragY, (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.not)((0, _reactNativeReanimated.eq)(this.dragY, 0)), (0, _reactNativeReanimated.set)(this.prevDragY, this.dragY)))
|
|
391
354
|
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
392
355
|
exec: (0, _reactNativeReanimated.onChange)(this.didGestureFinish, (0, _reactNativeReanimated.cond)(this.didGestureFinish, [this.didScrollUpAndPullDown, this.setTranslationY, (0, _reactNativeReanimated.set)(this.tempDestSnapPoint, (0, _reactNativeReanimated.add)(normalisedSnapPoints[0], this.extraOffset)), (0, _reactNativeReanimated.set)(this.nextSnapIndex, 0), (0, _reactNativeReanimated.set)(this.destSnapPoint, this.calculateNextSnapPoint()), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.and)((0, _reactNativeReanimated.greaterThan)(this.dragY, this.lastStartScrollY), this.isAndroid, (0, _reactNativeReanimated.not)(this.dragWithHandle)), (0, _reactNativeReanimated.call)([], () => {
|
|
393
|
-
var
|
|
356
|
+
var _a, _b;
|
|
394
357
|
// This prevents the scroll glide from happening on Android when pulling down with inertia.
|
|
395
358
|
// It's not perfect, but does the job for now
|
|
396
359
|
const {
|
|
@@ -399,14 +362,67 @@ class ScrollBottomSheet extends _react.Component {
|
|
|
399
362
|
} = imperativeScrollOptions[this.props.componentType];
|
|
400
363
|
// @ts-ignore
|
|
401
364
|
const node = this.props.innerRef.current;
|
|
402
|
-
if (node && node[method] && (this.props.componentType === "FlatList" && (((
|
|
365
|
+
if (node && node[method] && (this.props.componentType === "FlatList" && (((_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0 || this.props.componentType === "SectionList" && this.props.sections.length > 0 || this.props.componentType === "ScrollView")) {
|
|
403
366
|
node[method](args);
|
|
404
367
|
}
|
|
405
368
|
})), (0, _reactNativeReanimated.set)(this.dragY, 0), (0, _reactNativeReanimated.set)(this.velocityY, 0), (0, _reactNativeReanimated.set)(this.lastSnap, (0, _reactNativeReanimated.sub)(this.destSnapPoint, (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0))), (0, _reactNativeReanimated.call)([this.lastSnap], _ref3 => {
|
|
406
|
-
var _this$masterDrawer, _this$masterDrawer$cu;
|
|
407
369
|
let [value] = _ref3;
|
|
370
|
+
var _a, _b;
|
|
371
|
+
// This is the TapGHandler trick
|
|
372
|
+
// @ts-ignore
|
|
373
|
+
(_b = (_a = this.masterDrawer) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setNativeProps({
|
|
374
|
+
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
375
|
+
});
|
|
376
|
+
}), (0, _reactNativeReanimated.set)(this.decelerationRate, (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.isAndroid, 1), (0, _reactNativeReanimated.cond)((0, _reactNativeReanimated.eq)(this.lastSnap, normalisedSnapPoints[0]), ANDROID_NORMAL_DECELERATION_RATE, 0), IOS_NORMAL_DECELERATION_RATE))]))
|
|
377
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.Code, {
|
|
378
|
+
exec: (0, _reactNativeReanimated.onChange)(this.isManuallySetValue, [(0, _reactNativeReanimated.cond)(this.isManuallySetValue, [(0, _reactNativeReanimated.set)(this.destSnapPoint, this.manualYOffset), (0, _reactNativeReanimated.set)(this.animationFinished, 0), (0, _reactNativeReanimated.set)(this.lastSnap, this.manualYOffset), (0, _reactNativeReanimated.call)([this.lastSnap], _ref4 => {
|
|
379
|
+
let [value] = _ref4;
|
|
380
|
+
var _a, _b;
|
|
408
381
|
// This is the TapGHandler trick
|
|
409
382
|
// @ts-ignore
|
|
383
|
+
(_b = (_a = this.masterDrawer) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setNativeProps({
|
|
384
|
+
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
385
|
+
});
|
|
386
|
+
})], [(0, _reactNativeReanimated.set)(this.nextSnapIndex, 0)])])
|
|
387
|
+
}));
|
|
388
|
+
// On Android, having an intermediary view with pointerEvents="box-none", breaks the
|
|
389
|
+
// waitFor logic
|
|
390
|
+
if (_reactNative.Platform.OS === "android") {
|
|
391
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
392
|
+
maxDurationMs: 100000,
|
|
393
|
+
ref: this.masterDrawer,
|
|
394
|
+
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0],
|
|
395
|
+
shouldCancelWhenOutside: false
|
|
396
|
+
}, Content);
|
|
397
|
+
}
|
|
398
|
+
// On iOS, We need to wrap the content on a view with PointerEvents box-none
|
|
399
|
+
// So that we can start scrolling automatically when reaching the top without
|
|
400
|
+
// Stopping the gesture
|
|
401
|
+
return /*#__PURE__*/_react.default.createElement(_reactNativeGestureHandler.TapGestureHandler, {
|
|
402
|
+
maxDurationMs: 100000,
|
|
403
|
+
ref: this.masterDrawer,
|
|
404
|
+
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0]
|
|
405
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
406
|
+
style: _reactNative.StyleSheet.absoluteFillObject,
|
|
407
|
+
pointerEvents: "box-none"
|
|
408
|
+
}, Content));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
exports.ScrollBottomSheet = ScrollBottomSheet;
|
|
412
|
+
ScrollBottomSheet.defaultProps = {
|
|
413
|
+
topInset: 0,
|
|
414
|
+
friction: 0.95,
|
|
415
|
+
animationType: "timing",
|
|
416
|
+
innerRef: /*#__PURE__*/_react.default.createRef(),
|
|
417
|
+
enableOverScroll: false
|
|
418
|
+
};
|
|
419
|
+
var _default = ScrollBottomSheet;
|
|
420
|
+
exports.default = _default;
|
|
421
|
+
const styles = _reactNative.StyleSheet.create({
|
|
422
|
+
container: {
|
|
423
|
+
flex: 1
|
|
424
|
+
}
|
|
425
|
+
}); @ts-ignore
|
|
410
426
|
(_this$masterDrawer = this.masterDrawer) === null || _this$masterDrawer === void 0 ? void 0 : (_this$masterDrawer$cu = _this$masterDrawer.current) === null || _this$masterDrawer$cu === void 0 ? void 0 : _this$masterDrawer$cu.setNativeProps({
|
|
411
427
|
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
412
428
|
});
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
12
|
const CONSTANTS = {
|
|
14
13
|
baseHeight: 42,
|
|
15
14
|
borderRadius: 4,
|
|
@@ -61,7 +60,7 @@ function Base(_ref) {
|
|
|
61
60
|
if (textAlign === "right") {
|
|
62
61
|
buttonStyles.justifyContent = "flex-end";
|
|
63
62
|
}
|
|
64
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable,
|
|
63
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
65
64
|
disabled: disabled || loading,
|
|
66
65
|
style: _ref2 => {
|
|
67
66
|
let {
|
|
@@ -70,8 +69,9 @@ function Base(_ref) {
|
|
|
70
69
|
return [styles.base, {
|
|
71
70
|
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
72
71
|
}, buttonStyles];
|
|
73
|
-
}
|
|
74
|
-
|
|
72
|
+
},
|
|
73
|
+
...props
|
|
74
|
+
}, loading ? /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, {
|
|
75
75
|
size: "small",
|
|
76
76
|
color: color,
|
|
77
77
|
style: styles.loading
|
|
@@ -90,13 +90,14 @@ const Solid = _ref3 => {
|
|
|
90
90
|
theme,
|
|
91
91
|
...props
|
|
92
92
|
} = _ref3;
|
|
93
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
93
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
94
94
|
style: [{
|
|
95
95
|
color: "#FFF",
|
|
96
96
|
borderRadius: theme.roundness,
|
|
97
97
|
backgroundColor: theme.colors.primary
|
|
98
|
-
}, style]
|
|
99
|
-
|
|
98
|
+
}, style],
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
100
101
|
};
|
|
101
102
|
const ButtonSolid = (0, _theming.withTheme)(Solid);
|
|
102
103
|
exports.ButtonSolid = ButtonSolid;
|
|
@@ -108,13 +109,14 @@ const Outline = _ref4 => {
|
|
|
108
109
|
theme,
|
|
109
110
|
...props
|
|
110
111
|
} = _ref4;
|
|
111
|
-
return /*#__PURE__*/React.createElement(Base,
|
|
112
|
+
return /*#__PURE__*/React.createElement(Base, {
|
|
112
113
|
style: [styles.outline, {
|
|
113
114
|
borderRadius: theme.roundness,
|
|
114
115
|
borderColor: theme.colors.primary,
|
|
115
116
|
color: theme.colors.primary
|
|
116
|
-
}, style]
|
|
117
|
-
|
|
117
|
+
}, style],
|
|
118
|
+
...props
|
|
119
|
+
});
|
|
118
120
|
};
|
|
119
121
|
const ButtonOutline = (0, _theming.withTheme)(Outline);
|
|
120
122
|
exports.ButtonOutline = ButtonOutline;
|
|
@@ -161,4 +163,25 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
161
163
|
}
|
|
162
164
|
})
|
|
163
165
|
}
|
|
166
|
+
});ent",
|
|
167
|
+
padding: 0,
|
|
168
|
+
minHeight: undefined
|
|
169
|
+
},
|
|
170
|
+
loading: {
|
|
171
|
+
marginRight: 6
|
|
172
|
+
},
|
|
173
|
+
icon: {
|
|
174
|
+
..._reactNative.Platform.select({
|
|
175
|
+
web: {
|
|
176
|
+
marginTop: 1,
|
|
177
|
+
marginRight: 4,
|
|
178
|
+
alignSelf: "center"
|
|
179
|
+
},
|
|
180
|
+
default: {
|
|
181
|
+
marginBottom: 2,
|
|
182
|
+
marginRight: 4,
|
|
183
|
+
alignSelf: "center"
|
|
184
|
+
}
|
|
185
|
+
})
|
|
186
|
+
}
|
|
164
187
|
});
|