@draftbit/core 44.1.13-3bb0d0.0 → 44.1.13-6f194c.0
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/Picker/PickerComponent.android.js +16 -41
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerComponent.js +253 -0
- package/lib/commonjs/components/Picker/PickerComponent.js.map +1 -0
- package/lib/commonjs/components/Picker/PickerComponent.web.js +16 -41
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/module/components/AspectRatio.js +2 -17
- package/lib/module/components/AspectRatio.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.android.js +19 -39
- package/lib/module/components/Picker/PickerComponent.android.js.map +1 -1
- package/lib/module/components/Picker/PickerComponent.js +231 -0
- package/lib/module/components/Picker/PickerComponent.js.map +1 -0
- package/lib/module/components/Picker/PickerComponent.web.js +19 -39
- package/lib/module/components/Picker/PickerComponent.web.js.map +1 -1
- package/lib/module/components/StepIndicator.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerComponent.d.ts +4501 -0
- package/package.json +2 -2
- package/src/components/Picker/PickerComponent.android.js +16 -18
- package/src/components/Picker/PickerComponent.android.tsx +18 -40
- package/src/components/Picker/PickerComponent.js +185 -0
- package/src/components/Picker/PickerComponent.tsx +321 -0
- package/src/components/Picker/PickerComponent.web.js +16 -18
- package/src/components/Picker/PickerComponent.web.tsx +18 -40
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +0 -92
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +0 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +0 -69
- package/lib/module/components/Picker/PickerComponent.ios.js.map +0 -1
- package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +0 -13
- package/src/components/Picker/PickerComponent.ios.js +0 -43
- package/src/components/Picker/PickerComponent.ios.tsx +0 -89
|
@@ -9,51 +9,26 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _picker = require("@react-native-picker/picker");
|
|
13
|
-
|
|
14
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
13
|
|
|
16
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
15
|
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
})));
|
|
42
|
-
};
|
|
16
|
+
const PickerComponent = () => {
|
|
17
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, null, "android");
|
|
18
|
+
}; // const styles = StyleSheet.create({
|
|
19
|
+
// nonIosPicker: {
|
|
20
|
+
// opacity: 0,
|
|
21
|
+
// position: "absolute",
|
|
22
|
+
// top: 0,
|
|
23
|
+
// left: 0,
|
|
24
|
+
// right: 0,
|
|
25
|
+
// bottom: 0,
|
|
26
|
+
// width: "100%",
|
|
27
|
+
// maxWidth: deviceWidth,
|
|
28
|
+
// maxHeight: deviceHeight,
|
|
29
|
+
// },
|
|
30
|
+
// });
|
|
43
31
|
|
|
44
|
-
exports.PickerComponent = PickerComponent;
|
|
45
32
|
|
|
46
|
-
|
|
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
|
|
57
|
-
}
|
|
58
|
-
});
|
|
33
|
+
exports.PickerComponent = PickerComponent;
|
|
59
34
|
//# sourceMappingURL=PickerComponent.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PickerComponent.android.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["PickerComponent.android.tsx"],"names":["PickerComponent"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAmBO,MAAMA,eAA+C,GAAG,MAAM;AACnE,sBAAO,oBAAC,iBAAD,kBAAP;AACD,CAFM,C,CAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["import * as React from \"react\";\nimport { /* StyleSheet, Dimensions, View, */ Text } from \"react-native\";\n\n// import { Picker as NativePicker } from \"@react-native-picker/picker\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nimport { PickerOption } from \"./Picker\";\n\n// const { 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 return <Text>android</Text>;\n};\n\n// const 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"]}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
13
|
+
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
|
|
16
|
+
var _picker = require("@react-native-picker/picker");
|
|
17
|
+
|
|
18
|
+
var _theming = require("../../theming");
|
|
19
|
+
|
|
20
|
+
var _Portal = _interopRequireDefault(require("../Portal/Portal"));
|
|
21
|
+
|
|
22
|
+
var _DeprecatedButton = _interopRequireDefault(require("../DeprecatedButton"));
|
|
23
|
+
|
|
24
|
+
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
25
|
+
|
|
26
|
+
var _utilities = require("../../utilities");
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
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
|
+
|
|
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
|
+
|
|
34
|
+
const Picker = _ref => {
|
|
35
|
+
var _find$label, _find, _stylesWithoutBorders;
|
|
36
|
+
|
|
37
|
+
let {
|
|
38
|
+
Icon,
|
|
39
|
+
style,
|
|
40
|
+
options = [],
|
|
41
|
+
placeholder = "",
|
|
42
|
+
value: selectedValue = "",
|
|
43
|
+
disabled = false,
|
|
44
|
+
onValueChange = () => {},
|
|
45
|
+
theme,
|
|
46
|
+
assistiveText,
|
|
47
|
+
label,
|
|
48
|
+
leftIconMode = "inset",
|
|
49
|
+
leftIconName,
|
|
50
|
+
placeholderTextColor,
|
|
51
|
+
rightIconName,
|
|
52
|
+
type
|
|
53
|
+
} = _ref;
|
|
54
|
+
const [pickerVisible, setIsPickerVisible] = React.useState(false);
|
|
55
|
+
const {
|
|
56
|
+
viewStyles,
|
|
57
|
+
textStyles
|
|
58
|
+
} = (0, _utilities.extractStyles)(style);
|
|
59
|
+
const {
|
|
60
|
+
colors
|
|
61
|
+
} = theme;
|
|
62
|
+
console.log({// viewStyles,
|
|
63
|
+
// textStyles,
|
|
64
|
+
// options,
|
|
65
|
+
// placeholder,
|
|
66
|
+
// selectedValue,
|
|
67
|
+
// theme,
|
|
68
|
+
// disabled,
|
|
69
|
+
// onValueChange,
|
|
70
|
+
// colors,
|
|
71
|
+
// assistiveText,
|
|
72
|
+
// label,
|
|
73
|
+
// leftIconMode,
|
|
74
|
+
// leftIconName,
|
|
75
|
+
// placeholderTextColor,
|
|
76
|
+
// rightIconName,
|
|
77
|
+
// type,
|
|
78
|
+
});
|
|
79
|
+
const borders = ["borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderColor", "borderStyle"];
|
|
80
|
+
const borderStyles = { ...{ ...(type === "solid" ? {
|
|
81
|
+
borderTopLeftRadius: 5,
|
|
82
|
+
borderTopRightRadius: 5,
|
|
83
|
+
borderBottomRightRadius: 5,
|
|
84
|
+
borderBottomLeftRadius: 5,
|
|
85
|
+
borderTopWidth: 1,
|
|
86
|
+
borderRightWidth: 1,
|
|
87
|
+
borderLeftWidth: 1
|
|
88
|
+
} : {}),
|
|
89
|
+
borderBottomWidth: 1,
|
|
90
|
+
borderColor: colors.light,
|
|
91
|
+
borderStyle: "solid"
|
|
92
|
+
},
|
|
93
|
+
...(0, _lodash.pick)(viewStyles, borders)
|
|
94
|
+
};
|
|
95
|
+
const margins = ["marginLeft", "marginRight", "marginTop", "marginBottom"];
|
|
96
|
+
const marginStyles = (0, _lodash.pick)(viewStyles, margins);
|
|
97
|
+
const stylesWithoutBordersAndMargins = { ...{
|
|
98
|
+
height: 60,
|
|
99
|
+
width: "100%"
|
|
100
|
+
},
|
|
101
|
+
...(0, _lodash.omit)(viewStyles, [...borders, ...margins])
|
|
102
|
+
};
|
|
103
|
+
const selectedLabel = selectedValue && ((_find$label = (_find = options.find(o => o.value === selectedValue)) === null || _find === void 0 ? void 0 : _find.label) !== null && _find$label !== void 0 ? _find$label : selectedValue);
|
|
104
|
+
const labelText = label ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
105
|
+
style: {
|
|
106
|
+
textAlign: textStyles.textAlign,
|
|
107
|
+
color: colors.light,
|
|
108
|
+
fontSize: 12,
|
|
109
|
+
paddingBottom: 4
|
|
110
|
+
}
|
|
111
|
+
}, label) : null;
|
|
112
|
+
const leftIconOutset = leftIconMode === "outset";
|
|
113
|
+
const leftIcon = leftIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
114
|
+
name: leftIconName,
|
|
115
|
+
size: 24,
|
|
116
|
+
style: {
|
|
117
|
+
marginRight: 8,
|
|
118
|
+
marginLeft: -6
|
|
119
|
+
}
|
|
120
|
+
}) : null;
|
|
121
|
+
const rightIcon = rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
122
|
+
name: rightIconName,
|
|
123
|
+
size: 24,
|
|
124
|
+
style: {
|
|
125
|
+
marginRight: -6,
|
|
126
|
+
marginLeft: 8
|
|
127
|
+
}
|
|
128
|
+
}) : null; // @ts-ignore
|
|
129
|
+
|
|
130
|
+
const width = (_stylesWithoutBorders = stylesWithoutBordersAndMargins === null || stylesWithoutBordersAndMargins === void 0 ? void 0 : stylesWithoutBordersAndMargins.width) !== null && _stylesWithoutBorders !== void 0 ? _stylesWithoutBorders : undefined;
|
|
131
|
+
const textAlign = textStyles === null || textStyles === void 0 ? void 0 : textStyles.textAlign;
|
|
132
|
+
const paddingLeft = leftIconOutset && (!textAlign || textAlign === "left" || textAlign === "justify") ? 28 // icon size + 4
|
|
133
|
+
: 0;
|
|
134
|
+
const assistiveTextLabel = assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
135
|
+
style: {
|
|
136
|
+
textAlign,
|
|
137
|
+
width,
|
|
138
|
+
paddingLeft,
|
|
139
|
+
color: colors.light,
|
|
140
|
+
fontSize: 12,
|
|
141
|
+
paddingTop: 4
|
|
142
|
+
}
|
|
143
|
+
}, assistiveText) : null;
|
|
144
|
+
const primaryTextStyle = {
|
|
145
|
+
color: colors.light,
|
|
146
|
+
fontSize: 14,
|
|
147
|
+
...(0, _lodash.pickBy)(textStyles, _lodash.identity),
|
|
148
|
+
...(placeholder === selectedValue ? {
|
|
149
|
+
color: placeholderTextColor !== null && placeholderTextColor !== void 0 ? placeholderTextColor : colors.light
|
|
150
|
+
} : {})
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const toggleVisibility = () => setIsPickerVisible(!pickerVisible);
|
|
154
|
+
|
|
155
|
+
return /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
156
|
+
style: [{
|
|
157
|
+
alignSelf: "stretch"
|
|
158
|
+
}, marginStyles]
|
|
159
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
160
|
+
disabled: disabled,
|
|
161
|
+
onPress: toggleVisibility,
|
|
162
|
+
style: {
|
|
163
|
+
alignSelf: "stretch",
|
|
164
|
+
alignItems: "center"
|
|
165
|
+
}
|
|
166
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
167
|
+
pointerEvents: "none",
|
|
168
|
+
style: [{
|
|
169
|
+
//alignSelf: "stretch",
|
|
170
|
+
flexDirection: "row",
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
justifyContent: "space-between"
|
|
173
|
+
}, stylesWithoutBordersAndMargins, // @ts-ignore
|
|
174
|
+
!leftIconOutset && borderStyles]
|
|
175
|
+
}, leftIcon, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
176
|
+
style: [{
|
|
177
|
+
flex: 1,
|
|
178
|
+
height: "100%",
|
|
179
|
+
flexDirection: "row",
|
|
180
|
+
alignItems: "center",
|
|
181
|
+
justifyContent: "space-between",
|
|
182
|
+
paddingLeft: 12,
|
|
183
|
+
paddingRight: 12
|
|
184
|
+
}, // @ts-ignore
|
|
185
|
+
leftIconOutset && borderStyles]
|
|
186
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
187
|
+
style: {
|
|
188
|
+
flex: 1 // paddingTop: 0,
|
|
189
|
+
// paddingRight: 0, // add inner text paddding settings
|
|
190
|
+
// paddingLeft: 0,
|
|
191
|
+
// paddingBottom: 0,
|
|
192
|
+
|
|
193
|
+
}
|
|
194
|
+
}, labelText, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
195
|
+
style: primaryTextStyle
|
|
196
|
+
}, String(selectedLabel !== null && selectedLabel !== void 0 ? selectedLabel : placeholder))), rightIcon)), assistiveTextLabel), _reactNative.Platform.OS === "ios" && pickerVisible ? /*#__PURE__*/React.createElement(_Portal.default, null, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
197
|
+
style: {
|
|
198
|
+
position: "absolute",
|
|
199
|
+
bottom: 0,
|
|
200
|
+
left: 0,
|
|
201
|
+
right: 0,
|
|
202
|
+
flexDirection: "row",
|
|
203
|
+
justifyContent: "center",
|
|
204
|
+
backgroundColor: colors.divider
|
|
205
|
+
}
|
|
206
|
+
}, /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
207
|
+
style: {
|
|
208
|
+
backgroundColor: "white",
|
|
209
|
+
flexDirection: "column",
|
|
210
|
+
width: "100%"
|
|
211
|
+
}
|
|
212
|
+
}, /*#__PURE__*/React.createElement(_DeprecatedButton.default, {
|
|
213
|
+
Icon: Icon,
|
|
214
|
+
type: "text",
|
|
215
|
+
onPress: toggleVisibility,
|
|
216
|
+
style: {
|
|
217
|
+
alignSelf: "flex-end"
|
|
218
|
+
}
|
|
219
|
+
}, "Close"), /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
220
|
+
style: {
|
|
221
|
+
backgroundColor: "white"
|
|
222
|
+
},
|
|
223
|
+
selectedValue: selectedValue,
|
|
224
|
+
onValueChange: onValueChange
|
|
225
|
+
}, options.map(o => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
226
|
+
label: o.label,
|
|
227
|
+
value: o.value,
|
|
228
|
+
key: o.value
|
|
229
|
+
})))))) : /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
230
|
+
enabled: pickerVisible,
|
|
231
|
+
selectedValue: selectedValue,
|
|
232
|
+
onValueChange: onValueChange,
|
|
233
|
+
style: {
|
|
234
|
+
opacity: 0,
|
|
235
|
+
position: "absolute",
|
|
236
|
+
top: 0,
|
|
237
|
+
left: 0,
|
|
238
|
+
right: 0,
|
|
239
|
+
bottom: 0,
|
|
240
|
+
width: "100%"
|
|
241
|
+
}
|
|
242
|
+
}, options.map(o => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
243
|
+
label: o.label,
|
|
244
|
+
value: o.value,
|
|
245
|
+
key: o.value
|
|
246
|
+
}))));
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
var _default = (0, _theming.withTheme)(Picker);
|
|
250
|
+
|
|
251
|
+
exports.default = _default;
|
|
252
|
+
//# sourceMappingURL=PickerComponent.js.map.default = _default;
|
|
253
|
+
//# sourceMappingURL=PickerComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["PickerComponent.tsx"],"names":["Picker","Icon","style","options","placeholder","value","selectedValue","disabled","onValueChange","theme","assistiveText","label","leftIconMode","leftIconName","placeholderTextColor","rightIconName","type","pickerVisible","setIsPickerVisible","React","useState","viewStyles","textStyles","colors","console","log","borders","borderStyles","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderTopWidth","borderRightWidth","borderLeftWidth","borderBottomWidth","borderColor","light","borderStyle","margins","marginStyles","stylesWithoutBordersAndMargins","height","width","selectedLabel","find","o","labelText","textAlign","color","fontSize","paddingBottom","leftIconOutset","leftIcon","marginRight","marginLeft","rightIcon","undefined","paddingLeft","assistiveTextLabel","paddingTop","primaryTextStyle","identity","toggleVisibility","alignSelf","alignItems","flexDirection","justifyContent","flex","paddingRight","String","Platform","OS","position","bottom","left","right","backgroundColor","divider","map","opacity","top"],"mappings":";;;;;;;AAAA;;AACA;;AACA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AACzC;AAHT,IADD,CALH,CAhBF,CAXF,CADF,CADD,gBA8CC,oBAAC,cAAD;AACE,IAAA,OAAO,EAAEY,aADX;AAEE,IAAA,aAAa,EAAEX,aAFjB;AAGE,IAAA,aAAa,EAAEE,aAHjB;AAIE,IAAA,KAAK,EAAE;AACLwE,MAAAA,OAAO,EAAE,CADJ;AAELP,MAAAA,QAAQ,EAAE,UAFL;AAGLQ,MAAAA,GAAG,EAAE,CAHA;AAILN,MAAAA,IAAI,EAAE,CAJD;AAKLC,MAAAA,KAAK,EAAE,CALF;AAMLF,MAAAA,MAAM,EAAE,CANH;AAOL/B,MAAAA,KAAK,EAAE;AAPF;AAJT,KAcIxC,OAAD,CAAuC4E,GAAvC,CAA4CjC,CAAD,iBAC1C,oBAAC,cAAD,CAAc,IAAd;AAAmB,IAAA,KAAK,EAAEA,CAAC,CAACnC,KAA5B;AAAmC,IAAA,KAAK,EAAEmC,CAAC,CAACzC,KAA5C;AAAmD,IAAA,GAAG,EAAEyC,CAAC,CAACzC;AAA1D,IADD,CAdH,CAhHJ,CADF;AAsID,CA/SD;;eAiTe,wBAAUL,MAAV,C","sourcesContent":["import * as React from \"react\";\nimport { View, /* StyleSheet, */ Text, Platform } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\nimport { omit, pick, pickBy, identity } from \"lodash\";\nimport { Picker as NativePicker } from \"@react-native-picker/picker\";\n\nimport { withTheme } from \"../../theming\";\nimport Portal from \"../Portal/Portal\";\nimport Button from \"../DeprecatedButton\";\nimport Touchable from \"../Touchable\";\nimport { PickerProps, PickerOption } from \"./Picker\";\nimport { extractStyles } from \"../../utilities\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport type { Theme } from \"../../styles/DefaultTheme\";\n\nconst Picker: React.FC<PickerProps & IconSlot & Theme> = ({\n Icon,\n style,\n options = [],\n placeholder = \"\",\n value: selectedValue = \"\",\n disabled = false,\n onValueChange = () => {},\n theme,\n assistiveText,\n label,\n leftIconMode = \"inset\",\n leftIconName,\n placeholderTextColor,\n rightIconName,\n type,\n}) => {\n const [pickerVisible, setIsPickerVisible] = React.useState(false);\n\n const { viewStyles, textStyles } = extractStyles(style);\n\n const { colors } = theme;\n\n console.log({\n // viewStyles,\n // textStyles,\n // options,\n // placeholder,\n // selectedValue,\n // theme,\n // disabled,\n // onValueChange,\n // colors,\n // assistiveText,\n // label,\n // leftIconMode,\n // leftIconName,\n // placeholderTextColor,\n // rightIconName,\n // type,\n });\n\n const borders = [\n \"borderRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderColor\",\n \"borderStyle\",\n ];\n\n const borderStyles = {\n ...{\n ...(type === \"solid\"\n ? {\n borderTopLeftRadius: 5,\n borderTopRightRadius: 5,\n borderBottomRightRadius: 5,\n borderBottomLeftRadius: 5,\n borderTopWidth: 1,\n borderRightWidth: 1,\n borderLeftWidth: 1,\n }\n : {}),\n borderBottomWidth: 1,\n borderColor: colors.light,\n borderStyle: \"solid\",\n },\n ...pick(viewStyles, borders),\n };\n\n const margins = [\"marginLeft\", \"marginRight\", \"marginTop\", \"marginBottom\"];\n\n const marginStyles = pick(viewStyles, margins);\n\n const stylesWithoutBordersAndMargins = {\n ...{\n height: 60,\n width: \"100%\",\n },\n ...omit(viewStyles, [...borders, ...margins]),\n };\n\n const selectedLabel =\n selectedValue &&\n ((options as unknown as PickerOption[]).find(\n (o) => o.value === selectedValue\n )?.label ??\n selectedValue);\n\n const labelText = label ? (\n <Text\n style={{\n textAlign: textStyles.textAlign,\n color: colors.light,\n fontSize: 12,\n paddingBottom: 4,\n }}\n >\n {label}\n </Text>\n ) : null;\n\n const leftIconOutset = leftIconMode === \"outset\";\n\n const leftIcon = leftIconName ? (\n <Icon\n name={leftIconName}\n size={24}\n style={{\n marginRight: 8,\n marginLeft: -6,\n }}\n />\n ) : null;\n\n const rightIcon = rightIconName ? (\n <Icon\n name={rightIconName}\n size={24}\n style={{\n marginRight: -6,\n marginLeft: 8,\n }}\n />\n ) : null;\n\n // @ts-ignore\n const width = stylesWithoutBordersAndMargins?.width ?? undefined;\n\n const textAlign = textStyles?.textAlign;\n\n const paddingLeft =\n leftIconOutset &&\n (!textAlign || textAlign === \"left\" || textAlign === \"justify\")\n ? 28 // icon size + 4\n : 0;\n\n const assistiveTextLabel = assistiveText ? (\n <Text\n style={{\n textAlign,\n width,\n paddingLeft,\n color: colors.light,\n fontSize: 12,\n paddingTop: 4,\n }}\n >\n {assistiveText}\n </Text>\n ) : null;\n\n const primaryTextStyle = {\n color: colors.light,\n fontSize: 14,\n ...pickBy(textStyles, identity),\n ...(placeholder === selectedValue\n ? { color: placeholderTextColor ?? colors.light }\n : {}),\n };\n\n const toggleVisibility = () => setIsPickerVisible(!pickerVisible);\n\n return (\n <View\n style={[\n {\n alignSelf: \"stretch\",\n },\n marginStyles,\n ]}\n >\n <Touchable\n disabled={disabled}\n onPress={toggleVisibility}\n style={{ alignSelf: \"stretch\", alignItems: \"center\" }}\n >\n <View\n pointerEvents=\"none\"\n style={[\n {\n //alignSelf: \"stretch\",\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n stylesWithoutBordersAndMargins,\n // @ts-ignore\n !leftIconOutset && borderStyles,\n ]}\n >\n {leftIcon}\n\n <View\n style={[\n {\n flex: 1,\n height: \"100%\",\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingLeft: 12,\n paddingRight: 12,\n },\n // @ts-ignore\n leftIconOutset && borderStyles,\n ]}\n >\n <View\n style={{\n flex: 1,\n // paddingTop: 0,\n // paddingRight: 0, // add inner text paddding settings\n // paddingLeft: 0,\n // paddingBottom: 0,\n }}\n >\n {labelText}\n\n <Text style={primaryTextStyle}>\n {String(selectedLabel ?? placeholder)}\n </Text>\n </View>\n\n {rightIcon}\n </View>\n </View>\n {assistiveTextLabel}\n </Touchable>\n\n {Platform.OS === \"ios\" && pickerVisible ? (\n <Portal>\n <View\n style={{\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n flexDirection: \"row\",\n justifyContent: \"center\",\n backgroundColor: colors.divider,\n }}\n >\n <SafeAreaView\n style={{\n backgroundColor: \"white\",\n flexDirection: \"column\",\n width: \"100%\",\n }}\n >\n <Button\n Icon={Icon}\n type=\"text\"\n onPress={toggleVisibility}\n style={{ alignSelf: \"flex-end\" }}\n >\n {\"Close\"}\n </Button>\n\n <NativePicker\n style={{ backgroundColor: \"white\" }}\n selectedValue={selectedValue}\n onValueChange={onValueChange}\n >\n {(options as unknown as PickerOption[]).map((o) => (\n <NativePicker.Item\n label={o.label}\n value={o.value}\n key={o.value}\n />\n ))}\n </NativePicker>\n </SafeAreaView>\n </View>\n </Portal>\n ) : (\n <NativePicker\n enabled={pickerVisible}\n selectedValue={selectedValue}\n onValueChange={onValueChange}\n style={{\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n }}\n >\n {(options as unknown as PickerOption[]).map((o) => (\n <NativePicker.Item label={o.label} value={o.value} key={o.value} />\n ))}\n </NativePicker>\n )}\n </View>\n );\n};\n\nexport default withTheme(Picker);\n"]}
|
|
@@ -9,51 +9,26 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _picker = require("@react-native-picker/picker");
|
|
13
|
-
|
|
14
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
13
|
|
|
16
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
15
|
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
})));
|
|
42
|
-
};
|
|
16
|
+
const PickerComponent = () => {
|
|
17
|
+
return /*#__PURE__*/React.createElement(_reactNative.Text, null, "web");
|
|
18
|
+
}; // const styles = StyleSheet.create({
|
|
19
|
+
// nonIosPicker: {
|
|
20
|
+
// opacity: 0,
|
|
21
|
+
// position: "absolute",
|
|
22
|
+
// top: 0,
|
|
23
|
+
// left: 0,
|
|
24
|
+
// right: 0,
|
|
25
|
+
// bottom: 0,
|
|
26
|
+
// width: "100%",
|
|
27
|
+
// maxWidth: deviceWidth,
|
|
28
|
+
// maxHeight: deviceHeight,
|
|
29
|
+
// },
|
|
30
|
+
// });
|
|
43
31
|
|
|
44
|
-
exports.PickerComponent = PickerComponent;
|
|
45
32
|
|
|
46
|
-
|
|
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
|
|
57
|
-
}
|
|
58
|
-
});
|
|
33
|
+
exports.PickerComponent = PickerComponent;
|
|
59
34
|
//# sourceMappingURL=PickerComponent.web.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PickerComponent.web.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["PickerComponent.web.tsx"],"names":["PickerComponent"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAmBO,MAAMA,eAA+C,GAAG,MAAM;AACnE,sBAAO,oBAAC,iBAAD,cAAP;AACD,CAFM,C,CAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["import * as React from \"react\";\nimport { /* StyleSheet, Dimensions, */ Text } from \"react-native\";\n\n// import { Picker as NativePicker } from \"@react-native-picker/picker\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nimport { PickerOption } from \"./Picker\";\n\n// const { 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 return <Text>web</Text>;\n};\n\n// const 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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["RadioButtonRow.
|
|
1
|
+
{"version":3,"sources":["RadioButtonRow.js"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","input","layout","props","label","description","required","defaultValue","direction","options","value","color","group","GROUPS","basic","unselectedColor"],"mappings":";;;;;;;AAAA;;AACO,MAAMA,SAAS,GAAG;AACrBC,EAAAA,IAAI,EAAE,kBADe;AAErBC,EAAAA,GAAG,EAAE,gBAFgB;AAGrBC,EAAAA,QAAQ,EAAEC,uBAAgBC,KAHL;AAIrBC,EAAAA,MAAM,EAAE,EAJa;AAKrBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE,2BAAe;AAClBA,MAAAA,KAAK,EAAE,OADW;AAElBC,MAAAA,WAAW,EAAE,qCAFK;AAGlBC,MAAAA,QAAQ,EAAE,IAHQ;AAIlBC,MAAAA,YAAY,EAAE;AAJI,KAAf,CADJ;AAOHC,IAAAA,SAAS,EAAE,+BAAmB;AAC1BJ,MAAAA,KAAK,EAAE,WADmB;AAE1BC,MAAAA,WAAW,EAAE,8DAFa;AAG1BI,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,aAAR;AAHiB,KAAnB,CAPR;AAYHC,IAAAA,KAAK,EAAE,2BAAe;AAClBN,MAAAA,KAAK,EAAE,OADW;AAElBC,MAAAA,WAAW,EAAE,2BAFK;AAGlBE,MAAAA,YAAY,EAAE,IAHI;AAIlBD,MAAAA,QAAQ,EAAE;AAJQ,KAAf,CAZJ;AAkBHK,IAAAA,KAAK,EAAE,4BAAgB;AACnBC,MAAAA,KAAK,EAAEC,cAAOC,KADK;AAEnBT,MAAAA,WAAW,EAAE,sBAFM;AAGnBE,MAAAA,YAAY,EAAE;AAHK,KAAhB,CAlBJ;AAuBHQ,IAAAA,eAAe,EAAE,4BAAgB;AAC7BH,MAAAA,KAAK,EAAEC,cAAOC,KADe;AAE7BV,MAAAA,KAAK,EAAE,kBAFsB;AAG7BC,MAAAA,WAAW,EAAE,iCAHgB;AAI7BE,MAAAA,YAAY,EAAE;AAJe,KAAhB;AAvBd;AALc,CAAlB","sourcesContent":["import { createTextProp, createTextEnumProp, COMPONENT_TYPES, createColorProp, GROUPS, } from \"@draftbit/types\";\nexport const SEED_DATA = {\n name: \"Radio Button Row\",\n tag: \"RadioButtonRow\",\n category: COMPONENT_TYPES.input,\n layout: {},\n props: {\n label: createTextProp({\n label: \"Label\",\n description: \"Label to show with the radio button\",\n required: true,\n defaultValue: \"First Option\",\n }),\n direction: createTextEnumProp({\n label: \"Direction\",\n description: \"Whether the checkbox will appear on the left or on the right\",\n options: [\"row\", \"row-reverse\"],\n }),\n value: createTextProp({\n label: \"Value\",\n description: \"Value of the radio button\",\n defaultValue: null,\n required: true,\n }),\n color: createColorProp({\n group: GROUPS.basic,\n description: \"Color for the button\",\n defaultValue: \"primary\",\n }),\n unselectedColor: createColorProp({\n group: GROUPS.basic,\n label: \"Unselected Color\",\n description: \"Unselected Color for the button\",\n defaultValue: \"primary\",\n }),\n },\n};\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
2
|
+
|
|
1
3
|
import React from "react";
|
|
2
4
|
import { View, StyleSheet } from "react-native";
|
|
3
5
|
|
|
@@ -30,23 +32,6 @@ const AspectRatio = props => {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
return /*#__PURE__*/React.createElement(View, { ...props,
|
|
34
|
-
style: style,
|
|
35
|
-
onLayout: _ref => {
|
|
36
|
-
let {
|
|
37
|
-
nativeEvent: {
|
|
38
|
-
layout: l
|
|
39
|
-
}
|
|
40
|
-
} = _ref;
|
|
41
|
-
return setLayout(l);
|
|
42
|
-
}
|
|
43
|
-
}, props.children);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default AspectRatio;
|
|
47
|
-
//# sourceMappingURL=AspectRatio.js.map }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
35
|
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
|
51
36
|
style: style,
|
|
52
37
|
onLayout: _ref => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["AspectRatio.
|
|
1
|
+
{"version":3,"sources":["AspectRatio.tsx"],"names":["React","View","StyleSheet","AspectRatio","props","layout","setLayout","useState","aspectRatio","inputStyle","flatten","style","width","height","push","nativeEvent","l","children"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,IADF,EAEEC,UAFF,QAMO,cANP;;AAaA,MAAMC,WAA4B,GAAIC,KAAD,IAAW;AAC9C,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBN,KAAK,CAACO,QAAN,CAAuC,IAAvC,CAA5B;AACA,QAAM;AAAEC,IAAAA,WAAW,GAAG,CAAhB;AAAmB,OAAGC;AAAtB,MACJP,UAAU,CAACQ,OAAX,CAAmBN,KAAK,CAACO,KAAzB,KAAmC,EADrC;AAEA,QAAMA,KAAK,GAAG,CAACF,UAAD,EAAa;AAAED,IAAAA;AAAF,GAAb,CAAd;;AAEA,MAAIH,MAAJ,EAAY;AACV,UAAM;AAAEO,MAAAA,KAAK,GAAG,CAAV;AAAaC,MAAAA,MAAM,GAAG;AAAtB,QAA4BR,MAAlC;;AACA,QAAIO,KAAK,KAAK,CAAd,EAAiB;AACfD,MAAAA,KAAK,CAACG,IAAN,CAAW;AAAEF,QAAAA,KAAK,EAAEC,MAAM,IAAI,IAAIL,WAAR,CAAf;AAAqCK,QAAAA;AAArC,OAAX;AACD,KAFD,MAEO;AACLF,MAAAA,KAAK,CAACG,IAAN,CAAW;AAAEF,QAAAA,KAAF;AAASC,QAAAA,MAAM,EAAED,KAAK,IAAI,IAAIJ,WAAR;AAAtB,OAAX;AACD;AACF;;AACD,sBACE,oBAAC,IAAD,eACMJ,KADN;AAEE,IAAA,KAAK,EAAEO,KAFT;AAGE,IAAA,QAAQ,EAAE;AAAA,UAAC;AAAEI,QAAAA,WAAW,EAAE;AAAEV,UAAAA,MAAM,EAAEW;AAAV;AAAf,OAAD;AAAA,aAAoCV,SAAS,CAACU,CAAD,CAA7C;AAAA;AAHZ,MAKGZ,KAAK,CAACa,QALT,CADF;AASD,CAvBD;;AAyBA,eAAed,WAAf","sourcesContent":["import React from \"react\";\nimport {\n View,\n StyleSheet,\n LayoutRectangle,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\n\ntype Props = {\n children?: React.ReactNode;\n style?: StyleProp<ViewStyle>;\n};\n\nconst AspectRatio: React.FC<Props> = (props) => {\n const [layout, setLayout] = React.useState<LayoutRectangle | null>(null);\n const { aspectRatio = 1, ...inputStyle } =\n StyleSheet.flatten(props.style) || {};\n const style = [inputStyle, { aspectRatio }];\n\n if (layout) {\n const { width = 0, height = 0 } = layout;\n if (width === 0) {\n style.push({ width: height * (1 / aspectRatio), height });\n } else {\n style.push({ width, height: width * (1 / aspectRatio) });\n }\n }\n return (\n <View\n {...props}\n style={style}\n onLayout={({ nativeEvent: { layout: l } }) => setLayout(l)}\n >\n {props.children}\n </View>\n );\n};\n\nexport default AspectRatio;\n"]}
|
|
@@ -1,41 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onBlur: togglePickerVisible
|
|
22
|
-
}, pickerOptions.map(option => /*#__PURE__*/React.createElement(NativePicker.Item, {
|
|
23
|
-
label: option.label,
|
|
24
|
-
value: option.value,
|
|
25
|
-
key: option.value
|
|
26
|
-
})));
|
|
27
|
-
};
|
|
28
|
-
const styles = StyleSheet.create({
|
|
29
|
-
nonIosPicker: {
|
|
30
|
-
opacity: 0,
|
|
31
|
-
position: "absolute",
|
|
32
|
-
top: 0,
|
|
33
|
-
left: 0,
|
|
34
|
-
right: 0,
|
|
35
|
-
bottom: 0,
|
|
36
|
-
width: "100%",
|
|
37
|
-
maxWidth: deviceWidth,
|
|
38
|
-
maxHeight: deviceHeight
|
|
39
|
-
}
|
|
40
|
-
});
|
|
2
|
+
import {
|
|
3
|
+
/* StyleSheet, Dimensions, View, */
|
|
4
|
+
Text } from "react-native"; // import { Picker as NativePicker } from "@react-native-picker/picker";
|
|
5
|
+
|
|
6
|
+
export const PickerComponent = () => {
|
|
7
|
+
return /*#__PURE__*/React.createElement(Text, null, "android");
|
|
8
|
+
}; // const styles = StyleSheet.create({
|
|
9
|
+
// nonIosPicker: {
|
|
10
|
+
// opacity: 0,
|
|
11
|
+
// position: "absolute",
|
|
12
|
+
// top: 0,
|
|
13
|
+
// left: 0,
|
|
14
|
+
// right: 0,
|
|
15
|
+
// bottom: 0,
|
|
16
|
+
// width: "100%",
|
|
17
|
+
// maxWidth: deviceWidth,
|
|
18
|
+
// maxHeight: deviceHeight,
|
|
19
|
+
// },
|
|
20
|
+
// });
|
|
41
21
|
//# sourceMappingURL=PickerComponent.android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PickerComponent.android.tsx"],"names":["React","
|
|
1
|
+
{"version":3,"sources":["PickerComponent.android.tsx"],"names":["React","Text","PickerComponent"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA;AAAS;AAAoCC,IAA7C,QAAyD,cAAzD,C,CAEA;;AAiBA,OAAO,MAAMC,eAA+C,GAAG,MAAM;AACnE,sBAAO,oBAAC,IAAD,kBAAP;AACD,CAFM,C,CAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["import * as React from \"react\";\nimport { /* StyleSheet, Dimensions, View, */ Text } from \"react-native\";\n\n// import { Picker as NativePicker } from \"@react-native-picker/picker\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nimport { PickerOption } from \"./Picker\";\n\n// const { 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 return <Text>android</Text>;\n};\n\n// const 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"]}
|