@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
|
@@ -13,6 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _reactNative = require("react-native");
|
|
14
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
17
|
function Center(_ref) {
|
|
17
18
|
let {
|
|
18
19
|
width = 240,
|
|
@@ -22,16 +23,15 @@ function Center(_ref) {
|
|
|
22
23
|
style,
|
|
23
24
|
...rest
|
|
24
25
|
} = _ref;
|
|
25
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
26
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
26
27
|
style: [{
|
|
27
28
|
justifyContent: "center",
|
|
28
29
|
alignItems: "center",
|
|
29
30
|
width,
|
|
30
31
|
height,
|
|
31
32
|
backgroundColor: bgColor
|
|
32
|
-
}, style]
|
|
33
|
-
|
|
34
|
-
}, children);
|
|
33
|
+
}, style]
|
|
34
|
+
}, rest), children);
|
|
35
35
|
}
|
|
36
36
|
function Circle(_ref2) {
|
|
37
37
|
let {
|
|
@@ -42,7 +42,7 @@ function Circle(_ref2) {
|
|
|
42
42
|
...rest
|
|
43
43
|
} = _ref2;
|
|
44
44
|
const borderRadius = 1000;
|
|
45
|
-
return /*#__PURE__*/React.createElement(Center, {
|
|
45
|
+
return /*#__PURE__*/React.createElement(Center, _extends({
|
|
46
46
|
width: size,
|
|
47
47
|
height: size,
|
|
48
48
|
bgColor: bgColor,
|
|
@@ -50,9 +50,8 @@ function Circle(_ref2) {
|
|
|
50
50
|
backgroundColor: bgColor,
|
|
51
51
|
borderRadius,
|
|
52
52
|
overflow: "hidden"
|
|
53
|
-
}]
|
|
54
|
-
|
|
55
|
-
}, children);
|
|
53
|
+
}]
|
|
54
|
+
}, rest), children);
|
|
56
55
|
}
|
|
57
56
|
function Square(_ref3) {
|
|
58
57
|
let {
|
|
@@ -62,13 +61,12 @@ function Square(_ref3) {
|
|
|
62
61
|
style,
|
|
63
62
|
...rest
|
|
64
63
|
} = _ref3;
|
|
65
|
-
return /*#__PURE__*/React.createElement(Center, {
|
|
64
|
+
return /*#__PURE__*/React.createElement(Center, _extends({
|
|
66
65
|
style: style,
|
|
67
66
|
width: size,
|
|
68
67
|
height: size,
|
|
69
|
-
bgColor: bgColor
|
|
70
|
-
|
|
71
|
-
}, children);
|
|
68
|
+
bgColor: bgColor
|
|
69
|
+
}, rest), children);
|
|
72
70
|
}
|
|
73
71
|
function Row(_ref4) {
|
|
74
72
|
let {
|
|
@@ -78,14 +76,15 @@ function Row(_ref4) {
|
|
|
78
76
|
style,
|
|
79
77
|
...rest
|
|
80
78
|
} = _ref4;
|
|
81
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
82
|
-
style: [style,
|
|
79
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
80
|
+
style: [style,
|
|
81
|
+
// style goes first b/c we can't override these
|
|
82
|
+
{
|
|
83
83
|
alignItems,
|
|
84
84
|
flexDirection: "row",
|
|
85
85
|
justifyContent: justifyContent
|
|
86
|
-
}]
|
|
87
|
-
|
|
88
|
-
}, children);
|
|
86
|
+
}]
|
|
87
|
+
}, rest), children);
|
|
89
88
|
}
|
|
90
89
|
function Spacer(_ref5) {
|
|
91
90
|
let {
|
|
@@ -97,36 +96,16 @@ function Spacer(_ref5) {
|
|
|
97
96
|
style,
|
|
98
97
|
...rest
|
|
99
98
|
} = _ref5;
|
|
100
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
99
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
101
100
|
style: [style, {
|
|
102
101
|
paddingRight: right,
|
|
103
102
|
paddingTop: top,
|
|
104
103
|
paddingLeft: left,
|
|
105
104
|
paddingBottom: bottom
|
|
106
|
-
}]
|
|
107
|
-
|
|
108
|
-
}, children);
|
|
105
|
+
}]
|
|
106
|
+
}, rest), children);
|
|
109
107
|
}
|
|
110
108
|
function Stack(_ref6) {
|
|
111
|
-
let {
|
|
112
|
-
children,
|
|
113
|
-
justifyContent = "flex-start",
|
|
114
|
-
alignItems = "flex-start",
|
|
115
|
-
style,
|
|
116
|
-
...rest
|
|
117
|
-
} = _ref6;
|
|
118
|
-
return (
|
|
119
|
-
/*#__PURE__*/
|
|
120
|
-
// style must go first since we don't want justifyContent, alignItems overridden
|
|
121
|
-
React.createElement(_reactNative.View, {
|
|
122
|
-
style: [style, {
|
|
123
|
-
justifyContent,
|
|
124
|
-
alignItems
|
|
125
|
-
}],
|
|
126
|
-
...rest
|
|
127
|
-
}, children)
|
|
128
|
-
);
|
|
129
|
-
}Stack(_ref6) {
|
|
130
109
|
let {
|
|
131
110
|
children,
|
|
132
111
|
justifyContent = "flex-start",
|
|
@@ -46,6 +46,7 @@ const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
|
46
46
|
const disabledColor = "rgb(240, 240, 240)";
|
|
47
47
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
48
48
|
const Picker = _ref => {
|
|
49
|
+
var _find$label, _find;
|
|
49
50
|
let {
|
|
50
51
|
error,
|
|
51
52
|
options = [],
|
|
@@ -67,7 +68,6 @@ const Picker = _ref => {
|
|
|
67
68
|
rightIconName,
|
|
68
69
|
type = "solid"
|
|
69
70
|
} = _ref;
|
|
70
|
-
var _a, _b;
|
|
71
71
|
const androidPickerRef = React.useRef(undefined);
|
|
72
72
|
const [internalValue, setInternalValue] = React.useState(value || defaultValue);
|
|
73
73
|
const [pickerVisible, setPickerVisible] = React.useState(false);
|
|
@@ -85,9 +85,9 @@ const Picker = _ref => {
|
|
|
85
85
|
}
|
|
86
86
|
}, [defaultValue]);
|
|
87
87
|
React.useEffect(() => {
|
|
88
|
-
var _a;
|
|
89
88
|
if (pickerVisible && androidPickerRef.current) {
|
|
90
|
-
|
|
89
|
+
var _androidPickerRef$cur;
|
|
90
|
+
androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
|
|
91
91
|
}
|
|
92
92
|
}, [pickerVisible, androidPickerRef]);
|
|
93
93
|
const normalizedOptions = normalizeOptions(options);
|
|
@@ -137,7 +137,7 @@ const Picker = _ref => {
|
|
|
137
137
|
...extractedMarginStyles
|
|
138
138
|
};
|
|
139
139
|
const stylesWithoutBordersAndMargins = (0, _lodash.omit)(viewStyles, [..._utilities.borderStyleNames, ..._utilities.marginStyleNames, ...additionalBorderStyles, ...additionalMarginStyles]);
|
|
140
|
-
const selectedLabel = internalValue && ((
|
|
140
|
+
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);
|
|
141
141
|
const labelText = label ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
142
142
|
style: {
|
|
143
143
|
textAlign: textStyles.textAlign,
|
|
@@ -324,9 +324,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
324
324
|
}
|
|
325
325
|
});
|
|
326
326
|
var _default = (0, _theming.withTheme)(Picker);
|
|
327
|
-
exports.default = _default;: deviceWidth,
|
|
328
|
-
maxHeight: deviceHeight
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
332
327
|
exports.default = _default;
|
|
@@ -15,7 +15,9 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
|
+
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); }
|
|
18
19
|
const Picker = _ref => {
|
|
20
|
+
var _options$find$label, _options$find;
|
|
19
21
|
let {
|
|
20
22
|
style,
|
|
21
23
|
options,
|
|
@@ -25,7 +27,6 @@ const Picker = _ref => {
|
|
|
25
27
|
onValueChange: onValueChangeOverride = () => {},
|
|
26
28
|
...props
|
|
27
29
|
} = _ref;
|
|
28
|
-
var _a, _b;
|
|
29
30
|
const {
|
|
30
31
|
viewStyles: {
|
|
31
32
|
borderRadius,
|
|
@@ -70,7 +71,7 @@ const Picker = _ref => {
|
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
73
|
-
const selectedLabel = selectedValue && ((
|
|
74
|
+
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);
|
|
74
75
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
75
76
|
disabled: disabled,
|
|
76
77
|
onPress: toggleFocus,
|
|
@@ -95,24 +96,6 @@ const Picker = _ref => {
|
|
|
95
96
|
key: o.value
|
|
96
97
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
97
98
|
pointerEvents: "none"
|
|
98
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, {
|
|
99
|
-
...props,
|
|
100
|
-
value: selectedLabel,
|
|
101
|
-
placeholder: placeholder,
|
|
102
|
-
// @ts-ignore
|
|
103
|
-
ref: textField,
|
|
104
|
-
disabled: disabled,
|
|
105
|
-
// @ts-expect-error
|
|
106
|
-
style: stylesWithoutMargin
|
|
107
|
-
}))));
|
|
108
|
-
};
|
|
109
|
-
const styles = _reactNative.StyleSheet.create({
|
|
110
|
-
container: {
|
|
111
|
-
alignSelf: "stretch"
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
115
|
-
exports.default = _default;pointerEvents: "none"
|
|
116
99
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
117
100
|
value: selectedLabel,
|
|
118
101
|
placeholder: placeholder
|
|
@@ -11,9 +11,6 @@ var _theming = require("../../theming");
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
14
|
/**
|
|
18
15
|
* Portal allows to render a component at a different place in the parent tree.
|
|
19
16
|
* You can use it to render content which should appear above other elements, similar to `Modal`.
|
|
@@ -35,6 +32,33 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
35
32
|
* }
|
|
36
33
|
* ```
|
|
37
34
|
*/
|
|
35
|
+
class Portal extends React.Component {
|
|
36
|
+
render() {
|
|
37
|
+
const {
|
|
38
|
+
children,
|
|
39
|
+
theme
|
|
40
|
+
} = this.props;
|
|
41
|
+
return /*#__PURE__*/React.createElement(_PortalHost.PortalContext.Consumer, null, manager => /*#__PURE__*/React.createElement(_PortalConsumer.default, {
|
|
42
|
+
manager: manager
|
|
43
|
+
}, /*#__PURE__*/React.createElement(_theming.ThemeProvider, {
|
|
44
|
+
theme: theme
|
|
45
|
+
}, children)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// @component ./PortalHost.tsx
|
|
49
|
+
Portal.Host = _PortalHost.default;
|
|
50
|
+
var _default = (0, _theming.withTheme)(Portal);
|
|
51
|
+
exports.default = _default;nent extends React.Component {
|
|
52
|
+
* render() {
|
|
53
|
+
* return (
|
|
54
|
+
* <Portal>
|
|
55
|
+
* <Text>This is rendered at a different place</Text>
|
|
56
|
+
* </Portal>
|
|
57
|
+
* );
|
|
58
|
+
* }
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
38
62
|
class Portal extends React.Component {
|
|
39
63
|
// @component ./PortalHost.tsx
|
|
40
64
|
|
|
@@ -7,16 +7,31 @@ exports.default = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
|
-
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; }
|
|
11
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
12
|
-
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); }
|
|
13
10
|
class PortalConsumer extends React.Component {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
_defineProperty(this, "key", void 0);
|
|
17
|
-
}
|
|
18
11
|
async componentDidMount() {
|
|
19
12
|
this.checkManager();
|
|
13
|
+
// Delay updating to prevent React from going to infinite loop
|
|
14
|
+
await Promise.resolve();
|
|
15
|
+
this.key = this.props.manager.mount(this.props.children);
|
|
16
|
+
}
|
|
17
|
+
componentDidUpdate() {
|
|
18
|
+
this.checkManager();
|
|
19
|
+
this.props.manager.update(this.key, this.props.children);
|
|
20
|
+
}
|
|
21
|
+
componentWillUnmount() {
|
|
22
|
+
this.checkManager();
|
|
23
|
+
this.props.manager.unmount(this.key);
|
|
24
|
+
}
|
|
25
|
+
checkManager() {
|
|
26
|
+
if (!this.props.manager) {
|
|
27
|
+
throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = PortalConsumer;s.checkManager();
|
|
20
35
|
|
|
21
36
|
// Delay updating to prevent React from going to infinite loop
|
|
22
37
|
await Promise.resolve();
|
|
@@ -7,6 +7,7 @@ exports.default = Pressable;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
11
|
function Pressable(_ref) {
|
|
11
12
|
let {
|
|
12
13
|
children,
|
|
@@ -19,22 +20,8 @@ function Pressable(_ref) {
|
|
|
19
20
|
style,
|
|
20
21
|
...props
|
|
21
22
|
} = _ref;
|
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Pressable, _extends({
|
|
23
24
|
onPress: onPress,
|
|
24
|
-
disabled: disabled,
|
|
25
|
-
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
26
|
-
hitSlop: hitSlop ? hitSlop : 8,
|
|
27
|
-
style: _ref2 => {
|
|
28
|
-
let {
|
|
29
|
-
pressed
|
|
30
|
-
} = _ref2;
|
|
31
|
-
return [{
|
|
32
|
-
opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1
|
|
33
|
-
}, style];
|
|
34
|
-
},
|
|
35
|
-
...props
|
|
36
|
-
}, children);
|
|
37
|
-
} onPress: onPress,
|
|
38
25
|
disabled: disabled,
|
|
39
26
|
delayLongPress: delayLongPress ? delayLongPress : 500,
|
|
40
27
|
hitSlop: hitSlop ? hitSlop : 8,
|
|
@@ -8,12 +8,16 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
15
|
const INDETERMINATE_WIDTH_FACTOR = 0.3;
|
|
12
16
|
const BAR_WIDTH_ZERO_POSITION = INDETERMINATE_WIDTH_FACTOR / (1 + INDETERMINATE_WIDTH_FACTOR);
|
|
13
17
|
class ProgressBar extends _react.Component {
|
|
14
18
|
constructor(props) {
|
|
15
19
|
super(props);
|
|
16
|
-
this
|
|
20
|
+
_defineProperty(this, "handleLayout", event => {
|
|
17
21
|
const {
|
|
18
22
|
width = 150,
|
|
19
23
|
onLayout
|
|
@@ -26,7 +30,7 @@ class ProgressBar extends _react.Component {
|
|
|
26
30
|
if (onLayout) {
|
|
27
31
|
onLayout(event);
|
|
28
32
|
}
|
|
29
|
-
};
|
|
33
|
+
});
|
|
30
34
|
const {
|
|
31
35
|
progress: progressP = 0,
|
|
32
36
|
indeterminate = false
|
|
@@ -74,6 +78,7 @@ class ProgressBar extends _react.Component {
|
|
|
74
78
|
...animationConfig,
|
|
75
79
|
toValue: progress,
|
|
76
80
|
velocity: 0,
|
|
81
|
+
//adjust this value if animation fails - velocity is required
|
|
77
82
|
useNativeDriver
|
|
78
83
|
}).start();
|
|
79
84
|
} else {
|
|
@@ -142,41 +147,6 @@ class ProgressBar extends _react.Component {
|
|
|
142
147
|
})
|
|
143
148
|
}]
|
|
144
149
|
};
|
|
145
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
146
|
-
style: [containerStyle, style],
|
|
147
|
-
onLayout: this.handleLayout,
|
|
148
|
-
...restProps
|
|
149
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
150
|
-
style: progressStyle
|
|
151
|
-
}), children);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
exports.default = ProgressBar;,
|
|
155
|
-
overflow: "hidden",
|
|
156
|
-
backgroundColor: unfilledColor
|
|
157
|
-
};
|
|
158
|
-
const progressStyle = {
|
|
159
|
-
backgroundColor: color,
|
|
160
|
-
// Always take up full height of container.
|
|
161
|
-
height: "100%",
|
|
162
|
-
transform: [{
|
|
163
|
-
translateX: this.state.animationValue.interpolate({
|
|
164
|
-
inputRange: [0, 1],
|
|
165
|
-
outputRange: [innerWidth * -INDETERMINATE_WIDTH_FACTOR, innerWidth]
|
|
166
|
-
})
|
|
167
|
-
}, {
|
|
168
|
-
translateX: this.state.progress.interpolate({
|
|
169
|
-
inputRange: [0, 1],
|
|
170
|
-
outputRange: [innerWidth / (_reactNative.I18nManager.isRTL ? 2 : -2), 0]
|
|
171
|
-
})
|
|
172
|
-
}, {
|
|
173
|
-
// Interpolation a temp workaround for https://github.com/facebook/react-native/issues/6278
|
|
174
|
-
scaleX: this.state.progress.interpolate({
|
|
175
|
-
inputRange: [0, 1],
|
|
176
|
-
outputRange: [0.0001, 1]
|
|
177
|
-
})
|
|
178
|
-
}]
|
|
179
|
-
};
|
|
180
150
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
181
151
|
style: [containerStyle, style],
|
|
182
152
|
onLayout: this.handleLayout
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.radioButtonGroupContext = exports.Direction = void 0;
|
|
7
7
|
exports.useRadioButtonGroupContext = useRadioButtonGroupContext;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
|
|
9
|
+
var Direction;
|
|
10
10
|
exports.Direction = Direction;
|
|
11
11
|
(function (Direction) {
|
|
12
12
|
Direction["Horizontal"] = "horizontal";
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _theming = require("../theming");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
12
|
const StarRating = _ref => {
|
|
14
13
|
let {
|
|
15
14
|
Icon,
|
|
@@ -40,9 +39,10 @@ const StarRating = _ref => {
|
|
|
40
39
|
!!onPress && onPress(r);
|
|
41
40
|
}, [onPress]);
|
|
42
41
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
43
|
-
return /*#__PURE__*/React.createElement(_reactNative.View,
|
|
44
|
-
style: [styles.container, style]
|
|
45
|
-
|
|
42
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
|
+
style: [styles.container, style],
|
|
44
|
+
...rest
|
|
45
|
+
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
46
46
|
key: i,
|
|
47
47
|
style: {
|
|
48
48
|
display: "flex"
|
|
@@ -83,4 +83,23 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
var _default = (0, _theming.withTheme)(StarRating);
|
|
86
|
+
exports.default = _default;lignItems: "center"
|
|
87
|
+
},
|
|
88
|
+
touchContainer: {
|
|
89
|
+
display: "flex",
|
|
90
|
+
flexDirection: "row",
|
|
91
|
+
position: "absolute",
|
|
92
|
+
top: 0,
|
|
93
|
+
right: 0,
|
|
94
|
+
left: 0,
|
|
95
|
+
bottom: 0,
|
|
96
|
+
zIndex: 1
|
|
97
|
+
},
|
|
98
|
+
pressable: {
|
|
99
|
+
flex: 1,
|
|
100
|
+
height: "100%",
|
|
101
|
+
width: "50%"
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var _default = (0, _theming.withTheme)(StarRating);
|
|
86
105
|
exports.default = _default;
|
|
@@ -8,8 +8,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
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); }
|
|
13
14
|
const STEP_STATUS = {
|
|
14
15
|
CURRENT: "current",
|
|
15
16
|
FINISHED: "finished",
|
|
@@ -18,7 +19,7 @@ const STEP_STATUS = {
|
|
|
18
19
|
class StepIndicator extends _react.Component {
|
|
19
20
|
constructor(props) {
|
|
20
21
|
super(props);
|
|
21
|
-
this
|
|
22
|
+
_defineProperty(this, "renderProgressBarBackground", () => {
|
|
22
23
|
const {
|
|
23
24
|
stepCount,
|
|
24
25
|
direction
|
|
@@ -61,8 +62,8 @@ class StepIndicator extends _react.Component {
|
|
|
61
62
|
},
|
|
62
63
|
style: progressBarBackgroundStyle
|
|
63
64
|
});
|
|
64
|
-
};
|
|
65
|
-
this
|
|
65
|
+
});
|
|
66
|
+
_defineProperty(this, "renderProgressBar", () => {
|
|
66
67
|
const {
|
|
67
68
|
stepCount,
|
|
68
69
|
direction
|
|
@@ -92,8 +93,8 @@ class StepIndicator extends _react.Component {
|
|
|
92
93
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
93
94
|
style: progressBarStyle
|
|
94
95
|
});
|
|
95
|
-
};
|
|
96
|
-
this
|
|
96
|
+
});
|
|
97
|
+
_defineProperty(this, "renderStepIndicator", () => {
|
|
97
98
|
let steps = [];
|
|
98
99
|
const {
|
|
99
100
|
stepCount,
|
|
@@ -124,8 +125,8 @@ class StepIndicator extends _react.Component {
|
|
|
124
125
|
height: this.state.customStyles.currentStepIndicatorSize
|
|
125
126
|
}]
|
|
126
127
|
}, steps);
|
|
127
|
-
};
|
|
128
|
-
this
|
|
128
|
+
});
|
|
129
|
+
_defineProperty(this, "renderStepLabels", () => {
|
|
129
130
|
const {
|
|
130
131
|
labels,
|
|
131
132
|
direction,
|
|
@@ -167,8 +168,8 @@ class StepIndicator extends _react.Component {
|
|
|
167
168
|
alignItems: this.state.customStyles.labelAlign
|
|
168
169
|
}]
|
|
169
170
|
}, labelViews);
|
|
170
|
-
};
|
|
171
|
-
this
|
|
171
|
+
});
|
|
172
|
+
_defineProperty(this, "renderStep", position => {
|
|
172
173
|
const {
|
|
173
174
|
renderStepIndicator
|
|
174
175
|
} = this.props;
|
|
@@ -235,8 +236,8 @@ class StepIndicator extends _react.Component {
|
|
|
235
236
|
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
236
237
|
style: indicatorLabelStyle
|
|
237
238
|
}, "".concat(position + 1)));
|
|
238
|
-
};
|
|
239
|
-
this
|
|
239
|
+
});
|
|
240
|
+
_defineProperty(this, "getStepStatus", stepPosition => {
|
|
240
241
|
const {
|
|
241
242
|
currentPosition
|
|
242
243
|
} = this.props;
|
|
@@ -247,8 +248,8 @@ class StepIndicator extends _react.Component {
|
|
|
247
248
|
} else {
|
|
248
249
|
return STEP_STATUS.UNFINISHED;
|
|
249
250
|
}
|
|
250
|
-
};
|
|
251
|
-
this
|
|
251
|
+
});
|
|
252
|
+
_defineProperty(this, "onCurrentPositionChanged", position => {
|
|
252
253
|
let {
|
|
253
254
|
stepCount
|
|
254
255
|
} = this.props;
|
|
@@ -268,7 +269,7 @@ class StepIndicator extends _react.Component {
|
|
|
268
269
|
toValue: this.state.customStyles.currentStepIndicatorSize / 2,
|
|
269
270
|
duration: 100
|
|
270
271
|
})])]).start();
|
|
271
|
-
};
|
|
272
|
+
});
|
|
272
273
|
const defaultStyles = {
|
|
273
274
|
stepIndicatorSize: 30,
|
|
274
275
|
currentStepIndicatorSize: 40,
|
|
@@ -334,6 +335,7 @@ class StepIndicator extends _react.Component {
|
|
|
334
335
|
// ),
|
|
335
336
|
// }));
|
|
336
337
|
// }
|
|
338
|
+
|
|
337
339
|
if (prevProps.currentPosition !== this.props.currentPosition) {
|
|
338
340
|
this.onCurrentPositionChanged(this.props.currentPosition);
|
|
339
341
|
}
|
|
@@ -375,47 +377,6 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
375
377
|
justifyContent: "center"
|
|
376
378
|
}
|
|
377
379
|
});
|
|
378
|
-
StepIndicator.defaultProps = {
|
|
379
|
-
currentPosition: 0,
|
|
380
|
-
stepCount: 5,
|
|
381
|
-
customStyles: {},
|
|
382
|
-
direction: "horizontal"
|
|
383
|
-
};exports.default = StepIndicator;
|
|
384
|
-
const styles = _reactNative.StyleSheet.create({
|
|
385
|
-
container: {
|
|
386
|
-
backgroundColor: "transparent"
|
|
387
|
-
},
|
|
388
|
-
stepIndicatorContainer: {
|
|
389
|
-
flexDirection: "row",
|
|
390
|
-
alignItems: "center",
|
|
391
|
-
justifyContent: "space-around",
|
|
392
|
-
backgroundColor: "transparent"
|
|
393
|
-
},
|
|
394
|
-
stepLabelsContainer: {
|
|
395
|
-
justifyContent: "space-around"
|
|
396
|
-
},
|
|
397
|
-
step: {
|
|
398
|
-
alignItems: "center",
|
|
399
|
-
justifyContent: "center",
|
|
400
|
-
zIndex: 2
|
|
401
|
-
},
|
|
402
|
-
stepContainer: {
|
|
403
|
-
flex: 1,
|
|
404
|
-
flexDirection: "row",
|
|
405
|
-
alignItems: "center",
|
|
406
|
-
justifyContent: "center"
|
|
407
|
-
},
|
|
408
|
-
stepLabel: {
|
|
409
|
-
fontSize: 12,
|
|
410
|
-
textAlign: "center",
|
|
411
|
-
fontWeight: "500"
|
|
412
|
-
},
|
|
413
|
-
stepLabelItem: {
|
|
414
|
-
flex: 1,
|
|
415
|
-
alignItems: "center",
|
|
416
|
-
justifyContent: "center"
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
380
|
StepIndicator.defaultProps = {
|
|
420
381
|
currentPosition: 0,
|
|
421
382
|
stepCount: 5,
|