@draftbit/core 46.5.2-b02f9e.2 → 46.6.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/lib/commonjs/components/Accordion/AccordionItem.js +23 -4
- package/lib/commonjs/components/AspectRatio.js +1 -17
- package/lib/commonjs/components/Banner.js +23 -4
- package/lib/commonjs/components/Button.js +36 -13
- package/lib/commonjs/components/CardBlock.js +4 -13
- package/lib/commonjs/components/CardContainer.js +13 -4
- package/lib/commonjs/components/CardContainerShortImage.js +15 -4
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -3
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +17 -2
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -2
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -2
- package/lib/commonjs/components/Container.js +15 -4
- package/lib/commonjs/components/DatePicker/DatePicker.js +13 -9
- package/lib/commonjs/components/DeprecatedButton.js +3 -27
- package/lib/commonjs/components/DeprecatedCardWrapper.js +15 -1
- package/lib/commonjs/components/DeprecatedFAB.js +3 -22
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/components/FAB.js +18 -4
- package/lib/commonjs/components/FieldSearchBarFull.js +1 -2
- package/lib/commonjs/components/Image.js +17 -2
- package/lib/commonjs/components/Layout.js +40 -19
- package/lib/commonjs/components/Picker/Picker.js +9 -4
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/commonjs/components/Picker/PickerComponent.web.js +20 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
- package/lib/commonjs/components/Portal/PortalManager.js +34 -8
- package/lib/commonjs/components/Pressable.js +50 -0
- package/lib/commonjs/components/ProgressBar.js +37 -7
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +9 -1
- package/lib/commonjs/components/ScreenContainer.js +20 -4
- package/lib/commonjs/components/Surface.js +14 -2
- package/lib/commonjs/components/Swiper/Swiper.js +2 -0
- package/lib/commonjs/components/Switch.js +19 -10
- package/lib/commonjs/components/TextField.js +76 -28
- package/lib/commonjs/components/ToggleButton.js +15 -2
- package/lib/commonjs/components/Touchable.js +23 -5
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/mappings/Button.js +39 -10
- package/lib/commonjs/mappings/FlashList.js +45 -2
- package/lib/commonjs/mappings/FlatList.js +12 -0
- package/lib/commonjs/mappings/Swiper.js +2 -0
- package/lib/commonjs/mappings/Touchable.js +47 -7
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/module/components/AvatarEdit.js +15 -4
- package/lib/module/components/Button.js +36 -13
- package/lib/module/components/Carousel.js +32 -8
- package/lib/module/components/Checkbox/Checkbox.js +26 -6
- package/lib/module/components/Checkbox/CheckboxGroup.js +16 -2
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +25 -7
- package/lib/module/components/Checkbox/CheckboxRow.js +2 -3
- package/lib/module/components/CircularProgress.js +28 -8
- package/lib/module/components/DatePicker/DatePicker.js +27 -13
- package/lib/module/components/DeprecatedButton.js +24 -30
- package/lib/module/components/DeprecatedFAB.js +2 -3
- package/lib/module/components/Elevation.js +14 -2
- package/lib/module/components/FieldSearchBarFull.js +1 -2
- package/lib/module/components/Image.js +18 -2
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/NumberInput.js +12 -3
- package/lib/module/components/Picker/Picker.js +10 -4
- package/lib/module/components/Picker/PickerComponent.ios.js +36 -11
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Portal/PortalConsumer.js +22 -7
- package/lib/module/components/Pressable.js +30 -0
- package/lib/module/components/RadioButton/RadioButtonRow.js +24 -5
- package/lib/module/components/ScreenContainer.js +21 -4
- package/lib/module/components/Swiper/Swiper.js +2 -0
- package/lib/module/components/Switch.js +21 -10
- package/lib/module/components/Text.js +50 -4
- package/lib/module/components/TextField.js +78 -28
- package/lib/module/components/Touchable.js +8 -3
- package/lib/module/constants.js +1 -2
- package/lib/module/index.js +1 -0
- package/lib/module/mappings/Button.js +40 -11
- package/lib/module/mappings/FieldSearchBarFull.js +4 -1
- package/lib/module/mappings/FlashList.js +46 -3
- package/lib/module/mappings/FlatList.js +13 -1
- package/lib/module/mappings/StarRating.js +7 -2
- package/lib/module/mappings/Swiper.js +3 -1
- package/lib/module/mappings/Touchable.js +49 -9
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/typescript/src/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxGroupRow.d.ts.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedButton.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedButton.d.ts.map +1 -1
- package/lib/typescript/src/components/DeprecatedFAB.d.ts +2 -2
- package/lib/typescript/src/components/DeprecatedFAB.d.ts.map +1 -1
- package/lib/typescript/src/components/Pressable.d.ts +10 -0
- package/lib/typescript/src/components/Pressable.d.ts.map +1 -0
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/components/Touchable.d.ts +5 -6
- package/lib/typescript/src/components/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Button.d.ts +113 -4
- package/lib/typescript/src/mappings/Button.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlashList.d.ts +112 -2
- package/lib/typescript/src/mappings/FlashList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +42 -0
- package/lib/typescript/src/mappings/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Swiper.d.ts +11 -0
- package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Touchable.d.ts +59 -5
- package/lib/typescript/src/mappings/Touchable.d.ts.map +1 -1
- package/lib/typescript/src/styles/overlay.d.ts +1 -1
- package/lib/typescript/src/styles/overlay.d.ts.map +1 -1
- package/lib/typescript/src/styles/shadow.d.ts +2 -2
- package/package.json +7 -7
- package/src/components/Button.js +3 -3
- package/src/components/Button.tsx +14 -4
- package/src/components/Checkbox/Checkbox.js +2 -3
- package/src/components/Checkbox/Checkbox.tsx +5 -7
- package/src/components/Checkbox/CheckboxGroupRow.js +2 -3
- package/src/components/Checkbox/CheckboxGroupRow.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +2 -3
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/DeprecatedButton.js +4 -16
- package/src/components/DeprecatedButton.tsx +7 -31
- package/src/components/DeprecatedFAB.js +2 -3
- package/src/components/DeprecatedFAB.tsx +5 -5
- package/src/components/Pressable.js +12 -0
- package/src/components/Pressable.tsx +44 -0
- package/src/components/Swiper/Swiper.js +2 -2
- package/src/components/Swiper/Swiper.tsx +3 -0
- package/src/components/Touchable.js +3 -3
- package/src/components/Touchable.tsx +11 -7
- package/src/index.js +1 -0
- package/src/index.tsx +1 -0
- package/src/mappings/Button.js +39 -10
- package/src/mappings/Button.ts +41 -10
- package/src/mappings/FlashList.js +77 -31
- package/src/mappings/FlashList.ts +82 -30
- package/src/mappings/FlatList.js +13 -1
- package/src/mappings/FlatList.ts +16 -0
- package/src/mappings/Swiper.js +3 -1
- package/src/mappings/Swiper.ts +4 -0
- package/src/mappings/Touchable.js +50 -7
- package/src/mappings/Touchable.ts +53 -6
- package/src/styles/overlay.tsx +2 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Pressable;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function Pressable(_ref) {
|
|
11
|
+
let {
|
|
12
|
+
children,
|
|
13
|
+
disabled,
|
|
14
|
+
onPress,
|
|
15
|
+
activeOpacity,
|
|
16
|
+
disabledOpacity,
|
|
17
|
+
delayLongPress,
|
|
18
|
+
hitSlop,
|
|
19
|
+
style,
|
|
20
|
+
...props
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
23
|
+
onPress: onPress,
|
|
24
|
+
disabled: disabled,
|
|
25
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
+
style: _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
pressed
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return [{
|
|
32
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
+
}, style];
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
}, children);
|
|
37
|
+
} onPress: onPress,
|
|
38
|
+
disabled: disabled,
|
|
39
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
40
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
41
|
+
style: _ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
pressed
|
|
44
|
+
} = _ref2;
|
|
45
|
+
return [{
|
|
46
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
47
|
+
}, style];
|
|
48
|
+
}
|
|
49
|
+
}, props), children);
|
|
50
|
+
}
|
|
@@ -8,16 +8,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
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); }
|
|
10
10
|
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; }
|
|
11
|
-
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); }
|
|
12
|
-
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; }
|
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
|
-
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); }
|
|
15
11
|
const INDETERMINATE_WIDTH_FACTOR = 0.3;
|
|
16
12
|
const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
|
|
17
13
|
class ProgressBar extends _react.Component {
|
|
18
14
|
constructor(props) {
|
|
19
15
|
super(props);
|
|
20
|
-
|
|
16
|
+
this.handleLayout = event => {
|
|
21
17
|
const {
|
|
22
18
|
width = 150,
|
|
23
19
|
onLayout
|
|
@@ -30,7 +26,7 @@ class ProgressBar extends _react.Component {
|
|
|
30
26
|
if (onLayout) {
|
|
31
27
|
onLayout(event);
|
|
32
28
|
}
|
|
33
|
-
}
|
|
29
|
+
};
|
|
34
30
|
const {
|
|
35
31
|
progress: progressP = 0,
|
|
36
32
|
indeterminate = false
|
|
@@ -78,7 +74,6 @@ class ProgressBar extends _react.Component {
|
|
|
78
74
|
...animationConfig,
|
|
79
75
|
toValue: progress,
|
|
80
76
|
velocity: 0,
|
|
81
|
-
//adjust this value if animation fails - velocity is required
|
|
82
77
|
useNativeDriver
|
|
83
78
|
}).start();
|
|
84
79
|
} else {
|
|
@@ -147,6 +142,41 @@ class ProgressBar extends _react.Component {
|
|
|
147
142
|
})
|
|
148
143
|
}]
|
|
149
144
|
};
|
|
145
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
146
|
+
style: [containerStyle, style],
|
|
147
|
+
onLayout: this.handleLayout,
|
|
148
|
+
...restProps
|
|
149
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
150
|
+
style: progressStyle
|
|
151
|
+
}), children);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.default = ProgressBar;,
|
|
155
|
+
overflow: "hidden",
|
|
156
|
+
backgroundColor: unfilledColor
|
|
157
|
+
};
|
|
158
|
+
const progressStyle = {
|
|
159
|
+
backgroundColor: color,
|
|
160
|
+
// Always take up full height of container.
|
|
161
|
+
height: "100%",
|
|
162
|
+
transform: [{
|
|
163
|
+
translateX: this.state.animationValue.interpolate({
|
|
164
|
+
inputRange: [0, 1],
|
|
165
|
+
outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth]
|
|
166
|
+
})
|
|
167
|
+
}, {
|
|
168
|
+
translateX: this.state.progress.interpolate({
|
|
169
|
+
inputRange: [0, 1],
|
|
170
|
+
outputRange: [innerWidth / (_reactNative.I18nManager.isRTL ? 2 : -2), 0]
|
|
171
|
+
})
|
|
172
|
+
}, {
|
|
173
|
+
// Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
|
|
174
|
+
scaleX: this.state.progress.interpolate({
|
|
175
|
+
inputRange: [0, 1],
|
|
176
|
+
outputRange: [0.0001, 1]
|
|
177
|
+
})
|
|
178
|
+
}]
|
|
179
|
+
};
|
|
150
180
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
151
181
|
style: [containerStyle, style],
|
|
152
182
|
onLayout: this.handleLayout
|
|
@@ -10,7 +10,6 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
|
10
10
|
var _theming = require("../../theming");
|
|
11
11
|
var _RadioButtonGroup = _interopRequireDefault(require("./RadioButtonGroup"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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 RadioButtonFieldGroup = _ref => {
|
|
15
14
|
let {
|
|
16
15
|
label,
|
|
@@ -27,6 +26,15 @@ const RadioButtonFieldGroup = _ref => {
|
|
|
27
26
|
fontSize: theme.typography.headline4.fontSize,
|
|
28
27
|
color: theme.typography.headline4.color
|
|
29
28
|
}, labelStyle]
|
|
29
|
+
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, {
|
|
30
|
+
theme: theme,
|
|
31
|
+
...rest
|
|
32
|
+
}, children));
|
|
33
|
+
};
|
|
34
|
+
var _default = (0, _theming.withTheme)(RadioButtonFieldGroup);
|
|
35
|
+
exports.default = _default; fontSize: theme.typography.headline4.fontSize,
|
|
36
|
+
color: theme.typography.headline4.color
|
|
37
|
+
}, labelStyle]
|
|
30
38
|
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, _extends({
|
|
31
39
|
theme: theme
|
|
32
40
|
}, rest), children));
|
|
@@ -10,7 +10,6 @@ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
|
10
10
|
var _theming = require("../theming");
|
|
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
|
function ScreenContainer(_ref) {
|
|
15
14
|
let {
|
|
16
15
|
scrollable = false,
|
|
@@ -30,12 +29,13 @@ function ScreenContainer(_ref) {
|
|
|
30
29
|
if (hasSafeArea || hasBottomSafeArea) {
|
|
31
30
|
edges.push("bottom");
|
|
32
31
|
}
|
|
33
|
-
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView,
|
|
32
|
+
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
34
33
|
edges: edges,
|
|
35
34
|
style: [styles.container, {
|
|
36
35
|
backgroundColor
|
|
37
|
-
}]
|
|
38
|
-
|
|
36
|
+
}],
|
|
37
|
+
...rest
|
|
38
|
+
}, scrollable ? /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
39
39
|
contentContainerStyle: [styles.scrollViewContainer, {
|
|
40
40
|
backgroundColor
|
|
41
41
|
}, style]
|
|
@@ -55,4 +55,20 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
58
|
+
exports.default = _default;(_reactNative.View, {
|
|
59
|
+
style: [styles.container, {
|
|
60
|
+
backgroundColor
|
|
61
|
+
}, style]
|
|
62
|
+
}, children));
|
|
63
|
+
}
|
|
64
|
+
const styles = _reactNative.StyleSheet.create({
|
|
65
|
+
container: {
|
|
66
|
+
flex: 1
|
|
67
|
+
},
|
|
68
|
+
scrollViewContainer: {
|
|
69
|
+
flexGrow: 1,
|
|
70
|
+
flex: undefined
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
58
74
|
exports.default = _default;
|
|
@@ -12,7 +12,8 @@ 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
|
-
|
|
15
|
+
/* Copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx */
|
|
16
|
+
|
|
16
17
|
const Surface = _ref => {
|
|
17
18
|
let {
|
|
18
19
|
elevation: propElevation,
|
|
@@ -42,7 +43,18 @@ const Surface = _ref => {
|
|
|
42
43
|
return colors.surface;
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
return /*#__PURE__*/React.createElement(_reactNative.Animated.View,
|
|
46
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
47
|
+
...rest,
|
|
48
|
+
style: [{
|
|
49
|
+
backgroundColor: getBackgroundColor(),
|
|
50
|
+
elevation,
|
|
51
|
+
...evalationStyles,
|
|
52
|
+
...restStyle
|
|
53
|
+
}]
|
|
54
|
+
}, children);
|
|
55
|
+
};
|
|
56
|
+
var _default = (0, _theming.withTheme)(Surface);
|
|
57
|
+
exports.default = _default;xtends({}, rest, {
|
|
46
58
|
style: [{
|
|
47
59
|
backgroundColor: getBackgroundColor(),
|
|
48
60
|
elevation,
|
|
@@ -25,6 +25,7 @@ const Swiper = _ref => {
|
|
|
25
25
|
keyExtractor,
|
|
26
26
|
renderItem,
|
|
27
27
|
children,
|
|
28
|
+
onIndexChanged,
|
|
28
29
|
style
|
|
29
30
|
} = _ref;
|
|
30
31
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
@@ -34,6 +35,7 @@ const Swiper = _ref => {
|
|
|
34
35
|
loop: loop,
|
|
35
36
|
timeout: timeout,
|
|
36
37
|
vertical: vertical,
|
|
38
|
+
onIndexChanged: onIndexChanged,
|
|
37
39
|
controlsProps: {
|
|
38
40
|
prevTitle,
|
|
39
41
|
nextTitle,
|
|
@@ -13,7 +13,6 @@ var _hooks = require("../hooks");
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
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); }
|
|
17
16
|
function Switch(_ref) {
|
|
18
17
|
let {
|
|
19
18
|
value,
|
|
@@ -38,7 +37,6 @@ function Switch(_ref) {
|
|
|
38
37
|
setChecked(value);
|
|
39
38
|
}
|
|
40
39
|
}, [value, checked]);
|
|
41
|
-
|
|
42
40
|
// This special logic is to handle weird APIs like Airtable that return
|
|
43
41
|
// true or undefined for a boolean
|
|
44
42
|
const previousDefaultValue = (0, _hooks.usePrevious)(defaultValue);
|
|
@@ -47,24 +45,24 @@ function Switch(_ref) {
|
|
|
47
45
|
setChecked(Boolean(defaultValue));
|
|
48
46
|
}
|
|
49
47
|
}, [defaultValue, previousDefaultValue]);
|
|
50
|
-
return /*#__PURE__*/React.createElement(_reactNative.Switch,
|
|
48
|
+
return /*#__PURE__*/React.createElement(_reactNative.Switch, {
|
|
51
49
|
value: checked,
|
|
52
50
|
disabled: disabled,
|
|
53
51
|
trackColor: {
|
|
54
52
|
false: inactiveTrackThemeColor,
|
|
55
53
|
true: activeTrackThemeColor
|
|
56
54
|
},
|
|
57
|
-
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor
|
|
55
|
+
thumbColor: value ? activeThumbThemeColor : inactiveThumbThemeColor,
|
|
58
56
|
// @ts-ignore react-native-web only
|
|
59
|
-
,
|
|
60
57
|
activeThumbColor: activeThumbThemeColor,
|
|
61
58
|
ios_backgroundColor: inactiveTrackThemeColor,
|
|
62
59
|
style: style,
|
|
63
60
|
onValueChange: bool => {
|
|
64
61
|
setChecked(bool);
|
|
65
62
|
onValueChange && onValueChange(bool);
|
|
66
|
-
}
|
|
67
|
-
|
|
63
|
+
},
|
|
64
|
+
...rest
|
|
65
|
+
});
|
|
68
66
|
}
|
|
69
67
|
function Row(_ref2) {
|
|
70
68
|
let {
|
|
@@ -93,7 +91,7 @@ function Row(_ref2) {
|
|
|
93
91
|
setChecked(defaultValue);
|
|
94
92
|
}
|
|
95
93
|
}, [defaultValue]);
|
|
96
|
-
return /*#__PURE__*/React.createElement(_FormRow.default,
|
|
94
|
+
return /*#__PURE__*/React.createElement(_FormRow.default, {
|
|
97
95
|
disabled: disabled,
|
|
98
96
|
onPress: () => {
|
|
99
97
|
setChecked(!checked);
|
|
@@ -101,8 +99,9 @@ function Row(_ref2) {
|
|
|
101
99
|
},
|
|
102
100
|
label: label,
|
|
103
101
|
direction: direction,
|
|
104
|
-
style: style
|
|
105
|
-
|
|
102
|
+
style: style,
|
|
103
|
+
...rest
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
106
105
|
theme: theme,
|
|
107
106
|
value: checked,
|
|
108
107
|
disabled: disabled,
|
|
@@ -116,4 +115,14 @@ function Row(_ref2) {
|
|
|
116
115
|
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
117
116
|
exports.SwitchRow = SwitchRow;
|
|
118
117
|
var _default = (0, _theming.withTheme)(Switch);
|
|
118
|
+
exports.default = _default;hange: onValueChange,
|
|
119
|
+
activeTrackColor: activeTrackColor,
|
|
120
|
+
inactiveTrackColor: inactiveTrackColor,
|
|
121
|
+
activeThumbColor: activeThumbColor,
|
|
122
|
+
inactiveThumbColor: inactiveThumbColor
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
const SwitchRow = (0, _theming.withTheme)(Row);
|
|
126
|
+
exports.SwitchRow = SwitchRow;
|
|
127
|
+
var _default = (0, _theming.withTheme)(Switch);
|
|
119
128
|
exports.default = _default;
|
|
@@ -10,10 +10,6 @@ var _theming = require("../theming");
|
|
|
10
10
|
var _utilities = require("../utilities");
|
|
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
|
-
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; }
|
|
15
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
-
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); }
|
|
17
13
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
18
14
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
19
15
|
const BLUR_ANIMATION_DURATION = 180;
|
|
@@ -21,7 +17,7 @@ const ICON_SIZE = 24;
|
|
|
21
17
|
class TextField extends React.Component {
|
|
22
18
|
constructor() {
|
|
23
19
|
super(...arguments);
|
|
24
|
-
|
|
20
|
+
this.state = {
|
|
25
21
|
nativeProps: {},
|
|
26
22
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
27
23
|
focused: false,
|
|
@@ -30,47 +26,46 @@ class TextField extends React.Component {
|
|
|
30
26
|
measured: false,
|
|
31
27
|
width: 0
|
|
32
28
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
};
|
|
30
|
+
this._timer = setTimeout(() => {}, 0);
|
|
31
|
+
this._showPlaceholder = () => {
|
|
36
32
|
clearTimeout(this._timer);
|
|
37
|
-
|
|
38
33
|
// Set the placeholder in a delay to offset the label animation
|
|
39
34
|
// If we show it immediately, they'll overlap and look ugly
|
|
40
35
|
this._timer = setTimeout(() => this.setState({
|
|
41
36
|
placeholder: this.props.placeholder
|
|
42
37
|
}), 50);
|
|
43
|
-
}
|
|
44
|
-
|
|
38
|
+
};
|
|
39
|
+
this._hidePlaceholder = () => this.setState({
|
|
45
40
|
placeholder: ""
|
|
46
|
-
})
|
|
47
|
-
|
|
41
|
+
});
|
|
42
|
+
this._restoreLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
48
43
|
toValue: 1,
|
|
49
44
|
duration: FOCUS_ANIMATION_DURATION,
|
|
50
45
|
useNativeDriver: true
|
|
51
|
-
}).start()
|
|
52
|
-
|
|
46
|
+
}).start();
|
|
47
|
+
this._minmizeLabel = () => _reactNative.Animated.timing(this.state.labeled, {
|
|
53
48
|
toValue: 0,
|
|
54
49
|
duration: BLUR_ANIMATION_DURATION,
|
|
55
50
|
useNativeDriver: true
|
|
56
|
-
}).start()
|
|
57
|
-
|
|
51
|
+
}).start();
|
|
52
|
+
this._handleFocus = () => {
|
|
58
53
|
if (this.props.disabled) {
|
|
59
54
|
return;
|
|
60
55
|
}
|
|
61
56
|
this.setState({
|
|
62
57
|
focused: true
|
|
63
58
|
});
|
|
64
|
-
}
|
|
65
|
-
|
|
59
|
+
};
|
|
60
|
+
this._handleBlur = () => {
|
|
66
61
|
if (this.props.disabled) {
|
|
67
62
|
return;
|
|
68
63
|
}
|
|
69
64
|
this.setState({
|
|
70
65
|
focused: false
|
|
71
66
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
67
|
+
};
|
|
68
|
+
this._handleChangeText = value => {
|
|
74
69
|
if (this.props.disabled) {
|
|
75
70
|
return;
|
|
76
71
|
}
|
|
@@ -85,8 +80,8 @@ class TextField extends React.Component {
|
|
|
85
80
|
});
|
|
86
81
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
87
82
|
}
|
|
88
|
-
}
|
|
89
|
-
|
|
83
|
+
};
|
|
84
|
+
this._root = undefined;
|
|
90
85
|
}
|
|
91
86
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
92
87
|
return {
|
|
@@ -173,7 +168,9 @@ class TextField extends React.Component {
|
|
|
173
168
|
roundness,
|
|
174
169
|
disabledOpacity
|
|
175
170
|
},
|
|
176
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput,
|
|
171
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, {
|
|
172
|
+
...props
|
|
173
|
+
}),
|
|
177
174
|
...rest
|
|
178
175
|
} = this.props;
|
|
179
176
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -313,9 +310,10 @@ class TextField extends React.Component {
|
|
|
313
310
|
} = _reactNative.StyleSheet.flatten(style || {});
|
|
314
311
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
315
312
|
style: [styles.container, styleProp]
|
|
316
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon,
|
|
313
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
314
|
+
...leftIconProps,
|
|
317
315
|
style: leftIconStyle
|
|
318
|
-
})
|
|
316
|
+
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
319
317
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
320
318
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
321
319
|
backgroundColor: bgColor,
|
|
@@ -383,9 +381,10 @@ class TextField extends React.Component {
|
|
|
383
381
|
style: {
|
|
384
382
|
justifyContent: type === "solid" ? "center" : undefined
|
|
385
383
|
}
|
|
386
|
-
}, /*#__PURE__*/React.createElement(Icon,
|
|
384
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
385
|
+
...leftIconProps,
|
|
387
386
|
style: leftIconStyle
|
|
388
|
-
}))
|
|
387
|
+
})) : null, render({
|
|
389
388
|
ref: c => {
|
|
390
389
|
this._root = c;
|
|
391
390
|
},
|
|
@@ -423,6 +422,55 @@ class TextField extends React.Component {
|
|
|
423
422
|
}
|
|
424
423
|
var _default = (0, _theming.withTheme)(TextField);
|
|
425
424
|
exports.default = _default;
|
|
425
|
+
const styles = _reactNative.StyleSheet.create({
|
|
426
|
+
container: {
|
|
427
|
+
alignSelf: "stretch"
|
|
428
|
+
},
|
|
429
|
+
placeholder: {
|
|
430
|
+
position: "absolute",
|
|
431
|
+
left: 0
|
|
432
|
+
},
|
|
433
|
+
underline: {
|
|
434
|
+
position: "absolute",
|
|
435
|
+
left: 0,
|
|
436
|
+
right: 0,
|
|
437
|
+
bottom: 0,
|
|
438
|
+
height: 2
|
|
439
|
+
},
|
|
440
|
+
input: {
|
|
441
|
+
flexGrow: 1,
|
|
442
|
+
justifyContent: "center",
|
|
443
|
+
textAlignVertical: "center",
|
|
444
|
+
margin: 0,
|
|
445
|
+
textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
|
|
446
|
+
}
|
|
447
|
+
});_handleFocus,
|
|
448
|
+
onBlur: this._handleBlur,
|
|
449
|
+
underlineColorAndroid: "transparent",
|
|
450
|
+
style: inputStyles,
|
|
451
|
+
...rest,
|
|
452
|
+
...this.state.nativeProps,
|
|
453
|
+
value: this.state.value
|
|
454
|
+
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
455
|
+
name: rightIconName,
|
|
456
|
+
size: ICON_SIZE,
|
|
457
|
+
color: colors.light,
|
|
458
|
+
style: {
|
|
459
|
+
position: "absolute",
|
|
460
|
+
right: 16,
|
|
461
|
+
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
462
|
+
}
|
|
463
|
+
}) : null, assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
464
|
+
style: [{
|
|
465
|
+
color: error ? colors.error : colors.light,
|
|
466
|
+
marginTop: 8,
|
|
467
|
+
marginLeft: assistiveTextLeftMargin
|
|
468
|
+
}]
|
|
469
|
+
}, assistiveText) : null);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
var _default = (0, _theming.withTheme)(TextField);
|
|
473
|
+
exports.default = _default;
|
|
426
474
|
const styles = _reactNative.StyleSheet.create({
|
|
427
475
|
container: {
|
|
428
476
|
alignSelf: "stretch"
|
|
@@ -11,7 +11,6 @@ var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
|
-
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); }
|
|
15
14
|
const ToggleButton = _ref => {
|
|
16
15
|
let {
|
|
17
16
|
Icon,
|
|
@@ -47,7 +46,7 @@ const ToggleButton = _ref => {
|
|
|
47
46
|
setInternalValue(!internalValue);
|
|
48
47
|
onPress(!internalValue);
|
|
49
48
|
};
|
|
50
|
-
return /*#__PURE__*/React.createElement(_IconButton.default,
|
|
49
|
+
return /*#__PURE__*/React.createElement(_IconButton.default, {
|
|
51
50
|
Icon: Icon,
|
|
52
51
|
icon: icon,
|
|
53
52
|
size: iconSize,
|
|
@@ -59,6 +58,20 @@ const ToggleButton = _ref => {
|
|
|
59
58
|
height,
|
|
60
59
|
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
61
60
|
borderColor: colors[borderColor]
|
|
61
|
+
}, style],
|
|
62
|
+
...rest
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const styles = _reactNative.StyleSheet.create({
|
|
66
|
+
mainContainer: {
|
|
67
|
+
borderWidth: 1
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var _default = (0, _theming.withTheme)(ToggleButton);
|
|
71
|
+
exports.default = _default;idth,
|
|
72
|
+
height,
|
|
73
|
+
backgroundColor: internalValue ? colors[colorSecondary] : colors[color],
|
|
74
|
+
borderColor: colors[borderColor]
|
|
62
75
|
}, style]
|
|
63
76
|
}, rest));
|
|
64
77
|
};
|
|
@@ -7,25 +7,43 @@ exports.default = Touchable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
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); }
|
|
11
10
|
function Touchable(_ref) {
|
|
12
11
|
let {
|
|
13
12
|
children,
|
|
14
13
|
disabled,
|
|
15
14
|
onPress,
|
|
15
|
+
activeOpacity,
|
|
16
|
+
disabledOpacity,
|
|
17
|
+
delayLongPress,
|
|
18
|
+
hitSlop,
|
|
16
19
|
style,
|
|
17
20
|
...props
|
|
18
21
|
} = _ref;
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable,
|
|
20
|
-
onPress: onPress,
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
21
23
|
disabled: disabled,
|
|
22
|
-
|
|
24
|
+
onPress: onPress,
|
|
25
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
+
style: _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
pressed
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return [{
|
|
32
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
+
}, style];
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
}, children);
|
|
37
|
+
} disabled: disabled,
|
|
38
|
+
onPress: onPress,
|
|
39
|
+
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
40
|
+
hitSlop: hitSlop ? hitSlop : 8,
|
|
23
41
|
style: _ref2 => {
|
|
24
42
|
let {
|
|
25
43
|
pressed
|
|
26
44
|
} = _ref2;
|
|
27
45
|
return [{
|
|
28
|
-
opacity: pressed
|
|
46
|
+
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
29
47
|
}, style];
|
|
30
48
|
}
|
|
31
49
|
}, props), children);
|
|
@@ -12,4 +12,4 @@ const APPROX_STATUSBAR_HEIGHT = _reactNative.Platform.select({
|
|
|
12
12
|
android: DEFAULT_STATUSBAR_HEIGHT_EXPO,
|
|
13
13
|
ios: _reactNative.Platform.Version < 11 ? DEFAULT_STATUSBAR_HEIGHT_EXPO : 0
|
|
14
14
|
});
|
|
15
|
-
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
|
15
|
+
exports.APPROX_STATUSBAR_HEIGHT = APPROX_STATUSBAR_HEIGHT;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -225,6 +225,12 @@ Object.defineProperty(exports, "Picker", {
|
|
|
225
225
|
return _Picker.default;
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
|
+
Object.defineProperty(exports, "Pressable", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _Pressable.default;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
228
234
|
Object.defineProperty(exports, "ProgressBar", {
|
|
229
235
|
enumerable: true,
|
|
230
236
|
get: function () {
|
|
@@ -438,6 +444,7 @@ var _Switch = _interopRequireWildcard(require("./components/Switch"));
|
|
|
438
444
|
var _TextField = _interopRequireDefault(require("./components/TextField"));
|
|
439
445
|
var _ToggleButton = _interopRequireDefault(require("./components/ToggleButton"));
|
|
440
446
|
var _Touchable = _interopRequireDefault(require("./components/Touchable"));
|
|
447
|
+
var _Pressable = _interopRequireDefault(require("./components/Pressable"));
|
|
441
448
|
var _Accordion = require("./components/Accordion");
|
|
442
449
|
var _ActionSheet = require("./components/ActionSheet");
|
|
443
450
|
var _Swiper = require("./components/Swiper");
|