react-native-my-survey-sdk 3.0.6 → 3.0.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboRatingView.d.ts","sourceRoot":"","sources":["../../src/components/XeboRatingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAsID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"XeboRatingView.d.ts","sourceRoot":"","sources":["../../src/components/XeboRatingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGhE,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAsID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAuI1C,CAAC"}
|
|
@@ -183,23 +183,21 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
183
183
|
{question.subtitle}
|
|
184
184
|
</react_native_1.Text>)}
|
|
185
185
|
|
|
186
|
-
{/* Rating icons
|
|
186
|
+
{/* Rating icons + labels: each icon paired with its label */}
|
|
187
187
|
<react_native_1.View style={styles.iconsRow}>
|
|
188
188
|
{Array.from({ length: totalSteps }, (_, i) => {
|
|
189
|
+
var _a, _b;
|
|
189
190
|
const isFilled = isCumulative ? selected !== null && i <= selected : i === selected;
|
|
191
|
+
const label = question.showColLabels ? (_b = (_a = question.columns) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.text : undefined;
|
|
190
192
|
return (<react_native_1.TouchableOpacity key={i} onPress={() => handleSelect(i)} style={styles.iconButton} activeOpacity={0.7}>
|
|
191
193
|
<RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor} totalSteps={totalSteps}/>
|
|
194
|
+
{!!label && (<react_native_1.Text style={[styles.colLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]} numberOfLines={1}>
|
|
195
|
+
{label}
|
|
196
|
+
</react_native_1.Text>)}
|
|
192
197
|
</react_native_1.TouchableOpacity>);
|
|
193
198
|
})}
|
|
194
199
|
</react_native_1.View>
|
|
195
200
|
|
|
196
|
-
{/* Column labels */}
|
|
197
|
-
{question.showColLabels && question.columns && (<react_native_1.View style={styles.colLabels}>
|
|
198
|
-
{question.columns.map((col) => (<react_native_1.Text key={col.id} style={[styles.colLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]} numberOfLines={1}>
|
|
199
|
-
{col.text}
|
|
200
|
-
</react_native_1.Text>))}
|
|
201
|
-
</react_native_1.View>)}
|
|
202
|
-
|
|
203
201
|
{/* Follow-up after rating */}
|
|
204
202
|
{selected !== null && !!question.followUpQuestion && (<react_native_1.View style={[styles.followUpCard, { borderRadius: theme.cornerRadius }]}>
|
|
205
203
|
<react_native_1.Text style={[styles.followUpTitle, { color: theme.textColor, fontFamily: theme.fontFamily }]}>
|
|
@@ -223,21 +221,23 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
223
221
|
exports.XeboRatingView = XeboRatingView;
|
|
224
222
|
const styles = react_native_1.StyleSheet.create({
|
|
225
223
|
outer: {
|
|
224
|
+
flex: 1,
|
|
226
225
|
paddingHorizontal: 20,
|
|
227
226
|
paddingBottom: 24,
|
|
227
|
+
justifyContent: 'space-between',
|
|
228
228
|
},
|
|
229
229
|
scroll: { maxHeight: 320 },
|
|
230
230
|
scrollContent: { paddingTop: 16, paddingBottom: 8 },
|
|
231
231
|
title: { fontSize: 18, fontWeight: '700', marginBottom: 16 },
|
|
232
232
|
subtitle: { fontSize: 14, opacity: 0.6, marginBottom: 16 },
|
|
233
|
-
iconsRow: { flexDirection: 'row', marginTop: 4, marginBottom: 20,
|
|
234
|
-
iconButton: { alignItems: 'center', justifyContent: '
|
|
233
|
+
iconsRow: { flexDirection: 'row', marginTop: 4, marginBottom: 20, justifyContent: 'space-between' },
|
|
234
|
+
iconButton: { flex: 1, alignItems: 'center', justifyContent: 'flex-start', paddingVertical: 4 },
|
|
235
235
|
colLabels: {
|
|
236
236
|
flexDirection: 'row',
|
|
237
237
|
justifyContent: 'space-between',
|
|
238
238
|
marginBottom: 16,
|
|
239
239
|
},
|
|
240
|
-
colLabel: { fontSize: 11, opacity: 0.6, textAlign: 'center',
|
|
240
|
+
colLabel: { fontSize: 11, opacity: 0.6, textAlign: 'center', marginTop: 6 },
|
|
241
241
|
followUpCard: {
|
|
242
242
|
borderWidth: 1.5,
|
|
243
243
|
borderColor: '#E5E7EB',
|
|
@@ -252,6 +252,6 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
252
252
|
minHeight: 80,
|
|
253
253
|
},
|
|
254
254
|
errorText: { color: '#EF4444', fontSize: 13, marginBottom: 8 },
|
|
255
|
-
button: { paddingVertical: 14, alignItems: 'center', marginTop: 8 },
|
|
255
|
+
button: { paddingVertical: 14, alignItems: 'center', marginTop: 16, marginBottom: 8 },
|
|
256
256
|
buttonText: { color: '#FFFFFF', fontSize: 16, fontWeight: '600' },
|
|
257
257
|
});
|