react-native-my-survey-sdk 3.0.8 → 3.0.9
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;
|
|
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"}
|
|
@@ -45,18 +45,19 @@ const FLAT_EMOJI_CONFIGS = [
|
|
|
45
45
|
{ bg: '#8AC926', mouth: 'smile' },
|
|
46
46
|
{ bg: '#21B573', mouth: 'bigSmile' },
|
|
47
47
|
];
|
|
48
|
-
function FlatEmoji({ index, selected }) {
|
|
48
|
+
function FlatEmoji({ index, selected, hasSelection }) {
|
|
49
49
|
const conf = FLAT_EMOJI_CONFIGS[Math.min(index, FLAT_EMOJI_CONFIGS.length - 1)];
|
|
50
50
|
const size = 44;
|
|
51
51
|
const eyeSize = 5;
|
|
52
52
|
const mouthW = 18;
|
|
53
53
|
const mouthH = 9;
|
|
54
|
+
const opacity = hasSelection ? (selected ? 1 : 0.35) : 1;
|
|
54
55
|
return (<react_native_1.View style={{
|
|
55
56
|
width: size,
|
|
56
57
|
height: size,
|
|
57
58
|
borderRadius: size / 2,
|
|
58
59
|
backgroundColor: conf.bg,
|
|
59
|
-
opacity
|
|
60
|
+
opacity,
|
|
60
61
|
alignItems: 'center',
|
|
61
62
|
justifyContent: 'center',
|
|
62
63
|
}}>
|
|
@@ -81,7 +82,7 @@ function FlatEmoji({ index, selected }) {
|
|
|
81
82
|
</react_native_1.View>)}
|
|
82
83
|
</react_native_1.View>);
|
|
83
84
|
}
|
|
84
|
-
function RatingIcon({ style, index, selected, filled, color, }) {
|
|
85
|
+
function RatingIcon({ style, index, selected, filled, color, hasSelection, }) {
|
|
85
86
|
const activeColor = color || '#F59E0B';
|
|
86
87
|
switch (style) {
|
|
87
88
|
case 'heart':
|
|
@@ -118,11 +119,9 @@ function RatingIcon({ style, index, selected, filled, color, }) {
|
|
|
118
119
|
case 'smiley':
|
|
119
120
|
case 'smileys':
|
|
120
121
|
case 'faces':
|
|
121
|
-
return <FlatEmoji index={index} selected={selected}/>;
|
|
122
|
-
case '3d_emoji':
|
|
123
|
-
|
|
124
|
-
return <FlatEmoji index={index} selected={selected}/>;
|
|
125
|
-
}
|
|
122
|
+
return <FlatEmoji index={index} selected={selected} hasSelection={hasSelection}/>;
|
|
123
|
+
case '3d_emoji':
|
|
124
|
+
return <FlatEmoji index={index} selected={selected} hasSelection={hasSelection}/>;
|
|
126
125
|
case 'star':
|
|
127
126
|
default:
|
|
128
127
|
return (<react_native_1.Text style={{ fontSize: 34, color: filled ? activeColor : '#E5E7EB' }}>
|
|
@@ -190,7 +189,7 @@ const XeboRatingView = ({ question, isLastQuestion, onAnswer }) => {
|
|
|
190
189
|
const isFilled = isCumulative ? selected !== null && i <= selected : i === selected;
|
|
191
190
|
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;
|
|
192
191
|
return (<react_native_1.TouchableOpacity key={i} onPress={() => handleSelect(i)} style={styles.iconButton} activeOpacity={0.7}>
|
|
193
|
-
<RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor} totalSteps={totalSteps}/>
|
|
192
|
+
<RatingIcon style={ratingStyle} index={i} selected={i === selected} filled={isFilled} color={ratingColor} totalSteps={totalSteps} hasSelection={selected !== null}/>
|
|
194
193
|
{!!label && (<react_native_1.Text style={[styles.colLabel, { color: theme.textColor, fontFamily: theme.fontFamily }]} numberOfLines={1}>
|
|
195
194
|
{label}
|
|
196
195
|
</react_native_1.Text>)}
|