@draftbit/core 46.6.2 → 46.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Accordion/AccordionItem.js +4 -23
- package/lib/commonjs/components/AvatarEdit.js +4 -15
- package/lib/commonjs/components/Banner.js +4 -23
- package/lib/commonjs/components/Button.js +10 -33
- package/lib/commonjs/components/Carousel.js +8 -30
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +5 -23
- package/lib/commonjs/components/Container.js +4 -15
- package/lib/commonjs/components/DatePicker/DatePicker.js +13 -26
- package/lib/commonjs/components/DeprecatedCardWrapper.js +1 -15
- package/lib/commonjs/components/Divider.js +1 -14
- package/lib/commonjs/components/FAB.js +4 -18
- package/lib/commonjs/components/IconButton.js +4 -19
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +11 -36
- package/lib/commonjs/components/Portal/Portal.js +3 -27
- package/lib/commonjs/components/Portal/PortalConsumer.js +7 -22
- package/lib/commonjs/components/Portal/PortalManager.js +8 -34
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +1 -9
- package/lib/commonjs/components/RadioButton/context.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +4 -20
- package/lib/commonjs/components/StarRating.js +4 -23
- package/lib/commonjs/components/Surface.js +2 -14
- package/lib/commonjs/components/TextField.js +28 -76
- package/lib/commonjs/components/ToggleButton.js +2 -15
- package/lib/commonjs/constants.js +1 -1
- package/lib/commonjs/hooks.js +2 -1
- package/lib/commonjs/mappings/StarRating.js +2 -6
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/commonjs/utilities.js +2 -1
- package/lib/module/components/AspectRatio.js +1 -18
- package/lib/module/components/AvatarEdit.js +4 -15
- package/lib/module/components/Banner.js +4 -25
- package/lib/module/components/Button.js +10 -33
- package/lib/module/components/CardBlock.js +4 -14
- package/lib/module/components/CardContainerRating.js +4 -14
- package/lib/module/components/CardContainerShortImage.js +4 -18
- package/lib/module/components/Carousel.js +32 -8
- package/lib/module/components/Checkbox/CheckboxGroup.js +2 -16
- package/lib/module/components/Container.js +4 -17
- package/lib/module/components/DeprecatedFAB.js +3 -23
- package/lib/module/components/Elevation.js +2 -14
- package/lib/module/components/FormRow.js +2 -17
- package/lib/module/components/Layout.js +21 -42
- package/lib/module/components/NumberInput.js +3 -12
- package/lib/module/components/Picker/PickerComponent.web.js +21 -3
- package/lib/module/components/Portal/Portal.js +3 -28
- package/lib/module/components/Portal/PortalConsumer.js +0 -23
- package/lib/module/components/Portal/PortalHost.js +15 -45
- package/lib/module/components/Portal/PortalManager.js +7 -33
- package/lib/module/components/ProgressBar.js +7 -39
- package/lib/module/components/RadioButton/RadioButton.js +1 -13
- package/lib/module/components/RadioButton/RadioButtonGroup.js +2 -16
- package/lib/module/components/RadioButton/RadioButtonRow.js +5 -24
- package/lib/module/components/RadioButton/context.js +1 -1
- package/lib/module/components/Slider.js +4 -21
- package/lib/module/components/StepIndicator.js +18 -58
- package/lib/module/components/Surface.js +1 -15
- package/lib/module/components/Switch.js +10 -21
- package/lib/module/components/TextField.js +28 -78
- package/lib/module/constants.js +2 -1
- package/lib/module/mappings/FieldSearchBarFull.js +1 -4
- package/package.json +4 -4
- package/src/Provider.js +9 -0
- package/src/components/Accordion/AccordionGroup.js +44 -0
- package/src/components/Accordion/AccordionItem.js +32 -0
- package/src/components/Accordion/index.js +2 -0
- package/src/components/ActionSheet/ActionSheet.js +45 -0
- package/src/components/ActionSheet/ActionSheetCancel.js +6 -0
- package/src/components/ActionSheet/ActionSheetItem.js +30 -0
- package/src/components/ActionSheet/index.js +3 -0
- package/src/components/AnimatedCircularProgress.js +43 -0
- package/src/components/AspectRatio.js +18 -0
- package/src/components/AvatarEdit.js +30 -0
- package/src/components/Banner.js +109 -0
- package/src/components/Button.js +114 -0
- package/src/components/Card.js +57 -0
- package/src/components/CardBlock.js +54 -0
- package/src/components/CardContainer.js +69 -0
- package/src/components/CardContainerRating.js +79 -0
- package/src/components/CardContainerShortImage.js +33 -0
- package/src/components/CardInline.js +36 -0
- package/src/components/Carousel.js +68 -0
- package/src/components/Checkbox/Checkbox.js +62 -0
- package/src/components/Checkbox/CheckboxGroup.js +21 -0
- package/src/components/Checkbox/CheckboxGroupRow.js +76 -0
- package/src/components/Checkbox/CheckboxRow.js +77 -0
- package/src/components/Checkbox/context.js +14 -0
- package/src/components/Checkbox/index.js +3 -0
- package/src/components/CircleImage.js +8 -0
- package/src/components/CircularProgress.js +81 -0
- package/src/components/Config.js +64 -0
- package/src/components/Container.js +43 -0
- package/src/components/DatePicker/DatePicker.js +377 -0
- package/src/components/DatePicker/DatePickerComponent.js +13 -0
- package/src/components/DatePicker/DatePickerComponent.web.js +30 -0
- package/src/components/DatePicker/DatePickerComponentType.js +1 -0
- package/src/components/DeprecatedButton.js +83 -0
- package/src/components/DeprecatedCardWrapper.js +18 -0
- package/src/components/DeprecatedFAB.js +114 -0
- package/src/components/Divider.js +13 -0
- package/src/components/Elevation.js +20 -0
- package/src/components/FAB.js +46 -0
- package/src/components/FieldSearchBarFull.js +53 -0
- package/src/components/FormRow.js +19 -0
- package/src/components/Header.js +44 -0
- package/src/components/HeaderLarge.js +7 -0
- package/src/components/HeaderMedium.js +7 -0
- package/src/components/HeaderOverline.js +7 -0
- package/src/components/IconButton.js +35 -0
- package/src/components/Image.js +47 -0
- package/src/components/Justification.js +1 -0
- package/src/components/Layout.js +50 -0
- package/src/components/NumberInput.js +49 -0
- package/src/components/Picker/Picker.js +267 -0
- package/src/components/Picker/PickerComponent.android.js +69 -0
- package/src/components/Picker/PickerComponent.ios.js +79 -0
- package/src/components/Picker/PickerComponent.web.js +70 -0
- package/src/components/Picker/PickerTypes.js +1 -0
- package/src/components/Portal/Portal.js +35 -0
- package/src/components/Portal/PortalConsumer.js +27 -0
- package/src/components/Portal/PortalHost.js +107 -0
- package/src/components/Portal/PortalManager.js +32 -0
- package/src/components/Pressable.js +12 -0
- package/src/components/ProgressBar.js +118 -0
- package/src/components/ProgressCircle.js +13 -0
- package/src/components/ProgressIndicator.js +27 -0
- package/src/components/RadioButton/RadioButton.js +17 -0
- package/src/components/RadioButton/RadioButtonFieldGroup.js +17 -0
- package/src/components/RadioButton/RadioButtonGroup.js +43 -0
- package/src/components/RadioButton/RadioButtonRow.js +76 -0
- package/src/components/RadioButton/context.js +14 -0
- package/src/components/RadioButton/index.js +4 -0
- package/src/components/ResizeMode.js +1 -0
- package/src/components/Row.js +48 -0
- package/src/components/RowBodyIcon.js +8 -0
- package/src/components/RowHeadlineImageCaption.js +12 -0
- package/src/components/RowHeadlineImageIcon.js +14 -0
- package/src/components/SVG.js +13 -0
- package/src/components/ScreenContainer.js +34 -0
- package/src/components/Slider.js +63 -0
- package/src/components/StarRating.js +50 -0
- package/src/components/StepIndicator.js +346 -0
- package/src/components/Stepper.js +41 -0
- package/src/components/Surface.js +32 -0
- package/src/components/Swiper/Swiper.js +29 -0
- package/src/components/Swiper/SwiperItem.js +9 -0
- package/src/components/Swiper/index.js +2 -0
- package/src/components/Switch.js +56 -0
- package/src/components/Text.js +33 -0
- package/src/components/TextField.js +428 -0
- package/src/components/ToggleButton.js +39 -0
- package/src/components/Touchable.js +12 -0
- package/src/components/Touchable.web.js +2 -0
- package/src/components/Typography.js +36 -0
- package/src/components/useAuthState.js +31 -0
- package/src/constants.js +10 -0
- package/src/hooks.js +12 -0
- package/src/index.js +53 -0
- package/src/interfaces/Icon.js +8 -0
- package/src/mappings/Accordion.js +41 -0
- package/src/mappings/AccordionItem.js +16 -0
- package/src/mappings/ActionSheet.js +13 -0
- package/src/mappings/ActionSheetCancel.js +19 -0
- package/src/mappings/ActionSheetItem.js +23 -0
- package/src/mappings/ActivityIndicator.js +58 -0
- package/src/mappings/AudioPlayer.js +57 -0
- package/src/mappings/AvatarEdit.js +38 -0
- package/src/mappings/Banner.js +32 -0
- package/src/mappings/BlurView.js +42 -0
- package/src/mappings/Button.js +116 -0
- package/src/mappings/Card.js +52 -0
- package/src/mappings/CardBlock.js +123 -0
- package/src/mappings/CardContainer.js +104 -0
- package/src/mappings/CardContainerRating.js +126 -0
- package/src/mappings/CardContainerShortImage.js +120 -0
- package/src/mappings/CardInline.js +52 -0
- package/src/mappings/Carousel.js +19 -0
- package/src/mappings/Checkbox.js +46 -0
- package/src/mappings/CheckboxGroup.js +26 -0
- package/src/mappings/CheckboxRow.js +61 -0
- package/src/mappings/CircleImage.js +25 -0
- package/src/mappings/Container.js +30 -0
- package/src/mappings/CustomCode.js +8 -0
- package/src/mappings/DatePicker.js +176 -0
- package/src/mappings/Divider.js +27 -0
- package/src/mappings/FAB.js +37 -0
- package/src/mappings/Fetch.js +13 -0
- package/src/mappings/FieldSearchBarFull.js +50 -0
- package/src/mappings/FlashList.js +79 -0
- package/src/mappings/FlatList.js +36 -0
- package/src/mappings/HeaderLarge.js +29 -0
- package/src/mappings/HeaderMedium.js +55 -0
- package/src/mappings/HeaderOverline.js +55 -0
- package/src/mappings/Icon.js +32 -0
- package/src/mappings/IconButton.js +35 -0
- package/src/mappings/Image.js +35 -0
- package/src/mappings/ImageBackground.js +29 -0
- package/src/mappings/KeyboardAvoidingView.js +41 -0
- package/src/mappings/KeyboardAwareScrollView.js +50 -0
- package/src/mappings/Layout.js +200 -0
- package/src/mappings/LinearGradient.js +77 -0
- package/src/mappings/MapCallout.js +21 -0
- package/src/mappings/MapMarker.js +47 -0
- package/src/mappings/MapView.js +139 -0
- package/src/mappings/Modal.js +42 -0
- package/src/mappings/NumberInput.js +254 -0
- package/src/mappings/Picker.js +148 -0
- package/src/mappings/ProgressBar.js +101 -0
- package/src/mappings/ProgressCircle.js +109 -0
- package/src/mappings/ProgressIndicator.js +181 -0
- package/src/mappings/RadioButton.js +51 -0
- package/src/mappings/RadioButtonGroup.js +17 -0
- package/src/mappings/RadioButtonRow.js +42 -0
- package/src/mappings/RowBodyIcon.js +75 -0
- package/src/mappings/RowHeadlineImageCaption.js +167 -0
- package/src/mappings/RowHeadlineImageIcon.js +99 -0
- package/src/mappings/SVG.js +20 -0
- package/src/mappings/SafeAreaView.js +33 -0
- package/src/mappings/ScrollView.js +31 -0
- package/src/mappings/Slider.js +60 -0
- package/src/mappings/StarRating.js +43 -0
- package/src/mappings/Stepper.js +32 -0
- package/src/mappings/Surface.js +14 -0
- package/src/mappings/Swiper.js +62 -0
- package/src/mappings/SwiperItem.js +8 -0
- package/src/mappings/Switch.js +81 -0
- package/src/mappings/Text.js +251 -0
- package/src/mappings/TextArea.js +274 -0
- package/src/mappings/TextField.js +391 -0
- package/src/mappings/TextInput.js +402 -0
- package/src/mappings/ToggleButton.js +50 -0
- package/src/mappings/Touchable.js +60 -0
- package/src/mappings/Video.js +81 -0
- package/src/mappings/View.js +207 -0
- package/src/mappings/WebView.js +88 -0
- package/src/styles/DarkTheme.js +26 -0
- package/src/styles/DefaultTheme.js +111 -0
- package/src/styles/fonts.js +62 -0
- package/src/styles/overlay.js +60 -0
- package/src/styles/shadow.js +51 -0
- package/src/theming.js +3 -0
- package/src/utilities.js +102 -0
|
@@ -9,6 +9,7 @@ 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); }
|
|
12
13
|
const IconButton = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
Icon,
|
|
@@ -23,7 +24,7 @@ const IconButton = _ref => {
|
|
|
23
24
|
...props
|
|
24
25
|
} = _ref;
|
|
25
26
|
const iconColor = customColor || theme.colors.primary;
|
|
26
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
27
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
27
28
|
onPress: onPress,
|
|
28
29
|
disabled: disabled || loading,
|
|
29
30
|
style: _ref2 => {
|
|
@@ -37,9 +38,8 @@ const IconButton = _ref => {
|
|
|
37
38
|
alignItems: "center",
|
|
38
39
|
justifyContent: "center"
|
|
39
40
|
}, style];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
41
|
+
}
|
|
42
|
+
}, props), /*#__PURE__*/React.createElement(_reactNative.View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
|
|
43
43
|
name: icon,
|
|
44
44
|
size: size - 2,
|
|
45
45
|
color: iconColor
|
|
@@ -61,19 +61,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
var _default = (0, _theming.withTheme)(IconButton);
|
|
64
|
-
exports.default = _default; }) : null));
|
|
65
|
-
};
|
|
66
|
-
const styles = _reactNative.StyleSheet.create({
|
|
67
|
-
container: {
|
|
68
|
-
alignItems: "center",
|
|
69
|
-
justifyContent: "center",
|
|
70
|
-
..._reactNative.Platform.select({
|
|
71
|
-
web: {
|
|
72
|
-
cursor: "pointer",
|
|
73
|
-
userSelect: "none"
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
var _default = (0, _theming.withTheme)(IconButton);
|
|
79
64
|
exports.default = _default;
|
|
@@ -18,7 +18,9 @@ var _utilities = require("../../utilities");
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
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); }
|
|
20
20
|
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; }
|
|
21
|
+
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); }
|
|
21
22
|
const Picker = _ref => {
|
|
23
|
+
var _options$find$label, _options$find;
|
|
22
24
|
let {
|
|
23
25
|
Icon,
|
|
24
26
|
style,
|
|
@@ -32,7 +34,6 @@ const Picker = _ref => {
|
|
|
32
34
|
},
|
|
33
35
|
...props
|
|
34
36
|
} = _ref;
|
|
35
|
-
var _a, _b;
|
|
36
37
|
const {
|
|
37
38
|
viewStyles: {
|
|
38
39
|
borderRadius,
|
|
@@ -73,24 +74,26 @@ const Picker = _ref => {
|
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
76
|
-
const selectedLabel = selectedValue && ((
|
|
77
|
+
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);
|
|
77
78
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
78
79
|
style: [styles.container, viewStyles]
|
|
79
80
|
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
80
81
|
disabled: disabled,
|
|
81
82
|
onPress: toggleVisibility
|
|
82
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, {
|
|
83
|
-
...props,
|
|
83
|
+
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
84
84
|
value: String(selectedLabel),
|
|
85
|
-
placeholder: placeholder
|
|
85
|
+
placeholder: placeholder
|
|
86
86
|
// @ts-ignore
|
|
87
|
-
|
|
87
|
+
,
|
|
88
|
+
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
89
|
+
,
|
|
88
90
|
disabled: disabled,
|
|
89
|
-
pointerEvents: "none"
|
|
91
|
+
pointerEvents: "none"
|
|
90
92
|
// @ts-expect-error
|
|
93
|
+
,
|
|
91
94
|
style: stylesWithoutMargin,
|
|
92
95
|
Icon: Icon
|
|
93
|
-
})), pickerVisible && /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
96
|
+
}))), pickerVisible && /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
94
97
|
style: [styles.picker, {
|
|
95
98
|
backgroundColor: colors.divider
|
|
96
99
|
}]
|
|
@@ -135,32 +138,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
135
138
|
}
|
|
136
139
|
});
|
|
137
140
|
var _default = (0, _theming.withTheme)(Picker);
|
|
138
|
-
exports.default = _default;ateElement(_picker.Picker.Item, {
|
|
139
|
-
label: o.label,
|
|
140
|
-
value: o.value,
|
|
141
|
-
key: o.value
|
|
142
|
-
})))))));
|
|
143
|
-
};
|
|
144
|
-
const styles = _reactNative.StyleSheet.create({
|
|
145
|
-
container: {
|
|
146
|
-
alignSelf: "stretch"
|
|
147
|
-
},
|
|
148
|
-
picker: {
|
|
149
|
-
position: "absolute",
|
|
150
|
-
bottom: 0,
|
|
151
|
-
left: 0,
|
|
152
|
-
right: 0,
|
|
153
|
-
flexDirection: "row",
|
|
154
|
-
justifyContent: "center"
|
|
155
|
-
},
|
|
156
|
-
pickerContainer: {
|
|
157
|
-
backgroundColor: "white",
|
|
158
|
-
flexDirection: "column",
|
|
159
|
-
width: "100%"
|
|
160
|
-
},
|
|
161
|
-
closeButton: {
|
|
162
|
-
alignSelf: "flex-end"
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
166
141
|
exports.default = _default;
|
|
@@ -11,6 +11,9 @@ 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); }
|
|
14
17
|
/**
|
|
15
18
|
* Portal allows to render a component at a different place in the parent tree.
|
|
16
19
|
* You can use it to render content which should appear above other elements, similar to `Modal`.
|
|
@@ -32,33 +35,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
32
35
|
* }
|
|
33
36
|
* ```
|
|
34
37
|
*/
|
|
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
|
-
*/
|
|
62
38
|
class Portal extends React.Component {
|
|
63
39
|
// @component ./PortalHost.tsx
|
|
64
40
|
|
|
@@ -7,31 +7,16 @@ 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); }
|
|
10
13
|
class PortalConsumer extends React.Component {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
await Promise.resolve();
|
|
15
|
-
this.key = this.props.manager.mount(this.props.children);
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
_defineProperty(this, "key", void 0);
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
this.checkManager();
|
|
19
|
-
this.props.manager.update(this.key, this.props.children);
|
|
20
|
-
}
|
|
21
|
-
componentWillUnmount() {
|
|
18
|
+
async componentDidMount() {
|
|
22
19
|
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();
|
|
35
20
|
|
|
36
21
|
// Delay updating to prevent React from going to infinite loop
|
|
37
22
|
await Promise.resolve();
|
|
@@ -8,54 +8,28 @@ 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 _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); }
|
|
11
14
|
/**
|
|
12
15
|
* Portal host is the component which actually renders all Portals.
|
|
13
16
|
*/
|
|
14
17
|
class PortalManager extends React.PureComponent {
|
|
15
18
|
constructor() {
|
|
16
19
|
super(...arguments);
|
|
17
|
-
this
|
|
20
|
+
_defineProperty(this, "state", {
|
|
18
21
|
portals: []
|
|
19
|
-
};
|
|
20
|
-
this
|
|
22
|
+
});
|
|
23
|
+
_defineProperty(this, "mount", (key, children) => {
|
|
21
24
|
this.setState(state => ({
|
|
22
25
|
portals: [...state.portals, {
|
|
23
26
|
key,
|
|
24
27
|
children
|
|
25
28
|
}]
|
|
26
29
|
}));
|
|
27
|
-
};
|
|
28
|
-
this.update = (key, children) => this.setState(state => ({
|
|
29
|
-
portals: state.portals.map(item => {
|
|
30
|
-
if (item.key === key) {
|
|
31
|
-
return {
|
|
32
|
-
...item,
|
|
33
|
-
children
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return item;
|
|
37
|
-
})
|
|
38
|
-
}));
|
|
39
|
-
this.unmount = key => this.setState(state => ({
|
|
40
|
-
portals: state.portals.filter(item => item.key !== key)
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
render() {
|
|
44
|
-
return this.state.portals.map(_ref => {
|
|
45
|
-
let {
|
|
46
|
-
key,
|
|
47
|
-
children
|
|
48
|
-
} = _ref;
|
|
49
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
50
|
-
key: key,
|
|
51
|
-
collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */,
|
|
52
|
-
pointerEvents: "box-none",
|
|
53
|
-
style: _reactNative.StyleSheet.absoluteFill
|
|
54
|
-
}, children);
|
|
55
30
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
exports.default = PortalManager;tate.portals.map(item => {
|
|
31
|
+
_defineProperty(this, "update", (key, children) => this.setState(state => ({
|
|
32
|
+
portals: state.portals.map(item => {
|
|
59
33
|
if (item.key === key) {
|
|
60
34
|
return {
|
|
61
35
|
...item,
|
|
@@ -10,6 +10,7 @@ var _Text = _interopRequireDefault(require("../Text"));
|
|
|
10
10
|
var _theming = require("../../theming");
|
|
11
11
|
var _RadioButtonGroup = _interopRequireDefault(require("./RadioButtonGroup"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
14
|
const RadioButtonFieldGroup = _ref => {
|
|
14
15
|
let {
|
|
15
16
|
label,
|
|
@@ -26,15 +27,6 @@ const RadioButtonFieldGroup = _ref => {
|
|
|
26
27
|
fontSize: theme.typography.headline4.fontSize,
|
|
27
28
|
color: theme.typography.headline4.color
|
|
28
29
|
}, labelStyle]
|
|
29
|
-
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, {
|
|
30
|
-
theme: theme,
|
|
31
|
-
...rest
|
|
32
|
-
}, children));
|
|
33
|
-
};
|
|
34
|
-
var _default = (0, _theming.withTheme)(RadioButtonFieldGroup);
|
|
35
|
-
exports.default = _default; fontSize: theme.typography.headline4.fontSize,
|
|
36
|
-
color: theme.typography.headline4.color
|
|
37
|
-
}, labelStyle]
|
|
38
30
|
}, label), /*#__PURE__*/_react.default.createElement(_RadioButtonGroup.default, _extends({
|
|
39
31
|
theme: theme
|
|
40
32
|
}, rest), children));
|
|
@@ -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
|
+
let Direction;
|
|
10
10
|
exports.Direction = Direction;
|
|
11
11
|
(function (Direction) {
|
|
12
12
|
Direction["Horizontal"] = "horizontal";
|
|
@@ -10,6 +10,7 @@ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
|
10
10
|
var _theming = require("../theming");
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
14
|
function ScreenContainer(_ref) {
|
|
14
15
|
let {
|
|
15
16
|
scrollable = false,
|
|
@@ -29,13 +30,12 @@ function ScreenContainer(_ref) {
|
|
|
29
30
|
if (hasSafeArea || hasBottomSafeArea) {
|
|
30
31
|
edges.push("bottom");
|
|
31
32
|
}
|
|
32
|
-
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
33
|
+
return /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, _extends({
|
|
33
34
|
edges: edges,
|
|
34
35
|
style: [styles.container, {
|
|
35
36
|
backgroundColor
|
|
36
|
-
}]
|
|
37
|
-
|
|
38
|
-
}, scrollable ? /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
37
|
+
}]
|
|
38
|
+
}, rest), scrollable ? /*#__PURE__*/React.createElement(_reactNative.ScrollView, {
|
|
39
39
|
contentContainerStyle: [styles.scrollViewContainer, {
|
|
40
40
|
backgroundColor
|
|
41
41
|
}, style]
|
|
@@ -55,20 +55,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
58
|
-
exports.default = _default;(_reactNative.View, {
|
|
59
|
-
style: [styles.container, {
|
|
60
|
-
backgroundColor
|
|
61
|
-
}, style]
|
|
62
|
-
}, children));
|
|
63
|
-
}
|
|
64
|
-
const styles = _reactNative.StyleSheet.create({
|
|
65
|
-
container: {
|
|
66
|
-
flex: 1
|
|
67
|
-
},
|
|
68
|
-
scrollViewContainer: {
|
|
69
|
-
flexGrow: 1,
|
|
70
|
-
flex: undefined
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
var _default = (0, _theming.withTheme)(ScreenContainer);
|
|
74
58
|
exports.default = _default;
|
|
@@ -9,6 +9,7 @@ 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); }
|
|
12
13
|
const StarRating = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
Icon,
|
|
@@ -39,10 +40,9 @@ const StarRating = _ref => {
|
|
|
39
40
|
!!onPress && onPress(r);
|
|
40
41
|
}, [onPress]);
|
|
41
42
|
const ratingRounded = Math.round(localRating * 2) / 2;
|
|
42
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
|
-
style: [styles.container, style]
|
|
44
|
-
|
|
45
|
-
}, [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
43
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
44
|
+
style: [styles.container, style]
|
|
45
|
+
}, rest), [...Array(maxStars)].map((_, i) => /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
46
46
|
key: i,
|
|
47
47
|
style: {
|
|
48
48
|
display: "flex"
|
|
@@ -83,23 +83,4 @@ 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);
|
|
105
86
|
exports.default = _default;
|
|
@@ -12,8 +12,7 @@ var _theming = require("../theming");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
16
|
const Surface = _ref => {
|
|
18
17
|
let {
|
|
19
18
|
elevation: propElevation,
|
|
@@ -43,18 +42,7 @@ const Surface = _ref => {
|
|
|
43
42
|
return colors.surface;
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, {
|
|
47
|
-
...rest,
|
|
48
|
-
style: [{
|
|
49
|
-
backgroundColor: getBackgroundColor(),
|
|
50
|
-
elevation,
|
|
51
|
-
...evalationStyles,
|
|
52
|
-
...restStyle
|
|
53
|
-
}]
|
|
54
|
-
}, children);
|
|
55
|
-
};
|
|
56
|
-
var _default = (0, _theming.withTheme)(Surface);
|
|
57
|
-
exports.default = _default;xtends({}, rest, {
|
|
45
|
+
return /*#__PURE__*/React.createElement(_reactNative.Animated.View, _extends({}, rest, {
|
|
58
46
|
style: [{
|
|
59
47
|
backgroundColor: getBackgroundColor(),
|
|
60
48
|
elevation,
|
|
@@ -10,6 +10,10 @@ var _theming = require("../theming");
|
|
|
10
10
|
var _utilities = require("../utilities");
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
17
|
const AnimatedText = _reactNative.Animated.createAnimatedComponent(_reactNative.Text);
|
|
14
18
|
const FOCUS_ANIMATION_DURATION = 150;
|
|
15
19
|
const BLUR_ANIMATION_DURATION = 180;
|
|
@@ -17,7 +21,7 @@ const ICON_SIZE = 24;
|
|
|
17
21
|
class TextField extends React.Component {
|
|
18
22
|
constructor() {
|
|
19
23
|
super(...arguments);
|
|
20
|
-
this
|
|
24
|
+
_defineProperty(this, "state", {
|
|
21
25
|
nativeProps: {},
|
|
22
26
|
labeled: new _reactNative.Animated.Value(this.props.value || this.props.error ? 0 : 1),
|
|
23
27
|
focused: false,
|
|
@@ -26,46 +30,47 @@ class TextField extends React.Component {
|
|
|
26
30
|
measured: false,
|
|
27
31
|
width: 0
|
|
28
32
|
}
|
|
29
|
-
};
|
|
30
|
-
this
|
|
31
|
-
this
|
|
33
|
+
});
|
|
34
|
+
_defineProperty(this, "_timer", setTimeout(() => {}, 0));
|
|
35
|
+
_defineProperty(this, "_showPlaceholder", () => {
|
|
32
36
|
clearTimeout(this._timer);
|
|
37
|
+
|
|
33
38
|
// Set the placeholder in a delay to offset the label animation
|
|
34
39
|
// If we show it immediately, they'll overlap and look ugly
|
|
35
40
|
this._timer = setTimeout(() => this.setState({
|
|
36
41
|
placeholder: this.props.placeholder
|
|
37
42
|
}), 50);
|
|
38
|
-
};
|
|
39
|
-
this._hidePlaceholder = () => this.setState({
|
|
40
|
-
placeholder: ""
|
|
41
43
|
});
|
|
42
|
-
this
|
|
44
|
+
_defineProperty(this, "_hidePlaceholder", () => this.setState({
|
|
45
|
+
placeholder: ""
|
|
46
|
+
}));
|
|
47
|
+
_defineProperty(this, "_restoreLabel", () => _reactNative.Animated.timing(this.state.labeled, {
|
|
43
48
|
toValue: 1,
|
|
44
49
|
duration: FOCUS_ANIMATION_DURATION,
|
|
45
50
|
useNativeDriver: true
|
|
46
|
-
}).start();
|
|
47
|
-
this
|
|
51
|
+
}).start());
|
|
52
|
+
_defineProperty(this, "_minmizeLabel", () => _reactNative.Animated.timing(this.state.labeled, {
|
|
48
53
|
toValue: 0,
|
|
49
54
|
duration: BLUR_ANIMATION_DURATION,
|
|
50
55
|
useNativeDriver: true
|
|
51
|
-
}).start();
|
|
52
|
-
this
|
|
56
|
+
}).start());
|
|
57
|
+
_defineProperty(this, "_handleFocus", () => {
|
|
53
58
|
if (this.props.disabled) {
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
61
|
this.setState({
|
|
57
62
|
focused: true
|
|
58
63
|
});
|
|
59
|
-
};
|
|
60
|
-
this
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(this, "_handleBlur", () => {
|
|
61
66
|
if (this.props.disabled) {
|
|
62
67
|
return;
|
|
63
68
|
}
|
|
64
69
|
this.setState({
|
|
65
70
|
focused: false
|
|
66
71
|
});
|
|
67
|
-
};
|
|
68
|
-
this
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "_handleChangeText", value => {
|
|
69
74
|
if (this.props.disabled) {
|
|
70
75
|
return;
|
|
71
76
|
}
|
|
@@ -80,8 +85,8 @@ class TextField extends React.Component {
|
|
|
80
85
|
});
|
|
81
86
|
this.props.onChangeText && this.props.onChangeText(value.nativeEvent.text);
|
|
82
87
|
}
|
|
83
|
-
};
|
|
84
|
-
this
|
|
88
|
+
});
|
|
89
|
+
_defineProperty(this, "_root", undefined);
|
|
85
90
|
}
|
|
86
91
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
87
92
|
return {
|
|
@@ -168,9 +173,7 @@ class TextField extends React.Component {
|
|
|
168
173
|
roundness,
|
|
169
174
|
disabledOpacity
|
|
170
175
|
},
|
|
171
|
-
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput,
|
|
172
|
-
...props
|
|
173
|
-
}),
|
|
176
|
+
render = props => /*#__PURE__*/React.createElement(_reactNative.TextInput, props),
|
|
174
177
|
...rest
|
|
175
178
|
} = this.props;
|
|
176
179
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
@@ -310,10 +313,9 @@ class TextField extends React.Component {
|
|
|
310
313
|
} = _reactNative.StyleSheet.flatten(style || {});
|
|
311
314
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
312
315
|
style: [styles.container, styleProp]
|
|
313
|
-
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, {
|
|
314
|
-
...leftIconProps,
|
|
316
|
+
}, leftIconName && leftIconMode === "outset" ? /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
315
317
|
style: leftIconStyle
|
|
316
|
-
}) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
318
|
+
})) : null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
317
319
|
style: (0, _utilities.applyStyles)([containerStyle], {
|
|
318
320
|
height: style === null || style === void 0 ? void 0 : style.height,
|
|
319
321
|
backgroundColor: bgColor,
|
|
@@ -381,10 +383,9 @@ class TextField extends React.Component {
|
|
|
381
383
|
style: {
|
|
382
384
|
justifyContent: type === "solid" ? "center" : undefined
|
|
383
385
|
}
|
|
384
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
385
|
-
...leftIconProps,
|
|
386
|
+
}, /*#__PURE__*/React.createElement(Icon, _extends({}, leftIconProps, {
|
|
386
387
|
style: leftIconStyle
|
|
387
|
-
})) : null, render({
|
|
388
|
+
}))) : null, render({
|
|
388
389
|
ref: c => {
|
|
389
390
|
this._root = c;
|
|
390
391
|
},
|
|
@@ -422,55 +423,6 @@ class TextField extends React.Component {
|
|
|
422
423
|
}
|
|
423
424
|
var _default = (0, _theming.withTheme)(TextField);
|
|
424
425
|
exports.default = _default;
|
|
425
|
-
const styles = _reactNative.StyleSheet.create({
|
|
426
|
-
container: {
|
|
427
|
-
alignSelf: "stretch"
|
|
428
|
-
},
|
|
429
|
-
placeholder: {
|
|
430
|
-
position: "absolute",
|
|
431
|
-
left: 0
|
|
432
|
-
},
|
|
433
|
-
underline: {
|
|
434
|
-
position: "absolute",
|
|
435
|
-
left: 0,
|
|
436
|
-
right: 0,
|
|
437
|
-
bottom: 0,
|
|
438
|
-
height: 2
|
|
439
|
-
},
|
|
440
|
-
input: {
|
|
441
|
-
flexGrow: 1,
|
|
442
|
-
justifyContent: "center",
|
|
443
|
-
textAlignVertical: "center",
|
|
444
|
-
margin: 0,
|
|
445
|
-
textAlign: _reactNative.I18nManager.isRTL ? "right" : "left"
|
|
446
|
-
}
|
|
447
|
-
});_handleFocus,
|
|
448
|
-
onBlur: this._handleBlur,
|
|
449
|
-
underlineColorAndroid: "transparent",
|
|
450
|
-
style: inputStyles,
|
|
451
|
-
...rest,
|
|
452
|
-
...this.state.nativeProps,
|
|
453
|
-
value: this.state.value
|
|
454
|
-
})), rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
455
|
-
name: rightIconName,
|
|
456
|
-
size: ICON_SIZE,
|
|
457
|
-
color: colors.light,
|
|
458
|
-
style: {
|
|
459
|
-
position: "absolute",
|
|
460
|
-
right: 16,
|
|
461
|
-
marginTop: type === "solid" ? MINIMIZED_LABEL_FONT_SIZE + 4 : 16
|
|
462
|
-
}
|
|
463
|
-
}) : null, assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
464
|
-
style: [{
|
|
465
|
-
color: error ? colors.error : colors.light,
|
|
466
|
-
marginTop: 8,
|
|
467
|
-
marginLeft: assistiveTextLeftMargin
|
|
468
|
-
}]
|
|
469
|
-
}, assistiveText) : null);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
var _default = (0, _theming.withTheme)(TextField);
|
|
473
|
-
exports.default = _default;
|
|
474
426
|
const styles = _reactNative.StyleSheet.create({
|
|
475
427
|
container: {
|
|
476
428
|
alignSelf: "stretch"
|