@draftbit/core 46.6.0 → 46.6.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/AvatarEdit.js +15 -4
- package/lib/commonjs/components/CardContainer.js +4 -13
- package/lib/commonjs/components/CardContainerShortImage.js +4 -15
- package/lib/commonjs/components/Carousel.js +30 -8
- package/lib/commonjs/components/Checkbox/Checkbox.js +4 -22
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +2 -17
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -5
- package/lib/commonjs/components/DatePicker/DatePicker.js +26 -13
- package/lib/commonjs/components/Divider.js +14 -1
- package/lib/commonjs/components/Elevation.js +2 -14
- package/lib/commonjs/components/FieldSearchBarFull.js +2 -1
- package/lib/commonjs/components/IconButton.js +19 -4
- package/lib/commonjs/components/Image.js +2 -17
- package/lib/commonjs/components/Layout.js +19 -40
- package/lib/commonjs/components/Picker/Picker.js +4 -9
- package/lib/commonjs/components/Picker/PickerComponent.web.js +3 -20
- package/lib/commonjs/components/Portal/Portal.js +27 -3
- package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
- package/lib/commonjs/components/Pressable.js +2 -15
- package/lib/commonjs/components/ProgressBar.js +7 -37
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/StarRating.js +23 -4
- package/lib/commonjs/components/StepIndicator.js +18 -57
- package/lib/commonjs/components/Switch.js +10 -19
- package/lib/commonjs/components/Touchable.js +2 -15
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +1 -2
- package/lib/commonjs/mappings/StarRating.js +6 -2
- package/lib/commonjs/styles/overlay.js +1 -3
- package/lib/commonjs/utilities.js +1 -2
- package/lib/module/components/AnimatedCircularProgress.js +13 -1
- package/lib/module/components/AspectRatio.js +18 -1
- package/lib/module/components/Banner.js +25 -4
- package/lib/module/components/CardBlock.js +14 -4
- package/lib/module/components/CardContainerRating.js +14 -4
- package/lib/module/components/CardContainerShortImage.js +18 -4
- package/lib/module/components/Carousel.js +8 -32
- package/lib/module/components/Checkbox/Checkbox.js +4 -25
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +5 -24
- package/lib/module/components/CircularProgress.js +8 -28
- package/lib/module/components/Container.js +17 -4
- package/lib/module/components/DatePicker/DatePicker.js +13 -27
- package/lib/module/components/DeprecatedButton.js +3 -21
- package/lib/module/components/DeprecatedFAB.js +23 -3
- package/lib/module/components/FieldSearchBarFull.js +2 -1
- package/lib/module/components/FormRow.js +17 -2
- package/lib/module/components/Image.js +2 -18
- package/lib/module/components/Picker/Picker.js +4 -10
- package/lib/module/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/module/components/Picker/PickerComponent.web.js +3 -21
- package/lib/module/components/Portal/Portal.js +28 -3
- package/lib/module/components/Portal/PortalHost.js +45 -15
- package/lib/module/components/Portal/PortalManager.js +33 -7
- package/lib/module/components/ProgressBar.js +39 -7
- package/lib/module/components/RadioButton/RadioButton.js +13 -1
- package/lib/module/components/RadioButton/RadioButtonGroup.js +16 -2
- package/lib/module/components/RadioButton/context.js +1 -1
- package/lib/module/components/ScreenContainer.js +4 -21
- package/lib/module/components/Slider.js +21 -4
- package/lib/module/components/StepIndicator.js +58 -18
- package/lib/module/components/Surface.js +15 -1
- package/lib/module/components/Text.js +4 -50
- package/lib/module/mappings/StarRating.js +2 -7
- package/package.json +3 -3
- package/src/Provider.js +0 -9
- package/src/components/Accordion/AccordionGroup.js +0 -44
- package/src/components/Accordion/AccordionItem.js +0 -32
- package/src/components/Accordion/index.js +0 -2
- package/src/components/ActionSheet/ActionSheet.js +0 -45
- package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
- package/src/components/ActionSheet/ActionSheetItem.js +0 -30
- package/src/components/ActionSheet/index.js +0 -3
- package/src/components/AnimatedCircularProgress.js +0 -43
- package/src/components/AspectRatio.js +0 -18
- package/src/components/AvatarEdit.js +0 -30
- package/src/components/Banner.js +0 -109
- package/src/components/Button.js +0 -114
- package/src/components/Card.js +0 -57
- package/src/components/CardBlock.js +0 -54
- package/src/components/CardContainer.js +0 -69
- package/src/components/CardContainerRating.js +0 -79
- package/src/components/CardContainerShortImage.js +0 -33
- package/src/components/CardInline.js +0 -36
- package/src/components/Carousel.js +0 -68
- package/src/components/Checkbox/Checkbox.js +0 -62
- package/src/components/Checkbox/CheckboxGroup.js +0 -21
- package/src/components/Checkbox/CheckboxGroupRow.js +0 -76
- package/src/components/Checkbox/CheckboxRow.js +0 -77
- package/src/components/Checkbox/context.js +0 -14
- package/src/components/Checkbox/index.js +0 -3
- package/src/components/CircleImage.js +0 -8
- package/src/components/CircularProgress.js +0 -81
- package/src/components/Config.js +0 -64
- package/src/components/Container.js +0 -43
- package/src/components/DatePicker/DatePicker.js +0 -377
- package/src/components/DatePicker/DatePickerComponent.js +0 -13
- package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
- package/src/components/DatePicker/DatePickerComponentType.js +0 -1
- package/src/components/DeprecatedButton.js +0 -83
- package/src/components/DeprecatedCardWrapper.js +0 -18
- package/src/components/DeprecatedFAB.js +0 -114
- package/src/components/Divider.js +0 -13
- package/src/components/Elevation.js +0 -20
- package/src/components/FAB.js +0 -46
- package/src/components/FieldSearchBarFull.js +0 -53
- package/src/components/FormRow.js +0 -19
- package/src/components/Header.js +0 -44
- package/src/components/HeaderLarge.js +0 -7
- package/src/components/HeaderMedium.js +0 -7
- package/src/components/HeaderOverline.js +0 -7
- package/src/components/IconButton.js +0 -35
- package/src/components/Image.js +0 -47
- package/src/components/Justification.js +0 -1
- package/src/components/Layout.js +0 -50
- package/src/components/NumberInput.js +0 -49
- package/src/components/Picker/Picker.js +0 -267
- package/src/components/Picker/PickerComponent.android.js +0 -69
- package/src/components/Picker/PickerComponent.ios.js +0 -79
- package/src/components/Picker/PickerComponent.web.js +0 -70
- package/src/components/Picker/PickerTypes.js +0 -1
- package/src/components/Portal/Portal.js +0 -35
- package/src/components/Portal/PortalConsumer.js +0 -27
- package/src/components/Portal/PortalHost.js +0 -107
- package/src/components/Portal/PortalManager.js +0 -32
- package/src/components/Pressable.js +0 -12
- package/src/components/ProgressBar.js +0 -118
- package/src/components/ProgressCircle.js +0 -13
- package/src/components/ProgressIndicator.js +0 -27
- package/src/components/RadioButton/RadioButton.js +0 -17
- package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
- package/src/components/RadioButton/RadioButtonGroup.js +0 -43
- package/src/components/RadioButton/RadioButtonRow.js +0 -76
- package/src/components/RadioButton/context.js +0 -14
- package/src/components/RadioButton/index.js +0 -4
- package/src/components/ResizeMode.js +0 -1
- package/src/components/Row.js +0 -48
- package/src/components/RowBodyIcon.js +0 -8
- package/src/components/RowHeadlineImageCaption.js +0 -12
- package/src/components/RowHeadlineImageIcon.js +0 -14
- package/src/components/SVG.js +0 -13
- package/src/components/ScreenContainer.js +0 -34
- package/src/components/Slider.js +0 -63
- package/src/components/StarRating.js +0 -50
- package/src/components/StepIndicator.js +0 -346
- package/src/components/Stepper.js +0 -41
- package/src/components/Surface.js +0 -32
- package/src/components/Swiper/Swiper.js +0 -29
- package/src/components/Swiper/SwiperItem.js +0 -9
- package/src/components/Swiper/index.js +0 -2
- package/src/components/Switch.js +0 -56
- package/src/components/Text.js +0 -33
- package/src/components/TextField.js +0 -428
- package/src/components/ToggleButton.js +0 -39
- package/src/components/Touchable.js +0 -12
- package/src/components/Touchable.web.js +0 -2
- package/src/components/Typography.js +0 -36
- package/src/components/useAuthState.js +0 -31
- package/src/constants.js +0 -10
- package/src/hooks.js +0 -12
- package/src/index.js +0 -53
- package/src/interfaces/Icon.js +0 -8
- package/src/mappings/Accordion.js +0 -41
- package/src/mappings/AccordionItem.js +0 -16
- package/src/mappings/ActionSheet.js +0 -13
- package/src/mappings/ActionSheetCancel.js +0 -19
- package/src/mappings/ActionSheetItem.js +0 -23
- package/src/mappings/ActivityIndicator.js +0 -58
- package/src/mappings/AudioPlayer.js +0 -57
- package/src/mappings/AvatarEdit.js +0 -38
- package/src/mappings/Banner.js +0 -32
- package/src/mappings/BlurView.js +0 -42
- package/src/mappings/Button.js +0 -116
- package/src/mappings/Card.js +0 -52
- package/src/mappings/CardBlock.js +0 -123
- package/src/mappings/CardContainer.js +0 -104
- package/src/mappings/CardContainerRating.js +0 -126
- package/src/mappings/CardContainerShortImage.js +0 -120
- package/src/mappings/CardInline.js +0 -52
- package/src/mappings/Carousel.js +0 -19
- package/src/mappings/Checkbox.js +0 -46
- package/src/mappings/CheckboxGroup.js +0 -26
- package/src/mappings/CheckboxRow.js +0 -61
- package/src/mappings/CircleImage.js +0 -25
- package/src/mappings/Container.js +0 -30
- package/src/mappings/CustomCode.js +0 -8
- package/src/mappings/DatePicker.js +0 -176
- package/src/mappings/Divider.js +0 -27
- package/src/mappings/FAB.js +0 -37
- package/src/mappings/Fetch.js +0 -13
- package/src/mappings/FieldSearchBarFull.js +0 -50
- package/src/mappings/FlashList.js +0 -79
- package/src/mappings/FlatList.js +0 -36
- package/src/mappings/HeaderLarge.js +0 -29
- package/src/mappings/HeaderMedium.js +0 -55
- package/src/mappings/HeaderOverline.js +0 -55
- package/src/mappings/Icon.js +0 -32
- package/src/mappings/IconButton.js +0 -35
- package/src/mappings/Image.js +0 -35
- package/src/mappings/ImageBackground.js +0 -29
- package/src/mappings/KeyboardAvoidingView.js +0 -41
- package/src/mappings/KeyboardAwareScrollView.js +0 -50
- package/src/mappings/Layout.js +0 -200
- package/src/mappings/LinearGradient.js +0 -77
- package/src/mappings/MapCallout.js +0 -21
- package/src/mappings/MapMarker.js +0 -47
- package/src/mappings/MapView.js +0 -139
- package/src/mappings/Modal.js +0 -42
- package/src/mappings/NumberInput.js +0 -254
- package/src/mappings/Picker.js +0 -148
- package/src/mappings/ProgressBar.js +0 -101
- package/src/mappings/ProgressCircle.js +0 -109
- package/src/mappings/ProgressIndicator.js +0 -181
- package/src/mappings/RadioButton.js +0 -51
- package/src/mappings/RadioButtonGroup.js +0 -17
- package/src/mappings/RadioButtonRow.js +0 -42
- package/src/mappings/RowBodyIcon.js +0 -75
- package/src/mappings/RowHeadlineImageCaption.js +0 -167
- package/src/mappings/RowHeadlineImageIcon.js +0 -99
- package/src/mappings/SVG.js +0 -20
- package/src/mappings/SafeAreaView.js +0 -33
- package/src/mappings/ScrollView.js +0 -31
- package/src/mappings/Slider.js +0 -60
- package/src/mappings/StarRating.js +0 -43
- package/src/mappings/Stepper.js +0 -32
- package/src/mappings/Surface.js +0 -14
- package/src/mappings/Swiper.js +0 -62
- package/src/mappings/SwiperItem.js +0 -8
- package/src/mappings/Switch.js +0 -81
- package/src/mappings/Text.js +0 -251
- package/src/mappings/TextArea.js +0 -274
- package/src/mappings/TextField.js +0 -391
- package/src/mappings/TextInput.js +0 -402
- package/src/mappings/ToggleButton.js +0 -50
- package/src/mappings/Touchable.js +0 -60
- package/src/mappings/Video.js +0 -81
- package/src/mappings/View.js +0 -207
- package/src/mappings/WebView.js +0 -88
- package/src/styles/DarkTheme.js +0 -26
- package/src/styles/DefaultTheme.js +0 -111
- package/src/styles/fonts.js +0 -62
- package/src/styles/overlay.js +0 -60
- package/src/styles/shadow.js +0 -51
- package/src/theming.js +0 -3
- package/src/utilities.js +0 -102
|
@@ -1,4 +1,3 @@
|
|
|
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
1
|
import * as React from "react";
|
|
3
2
|
import { View, ImageBackground, StyleSheet } from "react-native";
|
|
4
3
|
import { withTheme } from "../theming";
|
|
@@ -64,9 +63,10 @@ const Container = _ref => {
|
|
|
64
63
|
};
|
|
65
64
|
const Wrap = elevation ? Elevation : View;
|
|
66
65
|
if (elevation) containerStyle.elevation = elevation;
|
|
67
|
-
return /*#__PURE__*/React.createElement(Wrap,
|
|
68
|
-
style: [containerStyle, style]
|
|
69
|
-
|
|
66
|
+
return /*#__PURE__*/React.createElement(Wrap, {
|
|
67
|
+
style: [containerStyle, style],
|
|
68
|
+
...rest
|
|
69
|
+
}, backgroundImage ? /*#__PURE__*/React.createElement(ImageBackground, {
|
|
70
70
|
source: typeof backgroundImage === "string" ? {
|
|
71
71
|
uri: backgroundImage
|
|
72
72
|
} : backgroundImage,
|
|
@@ -80,4 +80,17 @@ const Container = _ref => {
|
|
|
80
80
|
style: innerStyle
|
|
81
81
|
}, children));
|
|
82
82
|
};
|
|
83
|
+
export default withTheme(Container);ring" ? {
|
|
84
|
+
uri: backgroundImage
|
|
85
|
+
} : backgroundImage,
|
|
86
|
+
resizeMode: backgroundImageResizeMode,
|
|
87
|
+
style: {
|
|
88
|
+
flex: 1
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
91
|
+
style: innerStyle
|
|
92
|
+
}, children)) : /*#__PURE__*/React.createElement(View, {
|
|
93
|
+
style: innerStyle
|
|
94
|
+
}, children));
|
|
95
|
+
};
|
|
83
96
|
export default withTheme(Container);
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput } from "react-native";
|
|
3
4
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -81,20 +82,24 @@ const DatePicker = _ref => {
|
|
|
81
82
|
focused ? _handleBlur() : _handleFocus();
|
|
82
83
|
};
|
|
83
84
|
const insets = useSafeAreaInsets();
|
|
85
|
+
|
|
84
86
|
// const _restoreLabel = () =>
|
|
85
87
|
// Animated.timing(labeled, {
|
|
86
88
|
// toValue: 1,
|
|
87
89
|
// duration: FOCUS_ANIMATION_DURATION,
|
|
88
90
|
// useNativeDriver: true,
|
|
89
91
|
// }).start();
|
|
92
|
+
|
|
90
93
|
// const _minmizeLabel = () =>
|
|
91
94
|
// Animated.timing(labeled, {
|
|
92
95
|
// toValue: 0,
|
|
93
96
|
// duration: BLUR_ANIMATION_DURATION,
|
|
94
97
|
// useNativeDriver: true,
|
|
95
98
|
// }).start();
|
|
99
|
+
|
|
96
100
|
// const _showPlaceholder = () =>
|
|
97
101
|
// setTimeout(() => setPlaceholder1(placeholder || ""), 50);
|
|
102
|
+
|
|
98
103
|
const _hidePlaceholder = () => {
|
|
99
104
|
setPlaceholder1("");
|
|
100
105
|
};
|
|
@@ -237,7 +242,9 @@ const DatePicker = _ref => {
|
|
|
237
242
|
const inputStyles = [styles.input, inputStyle, type === "solid" ? {
|
|
238
243
|
marginHorizontal: 12
|
|
239
244
|
} : {}];
|
|
245
|
+
|
|
240
246
|
// const render = (props) => <NativeTextInput {...props} />;
|
|
247
|
+
|
|
241
248
|
return /*#__PURE__*/React.createElement(View, {
|
|
242
249
|
style: [styles.container, style]
|
|
243
250
|
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
@@ -247,10 +254,9 @@ const DatePicker = _ref => {
|
|
|
247
254
|
pointerEvents: "none"
|
|
248
255
|
}, /*#__PURE__*/React.createElement(View, {
|
|
249
256
|
style: [styles.container, style]
|
|
250
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
251
|
-
...leftIconProps,
|
|
257
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
252
258
|
style: leftIconStyle
|
|
253
|
-
}) : null, /*#__PURE__*/React.createElement(View, {
|
|
259
|
+
})) : null, /*#__PURE__*/React.createElement(View, {
|
|
254
260
|
style: [containerStyle, style ? {
|
|
255
261
|
height: style.height
|
|
256
262
|
} : {}, viewStyles]
|
|
@@ -299,13 +305,12 @@ const DatePicker = _ref => {
|
|
|
299
305
|
opacity: hasActiveOutline ? labeled : 1
|
|
300
306
|
}],
|
|
301
307
|
numberOfLines: 1
|
|
302
|
-
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
303
|
-
...leftIconProps,
|
|
308
|
+
}, label)) : null, leftIconName && leftIconMode === "inset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
304
309
|
style: {
|
|
305
310
|
...leftIconStyle,
|
|
306
311
|
marginLeft: type === "solid" ? 16 : 0
|
|
307
312
|
}
|
|
308
|
-
}) : null, /*#__PURE__*/React.createElement(NativeTextInput, {
|
|
313
|
+
})) : null, /*#__PURE__*/React.createElement(NativeTextInput, _extends({
|
|
309
314
|
value: formatDate(),
|
|
310
315
|
placeholder: label ? placeholder1 : placeholder,
|
|
311
316
|
editable: !disabled,
|
|
@@ -314,9 +319,8 @@ const DatePicker = _ref => {
|
|
|
314
319
|
onFocus: _handleFocus,
|
|
315
320
|
onBlur: _handleBlur,
|
|
316
321
|
underlineColorAndroid: "transparent",
|
|
317
|
-
style: [inputStyles, textStyles]
|
|
318
|
-
|
|
319
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
322
|
+
style: [inputStyles, textStyles]
|
|
323
|
+
}, props))), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
320
324
|
name: rightIconName,
|
|
321
325
|
size: ICON_SIZE,
|
|
322
326
|
color: colors.light,
|
|
@@ -387,22 +391,4 @@ const styles = StyleSheet.create({
|
|
|
387
391
|
alignSelf: "flex-end"
|
|
388
392
|
}
|
|
389
393
|
});
|
|
390
|
-
export default withTheme(DatePicker);yContent: "center",
|
|
391
|
-
textAlignVertical: "center",
|
|
392
|
-
margin: 0,
|
|
393
|
-
textAlign: I18nManager.isRTL ? "right" : "left"
|
|
394
|
-
},
|
|
395
|
-
placeholder: {
|
|
396
|
-
position: "absolute",
|
|
397
|
-
left: 0
|
|
398
|
-
},
|
|
399
|
-
pickerContainer: {
|
|
400
|
-
flexDirection: "column",
|
|
401
|
-
width: "100%",
|
|
402
|
-
zIndex: 100
|
|
403
|
-
},
|
|
404
|
-
closeButton: {
|
|
405
|
-
alignSelf: "flex-end"
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
394
|
export default withTheme(DatePicker);
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { ActivityIndicator, View, Text, StyleSheet, Pressable } from "react-native";
|
|
3
4
|
import color from "color";
|
|
@@ -74,8 +75,7 @@ const Button = _ref => {
|
|
|
74
75
|
elevation,
|
|
75
76
|
alignSelf: "stretch"
|
|
76
77
|
}
|
|
77
|
-
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
78
|
-
...rest,
|
|
78
|
+
}, /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
|
|
79
79
|
onPress: onPress,
|
|
80
80
|
accessibilityState: {
|
|
81
81
|
disabled
|
|
@@ -83,7 +83,7 @@ const Button = _ref => {
|
|
|
83
83
|
accessibilityRole: "button",
|
|
84
84
|
disabled: disabled || loading,
|
|
85
85
|
style: [styles.button, buttonStyle]
|
|
86
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
87
87
|
style: styles.content
|
|
88
88
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
89
89
|
style: iconStyle
|
|
@@ -114,22 +114,4 @@ const styles = StyleSheet.create({
|
|
|
114
114
|
width: Config.buttonIconSize
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
export default withTheme(Button);: 1,
|
|
118
|
-
style: [textStyle, typography.button]
|
|
119
|
-
}, children))));
|
|
120
|
-
};
|
|
121
|
-
const styles = StyleSheet.create({
|
|
122
|
-
button: {
|
|
123
|
-
minWidth: 64,
|
|
124
|
-
borderStyle: "solid"
|
|
125
|
-
},
|
|
126
|
-
content: {
|
|
127
|
-
flexDirection: "row",
|
|
128
|
-
alignItems: "center",
|
|
129
|
-
justifyContent: "center"
|
|
130
|
-
},
|
|
131
|
-
icon: {
|
|
132
|
-
width: Config.buttonIconSize
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
117
|
export default withTheme(Button);
|
|
@@ -1,4 +1,3 @@
|
|
|
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
1
|
import * as React from "react";
|
|
3
2
|
import { ActivityIndicator, View, StyleSheet, Pressable } from "react-native";
|
|
4
3
|
import color from "color";
|
|
@@ -97,7 +96,8 @@ const FAB = _ref => {
|
|
|
97
96
|
style: [{
|
|
98
97
|
elevation
|
|
99
98
|
}, style]
|
|
100
|
-
}, /*#__PURE__*/React.createElement(Pressable,
|
|
99
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
100
|
+
...rest,
|
|
101
101
|
onPress: onPress,
|
|
102
102
|
accessibilityState: {
|
|
103
103
|
disabled
|
|
@@ -105,7 +105,7 @@ const FAB = _ref => {
|
|
|
105
105
|
accessibilityRole: "button",
|
|
106
106
|
disabled: disabled || loading,
|
|
107
107
|
style: buttonStyles
|
|
108
|
-
}
|
|
108
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
109
109
|
style: styles.content
|
|
110
110
|
}, icon && loading !== true ? /*#__PURE__*/React.createElement(View, {
|
|
111
111
|
style: iconStyle
|
|
@@ -144,4 +144,24 @@ const styles = StyleSheet.create({
|
|
|
144
144
|
borderRadius: 0
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
|
+
export default withTheme(FAB);le: "solid"
|
|
148
|
+
},
|
|
149
|
+
content: {
|
|
150
|
+
flexDirection: "row",
|
|
151
|
+
alignItems: "center",
|
|
152
|
+
justifyContent: "center"
|
|
153
|
+
},
|
|
154
|
+
icon: {
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
justifyContent: "center",
|
|
157
|
+
width: Config.buttonIconSize
|
|
158
|
+
},
|
|
159
|
+
fixed: {
|
|
160
|
+
left: 0,
|
|
161
|
+
right: 0,
|
|
162
|
+
bottom: 0,
|
|
163
|
+
height: 64,
|
|
164
|
+
borderRadius: 0
|
|
165
|
+
}
|
|
166
|
+
});
|
|
147
167
|
export default withTheme(FAB);
|
|
@@ -46,6 +46,7 @@ const FieldSearchBarFull = _ref => {
|
|
|
46
46
|
lineHeight,
|
|
47
47
|
...typeStyles
|
|
48
48
|
} = typography.body2; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
49
|
+
|
|
49
50
|
const handleChangeText = newValue => {
|
|
50
51
|
setInternalValue(newValue);
|
|
51
52
|
if (onChange) {
|
|
@@ -83,4 +84,4 @@ const styles = StyleSheet.create({
|
|
|
83
84
|
alignItems: "center"
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
|
-
export default withTheme(FieldSearchBarFull)
|
|
87
|
+
export default withTheme(FieldSearchBarFull);
|
|
@@ -1,4 +1,3 @@
|
|
|
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
1
|
import * as React from "react";
|
|
3
2
|
import { Text, StyleSheet } from "react-native";
|
|
4
3
|
import { extractStyles } from "../utilities";
|
|
@@ -17,11 +16,27 @@ export default function FormRow(_ref) {
|
|
|
17
16
|
textStyles,
|
|
18
17
|
viewStyles
|
|
19
18
|
} = extractStyles(style);
|
|
20
|
-
return /*#__PURE__*/React.createElement(Touchable,
|
|
19
|
+
return /*#__PURE__*/React.createElement(Touchable, {
|
|
21
20
|
disabled: disabled,
|
|
22
21
|
onPress: onPress,
|
|
23
22
|
style: [styles.row, {
|
|
24
23
|
flexDirection: direction
|
|
24
|
+
}, viewStyles],
|
|
25
|
+
...rest
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
27
|
+
style: textStyles
|
|
28
|
+
}, label), children);
|
|
29
|
+
}
|
|
30
|
+
const styles = StyleSheet.create({
|
|
31
|
+
row: {
|
|
32
|
+
marginLeft: 8,
|
|
33
|
+
marginRight: 8,
|
|
34
|
+
flexDirection: "row",
|
|
35
|
+
justifyContent: "space-between",
|
|
36
|
+
alignItems: "center"
|
|
37
|
+
}
|
|
38
|
+
});styles.row, {
|
|
39
|
+
flexDirection: direction
|
|
25
40
|
}, viewStyles]
|
|
26
41
|
}, rest), /*#__PURE__*/React.createElement(Text, {
|
|
27
42
|
style: textStyles
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
/* README: Internal Image component used for stuff like Card. DO NOT EXPORT! */
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { Image as NativeImage, StyleSheet } from "react-native";
|
|
@@ -55,24 +56,7 @@ const Image = _ref2 => {
|
|
|
55
56
|
height,
|
|
56
57
|
aspectRatio
|
|
57
58
|
}]
|
|
58
|
-
}, /*#__PURE__*/React.createElement(NativeImage, {
|
|
59
|
-
...props,
|
|
60
|
-
source: imageSource,
|
|
61
|
-
resizeMode: resizeMode,
|
|
62
|
-
style: [style, {
|
|
63
|
-
height: "100%",
|
|
64
|
-
width: "100%"
|
|
65
|
-
}]
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
return /*#__PURE__*/React.createElement(NativeImage, {
|
|
69
|
-
...props,
|
|
70
|
-
source: source,
|
|
71
|
-
resizeMode: resizeMode,
|
|
72
|
-
style: style
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
export default Image;eImage, _extends({}, props, {
|
|
59
|
+
}, /*#__PURE__*/React.createElement(NativeImage, _extends({}, props, {
|
|
76
60
|
source: imageSource,
|
|
77
61
|
resizeMode: resizeMode,
|
|
78
62
|
style: [style, {
|
|
@@ -37,6 +37,7 @@ const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
|
37
37
|
const disabledColor = "rgb(240, 240, 240)";
|
|
38
38
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
39
39
|
const Picker = _ref => {
|
|
40
|
+
var _find$label, _find;
|
|
40
41
|
let {
|
|
41
42
|
error,
|
|
42
43
|
options = [],
|
|
@@ -58,7 +59,6 @@ const Picker = _ref => {
|
|
|
58
59
|
rightIconName,
|
|
59
60
|
type = "solid"
|
|
60
61
|
} = _ref;
|
|
61
|
-
var _a, _b;
|
|
62
62
|
const androidPickerRef = React.useRef(undefined);
|
|
63
63
|
const [internalValue, setInternalValue] = React.useState(value || defaultValue);
|
|
64
64
|
const [pickerVisible, setPickerVisible] = React.useState(false);
|
|
@@ -76,9 +76,9 @@ const Picker = _ref => {
|
|
|
76
76
|
}
|
|
77
77
|
}, [defaultValue]);
|
|
78
78
|
React.useEffect(() => {
|
|
79
|
-
var _a;
|
|
80
79
|
if (pickerVisible && androidPickerRef.current) {
|
|
81
|
-
|
|
80
|
+
var _androidPickerRef$cur;
|
|
81
|
+
androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
|
|
82
82
|
}
|
|
83
83
|
}, [pickerVisible, androidPickerRef]);
|
|
84
84
|
const normalizedOptions = normalizeOptions(options);
|
|
@@ -128,7 +128,7 @@ const Picker = _ref => {
|
|
|
128
128
|
...extractedMarginStyles
|
|
129
129
|
};
|
|
130
130
|
const stylesWithoutBordersAndMargins = omit(viewStyles, [...borderStyleNames, ...marginStyleNames, ...additionalBorderStyles, ...additionalMarginStyles]);
|
|
131
|
-
const selectedLabel = internalValue && ((
|
|
131
|
+
const selectedLabel = internalValue && ((_find$label = (_find = pickerOptions.find(option => option.value === internalValue)) === null || _find === void 0 ? void 0 : _find.label) !== null && _find$label !== void 0 ? _find$label : internalValue);
|
|
132
132
|
const labelText = label ? /*#__PURE__*/React.createElement(Text, {
|
|
133
133
|
style: {
|
|
134
134
|
textAlign: textStyles.textAlign,
|
|
@@ -314,10 +314,4 @@ const styles = StyleSheet.create({
|
|
|
314
314
|
maxHeight: deviceHeight
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
|
-
export default withTheme(Picker);bottom: 0,
|
|
318
|
-
width: "100%",
|
|
319
|
-
maxWidth: deviceWidth,
|
|
320
|
-
maxHeight: deviceHeight
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
317
|
export default withTheme(Picker);
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet } from "react-native";
|
|
3
4
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
@@ -10,6 +11,7 @@ import TextField from "../TextField";
|
|
|
10
11
|
import Touchable from "../Touchable";
|
|
11
12
|
import { extractStyles } from "../../utilities";
|
|
12
13
|
const Picker = _ref => {
|
|
14
|
+
var _options$find$label, _options$find;
|
|
13
15
|
let {
|
|
14
16
|
Icon,
|
|
15
17
|
style,
|
|
@@ -23,7 +25,6 @@ const Picker = _ref => {
|
|
|
23
25
|
},
|
|
24
26
|
...props
|
|
25
27
|
} = _ref;
|
|
26
|
-
var _a, _b;
|
|
27
28
|
const {
|
|
28
29
|
viewStyles: {
|
|
29
30
|
borderRadius,
|
|
@@ -64,24 +65,26 @@ const Picker = _ref => {
|
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
67
|
-
const selectedLabel = selectedValue && ((
|
|
68
|
+
const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
|
|
68
69
|
return /*#__PURE__*/React.createElement(View, {
|
|
69
70
|
style: [styles.container, viewStyles]
|
|
70
71
|
}, /*#__PURE__*/React.createElement(Touchable, {
|
|
71
72
|
disabled: disabled,
|
|
72
73
|
onPress: toggleVisibility
|
|
73
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
74
|
-
...props,
|
|
74
|
+
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
75
75
|
value: String(selectedLabel),
|
|
76
|
-
placeholder: placeholder
|
|
76
|
+
placeholder: placeholder
|
|
77
77
|
// @ts-ignore
|
|
78
|
-
|
|
78
|
+
,
|
|
79
|
+
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
80
|
+
,
|
|
79
81
|
disabled: disabled,
|
|
80
|
-
pointerEvents: "none"
|
|
82
|
+
pointerEvents: "none"
|
|
81
83
|
// @ts-expect-error
|
|
84
|
+
,
|
|
82
85
|
style: stylesWithoutMargin,
|
|
83
86
|
Icon: Icon
|
|
84
|
-
})), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
87
|
+
}))), pickerVisible && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
85
88
|
style: [styles.picker, {
|
|
86
89
|
backgroundColor: colors.divider
|
|
87
90
|
}]
|
|
@@ -125,32 +128,4 @@ const styles = StyleSheet.create({
|
|
|
125
128
|
alignSelf: "flex-end"
|
|
126
129
|
}
|
|
127
130
|
});
|
|
128
|
-
export default withTheme(Picker);nValueChange
|
|
129
|
-
}, options.map(o => /*#__PURE__*/React.createElement(NativePicker.Item, {
|
|
130
|
-
label: o.label,
|
|
131
|
-
value: o.value,
|
|
132
|
-
key: o.value
|
|
133
|
-
})))))));
|
|
134
|
-
};
|
|
135
|
-
const styles = StyleSheet.create({
|
|
136
|
-
container: {
|
|
137
|
-
alignSelf: "stretch"
|
|
138
|
-
},
|
|
139
|
-
picker: {
|
|
140
|
-
position: "absolute",
|
|
141
|
-
bottom: 0,
|
|
142
|
-
left: 0,
|
|
143
|
-
right: 0,
|
|
144
|
-
flexDirection: "row",
|
|
145
|
-
justifyContent: "center"
|
|
146
|
-
},
|
|
147
|
-
pickerContainer: {
|
|
148
|
-
backgroundColor: "white",
|
|
149
|
-
flexDirection: "column",
|
|
150
|
-
width: "100%"
|
|
151
|
-
},
|
|
152
|
-
closeButton: {
|
|
153
|
-
alignSelf: "flex-end"
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
131
|
export default withTheme(Picker);
|
|
@@ -1,3 +1,4 @@
|
|
|
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); }
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { View, StyleSheet } from "react-native";
|
|
3
4
|
import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
@@ -7,6 +8,7 @@ import { extractStyles } from "../../utilities";
|
|
|
7
8
|
import TextField from "../TextField";
|
|
8
9
|
import Touchable from "../Touchable";
|
|
9
10
|
const Picker = _ref => {
|
|
11
|
+
var _options$find$label, _options$find;
|
|
10
12
|
let {
|
|
11
13
|
style,
|
|
12
14
|
options,
|
|
@@ -16,7 +18,6 @@ const Picker = _ref => {
|
|
|
16
18
|
onValueChange: onValueChangeOverride = () => {},
|
|
17
19
|
...props
|
|
18
20
|
} = _ref;
|
|
19
|
-
var _a, _b;
|
|
20
21
|
const {
|
|
21
22
|
viewStyles: {
|
|
22
23
|
borderRadius,
|
|
@@ -61,7 +62,7 @@ const Picker = _ref => {
|
|
|
61
62
|
};
|
|
62
63
|
|
|
63
64
|
const stylesWithoutMargin = style && omit(StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
64
|
-
const selectedLabel = selectedValue && ((
|
|
65
|
+
const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
|
|
65
66
|
return /*#__PURE__*/React.createElement(Touchable, {
|
|
66
67
|
disabled: disabled,
|
|
67
68
|
onPress: toggleFocus,
|
|
@@ -84,25 +85,6 @@ const Picker = _ref => {
|
|
|
84
85
|
label: o.label,
|
|
85
86
|
value: o.value,
|
|
86
87
|
key: o.value
|
|
87
|
-
}))), /*#__PURE__*/React.createElement(View, {
|
|
88
|
-
pointerEvents: "none"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(TextField, {
|
|
90
|
-
...props,
|
|
91
|
-
value: selectedLabel,
|
|
92
|
-
placeholder: placeholder,
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
ref: textField,
|
|
95
|
-
disabled: disabled,
|
|
96
|
-
// @ts-expect-error
|
|
97
|
-
style: stylesWithoutMargin
|
|
98
|
-
}))));
|
|
99
|
-
};
|
|
100
|
-
const styles = StyleSheet.create({
|
|
101
|
-
container: {
|
|
102
|
-
alignSelf: "stretch"
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
export default withTheme(Picker);y: o.value
|
|
106
88
|
}))), /*#__PURE__*/React.createElement(View, {
|
|
107
89
|
pointerEvents: "none"
|
|
108
90
|
}, /*#__PURE__*/React.createElement(TextField, _extends({}, props, {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
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); }
|
|
4
1
|
import * as React from "react";
|
|
5
2
|
import PortalConsumer from "./PortalConsumer";
|
|
6
3
|
import PortalHost, { PortalContext } from "./PortalHost";
|
|
@@ -26,6 +23,34 @@ import { ThemeProvider, withTheme } from "../../theming";
|
|
|
26
23
|
* }
|
|
27
24
|
* ```
|
|
28
25
|
*/
|
|
26
|
+
class Portal extends React.Component {
|
|
27
|
+
render() {
|
|
28
|
+
const {
|
|
29
|
+
children,
|
|
30
|
+
theme
|
|
31
|
+
} = this.props;
|
|
32
|
+
return /*#__PURE__*/React.createElement(PortalContext.Consumer, null, manager => /*#__PURE__*/React.createElement(PortalConsumer, {
|
|
33
|
+
manager: manager
|
|
34
|
+
}, /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
35
|
+
theme: theme
|
|
36
|
+
}, children)));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// @component ./PortalHost.tsx
|
|
40
|
+
Portal.Host = PortalHost;
|
|
41
|
+
export default withTheme(Portal);rt { Portal, Text } from 'react-native-paper';
|
|
42
|
+
*
|
|
43
|
+
* export default class MyComponent extends React.Component {
|
|
44
|
+
* render() {
|
|
45
|
+
* return (
|
|
46
|
+
* <Portal>
|
|
47
|
+
* <Text>This is rendered at a different place</Text>
|
|
48
|
+
* </Portal>
|
|
49
|
+
* );
|
|
50
|
+
* }
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
29
54
|
class Portal extends React.Component {
|
|
30
55
|
// @component ./PortalHost.tsx
|
|
31
56
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
-
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); }
|
|
4
1
|
import * as React from "react";
|
|
5
2
|
import { View, StyleSheet } from "react-native";
|
|
6
3
|
import PortalManager from "./PortalManager";
|
|
7
4
|
export const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Portal host renders all of its children `Portal` elements.
|
|
11
7
|
* For example, you can wrap a screen in `Portal.Host` to render items above the screen.
|
|
@@ -33,10 +29,10 @@ export const PortalContext = /*#__PURE__*/React.createContext(null);
|
|
|
33
29
|
export default class PortalHost extends React.Component {
|
|
34
30
|
constructor() {
|
|
35
31
|
super(...arguments);
|
|
36
|
-
|
|
32
|
+
this.setManager = manager => {
|
|
37
33
|
this.manager = manager;
|
|
38
|
-
}
|
|
39
|
-
|
|
34
|
+
};
|
|
35
|
+
this.mount = children => {
|
|
40
36
|
const key = this.nextKey++;
|
|
41
37
|
if (this.manager) {
|
|
42
38
|
this.manager.mount(key, children);
|
|
@@ -48,8 +44,8 @@ export default class PortalHost extends React.Component {
|
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
46
|
return key;
|
|
51
|
-
}
|
|
52
|
-
|
|
47
|
+
};
|
|
48
|
+
this.update = (key, children) => {
|
|
53
49
|
if (this.manager) {
|
|
54
50
|
this.manager.update(key, children);
|
|
55
51
|
} else {
|
|
@@ -66,8 +62,8 @@ export default class PortalHost extends React.Component {
|
|
|
66
62
|
this.queue.push(op);
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
65
|
+
};
|
|
66
|
+
this.unmount = key => {
|
|
71
67
|
if (this.manager) {
|
|
72
68
|
this.manager.unmount(key);
|
|
73
69
|
} else {
|
|
@@ -76,10 +72,9 @@ export default class PortalHost extends React.Component {
|
|
|
76
72
|
key
|
|
77
73
|
});
|
|
78
74
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
_defineProperty(this, "manager", void 0);
|
|
75
|
+
};
|
|
76
|
+
this.nextKey = 0;
|
|
77
|
+
this.queue = [];
|
|
83
78
|
}
|
|
84
79
|
componentDidMount() {
|
|
85
80
|
const manager = this.manager;
|
|
@@ -117,6 +112,41 @@ export default class PortalHost extends React.Component {
|
|
|
117
112
|
}));
|
|
118
113
|
}
|
|
119
114
|
}
|
|
115
|
+
PortalHost.displayName = "Portal.Host";
|
|
116
|
+
const styles = StyleSheet.create({
|
|
117
|
+
container: {
|
|
118
|
+
flex: 1
|
|
119
|
+
}
|
|
120
|
+
}); switch (action.type) {
|
|
121
|
+
case "mount":
|
|
122
|
+
manager.mount(action.key, action.children);
|
|
123
|
+
break;
|
|
124
|
+
case "update":
|
|
125
|
+
manager.update(action.key, action.children);
|
|
126
|
+
break;
|
|
127
|
+
case "unmount":
|
|
128
|
+
manager.unmount(action.key);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
return /*#__PURE__*/React.createElement(PortalContext.Provider, {
|
|
136
|
+
value: {
|
|
137
|
+
mount: this.mount,
|
|
138
|
+
update: this.update,
|
|
139
|
+
unmount: this.unmount
|
|
140
|
+
}
|
|
141
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
142
|
+
style: styles.container,
|
|
143
|
+
collapsable: false,
|
|
144
|
+
pointerEvents: "box-none"
|
|
145
|
+
}, this.props.children), /*#__PURE__*/React.createElement(PortalManager, {
|
|
146
|
+
ref: this.setManager
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
120
150
|
_defineProperty(PortalHost, "displayName", "Portal.Host");
|
|
121
151
|
const styles = StyleSheet.create({
|
|
122
152
|
container: {
|