@micromag/screen-survey 0.3.98 → 0.3.103
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/assets/css/styles.css +1 -1
- package/es/index.js +71 -43
- package/lib/index.js +71 -43
- package/package.json +3 -3
package/assets/css/styles.css
CHANGED
|
@@ -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
|
|
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
|
|
74
|
+
var _ref17;
|
|
75
75
|
|
|
76
76
|
var id = _ref.id,
|
|
77
77
|
layout = _ref.layout,
|
|
@@ -127,8 +127,36 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
127
127
|
}
|
|
128
128
|
}),
|
|
129
129
|
_useQuiz$quiz = _useQuiz.quiz,
|
|
130
|
-
|
|
130
|
+
allQuizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
|
|
131
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
|
+
});
|
|
132
160
|
var hasQuestion = isTextFilled(question);
|
|
133
161
|
var showInstantAnswer = isStatic || isCapture;
|
|
134
162
|
|
|
@@ -139,25 +167,25 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
139
167
|
|
|
140
168
|
var answered = userAnswerIndex !== null;
|
|
141
169
|
var quizAnswersComputed = useMemo(function () {
|
|
142
|
-
var total = answers !== null ? (quizAnswers || []).reduce(function (points,
|
|
143
|
-
var
|
|
144
|
-
count =
|
|
170
|
+
var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref5) {
|
|
171
|
+
var _ref5$count = _ref5.count,
|
|
172
|
+
count = _ref5$count === void 0 ? 0 : _ref5$count;
|
|
145
173
|
return points + parseInt(count, 10);
|
|
146
174
|
}, userAnswerIndex !== null && userAnswerIndex > -1 ? 1 : 0) : 0;
|
|
147
175
|
var computed = answers !== null ? (answers || []).reduce(function (answersTotal, ans, i) {
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
label =
|
|
176
|
+
var _ref6 = ans || {},
|
|
177
|
+
_ref6$label = _ref6.label,
|
|
178
|
+
label = _ref6$label === void 0 ? {} : _ref6$label;
|
|
151
179
|
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
body =
|
|
180
|
+
var _ref7 = label || {},
|
|
181
|
+
_ref7$body = _ref7.body,
|
|
182
|
+
body = _ref7$body === void 0 ? null : _ref7$body;
|
|
155
183
|
|
|
156
|
-
var
|
|
184
|
+
var _ref8 = quizAnswers.find(function (qa) {
|
|
157
185
|
return qa.choice === body;
|
|
158
186
|
}) || {},
|
|
159
|
-
|
|
160
|
-
count =
|
|
187
|
+
_ref8$count = _ref8.count,
|
|
188
|
+
count = _ref8$count === void 0 ? 0 : _ref8$count;
|
|
161
189
|
|
|
162
190
|
var countWithUser = i === userAnswerIndex ? count + 1 : count;
|
|
163
191
|
|
|
@@ -236,11 +264,11 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
236
264
|
|
|
237
265
|
var finalTransitionDuration = showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
|
|
238
266
|
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
resultsBarColor =
|
|
242
|
-
|
|
243
|
-
resultsTextColor =
|
|
267
|
+
var _ref9 = resultsStyle || {},
|
|
268
|
+
_ref9$barColor = _ref9.barColor,
|
|
269
|
+
resultsBarColor = _ref9$barColor === void 0 ? null : _ref9$barColor,
|
|
270
|
+
_ref9$textColor = _ref9.textColor,
|
|
271
|
+
resultsTextColor = _ref9$textColor === void 0 ? null : _ref9$textColor;
|
|
244
272
|
|
|
245
273
|
items.push( /*#__PURE__*/React.createElement("div", {
|
|
246
274
|
key: "answers",
|
|
@@ -250,34 +278,34 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
250
278
|
}, (isPlaceholder ? _toConsumableArray(new Array(3)) : answers).map(function (answer, answerIndex) {
|
|
251
279
|
var hasAnswer = answer !== null;
|
|
252
280
|
|
|
253
|
-
var
|
|
254
|
-
|
|
255
|
-
label =
|
|
256
|
-
|
|
257
|
-
answerButtonStyle =
|
|
258
|
-
|
|
259
|
-
answerResultStyle =
|
|
281
|
+
var _ref10 = answer || {},
|
|
282
|
+
_ref10$label = _ref10.label,
|
|
283
|
+
label = _ref10$label === void 0 ? null : _ref10$label,
|
|
284
|
+
_ref10$buttonStyle = _ref10.buttonStyle,
|
|
285
|
+
answerButtonStyle = _ref10$buttonStyle === void 0 ? null : _ref10$buttonStyle,
|
|
286
|
+
_ref10$resultStyle = _ref10.resultStyle,
|
|
287
|
+
answerResultStyle = _ref10$resultStyle === void 0 ? null : _ref10$resultStyle;
|
|
260
288
|
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
answerResultBarColor =
|
|
264
|
-
answerResultTextColor =
|
|
289
|
+
var _ref11 = answerResultStyle || {},
|
|
290
|
+
_ref11$barColor = _ref11.barColor,
|
|
291
|
+
answerResultBarColor = _ref11$barColor === void 0 ? null : _ref11$barColor,
|
|
292
|
+
answerResultTextColor = _ref11.textColor;
|
|
265
293
|
|
|
266
|
-
var
|
|
267
|
-
|
|
268
|
-
body =
|
|
294
|
+
var _ref12 = label || {},
|
|
295
|
+
_ref12$body = _ref12.body,
|
|
296
|
+
body = _ref12$body === void 0 ? null : _ref12$body;
|
|
269
297
|
|
|
270
|
-
var
|
|
271
|
-
|
|
272
|
-
percent =
|
|
298
|
+
var _ref13 = body !== null ? quizAnswersComputed[body] || {} : {},
|
|
299
|
+
_ref13$percent = _ref13.percent,
|
|
300
|
+
percent = _ref13$percent === void 0 ? 0 : _ref13$percent;
|
|
273
301
|
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
textStyle =
|
|
302
|
+
var _ref14 = label || {},
|
|
303
|
+
_ref14$textStyle = _ref14.textStyle,
|
|
304
|
+
textStyle = _ref14$textStyle === void 0 ? null : _ref14$textStyle;
|
|
277
305
|
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
labelColor =
|
|
306
|
+
var _ref15 = textStyle || {},
|
|
307
|
+
_ref15$color = _ref15.color,
|
|
308
|
+
labelColor = _ref15$color === void 0 ? null : _ref15$color;
|
|
281
309
|
|
|
282
310
|
var hasAnswerLabel = isTextFilled(label);
|
|
283
311
|
var userAnswer = userAnswerIndex === answerIndex;
|
|
@@ -380,7 +408,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
380
408
|
}
|
|
381
409
|
|
|
382
410
|
return /*#__PURE__*/React.createElement("div", {
|
|
383
|
-
className: classNames([styles.container, (
|
|
411
|
+
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
412
|
}, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, {
|
|
385
413
|
background: background,
|
|
386
414
|
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
|
|
95
|
+
var _ref17;
|
|
96
96
|
|
|
97
97
|
var id = _ref.id,
|
|
98
98
|
layout = _ref.layout,
|
|
@@ -148,8 +148,36 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
148
148
|
}
|
|
149
149
|
}),
|
|
150
150
|
_useQuiz$quiz = _useQuiz.quiz,
|
|
151
|
-
|
|
151
|
+
allQuizAnswers = _useQuiz$quiz === void 0 ? [] : _useQuiz$quiz;
|
|
152
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
|
+
});
|
|
153
181
|
var hasQuestion = utils.isTextFilled(question);
|
|
154
182
|
var showInstantAnswer = isStatic || isCapture;
|
|
155
183
|
|
|
@@ -160,25 +188,25 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
160
188
|
|
|
161
189
|
var answered = userAnswerIndex !== null;
|
|
162
190
|
var quizAnswersComputed = React.useMemo(function () {
|
|
163
|
-
var total = answers !== null ? (quizAnswers || []).reduce(function (points,
|
|
164
|
-
var
|
|
165
|
-
count =
|
|
191
|
+
var total = answers !== null ? (quizAnswers || []).reduce(function (points, _ref5) {
|
|
192
|
+
var _ref5$count = _ref5.count,
|
|
193
|
+
count = _ref5$count === void 0 ? 0 : _ref5$count;
|
|
166
194
|
return points + parseInt(count, 10);
|
|
167
195
|
}, userAnswerIndex !== null && userAnswerIndex > -1 ? 1 : 0) : 0;
|
|
168
196
|
var computed = answers !== null ? (answers || []).reduce(function (answersTotal, ans, i) {
|
|
169
|
-
var
|
|
170
|
-
|
|
171
|
-
label =
|
|
197
|
+
var _ref6 = ans || {},
|
|
198
|
+
_ref6$label = _ref6.label,
|
|
199
|
+
label = _ref6$label === void 0 ? {} : _ref6$label;
|
|
172
200
|
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
body =
|
|
201
|
+
var _ref7 = label || {},
|
|
202
|
+
_ref7$body = _ref7.body,
|
|
203
|
+
body = _ref7$body === void 0 ? null : _ref7$body;
|
|
176
204
|
|
|
177
|
-
var
|
|
205
|
+
var _ref8 = quizAnswers.find(function (qa) {
|
|
178
206
|
return qa.choice === body;
|
|
179
207
|
}) || {},
|
|
180
|
-
|
|
181
|
-
count =
|
|
208
|
+
_ref8$count = _ref8.count,
|
|
209
|
+
count = _ref8$count === void 0 ? 0 : _ref8$count;
|
|
182
210
|
|
|
183
211
|
var countWithUser = i === userAnswerIndex ? count + 1 : count;
|
|
184
212
|
|
|
@@ -257,11 +285,11 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
257
285
|
|
|
258
286
|
var finalTransitionDuration = showInstantAnswer ? 0 : "".concat(resultTransitionDuration, "ms");
|
|
259
287
|
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
resultsBarColor =
|
|
263
|
-
|
|
264
|
-
resultsTextColor =
|
|
288
|
+
var _ref9 = resultsStyle || {},
|
|
289
|
+
_ref9$barColor = _ref9.barColor,
|
|
290
|
+
resultsBarColor = _ref9$barColor === void 0 ? null : _ref9$barColor,
|
|
291
|
+
_ref9$textColor = _ref9.textColor,
|
|
292
|
+
resultsTextColor = _ref9$textColor === void 0 ? null : _ref9$textColor;
|
|
265
293
|
|
|
266
294
|
items.push( /*#__PURE__*/React__default["default"].createElement("div", {
|
|
267
295
|
key: "answers",
|
|
@@ -271,34 +299,34 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
271
299
|
}, (isPlaceholder ? _toConsumableArray__default["default"](new Array(3)) : answers).map(function (answer, answerIndex) {
|
|
272
300
|
var hasAnswer = answer !== null;
|
|
273
301
|
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
label =
|
|
277
|
-
|
|
278
|
-
answerButtonStyle =
|
|
279
|
-
|
|
280
|
-
answerResultStyle =
|
|
302
|
+
var _ref10 = answer || {},
|
|
303
|
+
_ref10$label = _ref10.label,
|
|
304
|
+
label = _ref10$label === void 0 ? null : _ref10$label,
|
|
305
|
+
_ref10$buttonStyle = _ref10.buttonStyle,
|
|
306
|
+
answerButtonStyle = _ref10$buttonStyle === void 0 ? null : _ref10$buttonStyle,
|
|
307
|
+
_ref10$resultStyle = _ref10.resultStyle,
|
|
308
|
+
answerResultStyle = _ref10$resultStyle === void 0 ? null : _ref10$resultStyle;
|
|
281
309
|
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
answerResultBarColor =
|
|
285
|
-
answerResultTextColor =
|
|
310
|
+
var _ref11 = answerResultStyle || {},
|
|
311
|
+
_ref11$barColor = _ref11.barColor,
|
|
312
|
+
answerResultBarColor = _ref11$barColor === void 0 ? null : _ref11$barColor,
|
|
313
|
+
answerResultTextColor = _ref11.textColor;
|
|
286
314
|
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
body =
|
|
315
|
+
var _ref12 = label || {},
|
|
316
|
+
_ref12$body = _ref12.body,
|
|
317
|
+
body = _ref12$body === void 0 ? null : _ref12$body;
|
|
290
318
|
|
|
291
|
-
var
|
|
292
|
-
|
|
293
|
-
percent =
|
|
319
|
+
var _ref13 = body !== null ? quizAnswersComputed[body] || {} : {},
|
|
320
|
+
_ref13$percent = _ref13.percent,
|
|
321
|
+
percent = _ref13$percent === void 0 ? 0 : _ref13$percent;
|
|
294
322
|
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
textStyle =
|
|
323
|
+
var _ref14 = label || {},
|
|
324
|
+
_ref14$textStyle = _ref14.textStyle,
|
|
325
|
+
textStyle = _ref14$textStyle === void 0 ? null : _ref14$textStyle;
|
|
298
326
|
|
|
299
|
-
var
|
|
300
|
-
|
|
301
|
-
labelColor =
|
|
327
|
+
var _ref15 = textStyle || {},
|
|
328
|
+
_ref15$color = _ref15.color,
|
|
329
|
+
labelColor = _ref15$color === void 0 ? null : _ref15$color;
|
|
302
330
|
|
|
303
331
|
var hasAnswerLabel = utils.isTextFilled(label);
|
|
304
332
|
var userAnswer = userAnswerIndex === answerIndex;
|
|
@@ -401,7 +429,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
401
429
|
}
|
|
402
430
|
|
|
403
431
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
404
|
-
className: classNames__default["default"]([styles.container, (
|
|
432
|
+
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
433
|
}, !isPlaceholder ? /*#__PURE__*/React__default["default"].createElement(Background__default["default"], {
|
|
406
434
|
background: background,
|
|
407
435
|
width: width,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-survey",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.103",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@micromag/data": "^0.3.91",
|
|
54
54
|
"@micromag/element-background": "^0.3.91",
|
|
55
55
|
"@micromag/element-button": "^0.3.91",
|
|
56
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
56
|
+
"@micromag/element-call-to-action": "^0.3.103",
|
|
57
57
|
"@micromag/element-container": "^0.3.91",
|
|
58
58
|
"@micromag/element-heading": "^0.3.91",
|
|
59
59
|
"@micromag/element-layout": "^0.3.91",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "660b2ada7b03941feb841470abf5cd2cc6e3e68f"
|
|
73
73
|
}
|