@draftbit/core 44.1.13-c10e64.0 → 44.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/CircularProgress.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/Justification.js +0 -3
- package/lib/commonjs/components/Picker/Picker.js +266 -27
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.android.js +34 -110
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +44 -113
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +34 -111
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/ResizeMode.js +0 -3
- package/lib/commonjs/mappings/Picker.js +7 -1
- package/lib/commonjs/mappings/Picker.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/utilities.js +19 -0
- package/lib/commonjs/utilities.js.map +1 -1
- package/lib/module/components/Justification.js +1 -1
- package/lib/module/components/Picker/Picker.js +260 -28
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +32 -103
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +42 -108
- package/lib/module/components/Picker/PickerComponent.ios.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.web.js +32 -104
- package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/module/components/ResizeMode.js +1 -1
- package/lib/module/mappings/Picker.js +8 -2
- package/lib/module/mappings/Picker.js.map +1 -1
- package/lib/module/utilities.js +12 -1
- package/lib/module/utilities.js.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts +28 -4
- package/lib/typescript/src/components/Picker/PickerComponent.android.d.ts +12 -5
- package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +11 -5
- package/lib/typescript/src/components/Picker/PickerComponent.web.d.ts +12 -5
- package/lib/typescript/src/mappings/Picker.d.ts +21 -0
- package/lib/typescript/src/utilities.d.ts +7 -0
- package/package.json +2 -2
- package/src/components/Picker/Picker.tsx +434 -34
- package/src/components/Picker/PickerComponent.android.tsx +44 -101
- package/src/components/Picker/PickerComponent.ios.tsx +63 -116
- package/src/components/Picker/PickerComponent.web.tsx +44 -102
- package/src/mappings/Picker.ts +4 -0
- package/src/utilities.ts +65 -1
- package/lib/commonjs/components/Picker/PickerTypes.js +0 -6
- package/lib/commonjs/components/Picker/PickerTypes.js.map +0 -1
- package/lib/module/components/Picker/PickerTypes.js +0 -2
- package/lib/module/components/Picker/PickerTypes.js.map +0 -1
- package/lib/typescript/src/components/Picker/PickerTypes.d.ts +0 -18
- package/src/Provider.js +0 -9
- package/src/components/Accordion/AccordionGroup.js +0 -44
- package/src/components/Accordion/AccordionItem.js +0 -32
- package/src/components/Accordion/index.js +0 -2
- package/src/components/ActionSheet/ActionSheet.js +0 -45
- package/src/components/ActionSheet/ActionSheetCancel.js +0 -6
- package/src/components/ActionSheet/ActionSheetItem.js +0 -30
- package/src/components/ActionSheet/index.js +0 -3
- package/src/components/AnimatedCircularProgress.js +0 -43
- package/src/components/AspectRatio.js +0 -18
- package/src/components/AvatarEdit.js +0 -30
- package/src/components/Banner.js +0 -109
- package/src/components/Button.js +0 -112
- package/src/components/Card.js +0 -57
- package/src/components/CardBlock.js +0 -54
- package/src/components/CardContainer.js +0 -69
- package/src/components/CardContainerRating.js +0 -79
- package/src/components/CardContainerShortImage.js +0 -33
- package/src/components/CardInline.js +0 -36
- package/src/components/Carousel.js +0 -66
- package/src/components/Checkbox/Checkbox.js +0 -63
- package/src/components/Checkbox/CheckboxGroup.js +0 -21
- package/src/components/Checkbox/CheckboxGroupRow.js +0 -77
- package/src/components/Checkbox/CheckboxRow.js +0 -78
- package/src/components/Checkbox/context.js +0 -14
- package/src/components/Checkbox/index.js +0 -3
- package/src/components/CircleImage.js +0 -8
- package/src/components/CircularProgress.js +0 -78
- package/src/components/Config.js +0 -63
- package/src/components/Container.js +0 -43
- package/src/components/DatePicker/DatePicker.js +0 -368
- package/src/components/DatePicker/DatePickerComponent.js +0 -13
- package/src/components/DatePicker/DatePickerComponent.web.js +0 -30
- package/src/components/DatePicker/DatePickerComponentType.js +0 -1
- package/src/components/DeprecatedButton.js +0 -95
- package/src/components/DeprecatedCardWrapper.js +0 -18
- package/src/components/DeprecatedFAB.js +0 -115
- package/src/components/Divider.js +0 -13
- package/src/components/Elevation.js +0 -20
- package/src/components/FAB.js +0 -46
- package/src/components/FieldSearchBarFull.js +0 -53
- package/src/components/FormRow.js +0 -19
- package/src/components/Header.js +0 -44
- package/src/components/HeaderLarge.js +0 -7
- package/src/components/HeaderMedium.js +0 -7
- package/src/components/HeaderOverline.js +0 -7
- package/src/components/IconButton.js +0 -35
- package/src/components/Image.js +0 -47
- package/src/components/Justification.js +0 -1
- package/src/components/Layout.js +0 -50
- package/src/components/NumberInput.js +0 -49
- package/src/components/Picker/Picker.js +0 -56
- package/src/components/Picker/PickerComponent.android.js +0 -68
- package/src/components/Picker/PickerComponent.ios.js +0 -78
- package/src/components/Picker/PickerComponent.web.js +0 -69
- package/src/components/Picker/PickerTypes.js +0 -1
- package/src/components/Picker/PickerTypes.ts +0 -18
- package/src/components/Portal/Portal.js +0 -35
- package/src/components/Portal/PortalConsumer.js +0 -28
- package/src/components/Portal/PortalHost.js +0 -105
- package/src/components/Portal/PortalManager.js +0 -29
- package/src/components/ProgressBar.js +0 -118
- package/src/components/ProgressCircle.js +0 -13
- package/src/components/ProgressIndicator.js +0 -27
- package/src/components/RadioButton/RadioButton.js +0 -17
- package/src/components/RadioButton/RadioButtonFieldGroup.js +0 -17
- package/src/components/RadioButton/RadioButtonGroup.js +0 -43
- package/src/components/RadioButton/RadioButtonRow.js +0 -76
- package/src/components/RadioButton/context.js +0 -14
- package/src/components/RadioButton/index.js +0 -4
- package/src/components/ResizeMode.js +0 -1
- package/src/components/Row.js +0 -48
- package/src/components/RowBodyIcon.js +0 -8
- package/src/components/RowHeadlineImageCaption.js +0 -12
- package/src/components/RowHeadlineImageIcon.js +0 -14
- package/src/components/ScreenContainer.js +0 -34
- package/src/components/Slider.js +0 -63
- package/src/components/StarRating.js +0 -50
- package/src/components/StepIndicator.js +0 -346
- package/src/components/Stepper.js +0 -39
- package/src/components/Surface.js +0 -32
- package/src/components/Swiper/Swiper.js +0 -29
- package/src/components/Swiper/SwiperItem.js +0 -9
- package/src/components/Swiper/index.js +0 -2
- package/src/components/Switch.js +0 -56
- package/src/components/Text.js +0 -28
- package/src/components/TextField.js +0 -420
- package/src/components/ToggleButton.js +0 -39
- package/src/components/Touchable.js +0 -12
- package/src/components/Touchable.web.js +0 -2
- package/src/components/Typography.js +0 -36
- package/src/components/useAuthState.js +0 -31
- package/src/constants.js +0 -10
- package/src/hooks.js +0 -12
- package/src/index.js +0 -52
- package/src/interfaces/Icon.js +0 -8
- package/src/mappings/Accordion.js +0 -41
- package/src/mappings/AccordionItem.js +0 -16
- package/src/mappings/ActionSheet.js +0 -13
- package/src/mappings/ActionSheetCancel.js +0 -19
- package/src/mappings/ActionSheetItem.js +0 -23
- package/src/mappings/ActivityIndicator.js +0 -53
- package/src/mappings/AudioPlayer.js +0 -20
- package/src/mappings/AvatarEdit.js +0 -37
- package/src/mappings/Banner.js +0 -32
- package/src/mappings/BlurView.js +0 -41
- package/src/mappings/Button.js +0 -56
- package/src/mappings/Card.js +0 -52
- package/src/mappings/CardBlock.js +0 -122
- package/src/mappings/CardContainer.js +0 -102
- package/src/mappings/CardContainerRating.js +0 -124
- package/src/mappings/CardContainerShortImage.js +0 -118
- package/src/mappings/CardInline.js +0 -51
- package/src/mappings/Carousel.js +0 -18
- package/src/mappings/Checkbox.js +0 -45
- package/src/mappings/CheckboxGroup.js +0 -25
- package/src/mappings/CheckboxRow.js +0 -56
- package/src/mappings/CircleImage.js +0 -24
- package/src/mappings/Container.js +0 -29
- package/src/mappings/CustomCode.js +0 -8
- package/src/mappings/DatePicker.js +0 -146
- package/src/mappings/Divider.js +0 -26
- package/src/mappings/FAB.js +0 -36
- package/src/mappings/Fetch.js +0 -12
- package/src/mappings/FieldSearchBarFull.js +0 -49
- package/src/mappings/FlatList.js +0 -19
- package/src/mappings/HeaderLarge.js +0 -28
- package/src/mappings/HeaderMedium.js +0 -54
- package/src/mappings/HeaderOverline.js +0 -54
- package/src/mappings/Icon.js +0 -25
- package/src/mappings/IconButton.js +0 -30
- package/src/mappings/Image.js +0 -15
- package/src/mappings/ImageBackground.js +0 -28
- package/src/mappings/KeyboardAvoidingView.js +0 -40
- package/src/mappings/KeyboardAwareScrollView.js +0 -49
- package/src/mappings/Layout.js +0 -195
- package/src/mappings/LinearGradient.js +0 -77
- package/src/mappings/MapCallout.js +0 -21
- package/src/mappings/MapMarker.js +0 -47
- package/src/mappings/MapView.js +0 -138
- package/src/mappings/Modal.js +0 -41
- package/src/mappings/Picker.js +0 -137
- package/src/mappings/ProgressBar.js +0 -100
- package/src/mappings/ProgressCircle.js +0 -108
- package/src/mappings/ProgressIndicator.js +0 -180
- package/src/mappings/RadioButton.js +0 -50
- package/src/mappings/RadioButtonGroup.js +0 -16
- package/src/mappings/RadioButtonRow.js +0 -37
- package/src/mappings/RowBodyIcon.js +0 -75
- package/src/mappings/RowHeadlineImageCaption.js +0 -167
- package/src/mappings/RowHeadlineImageIcon.js +0 -99
- package/src/mappings/SafeAreaView.js +0 -33
- package/src/mappings/ScrollView.js +0 -30
- package/src/mappings/Slider.js +0 -59
- package/src/mappings/StarRating.js +0 -42
- package/src/mappings/Stepper.js +0 -28
- package/src/mappings/Surface.js +0 -13
- package/src/mappings/Swiper.js +0 -60
- package/src/mappings/SwiperItem.js +0 -8
- package/src/mappings/Switch.js +0 -75
- package/src/mappings/Text.js +0 -232
- package/src/mappings/TextArea.js +0 -52
- package/src/mappings/TextField.js +0 -158
- package/src/mappings/TextInput.js +0 -208
- package/src/mappings/ToggleButton.js +0 -45
- package/src/mappings/Touchable.js +0 -12
- package/src/mappings/Video.js +0 -74
- package/src/mappings/View.js +0 -206
- package/src/mappings/WebView.js +0 -18
- package/src/styles/DarkTheme.js +0 -26
- package/src/styles/DefaultTheme.js +0 -111
- package/src/styles/fonts.js +0 -62
- package/src/styles/overlay.js +0 -60
- package/src/styles/shadow.js +0 -51
- package/src/theming.js +0 -3
- package/src/utilities.js +0 -54
|
@@ -3,133 +3,57 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PickerComponent = void 0;
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
13
|
-
|
|
14
|
-
var _theming = require("../../theming");
|
|
15
|
-
|
|
16
12
|
var _picker = require("@react-native-picker/picker");
|
|
17
13
|
|
|
18
|
-
var _utilities = require("../../utilities");
|
|
19
|
-
|
|
20
|
-
var _TextField = _interopRequireDefault(require("../TextField"));
|
|
21
|
-
|
|
22
|
-
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
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); }
|
|
27
15
|
|
|
28
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; }
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
const {
|
|
19
|
+
width: deviceWidth,
|
|
20
|
+
height: deviceHeight
|
|
21
|
+
} = _reactNative.Dimensions.get("screen");
|
|
34
22
|
|
|
23
|
+
const PickerComponent = _ref => {
|
|
35
24
|
let {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onValueChange: onValueChangeOverride = () => {},
|
|
42
|
-
...props
|
|
25
|
+
androidPickerRef,
|
|
26
|
+
togglePickerVisible,
|
|
27
|
+
pickerOptions,
|
|
28
|
+
internalValue,
|
|
29
|
+
handleValueChange
|
|
43
30
|
} = _ref;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
56
|
-
borderLeftWidth,
|
|
57
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
58
|
-
borderColor,
|
|
59
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
60
|
-
backgroundColor,
|
|
61
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
62
|
-
padding,
|
|
63
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
64
|
-
paddingTop,
|
|
65
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
66
|
-
paddingRight,
|
|
67
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
68
|
-
paddingBottom,
|
|
69
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
70
|
-
paddingLeft,
|
|
71
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
72
|
-
...viewStyles
|
|
73
|
-
}
|
|
74
|
-
} = (0, _utilities.extractStyles)(style);
|
|
75
|
-
const textField = React.useRef(undefined);
|
|
76
|
-
|
|
77
|
-
const onValueChange = (itemValue, itemIndex) => {
|
|
78
|
-
toggleFocus();
|
|
79
|
-
onValueChangeOverride(itemValue, itemIndex);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const toggleFocus = () => {
|
|
83
|
-
if (!disabled) {
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
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);
|
|
91
|
-
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
92
|
-
disabled: disabled,
|
|
93
|
-
onPress: toggleFocus,
|
|
94
|
-
style: [styles.container, viewStyles]
|
|
95
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, null, /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
96
|
-
enabled: !disabled,
|
|
97
|
-
selectedValue: selectedValue,
|
|
98
|
-
onValueChange: onValueChange,
|
|
99
|
-
style: {
|
|
100
|
-
opacity: 0,
|
|
101
|
-
position: "absolute",
|
|
102
|
-
top: 0,
|
|
103
|
-
left: 0,
|
|
104
|
-
right: 0,
|
|
105
|
-
bottom: 0,
|
|
106
|
-
width: "100%"
|
|
107
|
-
}
|
|
108
|
-
}, options.map(o => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
109
|
-
label: o.label,
|
|
110
|
-
value: o.value,
|
|
111
|
-
key: o.value
|
|
112
|
-
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
113
|
-
pointerEvents: "none"
|
|
114
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
115
|
-
value: selectedLabel,
|
|
116
|
-
placeholder: placeholder // @ts-ignore
|
|
117
|
-
,
|
|
118
|
-
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
119
|
-
,
|
|
120
|
-
disabled: disabled // @ts-expect-error
|
|
121
|
-
,
|
|
122
|
-
style: stylesWithoutMargin
|
|
123
|
-
})))));
|
|
31
|
+
return /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
32
|
+
selectedValue: internalValue,
|
|
33
|
+
onValueChange: handleValueChange,
|
|
34
|
+
style: styles.nonIosPicker,
|
|
35
|
+
ref: androidPickerRef,
|
|
36
|
+
onBlur: togglePickerVisible
|
|
37
|
+
}, pickerOptions.map(option => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
38
|
+
label: option.label,
|
|
39
|
+
value: option.value,
|
|
40
|
+
key: option.value
|
|
41
|
+
})));
|
|
124
42
|
};
|
|
125
43
|
|
|
44
|
+
exports.PickerComponent = PickerComponent;
|
|
45
|
+
|
|
126
46
|
const styles = _reactNative.StyleSheet.create({
|
|
127
|
-
|
|
128
|
-
|
|
47
|
+
nonIosPicker: {
|
|
48
|
+
opacity: 0,
|
|
49
|
+
position: "absolute",
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
bottom: 0,
|
|
54
|
+
width: "100%",
|
|
55
|
+
maxWidth: deviceWidth,
|
|
56
|
+
maxHeight: deviceHeight
|
|
129
57
|
}
|
|
130
58
|
});
|
|
131
|
-
|
|
132
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
133
|
-
|
|
134
|
-
exports.default = _default;
|
|
135
59
|
//# sourceMappingURL=PickerComponent.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PickerComponent.android.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["PickerComponent.android.tsx"],"names":["width","deviceWidth","height","deviceHeight","Dimensions","get","PickerComponent","androidPickerRef","togglePickerVisible","pickerOptions","internalValue","handleValueChange","styles","nonIosPicker","map","option","label","value","StyleSheet","create","opacity","position","top","left","right","bottom","maxWidth","maxHeight"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAMA,MAAM;AAAEA,EAAAA,KAAK,EAAEC,WAAT;AAAsBC,EAAAA,MAAM,EAAEC;AAA9B,IAA+CC,wBAAWC,GAAX,CAAe,QAAf,CAArD;;AAWO,MAAMC,eAA+C,GAAG,QAMzD;AAAA,MAN0D;AAC9DC,IAAAA,gBAD8D;AAE9DC,IAAAA,mBAF8D;AAG9DC,IAAAA,aAH8D;AAI9DC,IAAAA,aAJ8D;AAK9DC,IAAAA;AAL8D,GAM1D;AACJ,sBACE,oBAAC,cAAD;AACE,IAAA,aAAa,EAAED,aADjB;AAEE,IAAA,aAAa,EAAEC,iBAFjB;AAGE,IAAA,KAAK,EAAEC,MAAM,CAACC,YAHhB;AAIE,IAAA,GAAG,EAAEN,gBAJP;AAKE,IAAA,MAAM,EAAEC;AALV,KAOIC,aAAD,CAA6CK,GAA7C,CAAkDC,MAAD,iBAChD,oBAAC,cAAD,CAAc,IAAd;AACE,IAAA,KAAK,EAAEA,MAAM,CAACC,KADhB;AAEE,IAAA,KAAK,EAAED,MAAM,CAACE,KAFhB;AAGE,IAAA,GAAG,EAAEF,MAAM,CAACE;AAHd,IADD,CAPH,CADF;AAiBD,CAxBM;;;;AA0BP,MAAML,MAAM,GAAGM,wBAAWC,MAAX,CAAkB;AAC/BN,EAAAA,YAAY,EAAE;AACZO,IAAAA,OAAO,EAAE,CADG;AAEZC,IAAAA,QAAQ,EAAE,UAFE;AAGZC,IAAAA,GAAG,EAAE,CAHO;AAIZC,IAAAA,IAAI,EAAE,CAJM;AAKZC,IAAAA,KAAK,EAAE,CALK;AAMZC,IAAAA,MAAM,EAAE,CANI;AAOZzB,IAAAA,KAAK,EAAE,MAPK;AAQZ0B,IAAAA,QAAQ,EAAEzB,WARE;AASZ0B,IAAAA,SAAS,EAAExB;AATC;AADiB,CAAlB,CAAf","sourcesContent":["import * as React from \"react\";\nimport { StyleSheet, Dimensions } from \"react-native\";\n\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nimport { PickerOption } from \"./Picker\";\n\nconst { width: deviceWidth, height: deviceHeight } = Dimensions.get(\"screen\");\n\ninterface PickerComponentProps {\n Icon: IconSlot[\"Icon\"];\n androidPickerRef: React.RefObject<any>;\n togglePickerVisible: () => void;\n pickerOptions: PickerOption[];\n internalValue: string | undefined;\n handleValueChange: (newValue: string, itemIndex: number) => void;\n}\n\nexport const PickerComponent: React.FC<PickerComponentProps> = ({\n androidPickerRef,\n togglePickerVisible,\n pickerOptions,\n internalValue,\n handleValueChange,\n}) => {\n return (\n <NativePicker\n selectedValue={internalValue}\n onValueChange={handleValueChange}\n style={styles.nonIosPicker}\n ref={androidPickerRef}\n onBlur={togglePickerVisible}\n >\n {(pickerOptions as unknown as PickerOption[]).map((option) => (\n <NativePicker.Item\n label={option.label}\n value={option.value}\n key={option.value}\n />\n ))}\n </NativePicker>\n );\n};\n\nconst styles = StyleSheet.create({\n nonIosPicker: {\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n maxWidth: deviceWidth,\n maxHeight: deviceHeight,\n },\n});\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PickerComponent = void 0;
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -11,151 +11,82 @@ var _reactNative = require("react-native");
|
|
|
11
11
|
|
|
12
12
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
13
13
|
|
|
14
|
-
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
15
|
-
|
|
16
14
|
var _picker = require("@react-native-picker/picker");
|
|
17
15
|
|
|
18
|
-
var _theming = require("../../theming");
|
|
19
|
-
|
|
20
16
|
var _Portal = _interopRequireDefault(require("../Portal/Portal"));
|
|
21
17
|
|
|
22
18
|
var _DeprecatedButton = _interopRequireDefault(require("../DeprecatedButton"));
|
|
23
19
|
|
|
24
|
-
var _TextField = _interopRequireDefault(require("../TextField"));
|
|
25
|
-
|
|
26
|
-
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
27
|
-
|
|
28
|
-
var _utilities = require("../../utilities");
|
|
29
|
-
|
|
30
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
21
|
|
|
32
22
|
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
23
|
|
|
34
24
|
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
25
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
const {
|
|
27
|
+
width: deviceWidth,
|
|
28
|
+
height: deviceHeight
|
|
29
|
+
} = _reactNative.Dimensions.get("screen");
|
|
40
30
|
|
|
31
|
+
const PickerComponent = _ref => {
|
|
41
32
|
let {
|
|
42
33
|
Icon,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
disabled = false,
|
|
48
|
-
onValueChange = () => {},
|
|
49
|
-
theme: {
|
|
50
|
-
colors
|
|
51
|
-
},
|
|
52
|
-
...props
|
|
34
|
+
togglePickerVisible,
|
|
35
|
+
pickerOptions,
|
|
36
|
+
internalValue,
|
|
37
|
+
handleValueChange
|
|
53
38
|
} = _ref;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
borderRadius,
|
|
57
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
58
|
-
borderWidth,
|
|
59
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
60
|
-
borderTopWidth,
|
|
61
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
62
|
-
borderRightWidth,
|
|
63
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
64
|
-
borderBottomWidth,
|
|
65
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
66
|
-
borderLeftWidth,
|
|
67
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
68
|
-
borderColor,
|
|
69
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
70
|
-
backgroundColor,
|
|
71
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
72
|
-
padding,
|
|
73
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
74
|
-
paddingTop,
|
|
75
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
76
|
-
paddingRight,
|
|
77
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
78
|
-
paddingBottom,
|
|
79
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
80
|
-
paddingLeft,
|
|
81
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
82
|
-
...viewStyles
|
|
83
|
-
}
|
|
84
|
-
} = (0, _utilities.extractStyles)(style);
|
|
85
|
-
const textField = React.useRef(undefined);
|
|
86
|
-
const [pickerVisible, setIsPickerVisible] = React.useState(false);
|
|
87
|
-
|
|
88
|
-
const toggleVisibility = () => {
|
|
89
|
-
setIsPickerVisible(!pickerVisible); // @ts-ignore
|
|
90
|
-
|
|
91
|
-
textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
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);
|
|
96
|
-
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
97
|
-
style: [styles.container, viewStyles]
|
|
98
|
-
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
99
|
-
disabled: disabled,
|
|
100
|
-
onPress: toggleVisibility
|
|
101
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
102
|
-
value: String(selectedLabel),
|
|
103
|
-
placeholder: placeholder // @ts-ignore
|
|
104
|
-
,
|
|
105
|
-
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
106
|
-
,
|
|
107
|
-
disabled: disabled,
|
|
108
|
-
pointerEvents: "none" // @ts-expect-error
|
|
109
|
-
,
|
|
110
|
-
style: stylesWithoutMargin,
|
|
111
|
-
Icon: Icon
|
|
112
|
-
}))), pickerVisible && /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
113
|
-
style: [styles.picker, {
|
|
114
|
-
backgroundColor: colors.divider
|
|
115
|
-
}]
|
|
39
|
+
return /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
40
|
+
style: styles.iosPicker
|
|
116
41
|
}, /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
117
|
-
style: styles.
|
|
42
|
+
style: styles.iosSafeArea
|
|
118
43
|
}, /*#__PURE__*/React.createElement(_DeprecatedButton.default, {
|
|
119
44
|
Icon: Icon,
|
|
120
45
|
type: "text",
|
|
121
|
-
onPress:
|
|
122
|
-
style: styles.
|
|
46
|
+
onPress: togglePickerVisible,
|
|
47
|
+
style: styles.iosButton
|
|
123
48
|
}, "Close"), /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
124
|
-
style:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
key: o.value
|
|
133
|
-
})))))));
|
|
49
|
+
style: styles.iosNativePicker,
|
|
50
|
+
selectedValue: internalValue,
|
|
51
|
+
onValueChange: handleValueChange
|
|
52
|
+
}, pickerOptions.map(option => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
53
|
+
label: option.label,
|
|
54
|
+
value: option.value,
|
|
55
|
+
key: option.value
|
|
56
|
+
}))))));
|
|
134
57
|
};
|
|
135
58
|
|
|
59
|
+
exports.PickerComponent = PickerComponent;
|
|
60
|
+
|
|
136
61
|
const styles = _reactNative.StyleSheet.create({
|
|
137
|
-
|
|
138
|
-
alignSelf: "stretch"
|
|
139
|
-
},
|
|
140
|
-
picker: {
|
|
62
|
+
iosPicker: {
|
|
141
63
|
position: "absolute",
|
|
142
64
|
bottom: 0,
|
|
143
65
|
left: 0,
|
|
144
66
|
right: 0,
|
|
145
67
|
flexDirection: "row",
|
|
146
|
-
justifyContent: "center"
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
width: deviceWidth,
|
|
70
|
+
// TODO
|
|
71
|
+
maxWidth: deviceWidth,
|
|
72
|
+
maxHeight: deviceHeight,
|
|
73
|
+
backgroundColor: "green" // TODO
|
|
74
|
+
// backgroundColor: "rgba(255, 255, 255, 1)",
|
|
75
|
+
|
|
147
76
|
},
|
|
148
|
-
|
|
149
|
-
backgroundColor: "
|
|
77
|
+
iosSafeArea: {
|
|
78
|
+
backgroundColor: "yellow",
|
|
79
|
+
// backgroundColor: "white",// TODO
|
|
150
80
|
flexDirection: "column",
|
|
151
|
-
width:
|
|
81
|
+
width: deviceWidth,
|
|
82
|
+
maxWidth: deviceWidth
|
|
152
83
|
},
|
|
153
|
-
|
|
84
|
+
iosButton: {
|
|
154
85
|
alignSelf: "flex-end"
|
|
86
|
+
},
|
|
87
|
+
iosNativePicker: {
|
|
88
|
+
//backgroundColor: "white",// TODO
|
|
89
|
+
backgroundColor: "red"
|
|
155
90
|
}
|
|
156
91
|
});
|
|
157
|
-
|
|
158
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
159
|
-
|
|
160
|
-
exports.default = _default;
|
|
161
92
|
//# sourceMappingURL=PickerComponent.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PickerComponent.ios.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["PickerComponent.ios.tsx"],"names":["width","deviceWidth","height","deviceHeight","Dimensions","get","PickerComponent","Icon","togglePickerVisible","pickerOptions","internalValue","handleValueChange","styles","iosPicker","iosSafeArea","iosButton","iosNativePicker","map","option","label","value","StyleSheet","create","position","bottom","left","right","flexDirection","justifyContent","maxWidth","maxHeight","backgroundColor","alignSelf"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAGA;;AACA;;;;;;;;AAGA,MAAM;AAAEA,EAAAA,KAAK,EAAEC,WAAT;AAAsBC,EAAAA,MAAM,EAAEC;AAA9B,IAA+CC,wBAAWC,GAAX,CAAe,QAAf,CAArD;;AAWO,MAAMC,eAA+C,GAAG,QAMzD;AAAA,MAN0D;AAC9DC,IAAAA,IAD8D;AAE9DC,IAAAA,mBAF8D;AAG9DC,IAAAA,aAH8D;AAI9DC,IAAAA,aAJ8D;AAK9DC,IAAAA;AAL8D,GAM1D;AACJ,sBACE,oBAAC,eAAD,qBACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC,MAAM,CAACC;AAApB,kBACE,oBAAC,wCAAD;AAAc,IAAA,KAAK,EAAED,MAAM,CAACE;AAA5B,kBACE,oBAAC,yBAAD;AACE,IAAA,IAAI,EAAEP,IADR;AAEE,IAAA,IAAI,EAAC,MAFP;AAGE,IAAA,OAAO,EAAEC,mBAHX;AAIE,IAAA,KAAK,EAAEI,MAAM,CAACG;AAJhB,KAMG,OANH,CADF,eAUE,oBAAC,cAAD;AACE,IAAA,KAAK,EAAEH,MAAM,CAACI,eADhB;AAEE,IAAA,aAAa,EAAEN,aAFjB;AAGE,IAAA,aAAa,EAAEC;AAHjB,KAKIF,aAAD,CAA6CQ,GAA7C,CAAkDC,MAAD,iBAChD,oBAAC,cAAD,CAAc,IAAd;AACE,IAAA,KAAK,EAAEA,MAAM,CAACC,KADhB;AAEE,IAAA,KAAK,EAAED,MAAM,CAACE,KAFhB;AAGE,IAAA,GAAG,EAAEF,MAAM,CAACE;AAHd,IADD,CALH,CAVF,CADF,CADF,CADF;AA8BD,CArCM;;;;AAuCP,MAAMR,MAAM,GAAGS,wBAAWC,MAAX,CAAkB;AAC/BT,EAAAA,SAAS,EAAE;AACTU,IAAAA,QAAQ,EAAE,UADD;AAETC,IAAAA,MAAM,EAAE,CAFC;AAGTC,IAAAA,IAAI,EAAE,CAHG;AAITC,IAAAA,KAAK,EAAE,CAJE;AAKTC,IAAAA,aAAa,EAAE,KALN;AAMTC,IAAAA,cAAc,EAAE,QANP;AAOT5B,IAAAA,KAAK,EAAEC,WAPE;AAOW;AACpB4B,IAAAA,QAAQ,EAAE5B,WARD;AAST6B,IAAAA,SAAS,EAAE3B,YATF;AAUT4B,IAAAA,eAAe,EAAE,OAVR,CAUiB;AAC1B;;AAXS,GADoB;AAc/BjB,EAAAA,WAAW,EAAE;AACXiB,IAAAA,eAAe,EAAE,QADN;AAEX;AACAJ,IAAAA,aAAa,EAAE,QAHJ;AAIX3B,IAAAA,KAAK,EAAEC,WAJI;AAKX4B,IAAAA,QAAQ,EAAE5B;AALC,GAdkB;AAqB/Bc,EAAAA,SAAS,EAAE;AACTiB,IAAAA,SAAS,EAAE;AADF,GArBoB;AAwB/BhB,EAAAA,eAAe,EAAE;AACf;AACAe,IAAAA,eAAe,EAAE;AAFF;AAxBc,CAAlB,CAAf","sourcesContent":["import * as React from \"react\";\nimport { View, StyleSheet, Dimensions } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport Portal from \"../Portal/Portal\";\nimport Button from \"../DeprecatedButton\";\nimport { PickerOption } from \"./Picker\";\n\nconst { width: deviceWidth, height: deviceHeight } = Dimensions.get(\"screen\");\n\ninterface PickerComponentProps {\n Icon: IconSlot[\"Icon\"];\n androidPickerRef: React.RefObject<any>;\n togglePickerVisible: () => void;\n pickerOptions: PickerOption[];\n internalValue: string | undefined;\n handleValueChange: (newValue: string, itemIndex: number) => void;\n}\n\nexport const PickerComponent: React.FC<PickerComponentProps> = ({\n Icon,\n togglePickerVisible,\n pickerOptions,\n internalValue,\n handleValueChange,\n}) => {\n return (\n <Portal>\n <View style={styles.iosPicker}>\n <SafeAreaView style={styles.iosSafeArea}>\n <Button\n Icon={Icon}\n type=\"text\"\n onPress={togglePickerVisible}\n style={styles.iosButton}\n >\n {\"Close\"}\n </Button>\n\n <NativePicker\n style={styles.iosNativePicker}\n selectedValue={internalValue}\n onValueChange={handleValueChange}\n >\n {(pickerOptions as unknown as PickerOption[]).map((option) => (\n <NativePicker.Item\n label={option.label}\n value={option.value}\n key={option.value}\n />\n ))}\n </NativePicker>\n </SafeAreaView>\n </View>\n </Portal>\n );\n};\n\nconst styles = StyleSheet.create({\n iosPicker: {\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n flexDirection: \"row\",\n justifyContent: \"center\",\n width: deviceWidth, // TODO\n maxWidth: deviceWidth,\n maxHeight: deviceHeight,\n backgroundColor: \"green\", // TODO\n // backgroundColor: \"rgba(255, 255, 255, 1)\",\n },\n iosSafeArea: {\n backgroundColor: \"yellow\",\n // backgroundColor: \"white\",// TODO\n flexDirection: \"column\",\n width: deviceWidth,\n maxWidth: deviceWidth,\n },\n iosButton: {\n alignSelf: \"flex-end\",\n },\n iosNativePicker: {\n //backgroundColor: \"white\",// TODO\n backgroundColor: \"red\",\n },\n});\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PickerComponent = void 0;
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -11,126 +11,49 @@ var _reactNative = require("react-native");
|
|
|
11
11
|
|
|
12
12
|
var _picker = require("@react-native-picker/picker");
|
|
13
13
|
|
|
14
|
-
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
15
|
-
|
|
16
|
-
var _theming = require("../../theming");
|
|
17
|
-
|
|
18
|
-
var _utilities = require("../../utilities");
|
|
19
|
-
|
|
20
|
-
var _TextField = _interopRequireDefault(require("../TextField"));
|
|
21
|
-
|
|
22
|
-
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
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); }
|
|
27
15
|
|
|
28
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; }
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
const {
|
|
19
|
+
width: deviceWidth,
|
|
20
|
+
height: deviceHeight
|
|
21
|
+
} = _reactNative.Dimensions.get("screen");
|
|
34
22
|
|
|
23
|
+
const PickerComponent = _ref => {
|
|
35
24
|
let {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onValueChange: onValueChangeOverride = () => {},
|
|
42
|
-
...props
|
|
25
|
+
androidPickerRef,
|
|
26
|
+
togglePickerVisible,
|
|
27
|
+
pickerOptions,
|
|
28
|
+
internalValue,
|
|
29
|
+
handleValueChange
|
|
43
30
|
} = _ref;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
56
|
-
borderLeftWidth,
|
|
57
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
58
|
-
borderColor,
|
|
59
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
60
|
-
backgroundColor,
|
|
61
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
62
|
-
padding,
|
|
63
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
64
|
-
paddingTop,
|
|
65
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
66
|
-
paddingRight,
|
|
67
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
68
|
-
paddingBottom,
|
|
69
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
70
|
-
paddingLeft,
|
|
71
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
72
|
-
...viewStyles
|
|
73
|
-
}
|
|
74
|
-
} = (0, _utilities.extractStyles)(style);
|
|
75
|
-
const textField = React.useRef(undefined);
|
|
76
|
-
|
|
77
|
-
const onValueChange = (itemValue, itemIndex) => {
|
|
78
|
-
toggleFocus();
|
|
79
|
-
onValueChangeOverride(itemValue, itemIndex);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const toggleFocus = () => {
|
|
83
|
-
if (!disabled) {
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
|
|
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);
|
|
91
|
-
return /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
92
|
-
disabled: disabled,
|
|
93
|
-
onPress: toggleFocus,
|
|
94
|
-
style: [styles.container, viewStyles]
|
|
95
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, null, /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
96
|
-
enabled: !disabled,
|
|
97
|
-
selectedValue: selectedValue,
|
|
98
|
-
onValueChange: onValueChange,
|
|
99
|
-
style: {
|
|
100
|
-
flex: 1,
|
|
101
|
-
opacity: 0,
|
|
102
|
-
position: "absolute",
|
|
103
|
-
top: 0,
|
|
104
|
-
left: 0,
|
|
105
|
-
right: 0,
|
|
106
|
-
bottom: 0,
|
|
107
|
-
width: "100%"
|
|
108
|
-
}
|
|
109
|
-
}, options.map(o => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
110
|
-
label: o.label,
|
|
111
|
-
value: o.value,
|
|
112
|
-
key: o.value
|
|
113
|
-
}))), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
114
|
-
pointerEvents: "none"
|
|
115
|
-
}, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
|
|
116
|
-
value: selectedLabel,
|
|
117
|
-
placeholder: placeholder // @ts-ignore
|
|
118
|
-
,
|
|
119
|
-
ref: textField // cannot determine if ref is of correct type due to component being wrapped in a withTheme()
|
|
120
|
-
,
|
|
121
|
-
disabled: disabled // @ts-expect-error
|
|
122
|
-
,
|
|
123
|
-
style: stylesWithoutMargin
|
|
124
|
-
})))));
|
|
31
|
+
return /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
32
|
+
selectedValue: internalValue,
|
|
33
|
+
onValueChange: handleValueChange,
|
|
34
|
+
style: styles.nonIosPicker,
|
|
35
|
+
ref: androidPickerRef,
|
|
36
|
+
onBlur: togglePickerVisible
|
|
37
|
+
}, pickerOptions.map(option => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
38
|
+
label: option.label,
|
|
39
|
+
value: option.value,
|
|
40
|
+
key: option.value
|
|
41
|
+
})));
|
|
125
42
|
};
|
|
126
43
|
|
|
44
|
+
exports.PickerComponent = PickerComponent;
|
|
45
|
+
|
|
127
46
|
const styles = _reactNative.StyleSheet.create({
|
|
128
|
-
|
|
129
|
-
|
|
47
|
+
nonIosPicker: {
|
|
48
|
+
opacity: 0,
|
|
49
|
+
position: "absolute",
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
bottom: 0,
|
|
54
|
+
width: "100%",
|
|
55
|
+
maxWidth: deviceWidth,
|
|
56
|
+
maxHeight: deviceHeight
|
|
130
57
|
}
|
|
131
58
|
});
|
|
132
|
-
|
|
133
|
-
var _default = (0, _theming.withTheme)(Picker);
|
|
134
|
-
|
|
135
|
-
exports.default = _default;
|
|
136
59
|
//# sourceMappingURL=PickerComponent.web.js.map
|