react-native-my-survey-sdk 3.0.9 → 3.1.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/dist/components/XeboRatingView.d.ts.map +1 -1
- package/dist/components/XeboRatingView.js +20 -6
- package/dist/components/XeboSurveyModal.d.ts.map +1 -1
- package/dist/components/XeboSurveyModal.js +3 -2
- package/dist/components/XeboTextBoxView.d.ts.map +1 -1
- package/dist/components/XeboTextBoxView.js +2 -1
- package/package.json +1 -1
|
@@ -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;
|
|
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;AA6ID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgJ1C,CAAC"}
|
|
@@ -91,13 +91,19 @@ function RatingIcon({ style, index, selected, filled, color, hasSelection, }) {
|
|
|
91
91
|
</react_native_1.Text>);
|
|
92
92
|
case 'circle':
|
|
93
93
|
return (<react_native_1.View style={{
|
|
94
|
-
width:
|
|
95
|
-
height:
|
|
96
|
-
borderRadius:
|
|
94
|
+
width: 42,
|
|
95
|
+
height: 42,
|
|
96
|
+
borderRadius: 21,
|
|
97
97
|
backgroundColor: filled ? activeColor : 'transparent',
|
|
98
|
-
borderWidth: 2,
|
|
98
|
+
borderWidth: filled ? 2.5 : 1.5,
|
|
99
99
|
borderColor: filled ? activeColor : '#D1D5DB',
|
|
100
|
-
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
}}>
|
|
103
|
+
<react_native_1.Text style={{ fontSize: 16, fontWeight: '600', color: filled ? '#FFFFFF' : '#6B7280' }}>
|
|
104
|
+
{index + 1}
|
|
105
|
+
</react_native_1.Text>
|
|
106
|
+
</react_native_1.View>);
|
|
101
107
|
case 'tile':
|
|
102
108
|
return (<react_native_1.View style={{
|
|
103
109
|
width: 44,
|
|
@@ -190,7 +196,15 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
190
196
|
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;
|
|
191
197
|
return (<react_native_1.TouchableOpacity key={i} onPress={() => handleSelect(i)} style={styles.iconButton} activeOpacity={0.7}>
|
|
192
198
|
<RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor} totalSteps={totalSteps} hasSelection={selected !== null}/>
|
|
193
|
-
{!!label && (<react_native_1.Text style={[
|
|
199
|
+
{!!label && (<react_native_1.Text style={[
|
|
200
|
+
styles.colLabel,
|
|
201
|
+
{
|
|
202
|
+
color: i === selected ? ratingColor : theme.textColor,
|
|
203
|
+
fontFamily: theme.fontFamily,
|
|
204
|
+
opacity: i === selected ? 1 : 0.5,
|
|
205
|
+
fontWeight: i === selected ? '600' : '400',
|
|
206
|
+
},
|
|
207
|
+
]} numberOfLines={1}>
|
|
194
208
|
{label}
|
|
195
209
|
</react_native_1.Text>)}
|
|
196
210
|
</react_native_1.TouchableOpacity>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboSurveyModal.d.ts","sourceRoot":"","sources":["../../src/components/XeboSurveyModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAqEjF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"XeboSurveyModal.d.ts","sourceRoot":"","sources":["../../src/components/XeboSurveyModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAqEjF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAkPnC,CAAC"}
|
|
@@ -74,7 +74,7 @@ function computeSheetHeight(question, screen, sh) {
|
|
|
74
74
|
case XeboModels_1.XeboQuestionType.rating:
|
|
75
75
|
return question.followUpQuestion ? sh * 0.55 : sh * 0.38;
|
|
76
76
|
case XeboModels_1.XeboQuestionType.singleTextBox:
|
|
77
|
-
return sh * 0.
|
|
77
|
+
return sh * 0.55;
|
|
78
78
|
case XeboModels_1.XeboQuestionType.multipleTextBox: {
|
|
79
79
|
const fieldCount = (_f = (_e = question.options) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 1;
|
|
80
80
|
return Math.min(sh * 0.70, sh * (0.28 + fieldCount * 0.10));
|
|
@@ -195,7 +195,8 @@ const XeboSurveyModal = () => {
|
|
|
195
195
|
const isLast = questionIndex === lastRealIndex;
|
|
196
196
|
// key must be passed directly (not via spread) — forces unmount/remount on question change,
|
|
197
197
|
// resetting all component state (selected score, text, etc.)
|
|
198
|
-
const
|
|
198
|
+
const numberedQuestion = Object.assign(Object.assign({}, question), { title: `${questionIndex + 1}. ${question.title}` });
|
|
199
|
+
const commonProps = { question: numberedQuestion, isLastQuestion: isLast, onAnswer: handleAnswer };
|
|
199
200
|
switch (question.type) {
|
|
200
201
|
case XeboModels_1.XeboQuestionType.singleChoice:
|
|
201
202
|
return <XeboSingleChoiceView_1.XeboSingleChoiceView key={question.id} {...commonProps}/>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XeboTextBoxView.d.ts","sourceRoot":"","sources":["../../src/components/XeboTextBoxView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAoB,MAAM,sBAAsB,CAAC;AAGlF,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"XeboTextBoxView.d.ts","sourceRoot":"","sources":["../../src/components/XeboTextBoxView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAWhD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAoB,MAAM,sBAAsB,CAAC;AAGlF,UAAU,KAAK;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmH3C,CAAC"}
|
|
@@ -104,8 +104,9 @@ const XeboTextBoxView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
104
104
|
color: theme.textColor,
|
|
105
105
|
fontFamily: theme.fontFamily,
|
|
106
106
|
borderRadius: theme.cornerRadius,
|
|
107
|
+
minHeight: isMulti ? 48 : 130,
|
|
107
108
|
},
|
|
108
|
-
]} placeholder={isMulti ? '' : (question.placeholder || 'Type your answer here...')} placeholderTextColor="#9CA3AF" value={(_a = values[field.id]) !== null && _a !== void 0 ? _a : ''} onChangeText={text => handleChange(field.id, text)} onFocus={() => handleFocus(idx)} multiline={!isMulti} numberOfLines={isMulti ? 1 :
|
|
109
|
+
]} placeholder={isMulti ? '' : (question.placeholder || 'Type your answer here...')} placeholderTextColor="#9CA3AF" value={(_a = values[field.id]) !== null && _a !== void 0 ? _a : ''} onChangeText={text => handleChange(field.id, text)} onFocus={() => handleFocus(idx)} multiline={!isMulti} numberOfLines={isMulti ? 1 : 6} textAlignVertical={isMulti ? 'center' : 'top'} returnKeyType={idx === fields.length - 1 ? 'done' : 'next'}/>
|
|
109
110
|
</react_native_1.View>);
|
|
110
111
|
})}
|
|
111
112
|
</react_native_1.ScrollView>
|