@draftbit/core 46.4.4-d55501.2 → 46.4.4-d5b88a.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 +15 -0
- 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 +18 -0
- package/lib/commonjs/components/CardContainerRating.js +20 -2
- package/lib/commonjs/components/CardContainerShortImage.js +12 -0
- package/lib/commonjs/components/CardInline.js +14 -1
- package/lib/commonjs/components/Carousel.js +21 -3
- 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 +20 -0
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +24 -3
- package/lib/commonjs/components/Checkbox/context.js +5 -0
- package/lib/commonjs/components/Checkbox/index.js +4 -0
- package/lib/commonjs/components/CircleImage.js +9 -0
- package/lib/commonjs/components/CircularProgress.js +13 -3
- package/lib/commonjs/components/Config.js +13 -5
- package/lib/commonjs/components/Container.js +15 -15
- package/lib/commonjs/components/DatePicker/DatePicker.js +48 -16
- 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 +11 -0
- package/lib/commonjs/components/DeprecatedFAB.js +26 -0
- package/lib/commonjs/components/Divider.js +9 -0
- package/lib/commonjs/components/Elevation.js +11 -0
- 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 +23 -6
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +27 -8
- package/lib/commonjs/components/Picker/PickerComponent.web.js +23 -6
- 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 +25 -5
- 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 +21 -1
- 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 +14 -0
- package/lib/commonjs/components/Slider.js +21 -0
- package/lib/commonjs/components/StarRating.js +10 -0
- package/lib/commonjs/components/StepIndicator.js +39 -5
- package/lib/commonjs/components/Stepper.js +26 -7
- 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 +18 -3
- package/lib/commonjs/components/TextField.js +62 -12
- 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 +4 -0
- package/lib/commonjs/hooks.js +7 -4
- package/lib/commonjs/index.js +52 -13
- 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 +4 -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/HtmlElements.js +125 -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 +3 -1
- 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 +3 -0
- 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 +10 -9
- package/lib/module/components/Button.js +10 -2
- package/lib/module/components/Card.js +2 -0
- package/lib/module/components/CardBlock.js +6 -0
- 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 +9 -3
- 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 +8 -0
- package/lib/module/components/Checkbox/CheckboxRow.js +11 -3
- package/lib/module/components/Checkbox/context.js +2 -0
- package/lib/module/components/CircleImage.js +3 -0
- package/lib/module/components/CircularProgress.js +9 -3
- package/lib/module/components/Config.js +11 -5
- package/lib/module/components/Container.js +3 -0
- package/lib/module/components/DatePicker/DatePicker.js +33 -16
- 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 +13 -0
- 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 +10 -0
- package/lib/module/components/Layout.js +3 -4
- package/lib/module/components/NumberInput.js +16 -8
- package/lib/module/components/Picker/Picker.js +25 -8
- 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 +10 -5
- package/lib/module/components/Portal/PortalHost.js +22 -4
- 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 +6 -1
- package/lib/module/components/RadioButton/RadioButtonFieldGroup.js +3 -0
- package/lib/module/components/RadioButton/RadioButtonGroup.js +7 -0
- package/lib/module/components/RadioButton/RadioButtonRow.js +9 -1
- package/lib/module/components/RadioButton/context.js +2 -0
- 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 +16 -9
- package/lib/module/components/Surface.js +5 -0
- package/lib/module/components/Swiper/Swiper.js +4 -0
- package/lib/module/components/Swiper/SwiperItem.js +2 -0
- package/lib/module/components/Switch.js +7 -5
- package/lib/module/components/Text.js +10 -3
- package/lib/module/components/TextField.js +50 -12
- 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 +2 -4
- package/lib/module/mappings/Fetch.js +1 -0
- package/lib/module/mappings/FieldSearchBarFull.js +1 -2
- package/lib/module/mappings/HtmlElements.js +116 -0
- 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 +1 -1
- 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/Stepper.d.ts +1 -2
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/mappings/HtmlElements.d.ts +49 -0
- package/package.json +5 -6
- package/src/components/Picker/Picker.js +1 -1
- package/src/components/Picker/Picker.tsx +2 -2
- package/src/components/Stepper.js +5 -3
- package/src/components/Stepper.tsx +5 -5
- package/src/index.js +0 -1
- package/src/index.tsx +0 -1
- package/src/mappings/HtmlElements.js +141 -0
- package/src/mappings/HtmlElements.ts +151 -0
- package/src/mappings/Stepper.js +5 -2
- package/src/mappings/Stepper.ts +5 -1
- package/lib/commonjs/components/TabView/TabView.js +0 -87
- package/lib/commonjs/components/TabView/TabViewItem.js +0 -24
- package/lib/commonjs/components/TabView/index.js +0 -20
- package/lib/commonjs/mappings/TabView.js +0 -77
- package/lib/module/components/TabView/TabView.js +0 -79
- package/lib/module/components/TabView/TabViewItem.js +0 -17
- package/lib/module/components/TabView/index.js +0 -2
- package/lib/module/mappings/TabView.js +0 -70
- package/lib/typescript/src/components/TabView/TabView.d.ts +0 -19
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +0 -10
- package/lib/typescript/src/components/TabView/index.d.ts +0 -2
- package/lib/typescript/src/mappings/TabView.d.ts +0 -111
- package/src/components/TabView/TabView.js +0 -34
- package/src/components/TabView/TabView.tsx +0 -97
- package/src/components/TabView/TabViewItem.js +0 -5
- package/src/components/TabView/TabViewItem.tsx +0 -21
- package/src/components/TabView/index.js +0 -2
- package/src/components/TabView/index.tsx +0 -2
- package/src/mappings/TabView.js +0 -73
- package/src/mappings/TabView.ts +0 -80
|
@@ -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,34 @@ 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; }
|
|
29
|
+
|
|
18
30
|
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); }
|
|
31
|
+
|
|
19
32
|
const Picker = _ref => {
|
|
20
|
-
var _options$find;
|
|
33
|
+
var _options$find$label, _options$find;
|
|
34
|
+
|
|
21
35
|
let {
|
|
22
36
|
style,
|
|
23
37
|
options,
|
|
@@ -59,10 +73,12 @@ const Picker = _ref => {
|
|
|
59
73
|
}
|
|
60
74
|
} = (0, _utilities.extractStyles)(style);
|
|
61
75
|
const textField = React.useRef(undefined);
|
|
76
|
+
|
|
62
77
|
const onValueChange = (itemValue, itemIndex) => {
|
|
63
78
|
toggleFocus();
|
|
64
79
|
onValueChangeOverride(itemValue, itemIndex);
|
|
65
80
|
};
|
|
81
|
+
|
|
66
82
|
const toggleFocus = () => {
|
|
67
83
|
if (!disabled) {
|
|
68
84
|
// @ts-ignore
|
|
@@ -71,7 +87,7 @@ const Picker = _ref => {
|
|
|
71
87
|
};
|
|
72
88
|
|
|
73
89
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
74
|
-
const selectedLabel = selectedValue && (((_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label)
|
|
90
|
+
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);
|
|
75
91
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
76
92
|
disabled: disabled,
|
|
77
93
|
onPress: toggleFocus,
|
|
@@ -97,21 +113,22 @@ const Picker = _ref => {
|
|
|
97
113
|
pointerEvents: "none"
|
|
98
114
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
99
115
|
value: selectedLabel,
|
|
100
|
-
placeholder: placeholder
|
|
101
|
-
// @ts-ignore
|
|
116
|
+
placeholder: placeholder // @ts-ignore
|
|
102
117
|
,
|
|
103
118
|
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
104
119
|
,
|
|
105
|
-
disabled: disabled
|
|
106
|
-
// @ts-expect-error
|
|
120
|
+
disabled: disabled // @ts-expect-error
|
|
107
121
|
,
|
|
108
122
|
style: stylesWithoutMargin
|
|
109
123
|
})))));
|
|
110
124
|
};
|
|
125
|
+
|
|
111
126
|
const styles = _reactNative.StyleSheet.create({
|
|
112
127
|
container: {
|
|
113
128
|
alignSelf: "stretch"
|
|
114
129
|
}
|
|
115
130
|
});
|
|
131
|
+
|
|
116
132
|
var _default = (0, _theming.withTheme)(Picker);
|
|
133
|
+
|
|
117
134
|
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;
|
|
@@ -4,20 +4,34 @@ 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 _picker = require("@react-native-picker/picker");
|
|
13
|
+
|
|
10
14
|
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
15
|
+
|
|
11
16
|
var _theming = require("../../theming");
|
|
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; }
|
|
29
|
+
|
|
18
30
|
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); }
|
|
31
|
+
|
|
19
32
|
const Picker = _ref => {
|
|
20
|
-
var _options$find;
|
|
33
|
+
var _options$find$label, _options$find;
|
|
34
|
+
|
|
21
35
|
let {
|
|
22
36
|
style,
|
|
23
37
|
options,
|
|
@@ -59,10 +73,12 @@ const Picker = _ref => {
|
|
|
59
73
|
}
|
|
60
74
|
} = (0, _utilities.extractStyles)(style);
|
|
61
75
|
const textField = React.useRef(undefined);
|
|
76
|
+
|
|
62
77
|
const onValueChange = (itemValue, itemIndex) => {
|
|
63
78
|
toggleFocus();
|
|
64
79
|
onValueChangeOverride(itemValue, itemIndex);
|
|
65
80
|
};
|
|
81
|
+
|
|
66
82
|
const toggleFocus = () => {
|
|
67
83
|
if (!disabled) {
|
|
68
84
|
// @ts-ignore
|
|
@@ -71,7 +87,7 @@ const Picker = _ref => {
|
|
|
71
87
|
};
|
|
72
88
|
|
|
73
89
|
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
74
|
-
const selectedLabel = selectedValue && (((_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label)
|
|
90
|
+
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);
|
|
75
91
|
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
76
92
|
disabled: disabled,
|
|
77
93
|
onPress: toggleFocus,
|
|
@@ -98,21 +114,22 @@ const Picker = _ref => {
|
|
|
98
114
|
pointerEvents: "none"
|
|
99
115
|
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
100
116
|
value: selectedLabel,
|
|
101
|
-
placeholder: placeholder
|
|
102
|
-
// @ts-ignore
|
|
117
|
+
placeholder: placeholder // @ts-ignore
|
|
103
118
|
,
|
|
104
119
|
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
105
120
|
,
|
|
106
|
-
disabled: disabled
|
|
107
|
-
// @ts-expect-error
|
|
121
|
+
disabled: disabled // @ts-expect-error
|
|
108
122
|
,
|
|
109
123
|
style: stylesWithoutMargin
|
|
110
124
|
})))));
|
|
111
125
|
};
|
|
126
|
+
|
|
112
127
|
const styles = _reactNative.StyleSheet.create({
|
|
113
128
|
container: {
|
|
114
129
|
alignSelf: "stretch"
|
|
115
130
|
}
|
|
116
131
|
});
|
|
132
|
+
|
|
117
133
|
var _default = (0, _theming.withTheme)(Picker);
|
|
134
|
+
|
|
118
135
|
exports.default = _default;
|
|
@@ -4,16 +4,23 @@ 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 _PortalConsumer = _interopRequireDefault(require("./PortalConsumer"));
|
|
11
|
+
|
|
9
12
|
var _PortalHost = _interopRequireWildcard(require("./PortalHost"));
|
|
13
|
+
|
|
10
14
|
var _theming = require("../../theming");
|
|
15
|
+
|
|
11
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
12
18
|
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); }
|
|
19
|
+
|
|
13
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; }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
17
24
|
/**
|
|
18
25
|
* Portal allows to render a component at a different place in the parent tree.
|
|
19
26
|
* You can use it to render content which should appear above other elements, similar to `Modal`.
|
|
@@ -37,7 +44,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
37
44
|
*/
|
|
38
45
|
class Portal extends React.Component {
|
|
39
46
|
// @component ./PortalHost.tsx
|
|
40
|
-
|
|
41
47
|
render() {
|
|
42
48
|
const {
|
|
43
49
|
children,
|
|
@@ -49,7 +55,11 @@ class Portal extends React.Component {
|
|
|
49
55
|
theme: theme
|
|
50
56
|
}, children)));
|
|
51
57
|
}
|
|
58
|
+
|
|
52
59
|
}
|
|
60
|
+
|
|
53
61
|
_defineProperty(Portal, "Host", _PortalHost.default);
|
|
62
|
+
|
|
54
63
|
var _default = (0, _theming.withTheme)(Portal);
|
|
64
|
+
|
|
55
65
|
exports.default = _default;
|
|
@@ -4,39 +4,49 @@ 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
|
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
|
+
|
|
9
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; }
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
|
|
13
16
|
class PortalConsumer extends React.Component {
|
|
14
17
|
constructor() {
|
|
15
18
|
super(...arguments);
|
|
19
|
+
|
|
16
20
|
_defineProperty(this, "key", void 0);
|
|
17
21
|
}
|
|
22
|
+
|
|
18
23
|
async componentDidMount() {
|
|
19
|
-
this.checkManager();
|
|
24
|
+
this.checkManager(); // Delay updating to prevent React from going to infinite loop
|
|
20
25
|
|
|
21
|
-
// Delay updating to prevent React from going to infinite loop
|
|
22
26
|
await Promise.resolve();
|
|
23
27
|
this.key = this.props.manager.mount(this.props.children);
|
|
24
28
|
}
|
|
29
|
+
|
|
25
30
|
componentDidUpdate() {
|
|
26
31
|
this.checkManager();
|
|
27
32
|
this.props.manager.update(this.key, this.props.children);
|
|
28
33
|
}
|
|
34
|
+
|
|
29
35
|
componentWillUnmount() {
|
|
30
36
|
this.checkManager();
|
|
31
37
|
this.props.manager.unmount(this.key);
|
|
32
38
|
}
|
|
39
|
+
|
|
33
40
|
checkManager() {
|
|
34
41
|
if (!this.props.manager) {
|
|
35
42
|
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");
|
|
36
43
|
}
|
|
37
44
|
}
|
|
45
|
+
|
|
38
46
|
render() {
|
|
39
47
|
return null;
|
|
40
48
|
}
|
|
49
|
+
|
|
41
50
|
}
|
|
51
|
+
|
|
42
52
|
exports.default = PortalConsumer;
|