@draftbit/core 46.9.1-c1e2bf.2 → 46.9.1-db63a0.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/CircleImage.js +1 -15
- package/lib/commonjs/components/Container.js +15 -4
- package/lib/commonjs/components/Table/Table.js +91 -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 +61 -0
- package/lib/commonjs/components/Table/index.js +27 -0
- package/lib/commonjs/index.js +19 -7
- package/lib/commonjs/mappings/ActionSheet.js +1 -1
- package/lib/commonjs/mappings/ActionSheetCancel.js +1 -1
- package/lib/commonjs/mappings/ActionSheetItem.js +1 -1
- package/lib/commonjs/mappings/MapCallout.js +1 -1
- package/lib/commonjs/mappings/MapMarker.js +1 -1
- package/lib/commonjs/mappings/Table.js +127 -0
- package/lib/module/components/Table/Table.js +83 -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/index.js +1 -1
- package/lib/module/mappings/ActionSheet.js +1 -1
- package/lib/module/mappings/ActionSheetCancel.js +1 -1
- package/lib/module/mappings/ActionSheetItem.js +1 -1
- package/lib/module/mappings/MapCallout.js +2 -2
- package/lib/module/mappings/MapMarker.js +2 -2
- package/lib/module/mappings/Table.js +120 -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/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Table.d.ts +327 -0
- package/lib/typescript/src/mappings/Table.d.ts.map +1 -0
- package/package.json +3 -5
- package/src/components/Table/Table.js +64 -0
- package/src/components/Table/Table.tsx +136 -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 +1 -1
- package/src/mappings/ActionSheet.js +4 -1
- package/src/mappings/ActionSheet.ts +4 -1
- package/src/mappings/ActionSheetCancel.js +4 -1
- package/src/mappings/ActionSheetCancel.ts +4 -1
- package/src/mappings/ActionSheetItem.js +4 -1
- package/src/mappings/ActionSheetItem.ts +4 -1
- package/src/mappings/MapCallout.js +6 -2
- package/src/mappings/MapCallout.ts +6 -2
- package/src/mappings/MapMarker.js +6 -2
- package/src/mappings/MapMarker.ts +6 -2
- package/src/mappings/Table.js +137 -0
- package/src/mappings/Table.ts +156 -0
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +0 -88
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +0 -464
- package/lib/commonjs/components/BottomSheet/index.js +0 -13
- package/lib/commonjs/mappings/BottomSheet.js +0 -74
- package/lib/module/components/BottomSheet/BottomSheet.js +0 -80
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -470
- package/lib/module/components/BottomSheet/index.js +0 -1
- package/lib/module/mappings/BottomSheet.js +0 -67
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +0 -20
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts.map +0 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts +0 -170
- package/lib/typescript/src/components/BottomSheet/BottomSheetComponent.d.ts.map +0 -1
- package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -2
- package/lib/typescript/src/components/BottomSheet/index.d.ts.map +0 -1
- package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -119
- package/lib/typescript/src/mappings/BottomSheet.d.ts.map +0 -1
- package/src/components/BottomSheet/BottomSheet.js +0 -56
- package/src/components/BottomSheet/BottomSheet.tsx +0 -120
- package/src/components/BottomSheet/BottomSheetComponent.js +0 -437
- package/src/components/BottomSheet/BottomSheetComponent.tsx +0 -895
- package/src/components/BottomSheet/index.js +0 -1
- package/src/components/BottomSheet/index.ts +0 -1
- package/src/mappings/BottomSheet.js +0 -64
- package/src/mappings/BottomSheet.ts +0 -78
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { StyleSheet, View } from "react-native";
|
|
4
|
-
import BottomSheetComponent from "./BottomSheetComponent";
|
|
5
|
-
import { withTheme } from "../../theming";
|
|
6
|
-
const BottomSheet = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
theme,
|
|
9
|
-
snapPoints = ["10%", "50%", "80%"],
|
|
10
|
-
initialSnapIndex = 0,
|
|
11
|
-
showHandle = true,
|
|
12
|
-
handleColor = theme.colors.divider,
|
|
13
|
-
topBorderRadius = 20,
|
|
14
|
-
borderWidth = 1,
|
|
15
|
-
borderColor = theme.colors.divider,
|
|
16
|
-
onSettle,
|
|
17
|
-
style,
|
|
18
|
-
children,
|
|
19
|
-
...rest
|
|
20
|
-
} = _ref;
|
|
21
|
-
const backgroundColor = (style === null || style === void 0 ? void 0 : style.backgroundColor) || theme.colors.background;
|
|
22
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
23
|
-
style: styles.parentContainer,
|
|
24
|
-
pointerEvents: "box-none"
|
|
25
|
-
}, /*#__PURE__*/React.createElement(BottomSheetComponent, _extends({
|
|
26
|
-
componentType: "ScrollView",
|
|
27
|
-
snapPoints: snapPoints,
|
|
28
|
-
initialSnapIndex: initialSnapIndex,
|
|
29
|
-
renderHandle: () => /*#__PURE__*/React.createElement(React.Fragment, null, showHandle && /*#__PURE__*/React.createElement(View, {
|
|
30
|
-
style: [styles.handleContainer, {
|
|
31
|
-
backgroundColor,
|
|
32
|
-
borderTopLeftRadius: topBorderRadius,
|
|
33
|
-
borderTopRightRadius: topBorderRadius
|
|
34
|
-
}]
|
|
35
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
36
|
-
style: [styles.handle, {
|
|
37
|
-
backgroundColor: handleColor
|
|
38
|
-
}]
|
|
39
|
-
}))),
|
|
40
|
-
contentContainerStyle: [styles.contentContainerStyle, style],
|
|
41
|
-
containerStyle: StyleSheet.flatten([styles.containerStyle, {
|
|
42
|
-
backgroundColor,
|
|
43
|
-
borderTopLeftRadius: topBorderRadius,
|
|
44
|
-
borderTopRightRadius: topBorderRadius,
|
|
45
|
-
borderWidth,
|
|
46
|
-
borderColor
|
|
47
|
-
}]),
|
|
48
|
-
onSettle: onSettle
|
|
49
|
-
}, rest), children));
|
|
50
|
-
};
|
|
51
|
-
const styles = StyleSheet.create({
|
|
52
|
-
//Render on top of everything
|
|
53
|
-
parentContainer: {
|
|
54
|
-
position: "absolute",
|
|
55
|
-
left: 0,
|
|
56
|
-
right: 0,
|
|
57
|
-
top: 0,
|
|
58
|
-
bottom: 0,
|
|
59
|
-
zIndex: 10,
|
|
60
|
-
overflow: "hidden"
|
|
61
|
-
},
|
|
62
|
-
contentContainerStyle: {
|
|
63
|
-
paddingHorizontal: 16,
|
|
64
|
-
paddingVertical: 10
|
|
65
|
-
},
|
|
66
|
-
containerStyle: {
|
|
67
|
-
flex: 1,
|
|
68
|
-
overflow: "hidden"
|
|
69
|
-
},
|
|
70
|
-
handleContainer: {
|
|
71
|
-
alignItems: "center",
|
|
72
|
-
paddingVertical: 20
|
|
73
|
-
},
|
|
74
|
-
handle: {
|
|
75
|
-
width: 40,
|
|
76
|
-
height: 2,
|
|
77
|
-
borderRadius: 4
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
export default withTheme(BottomSheet);
|
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
-
/**
|
|
6
|
-
* Slightly modfied version as taken from https://github.com/rgommezz/react-native-scroll-bottom-sheet
|
|
7
|
-
* Main previously breaking change:
|
|
8
|
-
* const node = this.props.innerRef.current?.getNode() ==> const node = this.props.innerRef.current as any
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) 2020 Raul Gomez Acuna
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import React, { Component } from "react";
|
|
20
|
-
import { Dimensions, FlatList, Platform, ScrollView, SectionList, StyleSheet, View } from "react-native";
|
|
21
|
-
import Animated, { abs, add, and, call, Clock, clockRunning, cond, Easing as EasingDeprecated,
|
|
22
|
-
// @ts-ignore: this property is only present in Reanimated 2
|
|
23
|
-
EasingNode, eq, event, Extrapolate, greaterOrEq, greaterThan, multiply, not, onChange, or, set, startClock, stopClock, sub, spring, timing, Value } from "react-native-reanimated";
|
|
24
|
-
import { NativeViewGestureHandler, PanGestureHandler, State as GestureState, TapGestureHandler } from "react-native-gesture-handler";
|
|
25
|
-
const {
|
|
26
|
-
//@ts-ignore
|
|
27
|
-
interpolate: interpolateDeprecated,
|
|
28
|
-
// @ts-ignore: this property is only present in Reanimated 2
|
|
29
|
-
interpolateNode
|
|
30
|
-
} = Animated;
|
|
31
|
-
const interpolate = interpolateNode !== null && interpolateNode !== void 0 ? interpolateNode : interpolateDeprecated;
|
|
32
|
-
//@ts-ignore
|
|
33
|
-
const Easing = EasingNode !== null && EasingNode !== void 0 ? EasingNode : EasingDeprecated;
|
|
34
|
-
const FlatListComponentType = "FlatList";
|
|
35
|
-
const ScrollViewComponentType = "ScrollView";
|
|
36
|
-
const SectionListComponentType = "SectionList";
|
|
37
|
-
const TimingAnimationType = "timing";
|
|
38
|
-
const SpringAnimationType = "spring";
|
|
39
|
-
const DEFAULT_SPRING_PARAMS = {
|
|
40
|
-
damping: 50,
|
|
41
|
-
mass: 0.3,
|
|
42
|
-
stiffness: 121.6,
|
|
43
|
-
overshootClamping: true,
|
|
44
|
-
restSpeedThreshold: 0.3,
|
|
45
|
-
restDisplacementThreshold: 0.3
|
|
46
|
-
};
|
|
47
|
-
const {
|
|
48
|
-
height: windowHeight
|
|
49
|
-
} = Dimensions.get("window");
|
|
50
|
-
const IOS_NORMAL_DECELERATION_RATE = 0.998;
|
|
51
|
-
const ANDROID_NORMAL_DECELERATION_RATE = 0.985;
|
|
52
|
-
const DEFAULT_ANIMATION_DURATION = 250;
|
|
53
|
-
const DEFAULT_EASING = Easing.inOut(Easing.linear);
|
|
54
|
-
const imperativeScrollOptions = {
|
|
55
|
-
[FlatListComponentType]: {
|
|
56
|
-
method: "scrollToIndex",
|
|
57
|
-
args: {
|
|
58
|
-
index: 0,
|
|
59
|
-
viewPosition: 0,
|
|
60
|
-
viewOffset: 1000,
|
|
61
|
-
animated: true
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
[ScrollViewComponentType]: {
|
|
65
|
-
method: "scrollTo",
|
|
66
|
-
args: {
|
|
67
|
-
x: 0,
|
|
68
|
-
y: 0,
|
|
69
|
-
animated: true
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
[SectionListComponentType]: {
|
|
73
|
-
method: "scrollToLocation",
|
|
74
|
-
args: {
|
|
75
|
-
itemIndex: 0,
|
|
76
|
-
sectionIndex: 0,
|
|
77
|
-
viewPosition: 0,
|
|
78
|
-
viewOffset: 1000,
|
|
79
|
-
animated: true
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
export class ScrollBottomSheet extends Component {
|
|
84
|
-
/**
|
|
85
|
-
* Gesture Handler references
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* ScrollView prop
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Pan gesture handler events for drawer handle and content
|
|
94
|
-
*/
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Main Animated Value that drives the top position of the UI drawer at any point in time
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Animated value that keeps track of the position: 0 => closed, 1 => opened
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Flag to indicate imperative snapping
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Manual snapping amount
|
|
110
|
-
*/
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Keeps track of the current index
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Deceleration rate of the scroll component. This is used only on Android to
|
|
118
|
-
* compensate the unexpected glide it gets sometimes.
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
constructor(props) {
|
|
122
|
-
var _props$animationConfi, _this;
|
|
123
|
-
super(props);
|
|
124
|
-
_this = this;
|
|
125
|
-
_defineProperty(this, "masterDrawer", /*#__PURE__*/React.createRef());
|
|
126
|
-
_defineProperty(this, "drawerHandleRef", /*#__PURE__*/React.createRef());
|
|
127
|
-
_defineProperty(this, "drawerContentRef", /*#__PURE__*/React.createRef());
|
|
128
|
-
_defineProperty(this, "scrollComponentRef", /*#__PURE__*/React.createRef());
|
|
129
|
-
_defineProperty(this, "onScrollBeginDrag", void 0);
|
|
130
|
-
_defineProperty(this, "onHandleGestureEvent", void 0);
|
|
131
|
-
_defineProperty(this, "onDrawerGestureEvent", void 0);
|
|
132
|
-
_defineProperty(this, "translateY", void 0);
|
|
133
|
-
_defineProperty(this, "position", void 0);
|
|
134
|
-
_defineProperty(this, "isManuallySetValue", new Value(0));
|
|
135
|
-
_defineProperty(this, "manualYOffset", new Value(0));
|
|
136
|
-
_defineProperty(this, "nextSnapIndex", void 0);
|
|
137
|
-
_defineProperty(this, "decelerationRate", void 0);
|
|
138
|
-
_defineProperty(this, "prevSnapIndex", -1);
|
|
139
|
-
_defineProperty(this, "dragY", new Value(0));
|
|
140
|
-
_defineProperty(this, "prevDragY", new Value(0));
|
|
141
|
-
_defineProperty(this, "tempDestSnapPoint", new Value(0));
|
|
142
|
-
_defineProperty(this, "isAndroid", new Value(Number(Platform.OS === "android")));
|
|
143
|
-
_defineProperty(this, "animationClock", new Clock());
|
|
144
|
-
_defineProperty(this, "animationPosition", new Value(0));
|
|
145
|
-
_defineProperty(this, "animationFinished", new Value(0));
|
|
146
|
-
_defineProperty(this, "animationFrameTime", new Value(0));
|
|
147
|
-
_defineProperty(this, "velocityY", new Value(0));
|
|
148
|
-
_defineProperty(this, "lastStartScrollY", new Value(0));
|
|
149
|
-
_defineProperty(this, "prevTranslateYOffset", void 0);
|
|
150
|
-
_defineProperty(this, "translationY", void 0);
|
|
151
|
-
_defineProperty(this, "destSnapPoint", new Value(0));
|
|
152
|
-
_defineProperty(this, "lastSnap", void 0);
|
|
153
|
-
_defineProperty(this, "dragWithHandle", new Value(0));
|
|
154
|
-
_defineProperty(this, "scrollUpAndPullDown", new Value(0));
|
|
155
|
-
_defineProperty(this, "didGestureFinish", void 0);
|
|
156
|
-
_defineProperty(this, "didScrollUpAndPullDown", void 0);
|
|
157
|
-
_defineProperty(this, "setTranslationY", void 0);
|
|
158
|
-
_defineProperty(this, "extraOffset", void 0);
|
|
159
|
-
_defineProperty(this, "calculateNextSnapPoint", void 0);
|
|
160
|
-
_defineProperty(this, "scrollComponent", void 0);
|
|
161
|
-
_defineProperty(this, "convertPercentageToDp", str => Number(str.split("%")[0]) * (windowHeight - this.props.topInset) / 100);
|
|
162
|
-
_defineProperty(this, "getNormalisedSnapPoints", () => {
|
|
163
|
-
return this.props.snapPoints.map(p => {
|
|
164
|
-
if (typeof p === "string") {
|
|
165
|
-
return this.convertPercentageToDp(p);
|
|
166
|
-
} else if (typeof p === "number") {
|
|
167
|
-
return p;
|
|
168
|
-
}
|
|
169
|
-
throw new Error("Invalid type for value ".concat(p, ": ").concat(typeof p, ". It should be either a percentage string or a number"));
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
_defineProperty(this, "getScrollComponent", () => {
|
|
173
|
-
switch (this.props.componentType) {
|
|
174
|
-
case "FlatList":
|
|
175
|
-
return FlatList;
|
|
176
|
-
case "ScrollView":
|
|
177
|
-
return ScrollView;
|
|
178
|
-
case "SectionList":
|
|
179
|
-
return SectionList;
|
|
180
|
-
default:
|
|
181
|
-
throw new Error("Component type not supported: it should be one of `FlatList`, `ScrollView` or `SectionList`");
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
_defineProperty(this, "snapTo", index => {
|
|
185
|
-
const snapPoints = this.getNormalisedSnapPoints();
|
|
186
|
-
this.isManuallySetValue.setValue(1);
|
|
187
|
-
this.manualYOffset.setValue(snapPoints[index]);
|
|
188
|
-
this.nextSnapIndex.setValue(index);
|
|
189
|
-
});
|
|
190
|
-
const {
|
|
191
|
-
initialSnapIndex,
|
|
192
|
-
animationType
|
|
193
|
-
} = props;
|
|
194
|
-
const animationDriver = animationType === "timing" ? 0 : 1;
|
|
195
|
-
const animationDuration = props.animationType === "timing" && ((_props$animationConfi = props.animationConfig) === null || _props$animationConfi === void 0 ? void 0 : _props$animationConfi.duration) || DEFAULT_ANIMATION_DURATION;
|
|
196
|
-
const ScrollComponent = this.getScrollComponent();
|
|
197
|
-
// @ts-ignore
|
|
198
|
-
this.scrollComponent = Animated.createAnimatedComponent(ScrollComponent);
|
|
199
|
-
const _snapPoints = this.getNormalisedSnapPoints();
|
|
200
|
-
const openPosition = _snapPoints[0];
|
|
201
|
-
const closedPosition = this.props.enableOverScroll ? windowHeight : _snapPoints[_snapPoints.length - 1];
|
|
202
|
-
const initialSnap = _snapPoints[initialSnapIndex];
|
|
203
|
-
this.nextSnapIndex = new Value(initialSnapIndex);
|
|
204
|
-
const initialDecelerationRate = Platform.select({
|
|
205
|
-
android: props.initialSnapIndex === 0 ? ANDROID_NORMAL_DECELERATION_RATE : 0,
|
|
206
|
-
ios: IOS_NORMAL_DECELERATION_RATE
|
|
207
|
-
});
|
|
208
|
-
this.decelerationRate = new Value(initialDecelerationRate);
|
|
209
|
-
|
|
210
|
-
//@ts-ignore
|
|
211
|
-
const handleGestureState = new Value(-1);
|
|
212
|
-
//@ts-ignore
|
|
213
|
-
const handleOldGestureState = new Value(-1);
|
|
214
|
-
//@ts-ignore
|
|
215
|
-
const drawerGestureState = new Value(-1);
|
|
216
|
-
//@ts-ignore
|
|
217
|
-
const drawerOldGestureState = new Value(-1);
|
|
218
|
-
const lastSnapInRange = new Value(1);
|
|
219
|
-
this.prevTranslateYOffset = new Value(initialSnap);
|
|
220
|
-
this.translationY = new Value(initialSnap);
|
|
221
|
-
this.lastSnap = new Value(initialSnap);
|
|
222
|
-
this.onHandleGestureEvent = event([{
|
|
223
|
-
nativeEvent: {
|
|
224
|
-
translationY: this.dragY,
|
|
225
|
-
oldState: handleOldGestureState,
|
|
226
|
-
state: handleGestureState,
|
|
227
|
-
velocityY: this.velocityY
|
|
228
|
-
}
|
|
229
|
-
}]);
|
|
230
|
-
this.onDrawerGestureEvent = event([{
|
|
231
|
-
nativeEvent: {
|
|
232
|
-
translationY: this.dragY,
|
|
233
|
-
oldState: drawerOldGestureState,
|
|
234
|
-
state: drawerGestureState,
|
|
235
|
-
velocityY: this.velocityY
|
|
236
|
-
}
|
|
237
|
-
}]);
|
|
238
|
-
this.onScrollBeginDrag = event([{
|
|
239
|
-
nativeEvent: {
|
|
240
|
-
contentOffset: {
|
|
241
|
-
y: this.lastStartScrollY
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}]);
|
|
245
|
-
const didHandleGestureBegin = eq(handleGestureState, GestureState.ACTIVE);
|
|
246
|
-
const isAnimationInterrupted = and(or(eq(handleGestureState, GestureState.BEGAN), eq(drawerGestureState, GestureState.BEGAN), and(eq(this.isAndroid, 0), eq(animationDriver, 1), or(eq(drawerGestureState, GestureState.ACTIVE), eq(handleGestureState, GestureState.ACTIVE)))), clockRunning(this.animationClock));
|
|
247
|
-
this.didGestureFinish = or(and(eq(handleOldGestureState, GestureState.ACTIVE), eq(handleGestureState, GestureState.END)), and(eq(drawerOldGestureState, GestureState.ACTIVE), eq(drawerGestureState, GestureState.END)));
|
|
248
|
-
|
|
249
|
-
// Function that determines if the last snap point is in the range {snapPoints}
|
|
250
|
-
// In the case of interruptions in the middle of an animation, we'll get
|
|
251
|
-
// lastSnap values outside the range
|
|
252
|
-
const isLastSnapPointInRange = function () {
|
|
253
|
-
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
254
|
-
return i === _snapPoints.length ? lastSnapInRange : cond(eq(_this.lastSnap, _snapPoints[i]), [set(lastSnapInRange, 1)], isLastSnapPointInRange(i + 1));
|
|
255
|
-
};
|
|
256
|
-
const scrollY = [set(lastSnapInRange, 0), isLastSnapPointInRange(), cond(or(didHandleGestureBegin, and(this.isManuallySetValue, not(eq(this.manualYOffset, _snapPoints[0])))), [set(this.dragWithHandle, 1), 0]), cond(
|
|
257
|
-
// This is to account for a continuous scroll on the drawer from a snap point
|
|
258
|
-
// Different than top, bringing the drawer to the top position, so that if we
|
|
259
|
-
// change scroll direction without releasing the gesture, it doesn't pull down the drawer again
|
|
260
|
-
and(eq(this.dragWithHandle, 1), greaterThan(_snapPoints[0], add(this.lastSnap, this.dragY)), and(not(eq(this.lastSnap, _snapPoints[0])), lastSnapInRange)), [set(this.lastSnap, _snapPoints[0]), set(this.dragWithHandle, 0), this.lastStartScrollY], cond(eq(this.dragWithHandle, 1), 0, this.lastStartScrollY))];
|
|
261
|
-
this.didScrollUpAndPullDown = cond(and(greaterOrEq(this.dragY, this.lastStartScrollY), greaterThan(this.lastStartScrollY, 0)), set(this.scrollUpAndPullDown, 1));
|
|
262
|
-
this.setTranslationY = cond(and(not(this.dragWithHandle), not(greaterOrEq(this.dragY, this.lastStartScrollY))), set(this.translationY, sub(this.dragY, this.lastStartScrollY)), set(this.translationY, this.dragY));
|
|
263
|
-
this.extraOffset = cond(eq(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0);
|
|
264
|
-
const endOffsetY = add(this.lastSnap, this.translationY, multiply(1 - props.friction, this.velocityY));
|
|
265
|
-
this.calculateNextSnapPoint = function () {
|
|
266
|
-
let i = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
267
|
-
return i === _snapPoints.length ? _this.tempDestSnapPoint : cond(greaterThan(abs(sub(_this.tempDestSnapPoint, endOffsetY)), abs(sub(add(_snapPoints[i], _this.extraOffset), endOffsetY))), [set(_this.tempDestSnapPoint, add(_snapPoints[i], _this.extraOffset)), set(_this.nextSnapIndex, i), _this.calculateNextSnapPoint(i + 1)], _this.calculateNextSnapPoint(i + 1));
|
|
268
|
-
};
|
|
269
|
-
const runAnimation = _ref => {
|
|
270
|
-
var _props$animationConfi2;
|
|
271
|
-
let {
|
|
272
|
-
clock,
|
|
273
|
-
from,
|
|
274
|
-
to,
|
|
275
|
-
position,
|
|
276
|
-
finished,
|
|
277
|
-
velocity,
|
|
278
|
-
frameTime
|
|
279
|
-
} = _ref;
|
|
280
|
-
const state = {
|
|
281
|
-
finished,
|
|
282
|
-
velocity: new Value(0),
|
|
283
|
-
position,
|
|
284
|
-
time: new Value(0),
|
|
285
|
-
frameTime
|
|
286
|
-
};
|
|
287
|
-
const timingConfig = {
|
|
288
|
-
duration: animationDuration,
|
|
289
|
-
easing: props.animationType === "timing" && ((_props$animationConfi2 = props.animationConfig) === null || _props$animationConfi2 === void 0 ? void 0 : _props$animationConfi2.easing) || DEFAULT_EASING,
|
|
290
|
-
toValue: new Value(0)
|
|
291
|
-
};
|
|
292
|
-
const springConfig = {
|
|
293
|
-
...DEFAULT_SPRING_PARAMS,
|
|
294
|
-
...(props.animationType === "spring" && props.animationConfig || {}),
|
|
295
|
-
toValue: new Value(0)
|
|
296
|
-
};
|
|
297
|
-
return [cond(and(not(clockRunning(clock)), not(eq(finished, 1))), [
|
|
298
|
-
// If the clock isn't running, we reset all the animation params and start the clock
|
|
299
|
-
set(state.finished, 0), set(state.velocity, velocity), set(state.time, 0), set(state.position, from), set(state.frameTime, 0), set(timingConfig.toValue, to), set(springConfig.toValue, to), startClock(clock)]),
|
|
300
|
-
// We run the step here that is going to update position
|
|
301
|
-
cond(eq(animationDriver, 0),
|
|
302
|
-
//@ts-ignore
|
|
303
|
-
timing(clock, state, timingConfig), spring(clock, state, springConfig)), cond(state.finished, [call([this.nextSnapIndex], _ref2 => {
|
|
304
|
-
let [value] = _ref2;
|
|
305
|
-
if (value !== this.prevSnapIndex) {
|
|
306
|
-
var _this$props$onSettle, _this$props;
|
|
307
|
-
(_this$props$onSettle = (_this$props = this.props).onSettle) === null || _this$props$onSettle === void 0 ? void 0 : _this$props$onSettle.call(_this$props, value);
|
|
308
|
-
}
|
|
309
|
-
this.prevSnapIndex = value;
|
|
310
|
-
}),
|
|
311
|
-
// Resetting appropriate values
|
|
312
|
-
set(drawerOldGestureState, GestureState.END), set(handleOldGestureState, GestureState.END), set(this.prevTranslateYOffset, state.position), cond(eq(this.scrollUpAndPullDown, 1), [set(this.prevTranslateYOffset, sub(this.prevTranslateYOffset, this.lastStartScrollY)), set(this.lastStartScrollY, 0), set(this.scrollUpAndPullDown, 0)]), cond(eq(this.destSnapPoint, _snapPoints[0]), [set(this.dragWithHandle, 0)]), set(this.isManuallySetValue, 0), set(this.manualYOffset, 0), stopClock(clock), this.prevTranslateYOffset],
|
|
313
|
-
// We made the block return the updated position,
|
|
314
|
-
state.position)];
|
|
315
|
-
};
|
|
316
|
-
const translateYOffset = cond(isAnimationInterrupted, [
|
|
317
|
-
// set(prevTranslateYOffset, animationPosition) should only run if we are
|
|
318
|
-
// interrupting an animation when the drawer is currently in a different
|
|
319
|
-
// position than the top
|
|
320
|
-
cond(or(this.dragWithHandle, greaterOrEq(abs(this.prevDragY), this.lastStartScrollY)), set(this.prevTranslateYOffset, this.animationPosition)), set(this.animationFinished, 1), set(this.translationY, 0),
|
|
321
|
-
// Resetting appropriate values
|
|
322
|
-
set(drawerOldGestureState, GestureState.END), set(handleOldGestureState, GestureState.END),
|
|
323
|
-
// By forcing that frameTime exceeds duration, it has the effect of stopping the animation
|
|
324
|
-
set(this.animationFrameTime, add(animationDuration, 1000)), set(this.velocityY, 0), stopClock(this.animationClock), this.prevTranslateYOffset], cond(or(this.didGestureFinish, this.isManuallySetValue, clockRunning(this.animationClock)), [runAnimation({
|
|
325
|
-
clock: this.animationClock,
|
|
326
|
-
from: cond(this.isManuallySetValue, this.prevTranslateYOffset, add(this.prevTranslateYOffset, this.translationY)),
|
|
327
|
-
to: this.destSnapPoint,
|
|
328
|
-
position: this.animationPosition,
|
|
329
|
-
finished: this.animationFinished,
|
|
330
|
-
frameTime: this.animationFrameTime,
|
|
331
|
-
velocity: this.velocityY
|
|
332
|
-
})], [set(this.animationFrameTime, 0), set(this.animationFinished, 0),
|
|
333
|
-
// @ts-ignore
|
|
334
|
-
this.prevTranslateYOffset]));
|
|
335
|
-
this.translateY = interpolate(add(translateYOffset, this.dragY, multiply(scrollY, -1)), {
|
|
336
|
-
inputRange: [openPosition, closedPosition],
|
|
337
|
-
outputRange: [openPosition, closedPosition],
|
|
338
|
-
extrapolate: Extrapolate.CLAMP
|
|
339
|
-
});
|
|
340
|
-
this.position = interpolate(this.translateY, {
|
|
341
|
-
inputRange: [openPosition, _snapPoints[_snapPoints.length - 1]],
|
|
342
|
-
outputRange: [1, 0],
|
|
343
|
-
extrapolate: Extrapolate.CLAMP
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
render() {
|
|
347
|
-
const {
|
|
348
|
-
renderHandle,
|
|
349
|
-
initialSnapIndex,
|
|
350
|
-
containerStyle,
|
|
351
|
-
...rest
|
|
352
|
-
} = this.props;
|
|
353
|
-
const AnimatedScrollableComponent = this.scrollComponent;
|
|
354
|
-
const normalisedSnapPoints = this.getNormalisedSnapPoints();
|
|
355
|
-
const initialSnap = normalisedSnapPoints[initialSnapIndex];
|
|
356
|
-
const Content = /*#__PURE__*/React.createElement(Animated.View, {
|
|
357
|
-
style: [StyleSheet.absoluteFillObject, containerStyle,
|
|
358
|
-
// @ts-ignore
|
|
359
|
-
{
|
|
360
|
-
transform: [{
|
|
361
|
-
translateY: this.translateY
|
|
362
|
-
}]
|
|
363
|
-
}]
|
|
364
|
-
}, /*#__PURE__*/React.createElement(PanGestureHandler, {
|
|
365
|
-
ref: this.drawerHandleRef,
|
|
366
|
-
shouldCancelWhenOutside: false,
|
|
367
|
-
simultaneousHandlers: this.masterDrawer,
|
|
368
|
-
onGestureEvent: this.onHandleGestureEvent,
|
|
369
|
-
onHandlerStateChange: this.onHandleGestureEvent
|
|
370
|
-
}, /*#__PURE__*/React.createElement(Animated.View, null, renderHandle())), /*#__PURE__*/React.createElement(PanGestureHandler, {
|
|
371
|
-
ref: this.drawerContentRef,
|
|
372
|
-
simultaneousHandlers: [this.scrollComponentRef, this.masterDrawer],
|
|
373
|
-
shouldCancelWhenOutside: false,
|
|
374
|
-
onGestureEvent: this.onDrawerGestureEvent,
|
|
375
|
-
onHandlerStateChange: this.onDrawerGestureEvent
|
|
376
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
377
|
-
style: styles.container
|
|
378
|
-
}, /*#__PURE__*/React.createElement(NativeViewGestureHandler, {
|
|
379
|
-
ref: this.scrollComponentRef,
|
|
380
|
-
waitFor: this.masterDrawer,
|
|
381
|
-
simultaneousHandlers: this.drawerContentRef
|
|
382
|
-
}, /*#__PURE__*/React.createElement(AnimatedScrollableComponent, _extends({
|
|
383
|
-
overScrollMode: "never",
|
|
384
|
-
bounces: false
|
|
385
|
-
}, rest, {
|
|
386
|
-
ref: this.props.innerRef
|
|
387
|
-
// @ts-ignore
|
|
388
|
-
,
|
|
389
|
-
decelerationRate: this.decelerationRate,
|
|
390
|
-
onScrollBeginDrag: this.onScrollBeginDrag,
|
|
391
|
-
scrollEventThrottle: 1,
|
|
392
|
-
contentContainerStyle: [rest.contentContainerStyle, {
|
|
393
|
-
paddingBottom: this.getNormalisedSnapPoints()[0]
|
|
394
|
-
}]
|
|
395
|
-
}))))), this.props.animatedPosition && /*#__PURE__*/React.createElement(Animated.Code, {
|
|
396
|
-
exec: onChange(this.position, set(this.props.animatedPosition, this.position))
|
|
397
|
-
}), /*#__PURE__*/React.createElement(Animated.Code, {
|
|
398
|
-
exec: onChange(this.dragY, cond(not(eq(this.dragY, 0)), set(this.prevDragY, this.dragY)))
|
|
399
|
-
}), /*#__PURE__*/React.createElement(Animated.Code, {
|
|
400
|
-
exec: onChange(this.didGestureFinish, cond(this.didGestureFinish, [this.didScrollUpAndPullDown, this.setTranslationY, set(this.tempDestSnapPoint, add(normalisedSnapPoints[0], this.extraOffset)), set(this.nextSnapIndex, 0), set(this.destSnapPoint, this.calculateNextSnapPoint()), cond(and(greaterThan(this.dragY, this.lastStartScrollY), this.isAndroid, not(this.dragWithHandle)), call([], () => {
|
|
401
|
-
var _this$props2, _this$props2$data;
|
|
402
|
-
// This prevents the scroll glide from happening on Android when pulling down with inertia.
|
|
403
|
-
// It's not perfect, but does the job for now
|
|
404
|
-
const {
|
|
405
|
-
method,
|
|
406
|
-
args
|
|
407
|
-
} = imperativeScrollOptions[this.props.componentType];
|
|
408
|
-
// @ts-ignore
|
|
409
|
-
const node = this.props.innerRef.current;
|
|
410
|
-
if (node && node[method] && (this.props.componentType === "FlatList" && (((_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$data = _this$props2.data) === null || _this$props2$data === void 0 ? void 0 : _this$props2$data.length) || 0) > 0 || this.props.componentType === "SectionList" && this.props.sections.length > 0 || this.props.componentType === "ScrollView")) {
|
|
411
|
-
node[method](args);
|
|
412
|
-
}
|
|
413
|
-
})), set(this.dragY, 0), set(this.velocityY, 0), set(this.lastSnap, sub(this.destSnapPoint, cond(eq(this.scrollUpAndPullDown, 1), this.lastStartScrollY, 0))), call([this.lastSnap], _ref3 => {
|
|
414
|
-
var _this$masterDrawer, _this$masterDrawer$cu;
|
|
415
|
-
let [value] = _ref3;
|
|
416
|
-
// This is the TapGHandler trick
|
|
417
|
-
// @ts-ignore
|
|
418
|
-
(_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({
|
|
419
|
-
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
420
|
-
});
|
|
421
|
-
}), set(this.decelerationRate, cond(eq(this.isAndroid, 1), cond(eq(this.lastSnap, normalisedSnapPoints[0]), ANDROID_NORMAL_DECELERATION_RATE, 0), IOS_NORMAL_DECELERATION_RATE))]))
|
|
422
|
-
}), /*#__PURE__*/React.createElement(Animated.Code, {
|
|
423
|
-
exec: onChange(this.isManuallySetValue, [cond(this.isManuallySetValue, [set(this.destSnapPoint, this.manualYOffset), set(this.animationFinished, 0), set(this.lastSnap, this.manualYOffset), call([this.lastSnap], _ref4 => {
|
|
424
|
-
var _this$masterDrawer2, _this$masterDrawer2$c;
|
|
425
|
-
let [value] = _ref4;
|
|
426
|
-
// This is the TapGHandler trick
|
|
427
|
-
// @ts-ignore
|
|
428
|
-
(_this$masterDrawer2 = this.masterDrawer) === null || _this$masterDrawer2 === void 0 ? void 0 : (_this$masterDrawer2$c = _this$masterDrawer2.current) === null || _this$masterDrawer2$c === void 0 ? void 0 : _this$masterDrawer2$c.setNativeProps({
|
|
429
|
-
maxDeltaY: value - this.getNormalisedSnapPoints()[0]
|
|
430
|
-
});
|
|
431
|
-
})], [set(this.nextSnapIndex, 0)])])
|
|
432
|
-
}));
|
|
433
|
-
|
|
434
|
-
// On Android, having an intermediary view with pointerEvents="box-none", breaks the
|
|
435
|
-
// waitFor logic
|
|
436
|
-
if (Platform.OS === "android") {
|
|
437
|
-
return /*#__PURE__*/React.createElement(TapGestureHandler, {
|
|
438
|
-
maxDurationMs: 100000,
|
|
439
|
-
ref: this.masterDrawer,
|
|
440
|
-
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0],
|
|
441
|
-
shouldCancelWhenOutside: false
|
|
442
|
-
}, Content);
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
// On iOS, We need to wrap the content on a view with PointerEvents box-none
|
|
446
|
-
// So that we can start scrolling automatically when reaching the top without
|
|
447
|
-
// Stopping the gesture
|
|
448
|
-
return /*#__PURE__*/React.createElement(TapGestureHandler, {
|
|
449
|
-
maxDurationMs: 100000,
|
|
450
|
-
ref: this.masterDrawer,
|
|
451
|
-
maxDeltaY: initialSnap - this.getNormalisedSnapPoints()[0]
|
|
452
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
453
|
-
style: StyleSheet.absoluteFillObject,
|
|
454
|
-
pointerEvents: "box-none"
|
|
455
|
-
}, Content));
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
_defineProperty(ScrollBottomSheet, "defaultProps", {
|
|
459
|
-
topInset: 0,
|
|
460
|
-
friction: 0.95,
|
|
461
|
-
animationType: "timing",
|
|
462
|
-
innerRef: /*#__PURE__*/React.createRef(),
|
|
463
|
-
enableOverScroll: false
|
|
464
|
-
});
|
|
465
|
-
export default ScrollBottomSheet;
|
|
466
|
-
const styles = StyleSheet.create({
|
|
467
|
-
container: {
|
|
468
|
-
flex: 1
|
|
469
|
-
}
|
|
470
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as BottomSheet } from "./BottomSheet";
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, createStaticBoolProp, CONTAINER_COMPONENT_STYLES_SECTIONS, Triggers, createActionProp, createColorProp, createStaticNumberProp, createArrayProp } from "@draftbit/types";
|
|
2
|
-
export const SEED_DATA = {
|
|
3
|
-
name: "Bottom Sheet",
|
|
4
|
-
tag: "BottomSheet",
|
|
5
|
-
description: "A draggable Bottom sheet that snaps to specific points. Renders children in ScrollView",
|
|
6
|
-
category: COMPONENT_TYPES.bottomsheet,
|
|
7
|
-
stylesPanelSections: CONTAINER_COMPONENT_STYLES_SECTIONS,
|
|
8
|
-
layout: {
|
|
9
|
-
paddingHorizontal: 16,
|
|
10
|
-
paddingVertical: 10
|
|
11
|
-
},
|
|
12
|
-
triggers: [Triggers.OnSettle],
|
|
13
|
-
props: {
|
|
14
|
-
onSettle: createActionProp({
|
|
15
|
-
label: "On settle",
|
|
16
|
-
description: "Action to execute when sheet settles on a snap point"
|
|
17
|
-
}),
|
|
18
|
-
snapPoints: createArrayProp({
|
|
19
|
-
label: "Snap points",
|
|
20
|
-
description: "An array of numerical values (that represent distance from the top) where bottom sheet can snap to place. Accepts numbers and percentages (minimum 2 snap points)",
|
|
21
|
-
defaultValue: ["10%", "50%", "80%"]
|
|
22
|
-
}),
|
|
23
|
-
initialSnapIndex: createStaticNumberProp({
|
|
24
|
-
label: "Initial snap index",
|
|
25
|
-
description: "Index of the snap point to be used as the initial point",
|
|
26
|
-
defaultValue: 0,
|
|
27
|
-
required: false
|
|
28
|
-
}),
|
|
29
|
-
showHandle: createStaticBoolProp({
|
|
30
|
-
label: "Show handle",
|
|
31
|
-
description: "Whether to show the top sheet handle or not",
|
|
32
|
-
defaultValue: true
|
|
33
|
-
}),
|
|
34
|
-
handleColor: createColorProp({
|
|
35
|
-
label: "Handle color",
|
|
36
|
-
description: "Color of the top handle",
|
|
37
|
-
defaultValue: "divider"
|
|
38
|
-
}),
|
|
39
|
-
topBorderRadius: createStaticNumberProp({
|
|
40
|
-
label: "Top border radius",
|
|
41
|
-
description: "Border radius of top corners",
|
|
42
|
-
defaultValue: 20,
|
|
43
|
-
required: false
|
|
44
|
-
}),
|
|
45
|
-
borderWidth: createStaticNumberProp({
|
|
46
|
-
label: "Border width",
|
|
47
|
-
description: "Width of bottom sheet borders",
|
|
48
|
-
defaultValue: 1,
|
|
49
|
-
required: false
|
|
50
|
-
}),
|
|
51
|
-
borderColor: createColorProp({
|
|
52
|
-
label: "Border color",
|
|
53
|
-
description: "Color of bottom sheet borders",
|
|
54
|
-
defaultValue: "divider"
|
|
55
|
-
}),
|
|
56
|
-
showsVerticalScrollIndicator: createStaticBoolProp({
|
|
57
|
-
label: "Show Vertical Scroll Indicator",
|
|
58
|
-
description: "When true, shows a vertical scroll indicator. The default value is true.",
|
|
59
|
-
defaultValue: true
|
|
60
|
-
}),
|
|
61
|
-
bounces: createStaticBoolProp({
|
|
62
|
-
label: "Bounce",
|
|
63
|
-
description: "When true, the scroll view bounces when it reaches the end of the content if the content is larger then the scroll view along the axis of the scroll direction.",
|
|
64
|
-
defaultValue: true
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle, ScrollViewProps } from "react-native";
|
|
3
|
-
import type { Theme } from "../../styles/DefaultTheme";
|
|
4
|
-
export interface BottomSheetProps extends ScrollViewProps {
|
|
5
|
-
snapPoints?: (string | number)[];
|
|
6
|
-
initialSnapIndex?: number;
|
|
7
|
-
showHandle?: boolean;
|
|
8
|
-
handleColor?: string;
|
|
9
|
-
topBorderRadius?: number;
|
|
10
|
-
borderWidth?: number;
|
|
11
|
-
borderColor?: string;
|
|
12
|
-
onSettle?: (index: number) => void;
|
|
13
|
-
style?: StyleProp<ViewStyle>;
|
|
14
|
-
theme: Theme;
|
|
15
|
-
}
|
|
16
|
-
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<BottomSheetProps>, "theme"> & {
|
|
17
|
-
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
18
|
-
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<BottomSheetProps>> & React.FC<React.PropsWithChildren<BottomSheetProps>>, {}>;
|
|
19
|
-
export default _default;
|
|
20
|
-
//# sourceMappingURL=BottomSheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAGL,SAAS,EACT,SAAS,EACT,eAAe,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGvD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;;;;AA+FD,wBAAsC"}
|