@draftbit/core 48.4.8-f6d6b8.2 → 48.4.8-fa5021.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/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Provider.js +10 -0
- package/src/Provider.js.map +1 -0
- package/src/components/AccordionGroup.js +45 -0
- package/src/components/AccordionGroup.js.map +1 -0
- package/src/components/ActionSheet/ActionSheet.js +46 -0
- package/src/components/ActionSheet/ActionSheet.js.map +1 -0
- package/src/components/ActionSheet/ActionSheetCancel.js +7 -0
- package/src/components/ActionSheet/ActionSheetCancel.js.map +1 -0
- package/src/components/ActionSheet/ActionSheetItem.js +31 -0
- package/src/components/ActionSheet/ActionSheetItem.js.map +1 -0
- package/src/components/ActionSheet/index.js +4 -0
- package/src/components/ActionSheet/index.js.map +1 -0
- package/src/components/AspectRatio.js +19 -0
- package/src/components/AspectRatio.js.map +1 -0
- package/src/components/BottomSheet/BottomSheet.js +72 -0
- package/src/components/BottomSheet/BottomSheet.js.map +1 -0
- package/src/components/BottomSheet/BottomSheetComponent.js +438 -0
- package/src/components/BottomSheet/BottomSheetComponent.js.map +1 -0
- package/src/components/BottomSheet/index.js +2 -0
- package/src/components/BottomSheet/index.js.map +1 -0
- package/src/components/Button.js +121 -0
- package/src/components/Button.js.map +1 -0
- package/src/components/Checkbox/Checkbox.js +63 -0
- package/src/components/Checkbox/Checkbox.js.map +1 -0
- package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
- package/src/components/Checkbox/CheckboxGroupRow.js.map +1 -0
- package/src/components/Checkbox/CheckboxRow.js +78 -0
- package/src/components/Checkbox/CheckboxRow.js.map +1 -0
- package/src/components/Checkbox/context.js +15 -0
- package/src/components/Checkbox/context.js.map +1 -0
- package/src/components/Checkbox/index.js +3 -0
- package/src/components/Checkbox/index.js.map +1 -0
- package/src/components/Config.js +65 -0
- package/src/components/Config.js.map +1 -0
- package/src/components/DatePicker/DatePicker.js +384 -0
- package/src/components/DatePicker/DatePicker.js.map +1 -0
- package/src/components/DatePicker/DatePickerComponent.js +14 -0
- package/src/components/DatePicker/DatePickerComponent.js.map +1 -0
- package/src/components/DatePicker/DatePickerComponent.web.js +31 -0
- package/src/components/DatePicker/DatePickerComponent.web.js.map +1 -0
- package/src/components/DatePicker/DatePickerComponentType.js +2 -0
- package/src/components/DatePicker/DatePickerComponentType.js.map +1 -0
- package/src/components/DeckSwiper/DeckSwiper.js +91 -0
- package/src/components/DeckSwiper/DeckSwiper.js.map +1 -0
- package/src/components/DeckSwiper/DeckSwiperCard.js +21 -0
- package/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -0
- package/src/components/DeckSwiper/index.js +3 -0
- package/src/components/DeckSwiper/index.js.map +1 -0
- package/src/components/Divider.js +14 -0
- package/src/components/Divider.js.map +1 -0
- package/src/components/Elevation.js +21 -0
- package/src/components/Elevation.js.map +1 -0
- package/src/components/FormRow.js +20 -0
- package/src/components/FormRow.js.map +1 -0
- package/src/components/IconButton.js +36 -0
- package/src/components/IconButton.js.map +1 -0
- package/src/components/Image.js +48 -0
- package/src/components/Image.js.map +1 -0
- package/src/components/Layout/AspectRatio.js +7 -0
- package/src/components/Layout/AspectRatio.js.map +1 -0
- package/src/components/Layout/Center.js +15 -0
- package/src/components/Layout/Center.js.map +1 -0
- package/src/components/Layout/Circle.js +16 -0
- package/src/components/Layout/Circle.js.map +1 -0
- package/src/components/Layout/HStack.js +12 -0
- package/src/components/Layout/HStack.js.map +1 -0
- package/src/components/Layout/LayoutCommon.js +8 -0
- package/src/components/Layout/LayoutCommon.js.map +1 -0
- package/src/components/Layout/Spacer.js +15 -0
- package/src/components/Layout/Spacer.js.map +1 -0
- package/src/components/Layout/Square.js +25 -0
- package/src/components/Layout/Square.js.map +1 -0
- package/src/components/Layout/VStack.js +12 -0
- package/src/components/Layout/VStack.js.map +1 -0
- package/src/components/Layout/ZStack.js +20 -0
- package/src/components/Layout/ZStack.js.map +1 -0
- package/src/components/Layout/index.js +9 -0
- package/src/components/Layout/index.js.map +1 -0
- package/src/components/Markdown.js +11 -0
- package/src/components/Markdown.js.map +1 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +2 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js.map +1 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +126 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -0
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +93 -0
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -0
- package/src/components/MediaPlayer/AudioPlayer/index.js +15 -0
- package/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -0
- package/src/components/MediaPlayer/MediaPlaybackWrapper.js +42 -0
- package/src/components/MediaPlayer/MediaPlaybackWrapper.js.map +1 -0
- package/src/components/MediaPlayer/MediaPlayerCommon.js +24 -0
- package/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -0
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +75 -0
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -0
- package/src/components/MediaPlayer/VideoPlayer/index.js +2 -0
- package/src/components/MediaPlayer/VideoPlayer/index.js.map +1 -0
- package/src/components/NumberInput.js +60 -0
- package/src/components/NumberInput.js.map +1 -0
- package/src/components/Picker/Picker.js +288 -0
- package/src/components/Picker/Picker.js.map +1 -0
- package/src/components/Picker/PickerComponent.android.js +70 -0
- package/src/components/Picker/PickerComponent.android.js.map +1 -0
- package/src/components/Picker/PickerComponent.ios.js +80 -0
- package/src/components/Picker/PickerComponent.ios.js.map +1 -0
- package/src/components/Picker/PickerComponent.web.js +71 -0
- package/src/components/Picker/PickerComponent.web.js.map +1 -0
- package/src/components/Picker/PickerTypes.js +2 -0
- package/src/components/Picker/PickerTypes.js.map +1 -0
- package/src/components/PinInput/CustomPinInputCell.js +11 -0
- package/src/components/PinInput/CustomPinInputCell.js.map +1 -0
- package/src/components/PinInput/PinInput.js +70 -0
- package/src/components/PinInput/PinInput.js.map +1 -0
- package/src/components/PinInput/PinInputText.js +14 -0
- package/src/components/PinInput/PinInputText.js.map +1 -0
- package/src/components/PinInput/index.js +4 -0
- package/src/components/PinInput/index.js.map +1 -0
- package/src/components/Portal/Portal.js +36 -0
- package/src/components/Portal/Portal.js.map +1 -0
- package/src/components/Portal/PortalConsumer.js +28 -0
- package/src/components/Portal/PortalConsumer.js.map +1 -0
- package/src/components/Portal/PortalHost.js +108 -0
- package/src/components/Portal/PortalHost.js.map +1 -0
- package/src/components/Portal/PortalManager.js +33 -0
- package/src/components/Portal/PortalManager.js.map +1 -0
- package/src/components/Pressable.js +13 -0
- package/src/components/Pressable.js.map +1 -0
- package/src/components/Progress/CircularProgress/CircularProgress.js +103 -0
- package/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -0
- package/src/components/Progress/CircularProgress/index.js +14 -0
- package/src/components/Progress/CircularProgress/index.js.map +1 -0
- package/src/components/Progress/IndeterminateProgress.js +39 -0
- package/src/components/Progress/IndeterminateProgress.js.map +1 -0
- package/src/components/Progress/LinearProgress/LinearProgress.js +56 -0
- package/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -0
- package/src/components/Progress/LinearProgress/index.js +14 -0
- package/src/components/Progress/LinearProgress/index.js.map +1 -0
- package/src/components/Progress/ProgressCommon.js +2 -0
- package/src/components/Progress/ProgressCommon.js.map +1 -0
- package/src/components/ProgressIndicator.js +28 -0
- package/src/components/ProgressIndicator.js.map +1 -0
- package/src/components/RadioButton/RadioButton.js +18 -0
- package/src/components/RadioButton/RadioButton.js.map +1 -0
- package/src/components/RadioButton/RadioButtonGroup.js +44 -0
- package/src/components/RadioButton/RadioButtonGroup.js.map +1 -0
- package/src/components/RadioButton/RadioButtonRow.js +77 -0
- package/src/components/RadioButton/RadioButtonRow.js.map +1 -0
- package/src/components/RadioButton/context.js +15 -0
- package/src/components/RadioButton/context.js.map +1 -0
- package/src/components/RadioButton/index.js +4 -0
- package/src/components/RadioButton/index.js.map +1 -0
- package/src/components/Row.js +49 -0
- package/src/components/Row.js.map +1 -0
- package/src/components/SVG.js +14 -0
- package/src/components/SVG.js.map +1 -0
- package/src/components/ScreenContainer.js +36 -0
- package/src/components/ScreenContainer.js.map +1 -0
- package/src/components/SectionList/SectionHeader.js +14 -0
- package/src/components/SectionList/SectionHeader.js.map +1 -0
- package/src/components/SectionList/SectionList.js +101 -0
- package/src/components/SectionList/SectionList.js.map +1 -0
- package/src/components/SectionList/index.js +3 -0
- package/src/components/SectionList/index.js.map +1 -0
- package/src/components/Shadow.js +26 -0
- package/src/components/Shadow.js.map +1 -0
- package/src/components/Slider.js +64 -0
- package/src/components/Slider.js.map +1 -0
- package/src/components/StarRating.js +51 -0
- package/src/components/StarRating.js.map +1 -0
- package/src/components/StepIndicator.js +347 -0
- package/src/components/StepIndicator.js.map +1 -0
- package/src/components/Stepper.js +42 -0
- package/src/components/Stepper.js.map +1 -0
- package/src/components/Surface.js +33 -0
- package/src/components/Surface.js.map +1 -0
- package/src/components/SwipeableItem/SwipeableItem.js +119 -0
- package/src/components/SwipeableItem/SwipeableItem.js.map +1 -0
- package/src/components/SwipeableItem/SwipeableItemButton.js +6 -0
- package/src/components/SwipeableItem/SwipeableItemButton.js.map +1 -0
- package/src/components/SwipeableItem/SwipeableItemCommon.js +44 -0
- package/src/components/SwipeableItem/SwipeableItemCommon.js.map +1 -0
- package/src/components/SwipeableItem/SwipeableList.js +29 -0
- package/src/components/SwipeableItem/SwipeableList.js.map +1 -0
- package/src/components/SwipeableItem/index.js +4 -0
- package/src/components/SwipeableItem/index.js.map +1 -0
- package/src/components/Swiper/Swiper.js +74 -0
- package/src/components/Swiper/Swiper.js.map +1 -0
- package/src/components/Swiper/SwiperItem.js +10 -0
- package/src/components/Swiper/SwiperItem.js.map +1 -0
- package/src/components/Swiper/index.js +3 -0
- package/src/components/Swiper/index.js.map +1 -0
- package/src/components/Switch.js +57 -0
- package/src/components/Switch.js.map +1 -0
- package/src/components/TabView/TabView.js +55 -0
- package/src/components/TabView/TabView.js.map +1 -0
- package/src/components/TabView/TabViewItem.js +12 -0
- package/src/components/TabView/TabViewItem.js.map +1 -0
- package/src/components/TabView/index.js +3 -0
- package/src/components/TabView/index.js.map +1 -0
- package/src/components/Table/Table.js +94 -0
- package/src/components/Table/Table.js.map +1 -0
- package/src/components/Table/TableCell.js +34 -0
- package/src/components/Table/TableCell.js.map +1 -0
- package/src/components/Table/TableCommon.js +13 -0
- package/src/components/Table/TableCommon.js.map +1 -0
- package/src/components/Table/TableRow.js +40 -0
- package/src/components/Table/TableRow.js.map +1 -0
- package/src/components/Table/index.js +4 -0
- package/src/components/Table/index.js.map +1 -0
- package/src/components/Text.js +34 -0
- package/src/components/Text.js.map +1 -0
- package/src/components/TextField.js +430 -0
- package/src/components/TextField.js.map +1 -0
- package/src/components/TextInput.js +15 -0
- package/src/components/TextInput.js.map +1 -0
- package/src/components/Touchable.js +13 -0
- package/src/components/Touchable.js.map +1 -0
- package/src/components/Touchable.web.js +3 -0
- package/src/components/Touchable.web.js.map +1 -0
- package/src/components/Typography.js +37 -0
- package/src/components/Typography.js.map +1 -0
- package/src/components/YoutubePlayer/YoutubePlayer.js +21 -0
- package/src/components/YoutubePlayer/YoutubePlayer.js.map +1 -0
- package/src/components/YoutubePlayer/YoutubePlayer.native.js +10 -0
- package/src/components/YoutubePlayer/YoutubePlayer.native.js.map +1 -0
- package/src/components/YoutubePlayer/YoutubePlayerProps.js +2 -0
- package/src/components/YoutubePlayer/YoutubePlayerProps.js.map +1 -0
- package/src/components/YoutubePlayer/index.js +2 -0
- package/src/components/YoutubePlayer/index.js.map +1 -0
- package/src/components/useAuthState.js +35 -0
- package/src/components/useAuthState.js.map +1 -0
- package/src/constants.js +11 -0
- package/src/constants.js.map +1 -0
- package/src/deprecated-components/AccordionItem.js +36 -0
- package/src/deprecated-components/AccordionItem.js.map +1 -0
- package/src/deprecated-components/AnimatedCircularProgress.js +47 -0
- package/src/deprecated-components/AnimatedCircularProgress.js.map +1 -0
- package/src/deprecated-components/AvatarEdit.js +34 -0
- package/src/deprecated-components/AvatarEdit.js.map +1 -0
- package/src/deprecated-components/Banner.js +113 -0
- package/src/deprecated-components/Banner.js.map +1 -0
- package/src/deprecated-components/Card.js +61 -0
- package/src/deprecated-components/Card.js.map +1 -0
- package/src/deprecated-components/CheckboxGroup.js +25 -0
- package/src/deprecated-components/CheckboxGroup.js.map +1 -0
- package/src/deprecated-components/CircleImage.js +12 -0
- package/src/deprecated-components/CircleImage.js.map +1 -0
- package/src/deprecated-components/CircularProgress.js +85 -0
- package/src/deprecated-components/CircularProgress.js.map +1 -0
- package/src/deprecated-components/Container.js +47 -0
- package/src/deprecated-components/Container.js.map +1 -0
- package/src/deprecated-components/DeprecatedButton.js +87 -0
- package/src/deprecated-components/DeprecatedButton.js.map +1 -0
- package/src/deprecated-components/DeprecatedCardWrapper.js +22 -0
- package/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -0
- package/src/deprecated-components/DeprecatedFAB.js +118 -0
- package/src/deprecated-components/DeprecatedFAB.js.map +1 -0
- package/src/deprecated-components/FAB.js +50 -0
- package/src/deprecated-components/FAB.js.map +1 -0
- package/src/deprecated-components/FieldSearchBarFull.js +57 -0
- package/src/deprecated-components/FieldSearchBarFull.js.map +1 -0
- package/src/deprecated-components/Layout.js +69 -0
- package/src/deprecated-components/Layout.js.map +1 -0
- package/src/deprecated-components/ProgressBar.js +122 -0
- package/src/deprecated-components/ProgressBar.js.map +1 -0
- package/src/deprecated-components/ProgressCircle.js +17 -0
- package/src/deprecated-components/ProgressCircle.js.map +1 -0
- package/src/deprecated-components/RadioButtonFieldGroup.js +21 -0
- package/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -0
- package/src/deprecated-components/RowBodyIcon.js +12 -0
- package/src/deprecated-components/RowBodyIcon.js.map +1 -0
- package/src/deprecated-components/RowHeadlineImageCaption.js +16 -0
- package/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -0
- package/src/deprecated-components/RowHeadlineImageIcon.js +18 -0
- package/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -0
- package/src/deprecated-components/ToggleButton.js +43 -0
- package/src/deprecated-components/ToggleButton.js.map +1 -0
- package/src/hooks.js +25 -0
- package/src/hooks.js.map +1 -0
- package/src/index.js +66 -0
- package/src/index.js.map +1 -0
- package/src/interfaces/Icon.js +9 -0
- package/src/interfaces/Icon.js.map +1 -0
- package/src/styles/DarkTheme.js +27 -0
- package/src/styles/DarkTheme.js.map +1 -0
- package/src/styles/DefaultTheme.js +112 -0
- package/src/styles/DefaultTheme.js.map +1 -0
- package/src/styles/fonts.js +63 -0
- package/src/styles/fonts.js.map +1 -0
- package/src/styles/overlay.js +61 -0
- package/src/styles/overlay.js.map +1 -0
- package/src/styles/shadow.js +52 -0
- package/src/styles/shadow.js.map +1 -0
- package/src/theming.js +4 -0
- package/src/theming.js.map +1 -0
- package/src/utilities.js +180 -0
- package/src/utilities.js.map +1 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Path } from "react-native-svg";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import Animated, { useAnimatedProps, useSharedValue, withTiming, } from "react-native-reanimated";
|
|
5
|
+
import { DEFAULT_ANIMATION_DURATION, } from "../ProgressCommon";
|
|
6
|
+
export const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
7
|
+
export const CircularProgress = ({ theme, minimumValue = 0, maximumValue = 100, value = minimumValue, thickness = 10, trackThickness = thickness, color = theme.colors.primary, trackColor = theme.colors.divider, trackOpacity = 1, showTrack = true, animationDuration = DEFAULT_ANIMATION_DURATION, isAnimated = true, lineCap = "round", trackLineCap = lineCap, dashWidth, trackDashWidth, dashGap, trackDashGap, dashOffset, trackDashOffset, customDashArray, trackCustomDashArray, onFullPathWidth, startPosition = "top", style, testID, }) => {
|
|
8
|
+
const [svgContainerWidth, setSvgContainerWidth] = React.useState(0);
|
|
9
|
+
const [circumfrence, setCircumefrence] = React.useState(0);
|
|
10
|
+
const dashArray = dashWidth !== undefined
|
|
11
|
+
? `${dashWidth} ${dashGap || dashWidth}`
|
|
12
|
+
: undefined;
|
|
13
|
+
const trackDashArray = trackDashWidth !== undefined
|
|
14
|
+
? `${trackDashWidth} ${trackDashGap || trackDashWidth}`
|
|
15
|
+
: undefined;
|
|
16
|
+
const maxThickness = Math.max(thickness, trackThickness);
|
|
17
|
+
const thicknessOffset = maxThickness / 2; // This offset guarantees nothing is cut off by view bounds
|
|
18
|
+
const radius = svgContainerWidth / 2;
|
|
19
|
+
const c = 2 * Math.PI * radius;
|
|
20
|
+
if (c !== circumfrence) {
|
|
21
|
+
setCircumefrence(c);
|
|
22
|
+
}
|
|
23
|
+
const startAngle = React.useMemo(() => {
|
|
24
|
+
switch (startPosition) {
|
|
25
|
+
case "top":
|
|
26
|
+
return 0;
|
|
27
|
+
case "right":
|
|
28
|
+
return 90;
|
|
29
|
+
case "bottom":
|
|
30
|
+
return 180;
|
|
31
|
+
case "left":
|
|
32
|
+
return 270;
|
|
33
|
+
}
|
|
34
|
+
}, [startPosition]);
|
|
35
|
+
const currentFillPercentage = value / (maximumValue + minimumValue);
|
|
36
|
+
const currentAngle = useSharedValue(startAngle);
|
|
37
|
+
const progressPathAnimatedProps = useAnimatedProps(() => {
|
|
38
|
+
const isBelowMinAngle = currentAngle.value <= startAngle;
|
|
39
|
+
return {
|
|
40
|
+
d: circlePath(radius, radius, radius - thicknessOffset, startAngle, Math.min(currentAngle.value, startAngle + 360) //Prevents going beyond the max angle
|
|
41
|
+
),
|
|
42
|
+
strokeOpacity: isBelowMinAngle ? 0.0 : 1.0,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
currentAngle.value = withTiming(startAngle + currentFillPercentage * 360, {
|
|
47
|
+
duration: isAnimated ? animationDuration : 0,
|
|
48
|
+
});
|
|
49
|
+
}, [
|
|
50
|
+
value,
|
|
51
|
+
currentFillPercentage,
|
|
52
|
+
animationDuration,
|
|
53
|
+
currentAngle,
|
|
54
|
+
maximumValue,
|
|
55
|
+
minimumValue,
|
|
56
|
+
isAnimated,
|
|
57
|
+
startAngle,
|
|
58
|
+
]);
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
onFullPathWidth === null || onFullPathWidth === void 0 ? void 0 : onFullPathWidth(circumfrence);
|
|
61
|
+
}, [circumfrence, onFullPathWidth]);
|
|
62
|
+
return (React.createElement(View, { onLayout: (event) => {
|
|
63
|
+
const width = event.nativeEvent.layout.width;
|
|
64
|
+
setSvgContainerWidth(width);
|
|
65
|
+
}, style: [
|
|
66
|
+
{
|
|
67
|
+
height: svgContainerWidth,
|
|
68
|
+
},
|
|
69
|
+
style,
|
|
70
|
+
] },
|
|
71
|
+
React.createElement(Svg, { testID: testID !== null && testID !== void 0 ? testID : "circular-progress-component", style: { flex: 1 } },
|
|
72
|
+
showTrack && (React.createElement(Path, { d: circlePath(radius, radius, radius - thicknessOffset, startAngle, startAngle + 360), stroke: trackColor, strokeWidth: trackThickness, strokeOpacity: trackOpacity, strokeLinecap: trackLineCap, strokeDasharray: trackCustomDashArray || trackDashArray, strokeDashoffset: trackDashOffset, fill: "rgba(0,0,0,0)" })),
|
|
73
|
+
React.createElement(AnimatedPath, { animatedProps: progressPathAnimatedProps, stroke: color, strokeWidth: thickness, strokeLinecap: lineCap, strokeDasharray: customDashArray || dashArray, strokeDashoffset: dashOffset, fill: "rgba(0,0,0,0)", onPress: () => { } }))));
|
|
74
|
+
};
|
|
75
|
+
// From: https://github.com/bartgryszko/react-native-circular-progress/blob/a93b501aea40306126c8ede72089741eead52308/src/CircularProgress.js#L15
|
|
76
|
+
function circlePath(x, y, radius, startAngle, endAngle) {
|
|
77
|
+
"worklet"; // Reanimated worklet to be runnable on the UI thread
|
|
78
|
+
function polarToCartesian(centerX, centerY, radius, angleInDegrees) {
|
|
79
|
+
var angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
|
|
80
|
+
return {
|
|
81
|
+
x: centerX + radius * Math.cos(angleInRadians),
|
|
82
|
+
y: centerY + radius * Math.sin(angleInRadians),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
var start = polarToCartesian(x, y, radius, endAngle * 0.9999);
|
|
86
|
+
var end = polarToCartesian(x, y, radius, startAngle);
|
|
87
|
+
var largeArcFlag = endAngle - startAngle <= 180 ? "0" : "1";
|
|
88
|
+
var d = [
|
|
89
|
+
"M",
|
|
90
|
+
start.x,
|
|
91
|
+
start.y,
|
|
92
|
+
"A",
|
|
93
|
+
radius,
|
|
94
|
+
radius,
|
|
95
|
+
0,
|
|
96
|
+
largeArcFlag,
|
|
97
|
+
0,
|
|
98
|
+
end.x,
|
|
99
|
+
end.y,
|
|
100
|
+
];
|
|
101
|
+
return d.join(" ");
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=CircularProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.js","sourceRoot":"","sources":["CircularProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,EAAE,EAAE,IAAI,EAAa,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,QAAQ,EAAE,EACf,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,GAG3B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,gBAAgB,GAEzB,CAAC,EACH,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,YAAY,GAAG,GAAG,EAClB,KAAK,GAAG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ACjB,CAAS,EACT,CAAS,EACT,MAAc,EACd,UAAkB,EAClB,QAAgB;IAEhB,SAAS,CAAC,CAAC,qDAAqD;IAEhE,SAAS,gBAAgB,CACvB,OAAe,EACf,OAAe,EACf,MAAc,EACd,cAAsB;QAEtB,IAAI,cAAc,GAAG,CAAC,CAAC,cAAc,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;QAC/D,OAAO;YACL,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;YAC9C,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;SAC/C,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC;IAC9D,IAAI,GAAG,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,YAAY,GAAG,QAAQ,GAAG,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5D,IAAI,CAAC,GAAG;QACN,GAAG;QACH,KAAK,CAAC,CAAC;QACP,KAAK,CAAC,CAAC;QACP,GAAG;QACH,MAAM;QACN,MAAM;QACN,CAAC;QACD,YAAY;QACZ,CAAC;QACD,GAAG,CAAC,CAAC;QACL,GAAG,CAAC,CAAC;KACN,CAAC;IACF,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import IndeterminateProgress from "../IndeterminateProgress";
|
|
3
|
+
import { CircularProgress as CircularProgressComponent } from "./CircularProgress";
|
|
4
|
+
import { withTheme } from "../../../theming";
|
|
5
|
+
const CircularProgress = (props) => {
|
|
6
|
+
if (props.indeterminate) {
|
|
7
|
+
return (React.createElement(IndeterminateProgress, { ProgressComponent: CircularProgressComponent, ...props }));
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return React.createElement(CircularProgressComponent, { ...props });
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default withTheme(CircularProgress);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAM7D,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,gBAAgB,GAElB,CAAC,KAAK,EAAE,EAAE;IACZ,IAAI,KAAK,CAAC,aAAa,EAAE;QACvB,OAAO,CACL,oBAAC,qBAAqB,IACpB,iBAAiB,EACf,yBAAwE,KAEtE,KAAK,GACT,CACH,CAAC;KACH;SAAM;QACL,OAAO,oBAAC,yBAAyB,OAAK,KAAK,GAAI,CAAC;KACjD;AACH,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { runOnJS, useAnimatedReaction, useSharedValue, withTiming, } from "react-native-reanimated";
|
|
3
|
+
import { DEFAULT_ANIMATION_DURATION, } from "./ProgressCommon";
|
|
4
|
+
const IndeterminateProgress = ({ ProgressComponent, ...rest }) => {
|
|
5
|
+
const [pathWidth, setPathWidth] = React.useState(0);
|
|
6
|
+
const [value, setValue] = React.useState(0);
|
|
7
|
+
const [dashOffset, setDashOffset] = React.useState(0);
|
|
8
|
+
const animationDuration = rest.animationDuration || DEFAULT_ANIMATION_DURATION;
|
|
9
|
+
const currentOffset = useSharedValue(0);
|
|
10
|
+
// dashOffset animation done through state due to it not being a 'native' prop that reanimated can animate on the native thread
|
|
11
|
+
useAnimatedReaction(() => currentOffset.value, (result) => runOnJS(setDashOffset)(result));
|
|
12
|
+
const repeatIndeterminateAnimation = React.useCallback(() => {
|
|
13
|
+
if (value === 0) {
|
|
14
|
+
setValue(100);
|
|
15
|
+
currentOffset.value = withTiming(pathWidth, {
|
|
16
|
+
duration: animationDuration,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
setValue(0);
|
|
21
|
+
currentOffset.value = withTiming(0, {
|
|
22
|
+
duration: animationDuration,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, [currentOffset, value, animationDuration, pathWidth]);
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
const timeout = setTimeout(() => {
|
|
28
|
+
repeatIndeterminateAnimation();
|
|
29
|
+
}, animationDuration);
|
|
30
|
+
return () => clearTimeout(timeout);
|
|
31
|
+
}, [animationDuration, repeatIndeterminateAnimation]);
|
|
32
|
+
return (React.createElement(ProgressComponent, { ...rest, testID: rest.testID || "indeterminate-progress", onFullPathWidth: (width) => {
|
|
33
|
+
var _a;
|
|
34
|
+
setPathWidth(width);
|
|
35
|
+
(_a = rest.onFullPathWidth) === null || _a === void 0 ? void 0 : _a.call(rest, width);
|
|
36
|
+
}, dashOffset: dashOffset, dashGap: pathWidth / 2, dashWidth: pathWidth / 2, animationDuration: animationDuration, minimumValue: 0, maximumValue: 100, value: 100 }));
|
|
37
|
+
};
|
|
38
|
+
export default IndeterminateProgress;
|
|
39
|
+
//# sourceMappingURL=IndeterminateProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndeterminateProgress.js","sourceRoot":"","sources":["IndeterminateProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,OAAO,EACP,m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AC;IAEzD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,4BAA4B,EAAE,CAAC;QACjC,CAAC,EAAE,iBAAiB,CAAC,CAAC;QACtB,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,iBAAiB,EAAE,4BAA4B,CAAC,CAAC,CAAC;IAEtD,OAAO,CACL,oBAAC,iBAAiB,OACZ,IAAI,EACR,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,wBAAwB,EAC/C,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;;YACzB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAA,IAAI,CAAC,eAAe,qDAAG,KAAK,CAAC,CAAC;QAChC,CAAC,EACD,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,SAAS,GAAG,CAAC,EACtB,SAAS,EAAE,SAAS,GAAG,CAAC,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,YAAY,EAAE,CAAC,EACf,YAAY,EAAE,GAAG,EACjB,KAAK,EAAE,GAAG,GACV,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Line } from "react-native-svg";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import Animated, { useAnimatedProps, useSharedValue, withTiming, } from "react-native-reanimated";
|
|
5
|
+
import { DEFAULT_ANIMATION_DURATION, } from "../ProgressCommon";
|
|
6
|
+
export const AnimatedLine = Animated.createAnimatedComponent(Line);
|
|
7
|
+
export const LinearProgress = ({ theme, minimumValue = 0, maximumValue = 100, value = minimumValue, thickness = 10, trackThickness = thickness, color = theme.colors.primary, trackColor = theme.colors.divider, trackOpacity = 1, showTrack = true, animationDuration = DEFAULT_ANIMATION_DURATION, isAnimated = true, lineCap = "round", trackLineCap = lineCap, dashWidth, trackDashWidth, dashGap, trackDashGap, dashOffset, trackDashOffset, customDashArray, trackCustomDashArray, onFullPathWidth, style, testID, }) => {
|
|
8
|
+
const [svgContainerWidth, setSvgContainerWidth] = React.useState(0);
|
|
9
|
+
const dashArray = dashWidth !== undefined
|
|
10
|
+
? `${dashWidth} ${dashGap || dashWidth}`
|
|
11
|
+
: undefined;
|
|
12
|
+
const trackDashArray = trackDashWidth !== undefined
|
|
13
|
+
? `${trackDashWidth} ${trackDashGap || trackDashWidth}`
|
|
14
|
+
: undefined;
|
|
15
|
+
const maxThickness = Math.max(thickness, trackThickness);
|
|
16
|
+
const thicknessOffset = maxThickness / 2; // This offset guarantees nothing is cut off by view bounds
|
|
17
|
+
const progressLineWidth = svgContainerWidth - thicknessOffset;
|
|
18
|
+
const trackProgressLineWidth = svgContainerWidth - thicknessOffset;
|
|
19
|
+
const currentFillPercentage = value / (maximumValue + minimumValue);
|
|
20
|
+
const currentProgressLineWidth = useSharedValue(0);
|
|
21
|
+
const progressLineAnimatedProps = useAnimatedProps(() => {
|
|
22
|
+
const isBelowMinWidth = currentProgressLineWidth.value <= thicknessOffset;
|
|
23
|
+
return {
|
|
24
|
+
x2: Math.min(progressLineWidth, currentProgressLineWidth.value),
|
|
25
|
+
strokeOpacity: isBelowMinWidth ? 0.0 : 1.0,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
currentProgressLineWidth.value = withTiming(progressLineWidth * currentFillPercentage, {
|
|
30
|
+
duration: isAnimated ? animationDuration : 0,
|
|
31
|
+
});
|
|
32
|
+
}, [
|
|
33
|
+
value,
|
|
34
|
+
progressLineWidth,
|
|
35
|
+
currentFillPercentage,
|
|
36
|
+
animationDuration,
|
|
37
|
+
currentProgressLineWidth,
|
|
38
|
+
maximumValue,
|
|
39
|
+
minimumValue,
|
|
40
|
+
isAnimated,
|
|
41
|
+
]);
|
|
42
|
+
return (React.createElement(View, { onLayout: (event) => {
|
|
43
|
+
const width = event.nativeEvent.layout.width;
|
|
44
|
+
setSvgContainerWidth(width);
|
|
45
|
+
onFullPathWidth === null || onFullPathWidth === void 0 ? void 0 : onFullPathWidth(width);
|
|
46
|
+
}, style: [
|
|
47
|
+
{
|
|
48
|
+
height: maxThickness,
|
|
49
|
+
},
|
|
50
|
+
style,
|
|
51
|
+
] },
|
|
52
|
+
React.createElement(Svg, { testID: testID !== null && testID !== void 0 ? testID : "linear-progress-component", style: { flex: 1 } },
|
|
53
|
+
showTrack && (React.createElement(Line, { x1: thicknessOffset, y1: thicknessOffset, x2: trackProgressLineWidth, y2: thicknessOffset, stroke: trackColor, strokeWidth: trackThickness, strokeOpacity: trackOpacity, strokeLinecap: trackLineCap, strokeDasharray: trackCustomDashArray || trackDashArray, strokeDashoffset: trackDashOffset })),
|
|
54
|
+
React.createElement(AnimatedLine, { animatedProps: progressLineAnimatedProps, x1: thicknessOffset, y1: thicknessOffset, y2: thicknessOffset, stroke: color, strokeWidth: thickness, strokeLinecap: lineCap, strokeDasharray: customDashArray || dashArray, strokeDashoffset: dashOffset, onPress: () => { } }))));
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=LinearProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearProgress.js","sourceRoot":"","sources":["LinearProgress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,EAAE,EAAE,IAAI,EAAa,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,QAAQ,EAAE,EACf,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,GAE3B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,YAAY,GAAG,QAAQ,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAEnE,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IACH,EAAE,EAAE,eAAe,EACnB,EAAE,EAAE,eAAe,EACnB,EAAE,EAAE,sBAAsB,EAC1B,EAAE,EAAE,eAAe,EACnB,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,cAAc,EAC3B,aAAa,EAAE,YAAY,EAC3B,aAAa,EAAE,YAAY,EAC3B,eAAe,EAAE,oBAAoB,IAAI,cAAc,EACvD,gBAAgB,EAAE,eAAe,GACjC,CACH;YACD,oBAAC,YAAY,IACX,aAAa,EAAE,yBAAyB,EACxC,EAAE,EAAE,eAAe,EACnB,EAAE,EAAE,eAAe,EACnB,EAAE,EAAE,eAAe,EACnB,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,SAAS,EACtB,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,eAAe,IAAI,SAAS,EAC7C,gBAAgB,EAAE,UAAU,EAC5B,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,GACjB,CACE,CACD,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import IndeterminateProgress from "../IndeterminateProgress";
|
|
3
|
+
import { LinearProgress as LinearProgressComponent } from "./LinearProgress";
|
|
4
|
+
import { withTheme } from "../../../theming";
|
|
5
|
+
const LinearProgress = (props) => {
|
|
6
|
+
if (props.indeterminate) {
|
|
7
|
+
return (React.createElement(IndeterminateProgress, { ProgressComponent: LinearProgressComponent, ...props }));
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return React.createElement(LinearProgressComponent, { ...props });
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default withTheme(LinearProgress);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAK7D,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,cAAc,GAEhB,CAAC,KAAK,EAAE,EAAE;IACZ,IAAI,KAAK,CAAC,aAAa,EAAE;QACvB,OAAO,CACL,oBAAC,qBAAqB,IACpB,iBAAiB,EAAE,uBAAuB,KACtC,KAAK,GACT,CACH,CAAC;KACH;SAAM;QACL,OAAO,oBAAC,uBAAuB,OAAK,KAAK,GAAI,CAAC;KAC/C;AACH,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressCommon.js","sourceRoot":"","sources":["ProgressCommon.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import StepIndicator from "./StepIndicator";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
const ProgressIndicator = ({ numberOfSteps, currentStep, currentStepStrokeWidth = 3, stepStrokeCurrentColor = "primary", stepIndicatorSize, currentStepIndicatorSize, stepIndicatorCurrentColor, stepIndicatorLabelCurrentColor, stepIndicatorLabelFontSize = 12, stepNumberFinishedColor = "strongInverse", stepNumberUnfinishedColor = "primary", unfinishedColor = "light", finishedColor = "primary", theme, }) => {
|
|
5
|
+
const currentPosition = currentStep - 1;
|
|
6
|
+
return (React.createElement(StepIndicator, { stepCount: numberOfSteps, currentPosition: currentPosition, customStyles: {
|
|
7
|
+
stepIndicatorSize,
|
|
8
|
+
currentStepIndicatorSize: currentStepIndicatorSize
|
|
9
|
+
? currentStepIndicatorSize
|
|
10
|
+
: stepIndicatorSize,
|
|
11
|
+
stepStrokeFinishedColor: finishedColor,
|
|
12
|
+
stepStrokeUnFinishedColor: unfinishedColor,
|
|
13
|
+
separatorFinishedColor: finishedColor,
|
|
14
|
+
separatorUnFinishedColor: unfinishedColor,
|
|
15
|
+
stepIndicatorFinishedColor: finishedColor,
|
|
16
|
+
stepIndicatorUnFinishedColor: unfinishedColor,
|
|
17
|
+
currentStepStrokeWidth,
|
|
18
|
+
stepStrokeCurrentColor: stepStrokeCurrentColor || stepIndicatorCurrentColor,
|
|
19
|
+
stepIndicatorLabelUnFinishedColor: stepNumberUnfinishedColor,
|
|
20
|
+
stepIndicatorLabelFinishedColor: stepNumberFinishedColor,
|
|
21
|
+
stepIndicatorCurrentColor: stepIndicatorCurrentColor || unfinishedColor,
|
|
22
|
+
stepIndicatorLabelCurrentColor: stepIndicatorLabelCurrentColor || stepNumberUnfinishedColor,
|
|
23
|
+
stepIndicatorLabelFontSize,
|
|
24
|
+
labelFontFamily: theme.typography.body1.fontFamily,
|
|
25
|
+
} }));
|
|
26
|
+
};
|
|
27
|
+
export default withTheme(ProgressIndicator);
|
|
28
|
+
//# sourceMappingURL=ProgressIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressIndicator.js","sourceRoot":"","sources":["ProgressIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAqBvC,MAAM,iBAAiB,GAA6C,CAAC,EACnE,aAAa,EACb,WAAW,EACX,sBAAsB,GAAG,CAAC,EAC1B,sBAAsB,GAAG,SAAS,EAClC,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,0BAA0B,GAAG,EAAE,EAC/B,uBAAuB,GAAG,eAAe,EACzC,yBAAyB,GAAG,SAAS,EACrC,eAAe,GAAG,OAAO,EACzB,aAAa,GAAG,SAAS,EACzB,KAAK,GACN,EAAE,EAAE;IACH,MAAM,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC;IACxC,OAAO,CACL,oBAAC,aAAa,IACZ,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE;YACZ,iBAAiB;YACjB,wBAAwB,EAAE,wBAAwB;gBAChD,CAAC,CAAC,wBAAwB;gBAC1B,CAAC,CAAC,iBAAiB;YACrB,uBAAuB,EAAE,aAAa;YACtC,yBAAyB,EAAE,eAAe;YAC1C,sBAAsB,EAAE,aAAa;YACrC,wBAAwB,EAAE,eAAe;YACzC,0BAA0B,EAAE,aAAa;YACzC,4BAA4B,EAAE,eAAe;YAC7C,sBAAsB;YACtB,sBAAsB,EACpB,sBAAsB,IAAI,yBAAyB;YACrD,iCAAiC,EAAE,yBAAyB;YAC5D,+BAA+B,EAAE,uBAAuB;YACxD,yBAAyB,EAAE,yBAAyB,IAAI,eAAe;YACvE,8BAA8B,EAC5B,8BAA8B,IAAI,yBAAyB;YAC7D,0BAA0B;YAC1B,eAAe,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU;SACnD,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Config from "../Config";
|
|
3
|
+
import IconButton from "../IconButton";
|
|
4
|
+
import { getValueForRadioButton } from "../../utilities";
|
|
5
|
+
import { useRadioButtonGroupContext } from "./context";
|
|
6
|
+
const RadioButton = ({ Icon, disabled = false, color, value = "", selected, unselectedColor, onPress, size = Config.radioButtonSize, selectedIcon = "MaterialIcons/radio-button-checked", unselectedIcon = "MaterialIcons/radio-button-unchecked", style, ...rest }) => {
|
|
7
|
+
const { value: contextValue, onValueChange } = useRadioButtonGroupContext();
|
|
8
|
+
const realValue = getValueForRadioButton(value);
|
|
9
|
+
const realContextValue = getValueForRadioButton(contextValue);
|
|
10
|
+
const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue === realValue;
|
|
11
|
+
const handlePress = () => {
|
|
12
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
13
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
14
|
+
};
|
|
15
|
+
return (React.createElement(IconButton, { Icon: Icon, icon: isSelected ? selectedIcon : unselectedIcon, color: isSelected ? color : unselectedColor, disabled: disabled, onPress: handlePress, size: size, style: style, ...rest }));
|
|
16
|
+
};
|
|
17
|
+
export default RadioButton;
|
|
18
|
+
//# sourceMappingURL=RadioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.js","sourceRoot":"","sources":["RadioButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAiBvD,MAAM,WAAW,GAA+B,CAAC,EAC/C,IAAI,EACJ,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,eAAe,EACf,OAAO,EACP,IAAI,GAAG,MAAM,CAAC,eAAe,EAC7B,YAAY,GAAG,oCAAoC,EACnD,cAAc,GAAG,sCAAsC,EACvD,KAAK,EACL,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAE5E,MAAM,SAAS,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,YAAY,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,gBAAgB,KAAK,SAAS,CAAC;IAE9D,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,SAAS,CAAC,CAAC;QACrB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,SAAS,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EAChD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,EAC3C,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,KACR,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { getValueForRadioButton } from "../../utilities";
|
|
4
|
+
import { radioButtonGroupContext, Direction } from "./context";
|
|
5
|
+
const { Provider } = radioButtonGroupContext;
|
|
6
|
+
const RadioButtonGroup = ({ direction = Direction.Vertical, value = "", onValueChange, defaultValue, style, children, ...rest }) => {
|
|
7
|
+
const [internalValue, setInternalValue] = React.useState("");
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
if (value != null) {
|
|
10
|
+
const realValue = getValueForRadioButton(value);
|
|
11
|
+
setInternalValue(realValue);
|
|
12
|
+
}
|
|
13
|
+
}, [value]);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
if (defaultValue != null) {
|
|
16
|
+
const realDefaultValue = getValueForRadioButton(defaultValue);
|
|
17
|
+
setInternalValue(realDefaultValue);
|
|
18
|
+
}
|
|
19
|
+
}, [defaultValue]);
|
|
20
|
+
const handleValueChange = (newValue) => {
|
|
21
|
+
const realNewValue = getValueForRadioButton(newValue);
|
|
22
|
+
setInternalValue(realNewValue);
|
|
23
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realNewValue);
|
|
24
|
+
};
|
|
25
|
+
const _containerStyle = [
|
|
26
|
+
{
|
|
27
|
+
flexDirection: direction === Direction.Horizontal ? "row" : "column",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
if (direction !== Direction.Vertical) {
|
|
31
|
+
_containerStyle.push({
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return (React.createElement(View, { style: [{ minHeight: 40 }, style], ...rest },
|
|
36
|
+
React.createElement(Provider, { value: {
|
|
37
|
+
value: internalValue,
|
|
38
|
+
onValueChange: handleValueChange,
|
|
39
|
+
direction,
|
|
40
|
+
} },
|
|
41
|
+
React.createElement(View, { style: _containerStyle }, children))));
|
|
42
|
+
};
|
|
43
|
+
export default RadioButtonGroup;
|
|
44
|
+
//# sourceMappingURL=RadioButtonGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonGroup.js","sourceRoot":"","sources":["RadioButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAW/D,MAAM,EAAE,QAAQ,EAAE,GAAG,uBAAuB,CAAC;AAE7C,MAAM,gBAAgB,GAAoC,CAAC,EACzD,SAAS,GAAG,SAAS,CAAC,QAAQ,EAC9B,KAAK,GAAG,EAAE,EACV,aAAa,EACb,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAA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AC,IAAI,IAAC,KAAK,EAAE,eAAe,IAAG,QAAQ,CAAQ,CACtC,CACN,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, View, Platform, } from "react-native";
|
|
3
|
+
import RadioButton from "./RadioButton";
|
|
4
|
+
import Text from "../Text";
|
|
5
|
+
import { useRadioButtonGroupContext } from "./context";
|
|
6
|
+
import { Direction as GroupDirection } from "./context";
|
|
7
|
+
import Touchable from "../Touchable";
|
|
8
|
+
import { extractStyles, getValueForRadioButton } from "../../utilities";
|
|
9
|
+
export var Direction;
|
|
10
|
+
(function (Direction) {
|
|
11
|
+
Direction["Row"] = "row";
|
|
12
|
+
Direction["RowReverse"] = "row-reverse";
|
|
13
|
+
})(Direction || (Direction = {}));
|
|
14
|
+
const getRadioButtonAlignment = (parentDirection, direction) => {
|
|
15
|
+
if (parentDirection === GroupDirection.Horizontal) {
|
|
16
|
+
return direction === Direction.Row ? "flex-start" : "flex-end";
|
|
17
|
+
}
|
|
18
|
+
else if (direction === Direction.RowReverse) {
|
|
19
|
+
return "flex-start";
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return "flex-end";
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const renderLabel = (value, labelStyle, textStyle) => {
|
|
26
|
+
if (typeof value === "string") {
|
|
27
|
+
return React.createElement(Text, { style: [labelStyle, textStyle] }, value);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return React.createElement(React.Fragment, null, value);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const RadioButtonRow = ({ Icon, label, value = "", color, unselectedColor, onPress, labelContainerStyle, labelStyle, radioButtonStyle, direction = Direction.Row, selected, disabled, style, ...rest }) => {
|
|
34
|
+
const { value: contextValue, onValueChange, direction: parentDirection, } = useRadioButtonGroupContext();
|
|
35
|
+
const realValue = getValueForRadioButton(value);
|
|
36
|
+
const realContextValue = getValueForRadioButton(contextValue);
|
|
37
|
+
const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue === realValue;
|
|
38
|
+
const handlePress = () => {
|
|
39
|
+
onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
|
|
40
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
|
|
41
|
+
};
|
|
42
|
+
const { textStyles, viewStyles } = extractStyles(style);
|
|
43
|
+
return (React.createElement(Touchable, { onPress: handlePress, style: [styles.mainParent, { flexDirection: direction }, viewStyles], disabled: disabled, ...rest },
|
|
44
|
+
React.createElement(View, { style: [
|
|
45
|
+
styles.label,
|
|
46
|
+
{
|
|
47
|
+
alignItems: direction === Direction.Row ? "flex-start" : "flex-end",
|
|
48
|
+
},
|
|
49
|
+
labelContainerStyle,
|
|
50
|
+
] }, renderLabel(label, labelStyle, textStyles)),
|
|
51
|
+
React.createElement(View, { style: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
alignItems: getRadioButtonAlignment(parentDirection, direction),
|
|
54
|
+
} },
|
|
55
|
+
React.createElement(RadioButton, { Icon: Icon, selected: isSelected, value: realValue, color: color, unselectedColor: unselectedColor, style: radioButtonStyle }))));
|
|
56
|
+
};
|
|
57
|
+
const styles = StyleSheet.create({
|
|
58
|
+
mainParent: {
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "space-around",
|
|
61
|
+
paddingStart: 20,
|
|
62
|
+
minHeight: 50,
|
|
63
|
+
paddingEnd: 20,
|
|
64
|
+
display: "flex",
|
|
65
|
+
...Platform.select({
|
|
66
|
+
web: {
|
|
67
|
+
cursor: "pointer",
|
|
68
|
+
userSelect: "none",
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
label: {
|
|
73
|
+
flex: 3,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
export default RadioButtonRow;
|
|
77
|
+
//# sourceMappingURL=RadioButt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;iBACpE;gBACD,mBAAmB;aACpB,IAEA,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CACtC;QACP,oBAAC,IAAI,IACH,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC;gBACP,UAAU,EAAE,uBAAuB,CAAC,eAAe,EAAE,SAAS,CAAC;aAChE;YAED,oBAAC,WAAW,IACV,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,KAAK,EAAE,gBAAgB,GACvB,CACG,CACG,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,cAAc;QAC9B,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,MAAM;QACf,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;KACH;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
export var Direction;
|
|
3
|
+
(function (Direction) {
|
|
4
|
+
Direction["Horizontal"] = "horizontal";
|
|
5
|
+
Direction["Vertical"] = "vertical";
|
|
6
|
+
})(Direction || (Direction = {}));
|
|
7
|
+
export const radioButtonGroupContext = createContext({
|
|
8
|
+
onValueChange: () => { },
|
|
9
|
+
value: "",
|
|
10
|
+
direction: undefined,
|
|
11
|
+
});
|
|
12
|
+
export function useRadioButtonGroupContext() {
|
|
13
|
+
return useContext(radioButtonGroupContext);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,sCAAyB,CAAA;IACzB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAOD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAA0B;IAC5E,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC;IACvB,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,UAAU,0BAA0B;IACxC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Text, Image, StyleSheet, } from "react-native";
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
const Row = ({ titleTypeStyle, titleColor, subtitleTypeStyle, subtitleColor, title, subtitle, multilineSubtitle, image, right, style, }) => {
|
|
6
|
+
return (React.createElement(View, { style: [styles.container, { padding: 16 }, style] },
|
|
7
|
+
React.createElement(View, { style: styles.leftContainer },
|
|
8
|
+
image && (React.createElement(Image, { source: typeof image === "string" ? { uri: image } : image, style: {
|
|
9
|
+
marginRight: 12,
|
|
10
|
+
width: subtitle
|
|
11
|
+
? Config.rowMultiLineImageSize
|
|
12
|
+
: Config.rowSingleLineImageSize,
|
|
13
|
+
height: subtitle
|
|
14
|
+
? Config.rowMultiLineImageSize
|
|
15
|
+
: Config.rowSingleLineImageSize,
|
|
16
|
+
} })),
|
|
17
|
+
React.createElement(View, { style: styles.textContainer },
|
|
18
|
+
React.createElement(Text, { style: [
|
|
19
|
+
titleTypeStyle,
|
|
20
|
+
{
|
|
21
|
+
color: titleColor,
|
|
22
|
+
},
|
|
23
|
+
], numberOfLines: 1 }, title),
|
|
24
|
+
subtitle ? (React.createElement(Text, { style: [
|
|
25
|
+
subtitleTypeStyle,
|
|
26
|
+
{
|
|
27
|
+
color: subtitleColor,
|
|
28
|
+
marginTop: 4,
|
|
29
|
+
},
|
|
30
|
+
], numberOfLines: multilineSubtitle ? undefined : 1 }, subtitle)) : null)),
|
|
31
|
+
right && right()));
|
|
32
|
+
};
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
leftContainer: {
|
|
35
|
+
flexDirection: "row",
|
|
36
|
+
flex: 1,
|
|
37
|
+
},
|
|
38
|
+
container: {
|
|
39
|
+
flexDirection: "row",
|
|
40
|
+
justifyContent: "space-between",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
},
|
|
43
|
+
textContainer: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export default withTheme(Row);
|
|
49
|
+
//# sourceMappingURL=Row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.js","sourceRoot":"","sources":["Row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EAEL,UAAU,GAIX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CA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AQ,CACJ,CACR,CAAC,CAAC,CAAC,IAAI,CACH,CACF;QACN,KAAK,IAAI,KAAK,EAAE,CACZ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,IAAI,EAAE,CAAC;KACR;IACD,SAAS,EAAE;QACT,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;KACrB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Platform, Image } from "react-native";
|
|
3
|
+
import { SvgUri } from "react-native-svg";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
const SVG = ({ source = Config.placeholderSvgURL, style, }) => {
|
|
6
|
+
return (React.createElement(React.Fragment, null,
|
|
7
|
+
Platform.OS === "ios" && (React.createElement(View, { style: style },
|
|
8
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
|
|
9
|
+
Platform.OS === "android" && (React.createElement(View, { style: style },
|
|
10
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
|
|
11
|
+
Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
|
|
12
|
+
};
|
|
13
|
+
export default SVG;
|
|
14
|
+
//# sourceMappingURL=SVG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SVG.js","sourceRoot":"","sources":["SVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAyB,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,MAAM,MAAM,UAAU,CAAC;AAO9B,MAAM,GAAG,GAAyD,CAAC,EACjE,MAAM,GAAG,MAAM,CAAC,iBAAiB,EACjC,KAAK,GACN,EAAE,EAAE;IACH,OAAO,CACL;QACG,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CACxB,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK;YAChB,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,GAAG,EAAE,MAAM,GAAI,CAC7C,CACR;QACA,QAAQ,CAAC,EAAE,KAAK,SAAS,IAAI,CAC5B,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK;YAChB,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,GAAG,EAAE,MAAM,GAAI,CAC7C,CACR;QACA,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CACxB,oBAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAI,CACjD,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleSheet, ScrollView, View, } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
import { withTheme } from "../theming";
|
|
5
|
+
function ScreenContainer({ scrollable = false, hasSafeArea = false, hasBottomSafeArea = false, hasTopSafeArea = false, theme, style, children, ...rest }) {
|
|
6
|
+
var _a;
|
|
7
|
+
const backgroundColor = ((_a = StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) || theme.colors.background;
|
|
8
|
+
const edges = ["left", "right"];
|
|
9
|
+
if (hasSafeArea || hasTopSafeArea) {
|
|
10
|
+
edges.push("top");
|
|
11
|
+
}
|
|
12
|
+
if (hasSafeArea || hasBottomSafeArea) {
|
|
13
|
+
edges.push("bottom");
|
|
14
|
+
}
|
|
15
|
+
return (React.createElement(SafeAreaView, { edges: edges, style: [
|
|
16
|
+
styles.container,
|
|
17
|
+
{
|
|
18
|
+
backgroundColor,
|
|
19
|
+
},
|
|
20
|
+
], ...rest }, scrollable ? (React.createElement(ScrollView, { contentContainerStyle: [
|
|
21
|
+
styles.scrollViewContainer,
|
|
22
|
+
{ backgroundColor },
|
|
23
|
+
style,
|
|
24
|
+
] }, children)) : (React.createElement(View, { style: [styles.container, { backgroundColor }, style] }, children))));
|
|
25
|
+
}
|
|
26
|
+
const styles = StyleSheet.create({
|
|
27
|
+
container: {
|
|
28
|
+
flex: 1,
|
|
29
|
+
},
|
|
30
|
+
scrollViewContainer: {
|
|
31
|
+
flexGrow: 1,
|
|
32
|
+
flex: undefined,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
export default withTheme(ScreenContainer);
|
|
36
|
+
//# sourceMappingURL=ScreenContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenContainer.js","sourceRoot":"","sources":["ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,UAAU,EAGV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAavC,SAAS,eAAe,CAAC,EACvB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACnB,iBAAiB,GAAG,KAAK,EACzB,cAAc,GAAG,KAAK,EACtB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACc;;IACrB,MAAM,eAAe,GACnB,CAAA,MAAA,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,0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