@draftbit/core 44.1.8 → 44.1.9-222859.1
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/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/components/Picker/Picker.js +254 -27
- package/lib/commonjs/components/Picker/Picker.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/hooks.js.map +1 -1
- package/lib/commonjs/mappings/AvatarEdit.js.map +1 -1
- package/lib/commonjs/mappings/Image.js.map +1 -1
- package/lib/commonjs/mappings/Picker.js +3 -1
- package/lib/commonjs/mappings/Picker.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/mappings/ScrollView.js.map +1 -1
- package/lib/commonjs/mappings/Swiper.js.map +1 -1
- package/lib/commonjs/mappings/WebView.js.map +1 -1
- package/lib/commonjs/styles/overlay.js.map +1 -1
- package/lib/commonjs/styles/shadow.js.map +1 -1
- package/lib/module/components/Picker/Picker.js +241 -29
- package/lib/module/components/Picker/Picker.js.map +1 -1
- package/lib/module/mappings/AudioPlayer.js.map +1 -1
- package/lib/module/mappings/Picker.js +4 -2
- package/lib/module/mappings/Picker.js.map +1 -1
- package/lib/typescript/src/components/Picker/Picker.d.ts +28 -4
- package/lib/typescript/src/mappings/Picker.d.ts +21 -0
- package/package.json +2 -2
- package/src/components/Picker/Picker.js +188 -18
- package/src/components/Picker/Picker.tsx +364 -35
- package/src/mappings/Picker.js +3 -1
- package/src/mappings/Picker.ts +4 -0
- package/lib/commonjs/components/Picker/PickerComponent.android.js +0 -135
- package/lib/commonjs/components/Picker/PickerComponent.android.js.map +0 -1
- package/lib/commonjs/components/Picker/PickerComponent.ios.js +0 -161
- package/lib/commonjs/components/Picker/PickerComponent.ios.js.map +0 -1
- package/lib/commonjs/components/Picker/PickerComponent.web.js +0 -136
- package/lib/commonjs/components/Picker/PickerComponent.web.js.map +0 -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/PickerComponent.android.js +0 -112
- package/lib/module/components/Picker/PickerComponent.android.js.map +0 -1
- package/lib/module/components/Picker/PickerComponent.ios.js +0 -135
- package/lib/module/components/Picker/PickerComponent.ios.js.map +0 -1
- package/lib/module/components/Picker/PickerComponent.web.js +0 -113
- package/lib/module/components/Picker/PickerComponent.web.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/PickerComponent.android.d.ts +0 -6
- package/lib/typescript/src/components/Picker/PickerComponent.ios.d.ts +0 -7
- package/lib/typescript/src/components/Picker/PickerComponent.web.d.ts +0 -6
- package/lib/typescript/src/components/Picker/PickerTypes.d.ts +0 -18
- package/src/components/Picker/PickerComponent.android.js +0 -68
- package/src/components/Picker/PickerComponent.android.tsx +0 -116
- package/src/components/Picker/PickerComponent.ios.js +0 -78
- package/src/components/Picker/PickerComponent.ios.tsx +0 -142
- package/src/components/Picker/PickerComponent.web.js +0 -69
- package/src/components/Picker/PickerComponent.web.tsx +0 -117
- package/src/components/Picker/PickerTypes.js +0 -1
- package/src/components/Picker/PickerTypes.ts +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ActionSheetItem.
|
|
1
|
+
{"version":3,"sources":["ActionSheetItem.js"],"names":["ActionSheetItem","label","style","color","onPress","textStyles","viewStyles","React","createElement","TouchableOpacity","activeOpacity","styles","wrapper","Text","StyleSheet","create","borderBottomWidth","hairlineWidth","borderBottomColor","backgroundColor","minHeight","overflow","display","justifyContent","fontSize","textAlign","fontWeight","paddingHorizontal","paddingVertical","alignSelf"],"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AAQHC,IAAAA,SAAS,EAAE;AARR;AAVsB,CAAlB,CAAf;;eAqBe7B,e","sourcesContent":["import React from \"react\";\nimport { Text, StyleSheet, TouchableOpacity, } from \"react-native\";\nimport { extractStyles } from \"../../utilities\";\nconst ActionSheetItem = ({ label, style, color, onPress }) => {\n const { textStyles, viewStyles } = extractStyles(style);\n return (React.createElement(TouchableOpacity, { activeOpacity: 0.7, style: [styles.wrapper, viewStyles], onPress: onPress },\n React.createElement(Text, { style: [styles.label, textStyles, { color }] }, label)));\n};\nconst styles = StyleSheet.create({\n wrapper: {\n borderBottomWidth: StyleSheet.hairlineWidth,\n borderBottomColor: \"#CCCCCC\",\n backgroundColor: \"#F1F1F1\",\n minHeight: 50,\n overflow: \"hidden\",\n display: \"flex\",\n justifyContent: \"center\",\n },\n label: {\n fontSize: 16,\n textAlign: \"center\",\n color: \"#0A84FF\",\n fontWeight: \"500\",\n overflow: \"hidden\",\n paddingHorizontal: 20,\n paddingVertical: 10,\n alignSelf: \"center\",\n },\n});\nexport default ActionSheetItem;\n"]}
|
|
@@ -7,9 +7,23 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
|
|
14
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
15
|
+
|
|
16
|
+
var _picker = require("@react-native-picker/picker");
|
|
17
|
+
|
|
10
18
|
var _theming = require("../../theming");
|
|
11
19
|
|
|
12
|
-
var
|
|
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");
|
|
13
27
|
|
|
14
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
29
|
|
|
@@ -17,24 +31,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
17
31
|
|
|
18
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; }
|
|
19
33
|
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
34
|
function normalizeOptions(options) {
|
|
23
35
|
if (options.length === 0) {
|
|
24
36
|
return [];
|
|
25
37
|
}
|
|
26
38
|
|
|
27
|
-
if (typeof options[0] === "string") {
|
|
39
|
+
if (typeof options[0] === ("string" || "number")) {
|
|
28
40
|
return options.map(option => ({
|
|
29
|
-
label: option,
|
|
41
|
+
label: String(option),
|
|
30
42
|
value: String(option)
|
|
31
43
|
}));
|
|
32
44
|
}
|
|
33
45
|
|
|
34
|
-
if (options[0].
|
|
46
|
+
if (typeof options[0] === "object" && options[0].value !== null && options[0].label !== null) {
|
|
35
47
|
return options.map(option => {
|
|
36
48
|
return {
|
|
37
|
-
label: option.label,
|
|
49
|
+
label: String(option.label),
|
|
38
50
|
value: String(option.value)
|
|
39
51
|
};
|
|
40
52
|
});
|
|
@@ -43,16 +55,36 @@ function normalizeOptions(options) {
|
|
|
43
55
|
throw new Error('Picker options must be either an array of strings or array of { "label": string; "value": string; } objects.');
|
|
44
56
|
}
|
|
45
57
|
|
|
58
|
+
const unstyledColor = "rgba(165, 173, 183, 1)";
|
|
59
|
+
const disabledColor = "rgb(240, 240, 240)";
|
|
60
|
+
const errorColor = "rgba(255, 69, 100, 1)";
|
|
61
|
+
|
|
46
62
|
const Picker = _ref => {
|
|
63
|
+
var _find$label, _find, _stylesWithoutBorders;
|
|
64
|
+
|
|
47
65
|
let {
|
|
66
|
+
error,
|
|
48
67
|
options = [],
|
|
68
|
+
onValueChange,
|
|
69
|
+
defaultValue,
|
|
70
|
+
Icon,
|
|
71
|
+
style,
|
|
49
72
|
placeholder,
|
|
50
|
-
onValueChange: onValueChangeOverride,
|
|
51
73
|
value,
|
|
52
|
-
|
|
53
|
-
|
|
74
|
+
disabled = false,
|
|
75
|
+
theme,
|
|
76
|
+
assistiveText,
|
|
77
|
+
label,
|
|
78
|
+
iconColor = unstyledColor,
|
|
79
|
+
iconSize = 24,
|
|
80
|
+
leftIconMode = "inset",
|
|
81
|
+
leftIconName,
|
|
82
|
+
placeholderTextColor = unstyledColor,
|
|
83
|
+
rightIconName,
|
|
84
|
+
type = "solid"
|
|
54
85
|
} = _ref;
|
|
55
86
|
const [internalValue, setInternalValue] = React.useState(value || defaultValue);
|
|
87
|
+
const [pickerVisible, togglePickerVisible] = React.useReducer(state => !state, false);
|
|
56
88
|
React.useEffect(() => {
|
|
57
89
|
if (value != null) {
|
|
58
90
|
setInternalValue(value);
|
|
@@ -63,36 +95,231 @@ const Picker = _ref => {
|
|
|
63
95
|
setInternalValue(defaultValue);
|
|
64
96
|
}
|
|
65
97
|
}, [defaultValue]);
|
|
66
|
-
const onValueChange = React.useCallback((itemValue, itemIndex) => {
|
|
67
|
-
if (placeholder && itemIndex === 0) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
onValueChangeOverride && onValueChangeOverride(String(itemValue), itemIndex);
|
|
72
|
-
}, [placeholder, onValueChangeOverride]);
|
|
73
98
|
const normalizedOptions = normalizeOptions(options);
|
|
74
99
|
const pickerOptions = placeholder ? [{
|
|
75
100
|
value: placeholder,
|
|
76
101
|
label: placeholder
|
|
77
102
|
}, ...normalizedOptions] : normalizedOptions;
|
|
103
|
+
const {
|
|
104
|
+
viewStyles,
|
|
105
|
+
textStyles
|
|
106
|
+
} = (0, _utilities.extractStyles)(style);
|
|
107
|
+
const {
|
|
108
|
+
colors
|
|
109
|
+
} = theme;
|
|
110
|
+
const borders = ["borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomRightRadius", "borderBottomLeftRadius", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderColor", "borderStyle", "backgroundColor"];
|
|
111
|
+
const borderStyles = { ...{ ...(type === "solid" ? {
|
|
112
|
+
borderTopLeftRadius: 5,
|
|
113
|
+
borderTopRightRadius: 5,
|
|
114
|
+
borderBottomRightRadius: 5,
|
|
115
|
+
borderBottomLeftRadius: 5,
|
|
116
|
+
borderTopWidth: 1,
|
|
117
|
+
borderRightWidth: 1,
|
|
118
|
+
borderLeftWidth: 1
|
|
119
|
+
} : {}),
|
|
120
|
+
borderBottomWidth: 1,
|
|
121
|
+
borderColor: unstyledColor,
|
|
122
|
+
borderStyle: "solid"
|
|
123
|
+
},
|
|
124
|
+
...(0, _lodash.pick)(viewStyles, borders),
|
|
125
|
+
...(error ? {
|
|
126
|
+
borderColor: errorColor
|
|
127
|
+
} : {}),
|
|
128
|
+
...(disabled ? {
|
|
129
|
+
borderColor: "transparent",
|
|
130
|
+
backgroundColor: disabledColor
|
|
131
|
+
} : {})
|
|
132
|
+
};
|
|
133
|
+
const margins = ["marginLeft", "marginRight", "marginTop", "marginBottom"];
|
|
134
|
+
const marginStyles = (0, _lodash.pick)(viewStyles, margins);
|
|
135
|
+
const maxHeight = viewStyles !== null && viewStyles !== void 0 && viewStyles.maxHeight && viewStyles.maxHeight !== "100%" ? viewStyles.maxHeight : _reactNative.Dimensions.get("window").height;
|
|
136
|
+
const stylesWithoutBordersAndMargins = { ...{
|
|
137
|
+
height: 60,
|
|
138
|
+
width: "100%"
|
|
139
|
+
},
|
|
140
|
+
...(0, _lodash.omit)(viewStyles, [...borders, ...margins]),
|
|
141
|
+
...{
|
|
142
|
+
maxHeight
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
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);
|
|
146
|
+
const labelText = label ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
147
|
+
style: {
|
|
148
|
+
textAlign: textStyles.textAlign,
|
|
149
|
+
color: unstyledColor,
|
|
150
|
+
fontSize: 12,
|
|
151
|
+
paddingBottom: 4
|
|
152
|
+
}
|
|
153
|
+
}, label) : null;
|
|
154
|
+
const leftIconOutset = leftIconMode === "outset";
|
|
155
|
+
const leftIcon = leftIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
156
|
+
name: leftIconName,
|
|
157
|
+
color: disabled ? unstyledColor : iconColor,
|
|
158
|
+
size: iconSize,
|
|
159
|
+
style: {
|
|
160
|
+
marginRight: 4,
|
|
161
|
+
marginLeft: 4
|
|
162
|
+
}
|
|
163
|
+
}) : null;
|
|
164
|
+
const rightIcon = rightIconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
165
|
+
name: rightIconName,
|
|
166
|
+
color: disabled ? unstyledColor : iconColor,
|
|
167
|
+
size: iconSize,
|
|
168
|
+
style: {
|
|
169
|
+
marginRight: -10,
|
|
170
|
+
marginLeft: 8
|
|
171
|
+
}
|
|
172
|
+
}) : null;
|
|
173
|
+
const width = (_stylesWithoutBorders = stylesWithoutBordersAndMargins === null || stylesWithoutBordersAndMargins === void 0 ? void 0 : stylesWithoutBordersAndMargins.width) !== null && _stylesWithoutBorders !== void 0 ? _stylesWithoutBorders : undefined;
|
|
174
|
+
const textAlign = textStyles === null || textStyles === void 0 ? void 0 : textStyles.textAlign;
|
|
175
|
+
const paddingLeft = leftIconOutset && (!textAlign || textAlign === "left" || textAlign === "justify") ? iconSize + 4 : 0;
|
|
176
|
+
const assistiveTextLabel = assistiveText ? /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
177
|
+
style: {
|
|
178
|
+
textAlign,
|
|
179
|
+
width,
|
|
180
|
+
paddingLeft,
|
|
181
|
+
color: unstyledColor,
|
|
182
|
+
fontSize: 12,
|
|
183
|
+
paddingTop: 4
|
|
184
|
+
}
|
|
185
|
+
}, assistiveText) : null;
|
|
186
|
+
const primaryTextStyle = {
|
|
187
|
+
color: unstyledColor,
|
|
188
|
+
fontSize: 14,
|
|
189
|
+
...(0, _lodash.pickBy)(textStyles, _lodash.identity),
|
|
190
|
+
...(placeholder === internalValue ? {
|
|
191
|
+
color: placeholderTextColor
|
|
192
|
+
} : {}),
|
|
193
|
+
...(disabled ? {
|
|
194
|
+
color: unstyledColor
|
|
195
|
+
} : {})
|
|
196
|
+
};
|
|
78
197
|
|
|
79
198
|
const handleValueChange = (newValue, itemIndex) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (onValueChange) {
|
|
83
|
-
onValueChange(newValue, itemIndex);
|
|
199
|
+
if (!placeholder || itemIndex > 0) {
|
|
200
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(newValue, itemIndex);
|
|
84
201
|
}
|
|
202
|
+
|
|
203
|
+
setInternalValue(newValue);
|
|
85
204
|
};
|
|
86
205
|
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
206
|
+
return (
|
|
207
|
+
/*#__PURE__*/
|
|
208
|
+
|
|
209
|
+
/* marginsContainer */
|
|
210
|
+
React.createElement(_reactNative.View, {
|
|
211
|
+
style: [styles.marginsContainer, marginStyles]
|
|
212
|
+
}, /*#__PURE__*/React.createElement(_Touchable.default, {
|
|
213
|
+
disabled: disabled,
|
|
214
|
+
onPress: togglePickerVisible,
|
|
215
|
+
style: styles.touchableContainer
|
|
216
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
217
|
+
pointerEvents: "none",
|
|
218
|
+
style: [styles.outsetContainer, stylesWithoutBordersAndMargins, // @ts-expect-error ... rejects border-related { key: undefined }
|
|
219
|
+
!leftIconOutset && borderStyles // set border if Icon is inset
|
|
220
|
+
]
|
|
221
|
+
}, leftIcon, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
222
|
+
style: [styles.insetContainer, // @ts-expect-error ... rejects border-related { key: undefined }
|
|
223
|
+
leftIconOutset && borderStyles // set border if Icon is outset
|
|
224
|
+
]
|
|
225
|
+
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
226
|
+
style: styles.primaryTextContainer
|
|
227
|
+
}, labelText, /*#__PURE__*/React.createElement(_reactNative.Text, {
|
|
228
|
+
style: primaryTextStyle
|
|
229
|
+
}, 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, {
|
|
230
|
+
style: [styles.iosPicker, {
|
|
231
|
+
backgroundColor: colors.divider
|
|
232
|
+
}]
|
|
233
|
+
}, /*#__PURE__*/React.createElement(_reactNativeSafeAreaContext.SafeAreaView, {
|
|
234
|
+
style: styles.iosSafeArea
|
|
235
|
+
}, /*#__PURE__*/React.createElement(_DeprecatedButton.default, {
|
|
236
|
+
Icon: Icon,
|
|
237
|
+
type: "text",
|
|
238
|
+
onPress: togglePickerVisible,
|
|
239
|
+
style: styles.iosButton
|
|
240
|
+
}, "Close"), /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
241
|
+
style: styles.iosNativePicker,
|
|
242
|
+
selectedValue: internalValue,
|
|
243
|
+
onValueChange: handleValueChange
|
|
244
|
+
}, pickerOptions.map(option => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
245
|
+
label: option.label,
|
|
246
|
+
value: option.value,
|
|
247
|
+
key: option.value
|
|
248
|
+
})))))) : null, _reactNative.Platform.OS !== "ios" ? /*#__PURE__*/React.createElement(_picker.Picker, {
|
|
249
|
+
enabled: !disabled,
|
|
250
|
+
selectedValue: internalValue,
|
|
251
|
+
onValueChange: handleValueChange,
|
|
252
|
+
style: styles.nonIosPicker
|
|
253
|
+
}, pickerOptions.map(option => /*#__PURE__*/React.createElement(_picker.Picker.Item, {
|
|
254
|
+
label: option.label,
|
|
255
|
+
value: option.value,
|
|
256
|
+
key: option.value
|
|
257
|
+
}))) : null)
|
|
258
|
+
);
|
|
93
259
|
};
|
|
94
260
|
|
|
95
261
|
var _default = (0, _theming.withTheme)(Picker);
|
|
96
262
|
|
|
97
263
|
exports.default = _default;
|
|
264
|
+
|
|
265
|
+
const styles = _reactNative.StyleSheet.create({
|
|
266
|
+
marginsContainer: {
|
|
267
|
+
alignSelf: "stretch"
|
|
268
|
+
},
|
|
269
|
+
touchableContainer: {
|
|
270
|
+
alignSelf: "stretch",
|
|
271
|
+
alignItems: "center"
|
|
272
|
+
},
|
|
273
|
+
outsetContainer: {
|
|
274
|
+
flexDirection: "row",
|
|
275
|
+
alignItems: "center",
|
|
276
|
+
justifyContent: "space-between"
|
|
277
|
+
},
|
|
278
|
+
insetContainer: {
|
|
279
|
+
flex: 1,
|
|
280
|
+
height: "100%",
|
|
281
|
+
flexDirection: "row",
|
|
282
|
+
alignItems: "center",
|
|
283
|
+
justifyContent: "space-between",
|
|
284
|
+
paddingLeft: 12,
|
|
285
|
+
paddingRight: 12
|
|
286
|
+
},
|
|
287
|
+
primaryTextContainer: {
|
|
288
|
+
flex: 1
|
|
289
|
+
},
|
|
290
|
+
iosPicker: {
|
|
291
|
+
position: "absolute",
|
|
292
|
+
bottom: 0,
|
|
293
|
+
left: 0,
|
|
294
|
+
right: 0,
|
|
295
|
+
flexDirection: "row",
|
|
296
|
+
justifyContent: "center"
|
|
297
|
+
},
|
|
298
|
+
iosSafeArea: {
|
|
299
|
+
backgroundColor: "white",
|
|
300
|
+
flexDirection: "column",
|
|
301
|
+
width: "100%"
|
|
302
|
+
},
|
|
303
|
+
iosButton: {
|
|
304
|
+
alignSelf: "flex-end"
|
|
305
|
+
},
|
|
306
|
+
iosNativePicker: {
|
|
307
|
+
backgroundColor: "white"
|
|
308
|
+
},
|
|
309
|
+
nonIosPicker: {
|
|
310
|
+
opacity: 0,
|
|
311
|
+
position: "absolute",
|
|
312
|
+
top: 0,
|
|
313
|
+
left: 0,
|
|
314
|
+
right: 0,
|
|
315
|
+
bottom: 0,
|
|
316
|
+
width: "100%"
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
//# sourceMappingURL=Picker.js.mapft: 0,
|
|
320
|
+
right: 0,
|
|
321
|
+
bottom: 0,
|
|
322
|
+
width: "100%"
|
|
323
|
+
}
|
|
324
|
+
});
|
|
98
325
|
//# sourceMappingURL=Picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Picker.tsx"],"names":["normalizeOptions","options","length","map","option","label","value","String","Error","Picker","placeholder","onValueChange","onValueChangeOverride","defaultValue","props","internalValue","setInternalValue","React","useState","useEffect","useCallback","itemValue","itemIndex","normalizedOptions","pickerOptions","handleValueChange","newValue"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;;;;;AASA,SAASA,gBAAT,CAA0BC,OAA1B,EAAqE;AACnE,MAAIA,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;AACxB,WAAO,EAAP;AACD;;AAED,MAAI,OAAOD,OAAO,CAAC,CAAD,CAAd,KAAsB,QAA1B,EAAoC;AAClC,WAAQA,OAAD,CAAsBE,GAAtB,CAA2BC,MAAD,KAAa;AAC5CC,MAAAA,KAAK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C;AAClC;AACD;;AACDV,IAAAA,qBAAqB,IACnBA,qBAAqB,CAACL,MAAM,CAACc,SAAD,CAAP,EAAoBC,SAApB,CADvB;AAED,GAPmB,EAQpB,CAACZ,WAAD,EAAcE,qBAAd,CARoB,CAAtB;AAWA,QAAMW,iBAAiB,GAAGvB,gBAAgB,CAACC,OAAD,CAA1C;AAEA,QAAMuB,aAAa,GAAGd,WAAW,GAC7B,CAAC;AAAEJ,IAAAA,KAAK,EAAEI,WAAT;AAAsBL,IAAAA,KAAK,EAAEK;AAA7B,GAAD,EAA6C,GAAGa,iBAAhD,CAD6B,GAE7BA,iBAFJ;;AAIA,QAAME,iBAAiB,GAAG,CAACC,QAAD,EAAmBJ,SAAnB,KAAyC;AACjEN,IAAAA,gBAAgB,CAACU,QAAD,CAAhB;;AACA,QAAIf,aAAJ,EAAmB;AACjBA,MAAAA,aAAa,CAACe,QAAD,EAAWJ,SAAX,CAAb;AACD;AACF,GALD;;AAOA,sBACE,oBAAC,wBAAD,eACMR,KADN;AAEE,IAAA,aAAa,EAAEP,MAAM,CAACQ,aAAD,CAFvB;AAGE,IAAA,WAAW,EAAEL,WAHf;AAIE,IAAA,OAAO,EAAEc,aAJX;AAKE,IAAA,aAAa,EAAEC;AALjB,KADF;AASD,CAzDD;;eA2De,wBAAUhB,MAAV,C","sourcesContent":["import * as React from \"react\";\nimport { withTheme } from \"../../theming\";\n//@ts-ignore\nimport PickerComponent from \"./PickerComponent\"; //unable to find file due to using .android/.web/.ios\nimport { PickerComponentProps, PickerOption } from \"./PickerTypes\";\n\ntype Props = PickerComponentProps & {\n placeholder?: string;\n value?: string;\n options: PickerOption[] | string[];\n};\n\nfunction normalizeOptions(options: Props[\"options\"]): PickerOption[] {\n if (options.length === 0) {\n return [];\n }\n\n if (typeof options[0] === \"string\") {\n return (options as string[]).map((option) => ({\n label: option,\n value: String(option),\n }));\n }\n\n if (options[0].label && options[0].value) {\n return options.map((option) => {\n return {\n label: option.label,\n value: String(option.value),\n };\n });\n }\n\n throw new Error(\n 'Picker options must be either an array of strings or array of { \"label\": string; \"value\": string; } objects.'\n );\n}\n\nconst Picker: React.FC<Props> = ({\n options = [],\n placeholder,\n onValueChange: onValueChangeOverride,\n value,\n defaultValue,\n ...props\n}) => {\n const [internalValue, setInternalValue] = React.useState<string | undefined>(\n value || defaultValue\n );\n\n React.useEffect(() => {\n if (value != null) {\n setInternalValue(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const onValueChange = React.useCallback(\n (itemValue: string, itemIndex: number) => {\n if (placeholder && itemIndex === 0) {\n return;\n }\n onValueChangeOverride &&\n onValueChangeOverride(String(itemValue), itemIndex);\n },\n [placeholder, onValueChangeOverride]\n );\n\n const normalizedOptions = normalizeOptions(options);\n\n const pickerOptions = placeholder\n ? [{ value: placeholder, label: placeholder }, ...normalizedOptions]\n : normalizedOptions;\n\n const handleValueChange = (newValue: string, itemIndex: number) => {\n setInternalValue(newValue);\n if (onValueChange) {\n onValueChange(newValue, itemIndex);\n }\n };\n\n return (\n <PickerComponent\n {...props}\n selectedValue={String(internalValue)}\n placeholder={placeholder}\n options={pickerOptions}\n onValueChange={handleValueChange}\n />\n );\n};\n\nexport default withTheme(Picker);\n"]}
|
|
1
|
+
{"version":3,"sources":["Picker.tsx"],"names":["normalizeOptions","options","length","map","option","label","String","value","Error","unstyledColor","disabledColor","errorColor","Picker","error","onValueChange","defaultValue","Icon","style","placeholder","disabled","theme","assistiveText","iconColor","iconSize","leftIconMode","leftIconName","placeholderTextColor","rightIconName","type","internalValue","setInternalValue","React","useState","pickerVisible","togglePickerVisible","useReducer","state","useEffect","normalizedOptions","pickerOptions","viewStyles","textStyles","colors","borders","borderStyles","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderTopWidth","borderRightWidth","borderLeftWidth","borderBottomWidth","borderColor","borderStyle","backgroundColor","margins","marginStyles","maxHeight","Dimensions","get","height","stylesWithoutBordersAndMargins","width","selectedLabel","find","labelText","textAlign","color","fontSize","paddingBottom","leftIconOutset","leftIcon","marginRight","marginLeft","rightIcon","undefined","paddingLeft","assistiveTextLabel","paddingTop","primaryTextStyle","identity","handleValueChange","newValue","itemIndex","styles","marginsContainer","touchableContainer","outsetContainer","insetContainer","primaryTextContainer","Platform","OS","iosPicker","divider","iosSafeArea","iosButton","iosNativePicker","nonIosPicker","StyleSheet","create","alignSelf","alignItems","flexDirection","justifyContent","flex","paddingRight","position","bottom","left","right","opacity","top"],"mappings":";;;;;;;AAAA;;AACA;;AASA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;AA6BA,SAASA,gBAAT,CAA0BC,OAA1B,EAA2E;AACzE,MAAIA,OAAO,CAACC,MAAR,KAAmB,CAAvB,EAA0B;AACxB,WAAO,EAAP;AACD;;AAED,MAAI,OAAOD,OAAO,CAAC,CAAD,CAAd,MAAuB,YAAY,QAAnC,CAAJ,EAAkD;AAChD,WAAQA,OAAD,CAAsBE,GAAtB,CAA2BC,MAAD,KAAa;AAC5CC,MAAAA,KAAK,EAAEC,MAAM,CAACF,MAAD,CAD+B;AAE5CG,MAAAA,KAAK,EAAED,MAAM,CAACF,MAAD;AAF+B,KAAb,CAA1B,CAAP;AAID;;AAED,MACE,OAAOH,OAAO,CAAC,CAAD,CAAd,KAAsB,QAAtB,IACAA,OAAO,CAAC,CAAD,CAAP,CAAWM,KAAX,KAAqB,IADrB,IAEAN,OAAO,CAAC,CAAD,CAAP,CAAWI,KAAX,KAAqB,IAHvB,EAIE;AACA,WAAQJ,OAAD,CAA4BE,GAA5B,CAAiCC,MAAD,IAAY;AACjD,aAAO;AACLC,QAAAA,KAAK,EAAEC,MAAM,CAACF,MAAM,CAACC,KAAR,CADR;AAELE,QAAAA,KAAK,EAAED,MAAM,CAACF,MAAM,CAACG,KAAR;AAFR,OAAP;AAID,KALM,CAAP;AAMD;;AAED,QAAM,IAAIC,KAA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AAA,KAAK,EAAE;AAHI,GA1BkB;AA+B/BiC,EAAAA,SAAS,EAAE;AAAEK,IAAAA,SAAS,EAAE;AAAb,GA/BoB;AAgC/BJ,EAAAA,eAAe,EAAE;AAAE1C,IAAAA,eAAe,EAAE;AAAnB,GAhCc;AAiC/B2C,EAAAA,YAAY,EAAE;AACZa,IAAAA,OAAO,EAAE,CADG;AAEZJ,IAAAA,QAAQ,EAAE,UAFE;AAGZK,IAAAA,GAAG,EAAE,CAHO;AAIZH,IAAAA,IAAI,EAAE,CAJM;AAKZC,IAAAA,KAAK,EAAE,CALK;AAMZF,IAAAA,MAAM,EAAE,CANI;AAOZ7C,IAAAA,KAAK,EAAE;AAPK;AAjCiB,CAAlB,CAAf","sourcesContent":["import * as React from \"react\";\nimport {\n View,\n StyleSheet,\n Text,\n Platform,\n ViewStyle,\n StyleProp,\n Dimensions,\n} from \"react-native\";\nimport { omit, pick, pickBy, identity } from \"lodash\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\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 type { Theme } from \"../../styles/DefaultTheme\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport { extractStyles } from \"../../utilities\";\n\nexport interface PickerOption {\n value: string;\n label: string;\n}\n\nexport type PickerProps = {\n error?: any;\n placeholder?: string;\n disabled?: boolean;\n style?: StyleProp<ViewStyle> & { height?: number };\n value?: string;\n options: PickerOption[] | string[];\n onValueChange: (value: string, index: number) => void;\n defaultValue?: string;\n assistiveText?: string;\n label?: string;\n iconColor?: string;\n iconSize?: number;\n leftIconMode?: \"inset\" | \"outset\";\n leftIconName?: string;\n placeholderTextColor?: string;\n rightIconName?: string;\n type?: \"solid\" | \"underline\";\n theme: Theme;\n Icon: IconSlot[\"Icon\"];\n};\n\nfunction normalizeOptions(options: PickerProps[\"options\"]): PickerOption[] {\n if (options.length === 0) {\n return [];\n }\n\n if (typeof options[0] === (\"string\" || \"number\")) {\n return (options as string[]).map((option) => ({\n label: String(option),\n value: String(option),\n }));\n }\n\n if (\n typeof options[0] === \"object\" &&\n options[0].value !== null &&\n options[0].label !== null\n ) {\n return (options as PickerOption[]).map((option) => {\n return {\n label: String(option.label),\n value: String(option.value),\n };\n });\n }\n\n throw new Error(\n 'Picker options must be either an array of strings or array of { \"label\": string; \"value\": string; } objects.'\n );\n}\n\nconst unstyledColor = \"rgba(165, 173, 183, 1)\";\nconst disabledColor = \"rgb(240, 240, 240)\";\nconst errorColor = \"rgba(255, 69, 100, 1)\";\n\nconst Picker: React.FC<PickerProps> = ({\n error,\n options = [],\n onValueChange,\n defaultValue,\n Icon,\n style,\n placeholder,\n value,\n disabled = false,\n theme,\n assistiveText,\n label,\n iconColor = unstyledColor,\n iconSize = 24,\n leftIconMode = \"inset\",\n leftIconName,\n placeholderTextColor = unstyledColor,\n rightIconName,\n type = \"solid\",\n}) => {\n const [internalValue, setInternalValue] = React.useState<string | undefined>(\n value || defaultValue\n );\n\n const [pickerVisible, togglePickerVisible] = React.useReducer(\n (state) => !state,\n false\n );\n\n React.useEffect(() => {\n if (value != null) {\n setInternalValue(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const normalizedOptions = normalizeOptions(options);\n\n const pickerOptions = placeholder\n ? [{ value: placeholder, label: placeholder }, ...normalizedOptions]\n : normalizedOptions;\n\n const { viewStyles, textStyles } = extractStyles(style);\n\n const { colors } = theme;\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 \"backgroundColor\",\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: unstyledColor,\n borderStyle: \"solid\",\n },\n ...pick(viewStyles, borders),\n ...(error ? { borderColor: errorColor } : {}),\n ...(disabled\n ? { borderColor: \"transparent\", backgroundColor: disabledColor }\n : {}),\n };\n\n const margins = [\"marginLeft\", \"marginRight\", \"marginTop\", \"marginBottom\"];\n\n const marginStyles = pick(viewStyles, margins);\n\n const maxHeight =\n viewStyles?.maxHeight && viewStyles.maxHeight !== \"100%\"\n ? viewStyles.maxHeight\n : Dimensions.get(\"window\").height;\n\n const stylesWithoutBordersAndMargins = {\n ...{\n height: 60,\n width: \"100%\",\n },\n ...omit(viewStyles, [...borders, ...margins]),\n ...{ maxHeight },\n };\n\n const selectedLabel =\n internalValue &&\n ((pickerOptions as unknown as PickerOption[]).find(\n (option) => option.value === internalValue\n )?.label ??\n internalValue);\n\n const labelText = label ? (\n <Text\n style={{\n textAlign: textStyles.textAlign,\n color: unstyledColor,\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 color={disabled ? unstyledColor : iconColor}\n size={iconSize}\n style={{\n marginRight: 4,\n marginLeft: 4,\n }}\n />\n ) : null;\n\n const rightIcon = rightIconName ? (\n <Icon\n name={rightIconName}\n color={disabled ? unstyledColor : iconColor}\n size={iconSize}\n style={{\n marginRight: -10,\n marginLeft: 8,\n }}\n />\n ) : null;\n\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 ? iconSize + 4\n : 0;\n\n const assistiveTextLabel = assistiveText ? (\n <Text\n style={{\n textAlign,\n width,\n paddingLeft,\n color: unstyledColor,\n fontSize: 12,\n paddingTop: 4,\n }}\n >\n {assistiveText}\n </Text>\n ) : null;\n\n const primaryTextStyle = {\n color: unstyledColor,\n fontSize: 14,\n ...pickBy(textStyles, identity),\n ...(placeholder === internalValue ? { color: placeholderTextColor } : {}),\n ...(disabled ? { color: unstyledColor } : {}),\n };\n\n const handleValueChange = (newValue: string, itemIndex: number) => {\n if (!placeholder || itemIndex > 0) {\n onValueChange?.(newValue, itemIndex);\n }\n setInternalValue(newValue);\n };\n\n return (\n /* marginsContainer */\n <View style={[styles.marginsContainer, marginStyles]}>\n {/* touchableContainer */}\n <Touchable\n disabled={disabled}\n onPress={togglePickerVisible}\n style={styles.touchableContainer}\n >\n {/* outsetContainer */}\n <View\n pointerEvents=\"none\"\n style={[\n styles.outsetContainer,\n stylesWithoutBordersAndMargins,\n // @ts-expect-error ... rejects border-related { key: undefined }\n !leftIconOutset && borderStyles, // set border if Icon is inset\n ]}\n >\n {leftIcon}\n\n {/* insetContainer */}\n <View\n style={[\n styles.insetContainer,\n // @ts-expect-error ... rejects border-related { key: undefined }\n leftIconOutset && borderStyles, // set border if Icon is outset\n ]}\n >\n {/* primaryTextContainer */}\n <View style={styles.primaryTextContainer}>\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 {/* iosPicker */}\n {Platform.OS === \"ios\" && pickerVisible ? (\n <Portal>\n <View\n style={[\n styles.iosPicker,\n {\n backgroundColor: colors.divider,\n },\n ]}\n >\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 ) : null}\n\n {/* nonIosPicker */}\n {Platform.OS !== \"ios\" ? (\n <NativePicker\n enabled={!disabled}\n selectedValue={internalValue}\n onValueChange={handleValueChange}\n style={styles.nonIosPicker}\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 ) : null}\n </View>\n );\n};\n\nexport default withTheme(Picker);\n\nconst styles = StyleSheet.create({\n marginsContainer: { alignSelf: \"stretch\" },\n touchableContainer: { alignSelf: \"stretch\", alignItems: \"center\" },\n outsetContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n },\n insetContainer: {\n flex: 1,\n height: \"100%\",\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingLeft: 12,\n paddingRight: 12,\n },\n primaryTextContainer: { flex: 1 },\n iosPicker: {\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n flexDirection: \"row\",\n justifyContent: \"center\",\n },\n iosSafeArea: {\n backgroundColor: \"white\",\n flexDirection: \"column\",\n width: \"100%\",\n },\n iosButton: { alignSelf: \"flex-end\" },\n iosNativePicker: { backgroundColor: \"white\" },\n nonIosPicker: {\n opacity: 0,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: \"100%\",\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["StepIndicator.tsx"],"names":["STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","Component","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","steps","push","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","Animated","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","onPress","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","StyleSheet","create","justifyContent","zIndex","textAlign","fontWeight","defaultProps"],"mappings":";;;;;;;AACA;;AACA;;;;;;;;AAQA,MAAMA,WAAW,GAAG;AAClBC,EAAAA,OAAO,EAAE,SADS;AAElBC,EAAAA,QAAQ,EAAE,UAFQ;AAGlBC,EAAAA,UAAU,EAAE;AAHM,CAApB;;AA+Ce,MAAMC,aAAN,SAA4BC,gBAA5B,CAAoD;AACjEC,EAAAA,WAAW,CAACC,KAAD,EAAe;AACxB,UAAMA,KAAN;;AADwB,yDAwFI,MAAM;AAClC,YAAM;AAAEC,QAAAA,SAAF;AAAaC,QAAAA;AAAb,UAA2B,KAAKF,KAAtC;AACA,UAAIG,0BAAJ;;AACA,UAAID,SAAS,KAAK,UAA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QAFC;AAGbmD,IAAAA,cAAc,EAAE;AAHH;AA7BgB,CAAlB,CAAf;;AAoCAhH,aAAa,CAACoH,YAAd,GAA6B;AAC3B1F,EAAAA,eAAe,EAAE,CADU;AAE3BtB,EAAAA,SAAS,EAAE,CAFgB;AAG3BK,EAAAA,YAAY,EAAE,EAHa;AAI3BJ,EAAAA,SAAS,EAAE;AAJgB,CAA7B","sourcesContent":["// @ts-nocheck\nimport React, { Component } from \"react\";\nimport {\n View,\n Text,\n StyleSheet,\n Animated,\n TouchableWithoutFeedback,\n} from \"react-native\";\n\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\n\ninterface CustomStyles {\n stepIndicatorSize?: number;\n currentStepIndicatorSize?: number;\n separatorStrokeWidth?: number;\n separatorStrokeUnfinishedWidth?: number;\n separatorStrokeFinishedWidth?: number;\n currentStepStrokeWidth: number;\n stepStrokeWidth?: number;\n stepStrokeCurrentColor?: string;\n stepStrokeFinishedColor: string;\n stepStrokeUnFinishedColor: string;\n separatorFinishedColor: string;\n separatorUnFinishedColor: string;\n stepIndicatorFinishedColor: string;\n stepIndicatorUnFinishedColor: string;\n stepIndicatorCurrentColor: string;\n stepIndicatorLabelFontSize: number;\n currentStepIndicatorLabelFontSize?: number;\n stepIndicatorLabelCurrentColor: string;\n stepIndicatorLabelFinishedColor: string;\n stepIndicatorLabelUnFinishedColor: string;\n labelColor?: string;\n labelSize?: number;\n labelAlign?: string;\n currentStepLabelColor?: string;\n labelFontFamily?: string;\n}\n\ntype Props = {\n stepCount: number;\n currentPosition: number;\n customStyles: CustomStyles;\n};\n\ntype State = {\n width: number;\n height: number;\n progressBarSize: number;\n customStyles: CustomStyles;\n};\n\nexport default class StepIndicator extends Component<Props, State> {\n constructor(props: Props) {\n super(props);\n\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize\n );\n this.borderRadiusAnim = new Animated.Value(\n this.state.customStyles.stepIndicatorSize / 2\n );\n }\n\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n\n render() {\n const { labels, direction } = this.props;\n return (\n <View\n style={[\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ]}\n >\n {this.state.width !== 0 && this.renderProgressBarBackground()}\n {this.state.width !== 0 && this.renderProgressBar()}\n {this.renderStepIndicator()}\n {labels && this.renderStepLabels()}\n </View>\n );\n }\n\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n } else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (\n <View\n onLayout={(event) => {\n if (direction === \"vertical\") {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.height },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n } else {\n this.setState(\n { progressBarSize: event.nativeEvent.layout.width },\n () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n );\n }\n }}\n style={progressBarBackgroundStyle}\n />\n );\n };\n\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left:\n (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n } else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top:\n (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height:\n this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return <Animated.View style={progressBarStyle} />;\n };\n\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(\n <TouchableWithoutFeedback\n key={position}\n onPress={() => this.stepPressed(position)}\n >\n <View\n style={[\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ]}\n >\n {this.renderStep(position)}\n </View>\n </TouchableWithoutFeedback>\n );\n }\n return (\n <View\n onLayout={(event) =>\n this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n })\n }\n style={[\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ]}\n >\n {steps}\n </View>\n );\n };\n\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle =\n index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (\n <TouchableWithoutFeedback\n style={styles.stepLabelItem}\n key={index}\n onPress={() => this.stepPressed(index)}\n >\n <View style={styles.stepLabelItem}>\n {renderLabel ? (\n renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })\n ) : (\n <Text\n style={[\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ]}\n >\n {label}\n </Text>\n )}\n </View>\n </TouchableWithoutFeedback>\n );\n });\n\n return (\n <View\n style={[\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ]}\n >\n {labelViews}\n </View>\n );\n };\n\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n\n return (\n <Animated.View key={\"step-indicator\"} style={[styles.step, stepStyle]}>\n {renderStepIndicator ? (\n renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })\n ) : (\n <Text style={indicatorLabelStyle}>{`${position + 1}`}</Text>\n )}\n </Animated.View>\n );\n };\n\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n } else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n } else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition =\n (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(\n this.state.customStyles.stepIndicatorSize / 2\n );\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\n\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["StepIndicator.js"],"names":["STEP_STATUS","CURRENT","FINISHED","UNFINISHED","StepIndicator","Component","constructor","props","stepCount","direction","progressBarBackgroundStyle","backgroundColor","state","customStyles","separatorUnFinishedColor","position","left","width","separatorStrokeWidth","top","height","bottom","separatorStrokeUnfinishedWidth","right","React","createElement","View","onLayout","event","setState","progressBarSize","nativeEvent","layout","onCurrentPositionChanged","currentPosition","style","progressBarStyle","separatorFinishedColor","separatorStrokeFinishedWidth","progressAnim","Animated","steps","push","TouchableWithoutFeedback","key","onPress","stepPressed","styles","stepContainer","flexDirection","renderStep","stepIndicatorContainer","currentStepIndicatorSize","labels","renderLabel","labelViews","map","label","index","selectedStepLabelStyle","color","currentStepLabelColor","labelColor","stepLabelItem","stepStatus","getStepStatus","Text","stepLabel","fontSize","labelSize","fontFamily","labelFontFamily","stepLabelsContainer","paddingHorizontal","paddingVertical","alignItems","labelAlign","renderStepIndicator","stepStyle","indicatorLabelStyle","stepIndicatorCurrentColor","borderWidth","currentStepStrokeWidth","borderColor","stepStrokeCurrentColor","sizeAnim","borderRadius","borderRadiusAnim","currentStepIndicatorLabelFontSize","stepIndicatorLabelCurrentColor","stepIndicatorFinishedColor","stepStrokeWidth","stepStrokeFinishedColor","stepIndicatorSize","stepIndicatorLabelFontSize","stepIndicatorLabelFinishedColor","stepIndicatorUnFinishedColor","stepStrokeUnFinishedColor","overflow","stepIndicatorLabelUnFinishedColor","step","stepPosition","animateToPosition","setValue","sequence","timing","toValue","duration","parallel","start","defaultStyles","Object","assign","Value","render","container","flex","renderProgressBarBackground","renderProgressBar","renderStepLabels","componentDidUpdate","prevProps","StyleSheet","create","justifyContent","zIndex","textAlign","fontWeight","defaultProps"],"mappings":";;;;;;;AACA;;AACA;;;;;;;;AACA,MAAMA,WAAW,GAAG;AAChBC,EAAAA,OAAO,EAAE,SADO;AAEhBC,EAAAA,QAAQ,EAAE,UAFM;AAGhBC,EAAAA,UAAU,EAAE;AAHI,CAApB;;AAKe,MAAMC,aAAN,SAA4BC,gBAA5B,CAAsC;AACjDC,EAAAA,WAAW,CAACC,KAAD,EAAQ;AACf,UAAMA,KAAN;;AADe,yDAsEW,MAAM;AAChC,YAAM;AAAEC,QAAAA,SAAF;AAAaC,QAAAA;AAAb,UAA2B,KAAKF,KAAtC;AACA,UAAIG,0BAAJ;;AACA,UAAID,SAAS,KAAK,UAAlB,EAA8B;AAC1BC,QAAAA,0BAA0B,GAAG;AACzBC,UAAAA,eAAe,EAAE,KAAKC,KAAL,CAAWC,YAAX,CAAwBC,wBADhB;AAEzBC,UAAAA,QAAQ,EAAE,UAFe;AAGzBC,UAAAA,IAAI,EAAE,CAAC,KAAKJ,KAAL,CAAWK,KAAX,GAAmB,KAAKL,KAAL,CAAWC,YAAX,CAAwBK,oBAA5C,IAAoE,CAHjD;AAIzBC,UAAAA,GAAG,EAAE,KAAKP,KAAL,CAAWQ,MAAX,IAAqB,IAAIZ,SAAzB,CAJoB;AAKzBa,UAAAA,MAAM,EAAE,KAAKT,KAAL,CAAWQ,MAAX,IAAqB,IAAIZ,SAAzB,CALiB;AAMzBS,UAAAA,KAAK,EAAE,KAAKL,KAAL,CAAWC,YAAX,CAAwBS,8BAAxB,KAA2D,CAA3D,GACD,KAAKV,KAAL,CAAWC,YAAX,CAAwBK,oBADvB,GAED,KAAKN,KAAL,CAAWC,YAAX,CAAwBS;AARL,SAA7B;AAUH,OAXD,MAYK;AACDZ,QAAAA,0BAA0B,GAAG;AACzBC,UAAAA,eAAe,EAAE,KAAKC,KAAL,CAAWC,YAAX,CAAwBC,wBADhB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heck\nimport React, { Component } from \"react\";\nimport { View, Text, StyleSheet, Animated, TouchableWithoutFeedback, } from \"react-native\";\nconst STEP_STATUS = {\n CURRENT: \"current\",\n FINISHED: \"finished\",\n UNFINISHED: \"unfinished\",\n};\nexport default class StepIndicator extends Component {\n constructor(props) {\n super(props);\n const defaultStyles = {\n stepIndicatorSize: 30,\n currentStepIndicatorSize: 40,\n separatorStrokeWidth: 3,\n separatorStrokeUnfinishedWidth: 0,\n separatorStrokeFinishedWidth: 0,\n currentStepStrokeWidth: 5,\n stepStrokeWidth: 0,\n stepStrokeCurrentColor: \"#4aae4f\",\n stepStrokeFinishedColor: \"#4aae4f\",\n stepStrokeUnFinishedColor: \"#4aae4f\",\n separatorFinishedColor: \"#4aae4f\",\n separatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorFinishedColor: \"#4aae4f\",\n stepIndicatorUnFinishedColor: \"#a4d4a5\",\n stepIndicatorCurrentColor: \"#ffffff\",\n stepIndicatorLabelFontSize: 15,\n currentStepIndicatorLabelFontSize: 15,\n stepIndicatorLabelCurrentColor: \"#000000\",\n stepIndicatorLabelFinishedColor: \"#ffffff\",\n stepIndicatorLabelUnFinishedColor: \"rgba(255,255,255,0.5)\",\n labelColor: \"#000000\",\n labelSize: 13,\n labelAlign: \"center\",\n currentStepLabelColor: \"#4aae4f\",\n };\n const customStyles = Object.assign(defaultStyles, props.customStyles);\n this.state = {\n width: 0,\n height: 1,\n progressBarSize: -2,\n customStyles,\n };\n this.progressAnim = new Animated.Value(0);\n this.sizeAnim = new Animated.Value(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim = new Animated.Value(this.state.customStyles.stepIndicatorSize / 2);\n }\n stepPressed(position) {\n if (this.props.onPress) {\n this.props.onPress(position);\n }\n }\n render() {\n const { labels, direction } = this.props;\n return (React.createElement(View, { style: [\n styles.container,\n direction === \"vertical\"\n ? { flexDirection: \"row\", flex: 1 }\n : { flexDirection: \"column\" },\n ] },\n this.state.width !== 0 && this.renderProgressBarBackground(),\n this.state.width !== 0 && this.renderProgressBar(),\n this.renderStepIndicator(),\n labels && this.renderStepLabels()));\n }\n componentDidUpdate(prevProps) {\n // if (prevProps.customStyles !== this.props.customStyles) {\n // this.setState((state) => ({\n // customStyles: Object.assign(\n // state.customStyles,\n // this.props.customStyles\n // ),\n // }));\n // }\n if (prevProps.currentPosition !== this.props.currentPosition) {\n this.onCurrentPositionChanged(this.props.currentPosition);\n }\n }\n renderProgressBarBackground = () => {\n const { stepCount, direction } = this.props;\n let progressBarBackgroundStyle;\n if (direction === \"vertical\") {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n left: (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width: this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n else {\n progressBarBackgroundStyle = {\n backgroundColor: this.state.customStyles.separatorUnFinishedColor,\n position: \"absolute\",\n top: (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height: this.state.customStyles.separatorStrokeUnfinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeUnfinishedWidth,\n };\n }\n return (React.createElement(View, { onLayout: (event) => {\n if (direction === \"vertical\") {\n this.setState({ progressBarSize: event.nativeEvent.layout.height }, () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n });\n }\n else {\n this.setState({ progressBarSize: event.nativeEvent.layout.width }, () => {\n this.onCurrentPositionChanged(this.props.currentPosition);\n });\n }\n }, style: progressBarBackgroundStyle }));\n };\n renderProgressBar = () => {\n const { stepCount, direction } = this.props;\n let progressBarStyle;\n if (direction === \"vertical\") {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n left: (this.state.width - this.state.customStyles.separatorStrokeWidth) / 2,\n top: this.state.height / (2 * stepCount),\n bottom: this.state.height / (2 * stepCount),\n width: this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n height: this.progressAnim,\n };\n }\n else {\n progressBarStyle = {\n backgroundColor: this.state.customStyles.separatorFinishedColor,\n position: \"absolute\",\n top: (this.state.height - this.state.customStyles.separatorStrokeWidth) /\n 2,\n left: this.state.width / (2 * stepCount),\n right: this.state.width / (2 * stepCount),\n height: this.state.customStyles.separatorStrokeFinishedWidth === 0\n ? this.state.customStyles.separatorStrokeWidth\n : this.state.customStyles.separatorStrokeFinishedWidth,\n width: this.progressAnim,\n };\n }\n return React.createElement(Animated.View, { style: progressBarStyle });\n };\n renderStepIndicator = () => {\n let steps = [];\n const { stepCount, direction } = this.props;\n for (let position = 0; position < stepCount; position++) {\n steps.push(React.createElement(TouchableWithoutFeedback, { key: position, onPress: () => this.stepPressed(position) },\n React.createElement(View, { style: [\n styles.stepContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\" }\n : { flexDirection: \"row\" },\n ] }, this.renderStep(position))));\n }\n return (React.createElement(View, { onLayout: (event) => this.setState({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n }), style: [\n styles.stepIndicatorContainer,\n direction === \"vertical\"\n ? {\n flexDirection: \"column\",\n width: this.state.customStyles.currentStepIndicatorSize,\n }\n : {\n flexDirection: \"row\",\n height: this.state.customStyles.currentStepIndicatorSize,\n },\n ] }, steps));\n };\n renderStepLabels = () => {\n const { labels, direction, currentPosition, renderLabel } = this.props;\n var labelViews = labels.map((label, index) => {\n const selectedStepLabelStyle = index === currentPosition\n ? { color: this.state.customStyles.currentStepLabelColor }\n : { color: this.state.customStyles.labelColor };\n return (React.createElement(TouchableWithoutFeedback, { style: styles.stepLabelItem, key: index, onPress: () => this.stepPressed(index) },\n React.createElement(View, { style: styles.stepLabelItem }, renderLabel ? (renderLabel({\n position: index,\n stepStatus: this.getStepStatus(index),\n label,\n currentPosition,\n })) : (React.createElement(Text, { style: [\n styles.stepLabel,\n selectedStepLabelStyle,\n {\n fontSize: this.state.customStyles.labelSize,\n fontFamily: this.state.customStyles.labelFontFamily,\n },\n ] }, label)))));\n });\n return (React.createElement(View, { style: [\n styles.stepLabelsContainer,\n direction === \"vertical\"\n ? { flexDirection: \"column\", paddingHorizontal: 4 }\n : { flexDirection: \"row\", paddingVertical: 4 },\n { alignItems: this.state.customStyles.labelAlign },\n ] }, labelViews));\n };\n renderStep = (position) => {\n const { renderStepIndicator } = this.props;\n let stepStyle;\n let indicatorLabelStyle;\n switch (this.getStepStatus(position)) {\n case STEP_STATUS.CURRENT: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorCurrentColor,\n borderWidth: this.state.customStyles.currentStepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeCurrentColor,\n height: this.sizeAnim,\n width: this.sizeAnim,\n borderRadius: this.borderRadiusAnim,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.currentStepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelCurrentColor,\n };\n break;\n }\n case STEP_STATUS.FINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelFinishedColor,\n };\n break;\n }\n case STEP_STATUS.UNFINISHED: {\n stepStyle = {\n backgroundColor: this.state.customStyles.stepIndicatorUnFinishedColor,\n borderWidth: this.state.customStyles.stepStrokeWidth,\n borderColor: this.state.customStyles.stepStrokeUnFinishedColor,\n height: this.state.customStyles.stepIndicatorSize,\n width: this.state.customStyles.stepIndicatorSize,\n borderRadius: this.state.customStyles.stepIndicatorSize / 2,\n };\n indicatorLabelStyle = {\n overflow: \"hidden\",\n fontSize: this.state.customStyles.stepIndicatorLabelFontSize,\n color: this.state.customStyles.stepIndicatorLabelUnFinishedColor,\n };\n break;\n }\n default:\n }\n return (React.createElement(Animated.View, { key: \"step-indicator\", style: [styles.step, stepStyle] }, renderStepIndicator ? (renderStepIndicator({\n position,\n stepStatus: this.getStepStatus(position),\n })) : (React.createElement(Text, { style: indicatorLabelStyle }, `${position + 1}`))));\n };\n getStepStatus = (stepPosition) => {\n const { currentPosition } = this.props;\n if (stepPosition === currentPosition) {\n return STEP_STATUS.CURRENT;\n }\n else if (stepPosition < currentPosition) {\n return STEP_STATUS.FINISHED;\n }\n else {\n return STEP_STATUS.UNFINISHED;\n }\n };\n onCurrentPositionChanged = (position) => {\n let { stepCount } = this.props;\n if (position > stepCount - 1) {\n position = stepCount - 1;\n }\n const animateToPosition = (this.state.progressBarSize / (stepCount - 1)) * position;\n this.sizeAnim.setValue(this.state.customStyles.stepIndicatorSize);\n this.borderRadiusAnim.setValue(this.state.customStyles.stepIndicatorSize / 2);\n Animated.sequence([\n Animated.timing(this.progressAnim, {\n toValue: animateToPosition,\n duration: 200,\n }),\n Animated.parallel([\n Animated.timing(this.sizeAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize,\n duration: 100,\n }),\n Animated.timing(this.borderRadiusAnim, {\n toValue: this.state.customStyles.currentStepIndicatorSize / 2,\n duration: 100,\n }),\n ]),\n ]).start();\n };\n}\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"transparent\",\n },\n stepIndicatorContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n backgroundColor: \"transparent\",\n },\n stepLabelsContainer: {\n justifyContent: \"space-around\",\n },\n step: {\n alignItems: \"center\",\n justifyContent: \"center\",\n zIndex: 2,\n },\n stepContainer: {\n flex: 1,\n flexDirection: \"row\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n stepLabel: {\n fontSize: 12,\n textAlign: \"center\",\n fontWeight: \"500\",\n },\n stepLabelItem: {\n flex: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n});\nStepIndicator.defaultProps = {\n currentPosition: 0,\n stepCount: 5,\n customStyles: {},\n direction: \"horizontal\",\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Stepper.
|
|
1
|
+
{"version":3,"sources":["Stepper.js"],"names":["Stepper","min","Infinity","max","value","valueProp","defaultValue","style","typeStyle","iconSize","iconColor","onChange","theme","colors","typography","Icon","setValue","isValidValue","valueArg","handlePlusOrMinus","type","newValue","React","createElement","View","flexDirection","IconButton","icon","onPress","size","color","disabled","opacity","Text","body1","textAlign","alignSelf","medium","marginHorizontal"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AACA,MAAMA,OAAO,GAAG,QAAqK;AAAA,MAApK;AAAEC,IAAAA,GAAG,GAAG,CAACC,QAAT;AAAmBC,IAAAA,GAAG,GAAGD,QAAzB;AAAmCE,IAAAA,KAAK,EAAEC,SAA1C;AAAqDC,IAAAA,YAArD;AAAmEC,IAAAA,KAAnE;AAA0EC,IAAAA,SAA1E;AAAqFC,IAAAA,QAAQ,GAAG,EAAhG;AAAoGC,IAAAA,SAApG;AAA+GC,IAAAA,QAA/G;AAAyHC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAhI;AAAwJC,IAAAA;AAAxJ,GAAoK;AACjL,QAAM,CAACX,KAAD,EAAQY,QAAR,IAAoB,qBAASV,YAAT,aAASA,YAAT,cAASA,YAAT,GAAyB,CAAzB,CAA1B;;AACA,QAAMW,YAAY,GAAIC,QAAD,IAAcA,QAAQ,IAAIjB,GAAZ,IAAmBiB,QAAQ,IA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O,UAAU,CAACoB,KADgB,EAE3B;AACIC,MAAAA,SAAS,EAAE,QADf;AAEIC,MAAAA,SAAS,EAAE,QAFf;AAGIN,MAAAA,KAAK,EAAEjB,MAAM,CAACwB,MAHlB;AAIIC,MAAAA,gBAAgB,EAAE;AAJtB,KAF2B,EAQ3B9B,SAR2B;AAAT,GAA1B,EASSJ,KATT,CAFI,eAYJkB,eAAMC,aAAN,CAAoBG,mBAApB,EAAgC;AAAEX,IAAAA,IAAI,EAAEA,IAAR;AAAcY,IAAAA,IAAI,EAAE,mBAApB;AAAyCC,IAAAA,OAAO,EAAE,MAAMT,iBAAiB,CAAC,MAAD,CAAzE;AAAmFU,IAAAA,IAAI,EAAEpB,QAAzF;AAAmGqB,IAAAA,KAAK,EAAEpB,SAA1G;AAAqHqB,IAAAA,QAAQ,EAAE3B,KAAK,KAAKD,GAAzI;AAA8II,IAAAA,KAAK,EAAE;AAAEyB,MAAAA,OAAO,EAAE5B,KAAK,KAAKD,GAAV,GAAgB,GAAhB,GAAsB;AAAjC;AAArJ,GAAhC,CAZI,CAAR;AAaH,CAhCD;;eAiCe,wBAAUH,OAAV,C","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { View, Text } from \"react-native\";\nimport { isNumber } from \"lodash\";\nimport { withTheme } from \"../theming\";\nimport IconButton from \"./IconButton\";\nconst Stepper = ({ min = -Infinity, max = Infinity, value: valueProp, defaultValue, style, typeStyle, iconSize = 24, iconColor, onChange, theme: { colors, typography }, Icon, }) => {\n const [value, setValue] = useState(defaultValue ?? 0);\n const isValidValue = (valueArg) => valueArg >= min && valueArg <= max;\n const handlePlusOrMinus = (type) => {\n const newValue = type === \"plus\" ? value + 1 : value - 1;\n if (isValidValue(newValue)) {\n setValue(newValue);\n onChange?.(newValue);\n }\n };\n useEffect(() => {\n if (valueProp != null &&\n isNumber(valueProp) &&\n valueProp !== value &&\n isValidValue(valueProp)) {\n setValue(valueProp);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [valueProp]);\n return (React.createElement(View, { style: [{ flexDirection: \"row\" }, style] },\n React.createElement(IconButton, { Icon: Icon, icon: \"MaterialIcons/remove\", onPress: () => handlePlusOrMinus(\"minus\"), size: iconSize, color: iconColor, disabled: value === min, style: { opacity: value === min ? 0.5 : 1 } }),\n React.createElement(Text, { style: [\n typography.body1,\n {\n textAlign: \"center\",\n alignSelf: \"center\",\n color: colors.medium,\n marginHorizontal: 8,\n },\n typeStyle,\n ] }, value),\n React.createElement(IconButton, { Icon: Icon, icon: \"MaterialIcons/add\", onPress: () => handlePlusOrMinus(\"plus\"), size: iconSize, color: iconColor, disabled: value === max, style: { opacity: value === max ? 0.5 : 1 } })));\n};\nexport default withTheme(Stepper);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["hooks.
|
|
1
|
+
{"version":3,"sources":["hooks.js"],"names":["usePrevious","value","ref","React","useRef","useEffect","current"],"mappings":";;;;;;;AAAA;;;;AACO,SAASA,WAAT,CAAqBC,KAArB,EAA4B;AAC/B;AACA;AACA,QAAMC,GAAG,GAAGC,eAAMC,MAAN,EAAZ,CAH+B,CAI/B;;;AACAD,iBAAME,SAAN,CAAgB,MAAM;AAClBH,IAAAA,GAAG,CAACI,OAAJ,GAAcL,KAAd;AACH,GAFD,EAEG,CAACA,KAAD,CAFH,EAL+B,CAQ/B;;;AACA,SAAOC,GAAG,CAACI,OAAX;AACH","sourcesContent":["import React from \"react\";\nexport function usePrevious(value) {\n // The ref object is a generic container whose current property is mutable\n // and can hold any value, similar to an instance property on a class\n const ref = React.useRef();\n // Store current value in ref\n React.useEffect(() => {\n ref.current = value;\n }, [value]);\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n"]}
|