@draftbit/core 46.4.4-c18fe1.2 → 46.4.4-c96c31.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/Provider.js +9 -0
- package/lib/commonjs/components/Accordion/AccordionGroup.js +14 -0
- package/lib/commonjs/components/Accordion/AccordionItem.js +13 -0
- package/lib/commonjs/components/Accordion/index.js +3 -0
- package/lib/commonjs/components/ActionSheet/ActionSheet.js +9 -0
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +5 -0
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +7 -0
- package/lib/commonjs/components/ActionSheet/index.js +4 -0
- package/lib/commonjs/components/AnimatedCircularProgress.js +26 -1
- package/lib/commonjs/components/AspectRatio.js +10 -0
- package/lib/commonjs/components/AvatarEdit.js +12 -0
- package/lib/commonjs/components/Banner.js +23 -9
- package/lib/commonjs/components/Button.js +19 -2
- package/lib/commonjs/components/Card.js +14 -0
- package/lib/commonjs/components/CardBlock.js +15 -0
- package/lib/commonjs/components/CardContainer.js +32 -4
- package/lib/commonjs/components/CardContainerRating.js +34 -6
- package/lib/commonjs/components/CardContainerShortImage.js +28 -4
- package/lib/commonjs/components/CardInline.js +14 -1
- package/lib/commonjs/components/Carousel.js +23 -5
- package/lib/commonjs/components/Checkbox/Checkbox.js +18 -3
- package/lib/commonjs/components/Checkbox/CheckboxGroup.js +11 -0
- package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +43 -5
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +47 -8
- package/lib/commonjs/components/Checkbox/context.js +5 -0
- package/lib/commonjs/components/Checkbox/index.js +4 -0
- package/lib/commonjs/components/CircleImage.js +10 -15
- package/lib/commonjs/components/CircularProgress.js +26 -8
- package/lib/commonjs/components/Config.js +13 -5
- package/lib/commonjs/components/Container.js +11 -0
- package/lib/commonjs/components/DatePicker/DatePicker.js +65 -23
- package/lib/commonjs/components/DatePicker/DatePickerComponent.js +7 -0
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +10 -0
- package/lib/commonjs/components/DeprecatedButton.js +23 -0
- package/lib/commonjs/components/DeprecatedCardWrapper.js +27 -1
- package/lib/commonjs/components/DeprecatedFAB.js +26 -0
- package/lib/commonjs/components/Divider.js +9 -0
- package/lib/commonjs/components/Elevation.js +25 -2
- package/lib/commonjs/components/FAB.js +10 -0
- package/lib/commonjs/components/FieldSearchBarFull.js +18 -0
- package/lib/commonjs/components/FormRow.js +10 -0
- package/lib/commonjs/components/Header.js +13 -0
- package/lib/commonjs/components/HeaderLarge.js +9 -0
- package/lib/commonjs/components/HeaderMedium.js +9 -0
- package/lib/commonjs/components/HeaderOverline.js +9 -0
- package/lib/commonjs/components/IconButton.js +10 -0
- package/lib/commonjs/components/Image.js +17 -0
- package/lib/commonjs/components/Layout.js +12 -2
- package/lib/commonjs/components/NumberInput.js +21 -8
- package/lib/commonjs/components/Picker/Picker.js +42 -9
- package/lib/commonjs/components/Picker/PickerComponent.android.js +43 -7
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +27 -8
- package/lib/commonjs/components/Picker/PickerComponent.web.js +43 -7
- package/lib/commonjs/components/Portal/Portal.js +14 -4
- package/lib/commonjs/components/Portal/PortalConsumer.js +15 -5
- package/lib/commonjs/components/Portal/PortalHost.js +31 -4
- package/lib/commonjs/components/Portal/PortalManager.js +19 -7
- package/lib/commonjs/components/ProgressBar.js +45 -9
- package/lib/commonjs/components/ProgressCircle.js +10 -0
- package/lib/commonjs/components/ProgressIndicator.js +9 -0
- package/lib/commonjs/components/RadioButton/RadioButton.js +14 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +10 -0
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +14 -0
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +44 -6
- package/lib/commonjs/components/RadioButton/context.js +5 -0
- package/lib/commonjs/components/RadioButton/index.js +5 -0
- package/lib/commonjs/components/Row.js +11 -0
- package/lib/commonjs/components/RowBodyIcon.js +10 -0
- package/lib/commonjs/components/RowHeadlineImageCaption.js +11 -2
- package/lib/commonjs/components/RowHeadlineImageIcon.js +10 -0
- package/lib/commonjs/components/SVG.js +9 -0
- package/lib/commonjs/components/ScreenContainer.js +36 -4
- package/lib/commonjs/components/Slider.js +21 -0
- package/lib/commonjs/components/StarRating.js +10 -0
- package/lib/commonjs/components/StepIndicator.js +71 -19
- package/lib/commonjs/components/Stepper.js +28 -8
- package/lib/commonjs/components/Surface.js +14 -0
- package/lib/commonjs/components/Swiper/Swiper.js +8 -0
- package/lib/commonjs/components/Swiper/SwiperItem.js +6 -0
- package/lib/commonjs/components/Swiper/index.js +3 -0
- package/lib/commonjs/components/Switch.js +18 -5
- package/lib/commonjs/components/Text.js +53 -8
- package/lib/commonjs/components/TextField.js +118 -35
- package/lib/commonjs/components/ToggleButton.js +14 -0
- package/lib/commonjs/components/Touchable.js +5 -0
- package/lib/commonjs/components/Touchable.web.js +2 -0
- package/lib/commonjs/components/Typography.js +5 -0
- package/lib/commonjs/components/useAuthState.js +9 -0
- package/lib/commonjs/constants.js +5 -1
- package/lib/commonjs/hooks.js +7 -4
- package/lib/commonjs/index.js +52 -7
- package/lib/commonjs/interfaces/Icon.js +5 -3
- package/lib/commonjs/mappings/Accordion.js +2 -0
- package/lib/commonjs/mappings/AccordionItem.js +2 -0
- package/lib/commonjs/mappings/ActionSheet.js +2 -0
- package/lib/commonjs/mappings/ActionSheetCancel.js +2 -0
- package/lib/commonjs/mappings/ActionSheetItem.js +2 -0
- package/lib/commonjs/mappings/ActivityIndicator.js +2 -0
- package/lib/commonjs/mappings/AudioPlayer.js +2 -0
- package/lib/commonjs/mappings/AvatarEdit.js +2 -0
- package/lib/commonjs/mappings/Banner.js +2 -0
- package/lib/commonjs/mappings/BlurView.js +2 -0
- package/lib/commonjs/mappings/Button.js +5 -6
- package/lib/commonjs/mappings/Card.js +4 -3
- package/lib/commonjs/mappings/CardBlock.js +5 -6
- package/lib/commonjs/mappings/CardContainer.js +7 -5
- package/lib/commonjs/mappings/CardContainerRating.js +4 -4
- package/lib/commonjs/mappings/CardContainerShortImage.js +2 -0
- package/lib/commonjs/mappings/CardInline.js +2 -0
- package/lib/commonjs/mappings/Carousel.js +2 -0
- package/lib/commonjs/mappings/Checkbox.js +2 -0
- package/lib/commonjs/mappings/CheckboxGroup.js +2 -0
- package/lib/commonjs/mappings/CheckboxRow.js +2 -0
- package/lib/commonjs/mappings/CircleImage.js +2 -0
- package/lib/commonjs/mappings/Container.js +2 -0
- package/lib/commonjs/mappings/CustomCode.js +2 -0
- package/lib/commonjs/mappings/DatePicker.js +17 -4
- package/lib/commonjs/mappings/Divider.js +2 -0
- package/lib/commonjs/mappings/FAB.js +2 -0
- package/lib/commonjs/mappings/Fetch.js +2 -0
- package/lib/commonjs/mappings/FieldSearchBarFull.js +3 -2
- package/lib/commonjs/mappings/FlashList.js +2 -0
- package/lib/commonjs/mappings/FlatList.js +2 -0
- package/lib/commonjs/mappings/HeaderLarge.js +2 -0
- package/lib/commonjs/mappings/HeaderMedium.js +2 -0
- package/lib/commonjs/mappings/HeaderOverline.js +2 -0
- package/lib/commonjs/mappings/Icon.js +3 -2
- package/lib/commonjs/mappings/IconButton.js +2 -0
- package/lib/commonjs/mappings/Image.js +2 -0
- package/lib/commonjs/mappings/ImageBackground.js +2 -0
- package/lib/commonjs/mappings/KeyboardAvoidingView.js +2 -0
- package/lib/commonjs/mappings/KeyboardAwareScrollView.js +2 -0
- package/lib/commonjs/mappings/Layout.js +2 -0
- package/lib/commonjs/mappings/LinearGradient.js +2 -0
- package/lib/commonjs/mappings/MapCallout.js +2 -0
- package/lib/commonjs/mappings/MapMarker.js +2 -0
- package/lib/commonjs/mappings/MapView.js +2 -0
- package/lib/commonjs/mappings/Modal.js +2 -0
- package/lib/commonjs/mappings/NumberInput.js +4 -4
- package/lib/commonjs/mappings/Picker.js +4 -4
- package/lib/commonjs/mappings/ProgressBar.js +2 -0
- package/lib/commonjs/mappings/ProgressCircle.js +2 -0
- package/lib/commonjs/mappings/ProgressIndicator.js +2 -0
- package/lib/commonjs/mappings/RadioButton.js +2 -0
- package/lib/commonjs/mappings/RadioButtonGroup.js +2 -0
- package/lib/commonjs/mappings/RadioButtonRow.js +2 -0
- package/lib/commonjs/mappings/RowBodyIcon.js +2 -0
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js +2 -0
- package/lib/commonjs/mappings/RowHeadlineImageIcon.js +8 -12
- package/lib/commonjs/mappings/SVG.js +2 -0
- package/lib/commonjs/mappings/SafeAreaView.js +2 -0
- package/lib/commonjs/mappings/ScrollView.js +2 -0
- package/lib/commonjs/mappings/Slider.js +2 -0
- package/lib/commonjs/mappings/StarRating.js +9 -3
- package/lib/commonjs/mappings/Stepper.js +3 -1
- package/lib/commonjs/mappings/Surface.js +2 -0
- package/lib/commonjs/mappings/Swiper.js +2 -0
- package/lib/commonjs/mappings/SwiperItem.js +2 -0
- package/lib/commonjs/mappings/Switch.js +2 -0
- package/lib/commonjs/mappings/Text.js +5 -5
- package/lib/commonjs/mappings/TextArea.js +3 -2
- package/lib/commonjs/mappings/TextField.js +8 -7
- package/lib/commonjs/mappings/TextInput.js +3 -2
- package/lib/commonjs/mappings/ToggleButton.js +2 -0
- package/lib/commonjs/mappings/Touchable.js +2 -0
- package/lib/commonjs/mappings/Video.js +2 -0
- package/lib/commonjs/mappings/View.js +2 -0
- package/lib/commonjs/mappings/WebView.js +2 -0
- package/lib/commonjs/styles/DarkTheme.js +6 -5
- package/lib/commonjs/styles/DefaultTheme.js +17 -26
- package/lib/commonjs/styles/fonts.js +5 -3
- package/lib/commonjs/styles/overlay.js +14 -5
- package/lib/commonjs/styles/shadow.js +9 -0
- package/lib/commonjs/theming.js +4 -0
- package/lib/commonjs/utilities.js +14 -2
- package/lib/module/Provider.js +1 -0
- package/lib/module/components/Accordion/AccordionGroup.js +4 -0
- package/lib/module/components/Accordion/AccordionItem.js +28 -4
- package/lib/module/components/ActionSheet/ActionSheet.js +2 -0
- package/lib/module/components/ActionSheet/ActionSheetCancel.js +2 -0
- package/lib/module/components/ActionSheet/ActionSheetItem.js +2 -0
- package/lib/module/components/AnimatedCircularProgress.js +6 -0
- package/lib/module/components/AspectRatio.js +6 -0
- package/lib/module/components/AvatarEdit.js +3 -0
- package/lib/module/components/Banner.js +33 -12
- package/lib/module/components/Button.js +41 -12
- package/lib/module/components/Card.js +2 -0
- package/lib/module/components/CardBlock.js +20 -4
- package/lib/module/components/CardContainer.js +7 -0
- package/lib/module/components/CardContainerRating.js +8 -2
- package/lib/module/components/CardContainerShortImage.js +3 -0
- package/lib/module/components/CardInline.js +2 -0
- package/lib/module/components/Carousel.js +41 -11
- package/lib/module/components/Checkbox/Checkbox.js +9 -3
- package/lib/module/components/Checkbox/CheckboxGroup.js +5 -0
- package/lib/module/components/Checkbox/CheckboxGroupRow.js +31 -5
- package/lib/module/components/Checkbox/CheckboxRow.js +34 -8
- package/lib/module/components/Checkbox/context.js +3 -1
- package/lib/module/components/CircleImage.js +3 -0
- package/lib/module/components/CircularProgress.js +22 -8
- package/lib/module/components/Config.js +11 -5
- package/lib/module/components/Container.js +3 -0
- package/lib/module/components/DatePicker/DatePicker.js +73 -30
- package/lib/module/components/DatePicker/DatePickerComponent.js +2 -0
- package/lib/module/components/DatePicker/DatePickerComponent.web.js +2 -0
- package/lib/module/components/DeprecatedButton.js +9 -0
- package/lib/module/components/DeprecatedCardWrapper.js +6 -0
- package/lib/module/components/DeprecatedFAB.js +34 -3
- package/lib/module/components/Divider.js +3 -0
- package/lib/module/components/Elevation.js +3 -0
- package/lib/module/components/FAB.js +3 -0
- package/lib/module/components/FieldSearchBarFull.js +9 -0
- package/lib/module/components/FormRow.js +1 -0
- package/lib/module/components/Header.js +2 -0
- package/lib/module/components/HeaderLarge.js +2 -0
- package/lib/module/components/HeaderMedium.js +2 -0
- package/lib/module/components/HeaderOverline.js +2 -0
- package/lib/module/components/IconButton.js +3 -0
- package/lib/module/components/Image.js +27 -2
- package/lib/module/components/Layout.js +42 -21
- package/lib/module/components/NumberInput.js +16 -8
- package/lib/module/components/Picker/Picker.js +34 -10
- package/lib/module/components/Picker/PickerComponent.android.js +10 -6
- package/lib/module/components/Picker/PickerComponent.ios.js +11 -8
- package/lib/module/components/Picker/PickerComponent.web.js +10 -6
- package/lib/module/components/Portal/Portal.js +6 -4
- package/lib/module/components/Portal/PortalConsumer.js +14 -9
- package/lib/module/components/Portal/PortalHost.js +44 -15
- package/lib/module/components/Portal/PortalManager.js +14 -7
- package/lib/module/components/ProgressBar.js +17 -5
- package/lib/module/components/ProgressCircle.js +2 -0
- package/lib/module/components/ProgressIndicator.js +2 -0
- package/lib/module/components/RadioButton/RadioButton.js +20 -2
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +3 -0
- package/lib/module/components/RadioButton/RadioButtonGroup.js +23 -2
- package/lib/module/components/RadioButton/RadioButtonRow.js +32 -6
- package/lib/module/components/RadioButton/context.js +3 -1
- package/lib/module/components/Row.js +2 -0
- package/lib/module/components/RowBodyIcon.js +2 -0
- package/lib/module/components/RowHeadlineImageCaption.js +3 -2
- package/lib/module/components/RowHeadlineImageIcon.js +2 -0
- package/lib/module/components/SVG.js +2 -0
- package/lib/module/components/ScreenContainer.js +6 -0
- package/lib/module/components/Slider.js +10 -0
- package/lib/module/components/StarRating.js +3 -0
- package/lib/module/components/StepIndicator.js +29 -5
- package/lib/module/components/Stepper.js +18 -10
- package/lib/module/components/Surface.js +20 -1
- package/lib/module/components/Swiper/Swiper.js +4 -0
- package/lib/module/components/Swiper/SwiperItem.js +2 -0
- package/lib/module/components/Switch.js +27 -12
- package/lib/module/components/Text.js +10 -3
- package/lib/module/components/TextField.js +105 -35
- package/lib/module/components/ToggleButton.js +5 -0
- package/lib/module/components/Touchable.js +1 -0
- package/lib/module/components/useAuthState.js +4 -0
- package/lib/module/constants.js +1 -2
- package/lib/module/hooks.js +2 -4
- package/lib/module/index.js +2 -5
- package/lib/module/interfaces/Icon.js +1 -2
- package/lib/module/mappings/Button.js +3 -6
- package/lib/module/mappings/Card.js +2 -3
- package/lib/module/mappings/CardBlock.js +3 -6
- package/lib/module/mappings/CardContainer.js +5 -5
- package/lib/module/mappings/CardContainerRating.js +2 -4
- package/lib/module/mappings/DatePicker.js +16 -5
- package/lib/module/mappings/Fetch.js +1 -0
- package/lib/module/mappings/FieldSearchBarFull.js +5 -3
- package/lib/module/mappings/Icon.js +1 -2
- package/lib/module/mappings/NumberInput.js +2 -4
- package/lib/module/mappings/Picker.js +2 -4
- package/lib/module/mappings/RowHeadlineImageIcon.js +6 -12
- package/lib/module/mappings/StarRating.js +8 -3
- package/lib/module/mappings/Stepper.js +2 -2
- package/lib/module/mappings/Text.js +3 -5
- package/lib/module/mappings/TextArea.js +1 -2
- package/lib/module/mappings/TextField.js +6 -7
- package/lib/module/mappings/TextInput.js +1 -2
- package/lib/module/styles/DarkTheme.js +2 -4
- package/lib/module/styles/DefaultTheme.js +13 -26
- package/lib/module/styles/fonts.js +1 -2
- package/lib/module/styles/overlay.js +10 -4
- package/lib/module/styles/shadow.js +6 -0
- package/lib/module/utilities.js +5 -2
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +4 -0
- package/lib/typescript/src/components/Stepper.d.ts +1 -2
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/mappings/DatePicker.d.ts +42 -0
- package/package.json +3 -5
- package/src/components/Carousel.js +2 -2
- package/src/components/Carousel.tsx +2 -2
- package/src/components/DatePicker/DatePicker.js +14 -8
- package/src/components/DatePicker/DatePicker.tsx +23 -7
- package/src/components/Picker/Picker.js +1 -1
- package/src/components/Picker/Picker.tsx +2 -2
- package/src/components/Stepper.js +6 -3
- package/src/components/Stepper.tsx +6 -6
- package/src/index.js +0 -1
- package/src/index.tsx +0 -1
- package/src/mappings/DatePicker.js +21 -1
- package/src/mappings/DatePicker.ts +23 -0
- package/src/mappings/Stepper.js +5 -2
- package/src/mappings/Stepper.ts +5 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.native.js +0 -58
- package/lib/commonjs/components/BottomSheet/BottomSheet.web.js +0 -83
- package/lib/commonjs/components/BottomSheet/index.js +0 -13
- package/lib/commonjs/components/BottomSheet/types.js +0 -5
- package/lib/commonjs/mappings/BottomSheet.js +0 -20
- package/lib/module/components/BottomSheet/BottomSheet.native.js +0 -49
- package/lib/module/components/BottomSheet/BottomSheet.web.js +0 -75
- package/lib/module/components/BottomSheet/index.js +0 -2
- package/lib/module/components/BottomSheet/types.js +0 -1
- package/lib/module/mappings/BottomSheet.js +0 -13
- package/lib/typescript/src/components/BottomSheet/BottomSheet.native.d.ts +0 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.web.d.ts +0 -4
- package/lib/typescript/src/components/BottomSheet/index.d.ts +0 -1
- package/lib/typescript/src/components/BottomSheet/types.d.ts +0 -8
- package/lib/typescript/src/mappings/BottomSheet.d.ts +0 -19
- package/src/components/BottomSheet/BottomSheet.native.js +0 -37
- package/src/components/BottomSheet/BottomSheet.native.tsx +0 -60
- package/src/components/BottomSheet/BottomSheet.web.js +0 -56
- package/src/components/BottomSheet/BottomSheet.web.tsx +0 -90
- package/src/components/BottomSheet/index.js +0 -2
- package/src/components/BottomSheet/index.tsx +0 -2
- package/src/components/BottomSheet/types.js +0 -1
- package/src/components/BottomSheet/types.tsx +0 -8
- package/src/mappings/BottomSheet.js +0 -20
- package/src/mappings/BottomSheet.ts +0 -25
|
@@ -4,12 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _theming = require("../theming");
|
|
13
|
+
|
|
10
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
|
+
|
|
11
16
|
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; }
|
|
17
|
+
|
|
12
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); }
|
|
19
|
+
|
|
13
20
|
const IconButton = _ref => {
|
|
14
21
|
let {
|
|
15
22
|
Icon,
|
|
@@ -48,6 +55,7 @@ const IconButton = _ref => {
|
|
|
48
55
|
color: iconColor
|
|
49
56
|
}) : null));
|
|
50
57
|
};
|
|
58
|
+
|
|
51
59
|
const styles = _reactNative.StyleSheet.create({
|
|
52
60
|
container: {
|
|
53
61
|
alignItems: "center",
|
|
@@ -60,5 +68,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
60
68
|
})
|
|
61
69
|
}
|
|
62
70
|
});
|
|
71
|
+
|
|
63
72
|
var _default = (0, _theming.withTheme)(IconButton);
|
|
73
|
+
|
|
64
74
|
exports.default = _default;
|
|
@@ -4,24 +4,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _Config = _interopRequireDefault(require("./Config"));
|
|
13
|
+
|
|
10
14
|
var _AspectRatio = _interopRequireDefault(require("./AspectRatio"));
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
12
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); }
|
|
19
|
+
|
|
13
20
|
const generateDimensions = _ref => {
|
|
14
21
|
let {
|
|
15
22
|
aspectRatio,
|
|
16
23
|
width,
|
|
17
24
|
height
|
|
18
25
|
} = _ref;
|
|
26
|
+
|
|
19
27
|
if (aspectRatio && !width && !height) {
|
|
20
28
|
return {
|
|
21
29
|
aspectRatio,
|
|
22
30
|
width: "100%"
|
|
23
31
|
};
|
|
24
32
|
}
|
|
33
|
+
|
|
25
34
|
if (aspectRatio && height) {
|
|
26
35
|
return {
|
|
27
36
|
aspectRatio,
|
|
@@ -29,6 +38,7 @@ const generateDimensions = _ref => {
|
|
|
29
38
|
width: aspectRatio * height
|
|
30
39
|
};
|
|
31
40
|
}
|
|
41
|
+
|
|
32
42
|
if (aspectRatio && width) {
|
|
33
43
|
return {
|
|
34
44
|
aspectRatio,
|
|
@@ -36,11 +46,13 @@ const generateDimensions = _ref => {
|
|
|
36
46
|
height: width / aspectRatio
|
|
37
47
|
};
|
|
38
48
|
}
|
|
49
|
+
|
|
39
50
|
return {
|
|
40
51
|
width,
|
|
41
52
|
height
|
|
42
53
|
};
|
|
43
54
|
};
|
|
55
|
+
|
|
44
56
|
const Image = _ref2 => {
|
|
45
57
|
let {
|
|
46
58
|
source,
|
|
@@ -49,12 +61,15 @@ const Image = _ref2 => {
|
|
|
49
61
|
...props
|
|
50
62
|
} = _ref2;
|
|
51
63
|
let imageSource = source === null || source === undefined ? _Config.default.placeholderImageURL : source;
|
|
64
|
+
|
|
52
65
|
const styles = _reactNative.StyleSheet.flatten(style || {});
|
|
66
|
+
|
|
53
67
|
const {
|
|
54
68
|
aspectRatio,
|
|
55
69
|
width,
|
|
56
70
|
height
|
|
57
71
|
} = generateDimensions(styles);
|
|
72
|
+
|
|
58
73
|
if (aspectRatio) {
|
|
59
74
|
return /*#__PURE__*/_react.default.createElement(_AspectRatio.default, {
|
|
60
75
|
style: [style, {
|
|
@@ -71,11 +86,13 @@ const Image = _ref2 => {
|
|
|
71
86
|
}]
|
|
72
87
|
})));
|
|
73
88
|
}
|
|
89
|
+
|
|
74
90
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Image, _extends({}, props, {
|
|
75
91
|
source: source,
|
|
76
92
|
resizeMode: resizeMode,
|
|
77
93
|
style: style
|
|
78
94
|
}));
|
|
79
95
|
};
|
|
96
|
+
|
|
80
97
|
var _default = Image;
|
|
81
98
|
exports.default = _default;
|
|
@@ -9,11 +9,17 @@ exports.Row = Row;
|
|
|
9
9
|
exports.Spacer = Spacer;
|
|
10
10
|
exports.Square = Square;
|
|
11
11
|
exports.Stack = Stack;
|
|
12
|
+
|
|
12
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
|
+
|
|
13
15
|
var _reactNative = require("react-native");
|
|
16
|
+
|
|
14
17
|
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); }
|
|
18
|
+
|
|
15
19
|
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; }
|
|
20
|
+
|
|
16
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); }
|
|
22
|
+
|
|
17
23
|
function Center(_ref) {
|
|
18
24
|
let {
|
|
19
25
|
width = 240,
|
|
@@ -33,6 +39,7 @@ function Center(_ref) {
|
|
|
33
39
|
}, style]
|
|
34
40
|
}, rest), children);
|
|
35
41
|
}
|
|
42
|
+
|
|
36
43
|
function Circle(_ref2) {
|
|
37
44
|
let {
|
|
38
45
|
size = 50,
|
|
@@ -53,6 +60,7 @@ function Circle(_ref2) {
|
|
|
53
60
|
}]
|
|
54
61
|
}, rest), children);
|
|
55
62
|
}
|
|
63
|
+
|
|
56
64
|
function Square(_ref3) {
|
|
57
65
|
let {
|
|
58
66
|
size = 50,
|
|
@@ -68,6 +76,7 @@ function Square(_ref3) {
|
|
|
68
76
|
bgColor: bgColor
|
|
69
77
|
}, rest), children);
|
|
70
78
|
}
|
|
79
|
+
|
|
71
80
|
function Row(_ref4) {
|
|
72
81
|
let {
|
|
73
82
|
justifyContent,
|
|
@@ -77,8 +86,7 @@ function Row(_ref4) {
|
|
|
77
86
|
...rest
|
|
78
87
|
} = _ref4;
|
|
79
88
|
return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
|
|
80
|
-
style: [style,
|
|
81
|
-
// style goes first b/c we can't override these
|
|
89
|
+
style: [style, // style goes first b/c we can't override these
|
|
82
90
|
{
|
|
83
91
|
alignItems,
|
|
84
92
|
flexDirection: "row",
|
|
@@ -86,6 +94,7 @@ function Row(_ref4) {
|
|
|
86
94
|
}]
|
|
87
95
|
}, rest), children);
|
|
88
96
|
}
|
|
97
|
+
|
|
89
98
|
function Spacer(_ref5) {
|
|
90
99
|
let {
|
|
91
100
|
top = 8,
|
|
@@ -105,6 +114,7 @@ function Spacer(_ref5) {
|
|
|
105
114
|
}]
|
|
106
115
|
}, rest), children);
|
|
107
116
|
}
|
|
117
|
+
|
|
108
118
|
function Stack(_ref6) {
|
|
109
119
|
let {
|
|
110
120
|
children,
|
|
@@ -4,12 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _lodash = require("lodash");
|
|
13
|
+
|
|
10
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
|
+
|
|
11
16
|
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; }
|
|
17
|
+
|
|
12
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); }
|
|
19
|
+
|
|
13
20
|
const NumberInput = _ref => {
|
|
14
21
|
let {
|
|
15
22
|
onChangeText,
|
|
@@ -18,6 +25,7 @@ const NumberInput = _ref => {
|
|
|
18
25
|
...props
|
|
19
26
|
} = _ref;
|
|
20
27
|
const [currentStringNumberValue, setCurrentStringNumberValue] = (0, _react.useState)("0");
|
|
28
|
+
|
|
21
29
|
const formatValueToStringNumber = valueToFormat => {
|
|
22
30
|
if (valueToFormat != null) {
|
|
23
31
|
if ((0, _lodash.isString)(valueToFormat) && valueToFormat !== "") {
|
|
@@ -32,31 +40,35 @@ const NumberInput = _ref => {
|
|
|
32
40
|
return valueToFormat.toString();
|
|
33
41
|
}
|
|
34
42
|
}
|
|
43
|
+
|
|
35
44
|
return "0";
|
|
36
|
-
};
|
|
45
|
+
}; // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
46
|
+
|
|
37
47
|
|
|
38
|
-
// set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
|
|
39
48
|
(0, _react.useEffect)(() => {
|
|
40
49
|
const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
|
|
50
|
+
|
|
41
51
|
if (currentStringNumberValue !== defaultStringNumberValue) {
|
|
42
52
|
setCurrentStringNumberValue(defaultStringNumberValue);
|
|
43
|
-
}
|
|
44
|
-
|
|
53
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
|
+
|
|
45
55
|
}, []);
|
|
56
|
+
|
|
46
57
|
const handleChangeText = newValue => {
|
|
47
58
|
const newStringNumberValue = formatValueToStringNumber(newValue);
|
|
48
59
|
const number = parseFloat(newStringNumberValue);
|
|
49
60
|
setCurrentStringNumberValue(newStringNumberValue);
|
|
50
61
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(number);
|
|
51
|
-
};
|
|
62
|
+
}; // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
|
|
63
|
+
|
|
52
64
|
|
|
53
|
-
// run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
|
|
54
65
|
(0, _react.useEffect)(() => {
|
|
55
66
|
const nextStringNumberValue = formatValueToStringNumber(value);
|
|
67
|
+
|
|
56
68
|
if (currentStringNumberValue !== nextStringNumberValue) {
|
|
57
69
|
handleChangeText(nextStringNumberValue);
|
|
58
|
-
}
|
|
59
|
-
|
|
70
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
71
|
+
|
|
60
72
|
}, [value]);
|
|
61
73
|
return /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, _extends({
|
|
62
74
|
keyboardType: "numeric",
|
|
@@ -64,5 +76,6 @@ const NumberInput = _ref => {
|
|
|
64
76
|
onChangeText: handleChangeText
|
|
65
77
|
}, props));
|
|
66
78
|
};
|
|
79
|
+
|
|
67
80
|
var _default = NumberInput;
|
|
68
81
|
exports.default = _default;
|
|
@@ -4,29 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _lodash = require("lodash");
|
|
13
|
+
|
|
10
14
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
15
|
+
|
|
11
16
|
var _picker = require("@react-native-picker/picker");
|
|
17
|
+
|
|
12
18
|
var _theming = require("../../theming");
|
|
19
|
+
|
|
13
20
|
var _Portal = _interopRequireDefault(require("../Portal/Portal"));
|
|
21
|
+
|
|
14
22
|
var _DeprecatedButton = _interopRequireDefault(require("../DeprecatedButton"));
|
|
23
|
+
|
|
15
24
|
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
25
|
+
|
|
16
26
|
var _utilities = require("../../utilities");
|
|
27
|
+
|
|
17
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
18
30
|
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); }
|
|
31
|
+
|
|
19
32
|
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; }
|
|
33
|
+
|
|
20
34
|
function normalizeOptions(options) {
|
|
21
35
|
if (options.length === 0) {
|
|
22
36
|
return [];
|
|
23
37
|
}
|
|
38
|
+
|
|
24
39
|
if (typeof options[0] === ("string" || "number")) {
|
|
25
40
|
return options.map(option => ({
|
|
26
41
|
label: String(option),
|
|
27
42
|
value: String(option)
|
|
28
43
|
}));
|
|
29
44
|
}
|
|
45
|
+
|
|
30
46
|
if ((0, _lodash.isObject)(options[0]) && options[0].value !== null && options[0].label !== null) {
|
|
31
47
|
return options.map(option => {
|
|
32
48
|
return {
|
|
@@ -35,18 +51,23 @@ function normalizeOptions(options) {
|
|
|
35
51
|
};
|
|
36
52
|
});
|
|
37
53
|
}
|
|
54
|
+
|
|
38
55
|
throw new Error('Picker options must be either an array of strings or array of { "label": string; "value": string; } objects.');
|
|
39
56
|
}
|
|
57
|
+
|
|
40
58
|
const {
|
|
41
59
|
width: deviceWidth,
|
|
42
60
|
height: deviceHeight
|
|
43
61
|
} = _reactNative.Dimensions.get("screen");
|
|
62
|
+
|
|
44
63
|
const isIos = _reactNative.Platform.OS === "ios";
|
|
45
64
|
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
46
65
|
const disabledColor = "rgb(240, 240, 240)";
|
|
47
66
|
const errorColor = "rgba(255, 69, 100, 1)";
|
|
67
|
+
|
|
48
68
|
const Picker = _ref => {
|
|
49
|
-
var _find;
|
|
69
|
+
var _find$label, _find;
|
|
70
|
+
|
|
50
71
|
let {
|
|
51
72
|
error,
|
|
52
73
|
options = [],
|
|
@@ -71,9 +92,11 @@ const Picker = _ref => {
|
|
|
71
92
|
const androidPickerRef = React.useRef(undefined);
|
|
72
93
|
const [internalValue, setInternalValue] = React.useState(value || defaultValue);
|
|
73
94
|
const [pickerVisible, setPickerVisible] = React.useState(false);
|
|
95
|
+
|
|
74
96
|
const togglePickerVisible = () => {
|
|
75
97
|
setPickerVisible(!pickerVisible);
|
|
76
98
|
};
|
|
99
|
+
|
|
77
100
|
React.useEffect(() => {
|
|
78
101
|
if (value != null) {
|
|
79
102
|
setInternalValue(value);
|
|
@@ -87,6 +110,7 @@ const Picker = _ref => {
|
|
|
87
110
|
React.useEffect(() => {
|
|
88
111
|
if (pickerVisible && androidPickerRef.current) {
|
|
89
112
|
var _androidPickerRef$cur;
|
|
113
|
+
|
|
90
114
|
androidPickerRef === null || androidPickerRef === void 0 ? void 0 : (_androidPickerRef$cur = androidPickerRef.current) === null || _androidPickerRef$cur === void 0 ? void 0 : _androidPickerRef$cur.focus();
|
|
91
115
|
}
|
|
92
116
|
}, [pickerVisible, androidPickerRef]);
|
|
@@ -108,9 +132,7 @@ const Picker = _ref => {
|
|
|
108
132
|
borderStyles: extractedBorderStyles,
|
|
109
133
|
marginStyles: extractedMarginStyles
|
|
110
134
|
} = (0, _utilities.extractBorderAndMarginStyles)(viewStyles, additionalBorderStyles, additionalMarginStyles);
|
|
111
|
-
const borderStyles = {
|
|
112
|
-
...{
|
|
113
|
-
...(type === "solid" ? {
|
|
135
|
+
const borderStyles = { ...{ ...(type === "solid" ? {
|
|
114
136
|
borderTopLeftRadius: 5,
|
|
115
137
|
borderTopRightRadius: 5,
|
|
116
138
|
borderBottomRightRadius: 5,
|
|
@@ -137,7 +159,7 @@ const Picker = _ref => {
|
|
|
137
159
|
...extractedMarginStyles
|
|
138
160
|
};
|
|
139
161
|
const stylesWithoutBordersAndMargins = (0, _lodash.omit)(viewStyles, [..._utilities.borderStyleNames, ..._utilities.marginStyleNames, ...additionalBorderStyles, ...additionalMarginStyles]);
|
|
140
|
-
const selectedLabel = internalValue && (((_find = pickerOptions.find(option => option.value === internalValue)) === null || _find === void 0 ? void 0 : _find.label)
|
|
162
|
+
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
163
|
const labelText = label ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
142
164
|
style: {
|
|
143
165
|
textAlign: textStyles.textAlign,
|
|
@@ -166,15 +188,19 @@ const Picker = _ref => {
|
|
|
166
188
|
}
|
|
167
189
|
}) : null;
|
|
168
190
|
const textAlign = textStyles === null || textStyles === void 0 ? void 0 : textStyles.textAlign;
|
|
191
|
+
|
|
169
192
|
const calculateLeftPadding = () => {
|
|
170
193
|
if (leftIconOutset) {
|
|
171
194
|
if (textAlign === "center") {
|
|
172
195
|
return iconSize - Math.abs(8 - iconSize);
|
|
173
196
|
}
|
|
197
|
+
|
|
174
198
|
return iconSize + 8;
|
|
175
199
|
}
|
|
200
|
+
|
|
176
201
|
return 0;
|
|
177
202
|
};
|
|
203
|
+
|
|
178
204
|
const assistiveTextLabel = assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
179
205
|
style: {
|
|
180
206
|
textAlign,
|
|
@@ -196,14 +222,18 @@ const Picker = _ref => {
|
|
|
196
222
|
color: unstyledColor
|
|
197
223
|
} : {})
|
|
198
224
|
};
|
|
225
|
+
|
|
199
226
|
const handleValueChange = (newValue, itemIndex) => {
|
|
200
227
|
if (!placeholder || itemIndex > 0) {
|
|
201
228
|
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
|
|
202
229
|
}
|
|
230
|
+
|
|
203
231
|
setInternalValue(newValue);
|
|
204
232
|
};
|
|
233
|
+
|
|
205
234
|
return (
|
|
206
235
|
/*#__PURE__*/
|
|
236
|
+
|
|
207
237
|
/* marginsContainer */
|
|
208
238
|
React.createElement(_reactNative.View, {
|
|
209
239
|
style: [styles.marginsContainer, marginStyles]
|
|
@@ -220,7 +250,7 @@ const Picker = _ref => {
|
|
|
220
250
|
style: styles.primaryTextContainer
|
|
221
251
|
}, labelText, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
222
252
|
style: primaryTextStyle
|
|
223
|
-
}, String(selectedLabel
|
|
253
|
+
}, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))), rightIcon)), assistiveTextLabel), isIos && pickerVisible ? /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
224
254
|
style: [styles.iosPicker, {
|
|
225
255
|
backgroundColor: colors.divider
|
|
226
256
|
}]
|
|
@@ -253,8 +283,7 @@ const Picker = _ref => {
|
|
|
253
283
|
}))) : null)
|
|
254
284
|
);
|
|
255
285
|
};
|
|
256
|
-
|
|
257
|
-
exports.default = _default;
|
|
286
|
+
|
|
258
287
|
const styles = _reactNative.StyleSheet.create({
|
|
259
288
|
marginsContainer: {
|
|
260
289
|
alignSelf: "stretch",
|
|
@@ -324,4 +353,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
324
353
|
maxWidth: deviceWidth,
|
|
325
354
|
maxHeight: deviceHeight
|
|
326
355
|
}
|
|
327
|
-
});
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
var _default = (0, _theming.withTheme)(Picker);
|
|
359
|
+
|
|
360
|
+
exports.default = _default;
|
|
@@ -4,20 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
13
|
+
|
|
10
14
|
var _theming = require("../../theming");
|
|
15
|
+
|
|
11
16
|
var _picker = require("@react-native-picker/picker");
|
|
17
|
+
|
|
12
18
|
var _utilities = require("../../utilities");
|
|
19
|
+
|
|
13
20
|
var _TextField = _interopRequireDefault(require("../TextField"));
|
|
21
|
+
|
|
14
22
|
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
23
|
+
|
|
15
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
16
26
|
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); }
|
|
27
|
+
|
|
17
28
|
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
|
-
|
|
29
|
+
|
|
19
30
|
const Picker = _ref => {
|
|
20
|
-
var _options$find;
|
|
21
31
|
let {
|
|
22
32
|
style,
|
|
23
33
|
options,
|
|
@@ -27,6 +37,9 @@ const Picker = _ref => {
|
|
|
27
37
|
onValueChange: onValueChangeOverride = () => {},
|
|
28
38
|
...props
|
|
29
39
|
} = _ref;
|
|
40
|
+
|
|
41
|
+
var _a, _b;
|
|
42
|
+
|
|
30
43
|
const {
|
|
31
44
|
viewStyles: {
|
|
32
45
|
borderRadius,
|
|
@@ -59,10 +72,12 @@ const Picker = _ref => {
|
|
|
59
72
|
}
|
|
60
73
|
} = (0, _utilities.extractStyles)(style);
|
|
61
74
|
const textField = React.useRef(undefined);
|
|
75
|
+
|
|
62
76
|
const onValueChange = (itemValue, itemIndex) => {
|
|
63
77
|
toggleFocus();
|
|
64
78
|
onValueChangeOverride(itemValue, itemIndex);
|
|
65
79
|
};
|
|
80
|
+
|
|
66
81
|
const toggleFocus = () => {
|
|
67
82
|
if (!disabled) {
|
|
68
83
|
// @ts-ignore
|
|
@@ -71,7 +86,7 @@ const Picker = _ref => {
|
|
|
71
86
|
};
|
|
72
87
|
|
|
73
88
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
74
|
-
const selectedLabel = selectedValue && (((
|
|
89
|
+
const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
|
|
75
90
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
76
91
|
disabled: disabled,
|
|
77
92
|
onPress: toggleFocus,
|
|
@@ -95,23 +110,44 @@ const Picker = _ref => {
|
|
|
95
110
|
key: o.value
|
|
96
111
|
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
97
112
|
pointerEvents: "none"
|
|
98
|
-
}, /*#__PURE__*/React.createElement(_TextField.default,
|
|
113
|
+
}, /*#__PURE__*/React.createElement(_TextField.default, { ...props,
|
|
99
114
|
value: selectedLabel,
|
|
100
|
-
placeholder: placeholder
|
|
115
|
+
placeholder: placeholder,
|
|
101
116
|
// @ts-ignore
|
|
117
|
+
ref: textField,
|
|
118
|
+
disabled: disabled,
|
|
119
|
+
// @ts-expect-error
|
|
120
|
+
style: stylesWithoutMargin
|
|
121
|
+
}))));
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const styles = _reactNative.StyleSheet.create({
|
|
125
|
+
container: {
|
|
126
|
+
alignSelf: "stretch"
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
var _default = (0, _theming.withTheme)(Picker);
|
|
131
|
+
|
|
132
|
+
exports.default = _default; pointerEvents: "none"
|
|
133
|
+
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
134
|
+
value: selectedLabel,
|
|
135
|
+
placeholder: placeholder // @ts-ignore
|
|
102
136
|
,
|
|
103
137
|
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
104
138
|
,
|
|
105
|
-
disabled: disabled
|
|
106
|
-
// @ts-expect-error
|
|
139
|
+
disabled: disabled // @ts-expect-error
|
|
107
140
|
,
|
|
108
141
|
style: stylesWithoutMargin
|
|
109
142
|
})))));
|
|
110
143
|
};
|
|
144
|
+
|
|
111
145
|
const styles = _reactNative.StyleSheet.create({
|
|
112
146
|
container: {
|
|
113
147
|
alignSelf: "stretch"
|
|
114
148
|
}
|
|
115
149
|
});
|
|
150
|
+
|
|
116
151
|
var _default = (0, _theming.withTheme)(Picker);
|
|
152
|
+
|
|
117
153
|
exports.default = _default;
|
|
@@ -4,23 +4,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
7
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
8
10
|
var _reactNative = require("react-native");
|
|
11
|
+
|
|
9
12
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
13
|
+
|
|
10
14
|
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
15
|
+
|
|
11
16
|
var _picker = require("@react-native-picker/picker");
|
|
17
|
+
|
|
12
18
|
var _theming = require("../../theming");
|
|
19
|
+
|
|
13
20
|
var _Portal = _interopRequireDefault(require("../Portal/Portal"));
|
|
21
|
+
|
|
14
22
|
var _DeprecatedButton = _interopRequireDefault(require("../DeprecatedButton"));
|
|
23
|
+
|
|
15
24
|
var _TextField = _interopRequireDefault(require("../TextField"));
|
|
25
|
+
|
|
16
26
|
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
27
|
+
|
|
17
28
|
var _utilities = require("../../utilities");
|
|
29
|
+
|
|
18
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
19
32
|
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); }
|
|
33
|
+
|
|
20
34
|
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; }
|
|
35
|
+
|
|
21
36
|
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); }
|
|
37
|
+
|
|
22
38
|
const Picker = _ref => {
|
|
23
|
-
var _options$find;
|
|
39
|
+
var _options$find$label, _options$find;
|
|
40
|
+
|
|
24
41
|
let {
|
|
25
42
|
Icon,
|
|
26
43
|
style,
|
|
@@ -67,14 +84,15 @@ const Picker = _ref => {
|
|
|
67
84
|
} = (0, _utilities.extractStyles)(style);
|
|
68
85
|
const textField = React.useRef(undefined);
|
|
69
86
|
const [pickerVisible, setIsPickerVisible] = React.useState(false);
|
|
87
|
+
|
|
70
88
|
const toggleVisibility = () => {
|
|
71
|
-
setIsPickerVisible(!pickerVisible);
|
|
72
|
-
|
|
89
|
+
setIsPickerVisible(!pickerVisible); // @ts-ignore
|
|
90
|
+
|
|
73
91
|
textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()
|
|
74
92
|
};
|
|
75
93
|
|
|
76
94
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
77
|
-
const selectedLabel = selectedValue && (((_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label)
|
|
95
|
+
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);
|
|
78
96
|
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
79
97
|
style: [styles.container, viewStyles]
|
|
80
98
|
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
@@ -82,14 +100,12 @@ const Picker = _ref => {
|
|
|
82
100
|
onPress: toggleVisibility
|
|
83
101
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
84
102
|
value: String(selectedLabel),
|
|
85
|
-
placeholder: placeholder
|
|
86
|
-
// @ts-ignore
|
|
103
|
+
placeholder: placeholder // @ts-ignore
|
|
87
104
|
,
|
|
88
105
|
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
89
106
|
,
|
|
90
107
|
disabled: disabled,
|
|
91
|
-
pointerEvents: "none"
|
|
92
|
-
// @ts-expect-error
|
|
108
|
+
pointerEvents: "none" // @ts-expect-error
|
|
93
109
|
,
|
|
94
110
|
style: stylesWithoutMargin,
|
|
95
111
|
Icon: Icon
|
|
@@ -116,6 +132,7 @@ const Picker = _ref => {
|
|
|
116
132
|
key: o.value
|
|
117
133
|
})))))));
|
|
118
134
|
};
|
|
135
|
+
|
|
119
136
|
const styles = _reactNative.StyleSheet.create({
|
|
120
137
|
container: {
|
|
121
138
|
alignSelf: "stretch"
|
|
@@ -137,5 +154,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
137
154
|
alignSelf: "flex-end"
|
|
138
155
|
}
|
|
139
156
|
});
|
|
157
|
+
|
|
140
158
|
var _default = (0, _theming.withTheme)(Picker);
|
|
159
|
+
|
|
141
160
|
exports.default = _default;
|