@micromag/screen-survey 0.3.100 → 0.3.102

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
- .micromag-screen-survey-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-survey-disabled.micromag-screen-survey-container{overflow:hidden;pointer-events:none}.micromag-screen-survey-hidden.micromag-screen-survey-container{display:none;visibility:hidden}.micromag-screen-survey-placeholder.micromag-screen-survey-container .micromag-screen-survey-content{position:relative;padding:6px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-survey-container .micromag-screen-survey-question{margin-bottom:20px}.micromag-screen-survey-container .micromag-screen-survey-answers,.micromag-screen-survey-container .micromag-screen-survey-items{position:relative}.micromag-screen-survey-container .micromag-screen-survey-item{padding:5px 0}.micromag-screen-survey-container .micromag-screen-survey-item:first-child .micromag-screen-survey-placeholderAnswer{width:80%}.micromag-screen-survey-container .micromag-screen-survey-item:last-child .micromag-screen-survey-placeholderAnswer{width:90%}.micromag-screen-survey-container .micromag-screen-survey-itemContent{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.micromag-screen-survey-container .micromag-screen-survey-resultBar{position:absolute;top:0;left:0;height:100%;background-color:hsla(0,0%,100%,.2)}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;top:50%;right:0;width:4em;padding:0 5px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff;text-align:right}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%}.micromag-screen-survey-container .micromag-screen-survey-button{display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%;padding:0;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out;transition:opacity .5s ease-out}.micromag-screen-survey-container .micromag-screen-survey-button:disabled{opacity:1;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-itemLabel{width:100%;padding:10px}.micromag-screen-survey-container .micromag-screen-survey-itemLabel,.micromag-screen-survey-container .micromag-screen-survey-itemText{display:inline-block;-webkit-transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;-o-transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out,-webkit-transform .3s ease-out}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{width:100%;margin:0 auto}.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{height:75px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer{height:50px}.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-button,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-result,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-resultLabel{opacity:1!important}.micromag-screen-survey-container.micromag-screen-survey-answered{line-height:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContainer{padding-right:50px;padding-left:15px}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContent{width:100%;opacity:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button{border-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0)}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-result,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultLabel{opacity:.6}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-itemLabel{margin-right:0;margin-left:0;text-align:left}.micromag-screen-survey-container.micromag-screen-survey-answered.micromag-screen-survey-withPercentage .micromag-screen-survey-itemText{-webkit-transform:translate(-2em);-ms-transform:translate(-2em);transform:translate(-2em)}.micromag-screen-survey-container.micromag-screen-survey-withPercentage .micromag-screen-survey-itemLabel{margin-right:2em;margin-left:2em}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-layout{padding:10px}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-item{padding:1px 0}
1
+ .micromag-screen-survey-container{position:relative;width:100%;height:100%;overflow:hidden}.micromag-screen-survey-disabled.micromag-screen-survey-container{overflow:hidden;pointer-events:none}.micromag-screen-survey-hidden.micromag-screen-survey-container{display:none;visibility:hidden}.micromag-screen-survey-placeholder.micromag-screen-survey-container .micromag-screen-survey-content{position:relative;padding:6px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{margin:5px auto;border:2px dashed #343434;color:#343434}.micromag-screen-survey-container .micromag-screen-survey-question{margin-bottom:20px}.micromag-screen-survey-container .micromag-screen-survey-answers,.micromag-screen-survey-container .micromag-screen-survey-items{position:relative}.micromag-screen-survey-container .micromag-screen-survey-item{padding:5px 0}.micromag-screen-survey-container .micromag-screen-survey-item:first-child .micromag-screen-survey-placeholderAnswer{width:80%}.micromag-screen-survey-container .micromag-screen-survey-item:last-child .micromag-screen-survey-placeholderAnswer{width:90%}.micromag-screen-survey-container .micromag-screen-survey-itemContent{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.micromag-screen-survey-container .micromag-screen-survey-resultBar{position:absolute;top:0;left:0;height:100%;background-color:hsla(0,0%,100%,.2)}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;top:50%;right:0;width:4em;padding:0 8px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff;text-align:right}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%}.micromag-screen-survey-container .micromag-screen-survey-button{display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;width:100%;padding:0;-webkit-transition:opacity .5s ease-out;-o-transition:opacity .5s ease-out;transition:opacity .5s ease-out}.micromag-screen-survey-container .micromag-screen-survey-button:disabled{opacity:1;pointer-events:none}.micromag-screen-survey-container .micromag-screen-survey-itemLabel{width:100%;padding:10px}.micromag-screen-survey-container .micromag-screen-survey-itemLabel,.micromag-screen-survey-container .micromag-screen-survey-itemText{display:inline-block;-webkit-transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;transition:margin-left .3s ease-out,-webkit-transform .3s ease-out;-o-transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out;transition:margin-left .3s ease-out,transform .3s ease-out,-webkit-transform .3s ease-out}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer,.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{width:100%;margin:0 auto}.micromag-screen-survey-container .micromag-screen-survey-emptyQuestion{height:75px}.micromag-screen-survey-container .micromag-screen-survey-emptyAnswer{height:50px}.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-button,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-result,.micromag-screen-survey-container .micromag-screen-survey-userAnswer .micromag-screen-survey-resultLabel{opacity:1!important}.micromag-screen-survey-container.micromag-screen-survey-answered{line-height:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContainer{padding-right:50px;padding-left:15px}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultContent{width:100%;opacity:1}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button{border-color:rgba(0,0,0,0);background-color:rgba(0,0,0,0)}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-button,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-result,.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-resultLabel{opacity:.6}.micromag-screen-survey-container.micromag-screen-survey-answered .micromag-screen-survey-itemLabel{margin-right:0;margin-left:0;text-align:left}.micromag-screen-survey-container.micromag-screen-survey-answered.micromag-screen-survey-withPercentage .micromag-screen-survey-itemText{-webkit-transform:translate(-2em);-ms-transform:translate(-2em);transform:translate(-2em)}.micromag-screen-survey-container.micromag-screen-survey-withPercentage .micromag-screen-survey-itemLabel{margin-right:2em;margin-left:2em}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-layout{padding:10px}.micromag-screen-survey-container.micromag-screen-survey-isPlaceholder .micromag-screen-survey-item{padding:1px 0}
package/es/index.js CHANGED
@@ -71,7 +71,7 @@ var defaultProps = {
71
71
  };
72
72
 
73
73
  var SurveyScreen = function SurveyScreen(_ref) {
74
- var _ref14;
74
+ var _ref17;
75
75
 
76
76
  var id = _ref.id,
77
77
  layout = _ref.layout,
@@ -127,7 +127,36 @@ var SurveyScreen = function SurveyScreen(_ref) {
127
127
  }
128
128
  }),
129
129
  _useQuiz$quiz = _useQuiz.quiz,
130
- quizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
130
+ allQuizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
131
+
132
+ var quizAnswers = allQuizAnswers.filter(function (item) {
133
+ var _ref2 = item || {},
134
+ _ref2$choice = _ref2.choice,
135
+ choice = _ref2$choice === void 0 ? null : _ref2$choice;
136
+
137
+ var answersBody = answers.map(function (answer) {
138
+ var _ref3 = answer || {},
139
+ _ref3$label = _ref3.label,
140
+ label = _ref3$label === void 0 ? null : _ref3$label;
141
+
142
+ var _ref4 = label || {},
143
+ _ref4$body = _ref4.body,
144
+ body = _ref4$body === void 0 ? null : _ref4$body;
145
+
146
+ return body;
147
+ }).filter(function (body) {
148
+ return body !== null;
149
+ });
150
+ var hasResult = answersBody.find(function (body) {
151
+ return body === choice;
152
+ });
153
+
154
+ if (hasResult) {
155
+ return true;
156
+ }
157
+
158
+ return false;
159
+ }); // console.log('finalQuizAnswers', finalQuizAnswers);
131
160
 
132
161
  var hasQuestion = isTextFilled(question);
133
162
  var showInstantAnswer = isStatic || isCapture;
@@ -139,25 +168,25 @@ var SurveyScreen = function SurveyScreen(_ref) {
139
168
 
140
169
  var answered = userAnswerIndex !== null;
141
170
  var quizAnswersComputed = useMemo(function () {
142
- var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref2) {
143
- var _ref2$count = _ref2.count,
144
- count = _ref2$count === void 0 ? 0 : _ref2$count;
171
+ var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref5) {
172
+ var _ref5$count = _ref5.count,
173
+ count = _ref5$count === void 0 ? 0 : _ref5$count;
145
174
  return points + parseInt(count, 10);
146
175
  }, userAnswerIndex !== null && userAnswerIndex > -1 ? 1 : 0) : 0;
147
176
  var computed = answers !== null ? (answers || []).reduce(function (answersTotal, ans, i) {
148
- var _ref3 = ans || {},
149
- _ref3$label = _ref3.label,
150
- label = _ref3$label === void 0 ? {} : _ref3$label;
177
+ var _ref6 = ans || {},
178
+ _ref6$label = _ref6.label,
179
+ label = _ref6$label === void 0 ? {} : _ref6$label;
151
180
 
152
- var _ref4 = label || {},
153
- _ref4$body = _ref4.body,
154
- body = _ref4$body === void 0 ? null : _ref4$body;
181
+ var _ref7 = label || {},
182
+ _ref7$body = _ref7.body,
183
+ body = _ref7$body === void 0 ? null : _ref7$body;
155
184
 
156
- var _ref5 = quizAnswers.find(function (qa) {
185
+ var _ref8 = quizAnswers.find(function (qa) {
157
186
  return qa.choice === body;
158
187
  }) || {},
159
- _ref5$count = _ref5.count,
160
- count = _ref5$count === void 0 ? 0 : _ref5$count;
188
+ _ref8$count = _ref8.count,
189
+ count = _ref8$count === void 0 ? 0 : _ref8$count;
161
190
 
162
191
  var countWithUser = i === userAnswerIndex ? count + 1 : count;
163
192
 
@@ -236,11 +265,11 @@ var SurveyScreen = function SurveyScreen(_ref) {
236
265
 
237
266
  var finalTransitionDuration = showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
238
267
 
239
- var _ref6 = resultsStyle || {},
240
- _ref6$barColor = _ref6.barColor,
241
- resultsBarColor = _ref6$barColor === void 0 ? null : _ref6$barColor,
242
- _ref6$textColor = _ref6.textColor,
243
- resultsTextColor = _ref6$textColor === void 0 ? null : _ref6$textColor;
268
+ var _ref9 = resultsStyle || {},
269
+ _ref9$barColor = _ref9.barColor,
270
+ resultsBarColor = _ref9$barColor === void 0 ? null : _ref9$barColor,
271
+ _ref9$textColor = _ref9.textColor,
272
+ resultsTextColor = _ref9$textColor === void 0 ? null : _ref9$textColor;
244
273
 
245
274
  items.push( /*#__PURE__*/React.createElement("div", {
246
275
  key: "answers",
@@ -250,34 +279,34 @@ var SurveyScreen = function SurveyScreen(_ref) {
250
279
  }, (isPlaceholder ? _toConsumableArray(new Array(3)) : answers).map(function (answer, answerIndex) {
251
280
  var hasAnswer = answer !== null;
252
281
 
253
- var _ref7 = answer || {},
254
- _ref7$label = _ref7.label,
255
- label = _ref7$label === void 0 ? null : _ref7$label,
256
- _ref7$buttonStyle = _ref7.buttonStyle,
257
- answerButtonStyle = _ref7$buttonStyle === void 0 ? null : _ref7$buttonStyle,
258
- _ref7$resultStyle = _ref7.resultStyle,
259
- answerResultStyle = _ref7$resultStyle === void 0 ? null : _ref7$resultStyle;
282
+ var _ref10 = answer || {},
283
+ _ref10$label = _ref10.label,
284
+ label = _ref10$label === void 0 ? null : _ref10$label,
285
+ _ref10$buttonStyle = _ref10.buttonStyle,
286
+ answerButtonStyle = _ref10$buttonStyle === void 0 ? null : _ref10$buttonStyle,
287
+ _ref10$resultStyle = _ref10.resultStyle,
288
+ answerResultStyle = _ref10$resultStyle === void 0 ? null : _ref10$resultStyle;
260
289
 
261
- var _ref8 = answerResultStyle || {},
262
- _ref8$barColor = _ref8.barColor,
263
- answerResultBarColor = _ref8$barColor === void 0 ? null : _ref8$barColor,
264
- answerResultTextColor = _ref8.textColor;
290
+ var _ref11 = answerResultStyle || {},
291
+ _ref11$barColor = _ref11.barColor,
292
+ answerResultBarColor = _ref11$barColor === void 0 ? null : _ref11$barColor,
293
+ answerResultTextColor = _ref11.textColor;
265
294
 
266
- var _ref9 = label || {},
267
- _ref9$body = _ref9.body,
268
- body = _ref9$body === void 0 ? null : _ref9$body;
295
+ var _ref12 = label || {},
296
+ _ref12$body = _ref12.body,
297
+ body = _ref12$body === void 0 ? null : _ref12$body;
269
298
 
270
- var _ref10 = body !== null ? quizAnswersComputed[body] || {} : {},
271
- _ref10$percent = _ref10.percent,
272
- percent = _ref10$percent === void 0 ? 0 : _ref10$percent;
299
+ var _ref13 = body !== null ? quizAnswersComputed[body] || {} : {},
300
+ _ref13$percent = _ref13.percent,
301
+ percent = _ref13$percent === void 0 ? 0 : _ref13$percent;
273
302
 
274
- var _ref11 = label || {},
275
- _ref11$textStyle = _ref11.textStyle,
276
- textStyle = _ref11$textStyle === void 0 ? null : _ref11$textStyle;
303
+ var _ref14 = label || {},
304
+ _ref14$textStyle = _ref14.textStyle,
305
+ textStyle = _ref14$textStyle === void 0 ? null : _ref14$textStyle;
277
306
 
278
- var _ref12 = textStyle || {},
279
- _ref12$color = _ref12.color,
280
- labelColor = _ref12$color === void 0 ? null : _ref12$color;
307
+ var _ref15 = textStyle || {},
308
+ _ref15$color = _ref15.color,
309
+ labelColor = _ref15$color === void 0 ? null : _ref15$color;
281
310
 
282
311
  var hasAnswerLabel = isTextFilled(label);
283
312
  var userAnswer = userAnswerIndex === answerIndex;
@@ -380,7 +409,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
380
409
  }
381
410
 
382
411
  return /*#__PURE__*/React.createElement("div", {
383
- className: classNames([styles.container, (_ref14 = {}, _defineProperty(_ref14, className, className !== null), _defineProperty(_ref14, styles.answered, answered), _defineProperty(_ref14, styles.withPercentage, !withoutPercentage), _defineProperty(_ref14, styles.isPlaceholder, isPlaceholder), _ref14)])
412
+ className: classNames([styles.container, (_ref17 = {}, _defineProperty(_ref17, className, className !== null), _defineProperty(_ref17, styles.answered, answered), _defineProperty(_ref17, styles.withPercentage, !withoutPercentage), _defineProperty(_ref17, styles.isPlaceholder, isPlaceholder), _ref17)])
384
413
  }, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
385
414
  background: background,
386
415
  width: width,
package/lib/index.js CHANGED
@@ -92,7 +92,7 @@ var defaultProps = {
92
92
  };
93
93
 
94
94
  var SurveyScreen = function SurveyScreen(_ref) {
95
- var _ref14;
95
+ var _ref17;
96
96
 
97
97
  var id = _ref.id,
98
98
  layout = _ref.layout,
@@ -148,7 +148,36 @@ var SurveyScreen = function SurveyScreen(_ref) {
148
148
  }
149
149
  }),
150
150
  _useQuiz$quiz = _useQuiz.quiz,
151
- quizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
151
+ allQuizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
152
+
153
+ var quizAnswers = allQuizAnswers.filter(function (item) {
154
+ var _ref2 = item || {},
155
+ _ref2$choice = _ref2.choice,
156
+ choice = _ref2$choice === void 0 ? null : _ref2$choice;
157
+
158
+ var answersBody = answers.map(function (answer) {
159
+ var _ref3 = answer || {},
160
+ _ref3$label = _ref3.label,
161
+ label = _ref3$label === void 0 ? null : _ref3$label;
162
+
163
+ var _ref4 = label || {},
164
+ _ref4$body = _ref4.body,
165
+ body = _ref4$body === void 0 ? null : _ref4$body;
166
+
167
+ return body;
168
+ }).filter(function (body) {
169
+ return body !== null;
170
+ });
171
+ var hasResult = answersBody.find(function (body) {
172
+ return body === choice;
173
+ });
174
+
175
+ if (hasResult) {
176
+ return true;
177
+ }
178
+
179
+ return false;
180
+ }); // console.log('finalQuizAnswers', finalQuizAnswers);
152
181
 
153
182
  var hasQuestion = utils.isTextFilled(question);
154
183
  var showInstantAnswer = isStatic || isCapture;
@@ -160,25 +189,25 @@ var SurveyScreen = function SurveyScreen(_ref) {
160
189
 
161
190
  var answered = userAnswerIndex !== null;
162
191
  var quizAnswersComputed = React.useMemo(function () {
163
- var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref2) {
164
- var _ref2$count = _ref2.count,
165
- count = _ref2$count === void 0 ? 0 : _ref2$count;
192
+ var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref5) {
193
+ var _ref5$count = _ref5.count,
194
+ count = _ref5$count === void 0 ? 0 : _ref5$count;
166
195
  return points + parseInt(count, 10);
167
196
  }, userAnswerIndex !== null && userAnswerIndex > -1 ? 1 : 0) : 0;
168
197
  var computed = answers !== null ? (answers || []).reduce(function (answersTotal, ans, i) {
169
- var _ref3 = ans || {},
170
- _ref3$label = _ref3.label,
171
- label = _ref3$label === void 0 ? {} : _ref3$label;
198
+ var _ref6 = ans || {},
199
+ _ref6$label = _ref6.label,
200
+ label = _ref6$label === void 0 ? {} : _ref6$label;
172
201
 
173
- var _ref4 = label || {},
174
- _ref4$body = _ref4.body,
175
- body = _ref4$body === void 0 ? null : _ref4$body;
202
+ var _ref7 = label || {},
203
+ _ref7$body = _ref7.body,
204
+ body = _ref7$body === void 0 ? null : _ref7$body;
176
205
 
177
- var _ref5 = quizAnswers.find(function (qa) {
206
+ var _ref8 = quizAnswers.find(function (qa) {
178
207
  return qa.choice === body;
179
208
  }) || {},
180
- _ref5$count = _ref5.count,
181
- count = _ref5$count === void 0 ? 0 : _ref5$count;
209
+ _ref8$count = _ref8.count,
210
+ count = _ref8$count === void 0 ? 0 : _ref8$count;
182
211
 
183
212
  var countWithUser = i === userAnswerIndex ? count + 1 : count;
184
213
 
@@ -257,11 +286,11 @@ var SurveyScreen = function SurveyScreen(_ref) {
257
286
 
258
287
  var finalTransitionDuration = showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
259
288
 
260
- var _ref6 = resultsStyle || {},
261
- _ref6$barColor = _ref6.barColor,
262
- resultsBarColor = _ref6$barColor === void 0 ? null : _ref6$barColor,
263
- _ref6$textColor = _ref6.textColor,
264
- resultsTextColor = _ref6$textColor === void 0 ? null : _ref6$textColor;
289
+ var _ref9 = resultsStyle || {},
290
+ _ref9$barColor = _ref9.barColor,
291
+ resultsBarColor = _ref9$barColor === void 0 ? null : _ref9$barColor,
292
+ _ref9$textColor = _ref9.textColor,
293
+ resultsTextColor = _ref9$textColor === void 0 ? null : _ref9$textColor;
265
294
 
266
295
  items.push( /*#__PURE__*/React__default["default"].createElement("div", {
267
296
  key: "answers",
@@ -271,34 +300,34 @@ var SurveyScreen = function SurveyScreen(_ref) {
271
300
  }, (isPlaceholder ? _toConsumableArray__default["default"](new Array(3)) : answers).map(function (answer, answerIndex) {
272
301
  var hasAnswer = answer !== null;
273
302
 
274
- var _ref7 = answer || {},
275
- _ref7$label = _ref7.label,
276
- label = _ref7$label === void 0 ? null : _ref7$label,
277
- _ref7$buttonStyle = _ref7.buttonStyle,
278
- answerButtonStyle = _ref7$buttonStyle === void 0 ? null : _ref7$buttonStyle,
279
- _ref7$resultStyle = _ref7.resultStyle,
280
- answerResultStyle = _ref7$resultStyle === void 0 ? null : _ref7$resultStyle;
303
+ var _ref10 = answer || {},
304
+ _ref10$label = _ref10.label,
305
+ label = _ref10$label === void 0 ? null : _ref10$label,
306
+ _ref10$buttonStyle = _ref10.buttonStyle,
307
+ answerButtonStyle = _ref10$buttonStyle === void 0 ? null : _ref10$buttonStyle,
308
+ _ref10$resultStyle = _ref10.resultStyle,
309
+ answerResultStyle = _ref10$resultStyle === void 0 ? null : _ref10$resultStyle;
281
310
 
282
- var _ref8 = answerResultStyle || {},
283
- _ref8$barColor = _ref8.barColor,
284
- answerResultBarColor = _ref8$barColor === void 0 ? null : _ref8$barColor,
285
- answerResultTextColor = _ref8.textColor;
311
+ var _ref11 = answerResultStyle || {},
312
+ _ref11$barColor = _ref11.barColor,
313
+ answerResultBarColor = _ref11$barColor === void 0 ? null : _ref11$barColor,
314
+ answerResultTextColor = _ref11.textColor;
286
315
 
287
- var _ref9 = label || {},
288
- _ref9$body = _ref9.body,
289
- body = _ref9$body === void 0 ? null : _ref9$body;
316
+ var _ref12 = label || {},
317
+ _ref12$body = _ref12.body,
318
+ body = _ref12$body === void 0 ? null : _ref12$body;
290
319
 
291
- var _ref10 = body !== null ? quizAnswersComputed[body] || {} : {},
292
- _ref10$percent = _ref10.percent,
293
- percent = _ref10$percent === void 0 ? 0 : _ref10$percent;
320
+ var _ref13 = body !== null ? quizAnswersComputed[body] || {} : {},
321
+ _ref13$percent = _ref13.percent,
322
+ percent = _ref13$percent === void 0 ? 0 : _ref13$percent;
294
323
 
295
- var _ref11 = label || {},
296
- _ref11$textStyle = _ref11.textStyle,
297
- textStyle = _ref11$textStyle === void 0 ? null : _ref11$textStyle;
324
+ var _ref14 = label || {},
325
+ _ref14$textStyle = _ref14.textStyle,
326
+ textStyle = _ref14$textStyle === void 0 ? null : _ref14$textStyle;
298
327
 
299
- var _ref12 = textStyle || {},
300
- _ref12$color = _ref12.color,
301
- labelColor = _ref12$color === void 0 ? null : _ref12$color;
328
+ var _ref15 = textStyle || {},
329
+ _ref15$color = _ref15.color,
330
+ labelColor = _ref15$color === void 0 ? null : _ref15$color;
302
331
 
303
332
  var hasAnswerLabel = utils.isTextFilled(label);
304
333
  var userAnswer = userAnswerIndex === answerIndex;
@@ -401,7 +430,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
401
430
  }
402
431
 
403
432
  return /*#__PURE__*/React__default["default"].createElement("div", {
404
- className: classNames__default["default"]([styles.container, (_ref14 = {}, _defineProperty__default["default"](_ref14, className, className !== null), _defineProperty__default["default"](_ref14, styles.answered, answered), _defineProperty__default["default"](_ref14, styles.withPercentage, !withoutPercentage), _defineProperty__default["default"](_ref14, styles.isPlaceholder, isPlaceholder), _ref14)])
433
+ className: classNames__default["default"]([styles.container, (_ref17 = {}, _defineProperty__default["default"](_ref17, className, className !== null), _defineProperty__default["default"](_ref17, styles.answered, answered), _defineProperty__default["default"](_ref17, styles.withPercentage, !withoutPercentage), _defineProperty__default["default"](_ref17, styles.isPlaceholder, isPlaceholder), _ref17)])
405
434
  }, !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
406
435
  background: background,
407
436
  width: width,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-survey",
3
- "version": "0.3.100",
3
+ "version": "0.3.102",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "bd594780d88fcd716c2d7d3c0e735e29c14c64ce"
72
+ "gitHead": "8c015961160dcdf5ee10e5a0abe50d67fe165710"
73
73
  }