react-native-my-survey-sdk 3.0.9 → 3.1.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.
@@ -126,6 +126,7 @@ const XeboMultipleChoiceView = ({ question, isLastQuestion, onAnswer }) => {
126
126
  exports.XeboMultipleChoiceView = XeboMultipleChoiceView;
127
127
  const styles = react_native_1.StyleSheet.create({
128
128
  container: {
129
+ flex: 1,
129
130
  paddingHorizontal: 20,
130
131
  paddingTop: 16,
131
132
  paddingBottom: 24,
@@ -141,7 +142,7 @@ const styles = react_native_1.StyleSheet.create({
141
142
  marginBottom: 16,
142
143
  },
143
144
  optionsList: {
144
- maxHeight: 280,
145
+ flex: 1,
145
146
  marginBottom: 12,
146
147
  },
147
148
  optionRow: {
@@ -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;AAuID,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwI1C,CAAC"}
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: 38,
95
- height: 38,
96
- borderRadius: 19,
97
- backgroundColor: filled ? activeColor : 'transparent',
98
- borderWidth: 2,
94
+ width: 42,
95
+ height: 42,
96
+ borderRadius: 21,
97
+ backgroundColor: 'transparent',
98
+ borderWidth: filled ? 3 : 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 ? activeColor : '#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={[styles.colLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]} numberOfLines={1}>
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>);
@@ -110,6 +110,7 @@ const XeboSingleChoiceView = ({ question, isLastQuestion, onAnswer }) => {
110
110
  exports.XeboSingleChoiceView = XeboSingleChoiceView;
111
111
  const styles = react_native_1.StyleSheet.create({
112
112
  container: {
113
+ flex: 1,
113
114
  paddingHorizontal: 20,
114
115
  paddingTop: 16,
115
116
  paddingBottom: 24,
@@ -125,7 +126,7 @@ const styles = react_native_1.StyleSheet.create({
125
126
  marginBottom: 16,
126
127
  },
127
128
  optionsList: {
128
- maxHeight: 280,
129
+ flex: 1,
129
130
  marginBottom: 12,
130
131
  },
131
132
  optionRow: {
@@ -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,EAiPnC,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"}
@@ -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 commonProps = { question, isLastQuestion: isLast, onAnswer: handleAnswer };
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,CAkH3C,CAAC"}
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,6 +104,7 @@ const XeboTextBoxView = ({ question, isLastQuestion, onAnswer }) => {
104
104
  color: theme.textColor,
105
105
  fontFamily: theme.fontFamily,
106
106
  borderRadius: theme.cornerRadius,
107
+ minHeight: 48,
107
108
  },
108
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 : 4} textAlignVertical={isMulti ? 'center' : 'top'} returnKeyType={idx === fields.length - 1 ? 'done' : 'next'}/>
109
110
  </react_native_1.View>);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-my-survey-sdk",
3
- "version": "3.0.9",
3
+ "version": "3.1.1",
4
4
  "description": "Xebo survey collection SDK for React Native",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",