@micromag/screen-survey 0.2.365 → 0.2.373
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 +10 -10
- package/lib/index.js +10 -10
- package/package.json +13 -13
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-resultContainer{-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-align-self:
|
|
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-resultContainer{-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;padding:15px 0;-webkit-transition-property:padding;-o-transition-property:padding;transition-property:padding;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.micromag-screen-survey-container .micromag-screen-survey-resultContent{width:0;height:1em;-webkit-transition-property:width opacity;-o-transition-property:width opacity;transition-property:width opacity;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;opacity:0}.micromag-screen-survey-container .micromag-screen-survey-result{position:relative;height:100%;background-color:#fff}.micromag-screen-survey-container .micromag-screen-survey-resultLabel{position:absolute;top:50%;left:100%;margin-left:5px;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#fff}.micromag-screen-survey-container .micromag-screen-survey-itemInner{width:100%;-webkit-transition-property:width;-o-transition-property:width;transition-property:width;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.micromag-screen-survey-container .micromag-screen-survey-button{position:relative;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;padding:0;border:2px solid #6c6c6c;-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{display:inline-block;padding:10px;margin-left:50%;-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;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-50%)}.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-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-left:0;text-align:left;-webkit-transform:translate(-10px);-ms-transform:translate(-10px);transform:translate(-10px)}.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}.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
|
@@ -237,23 +237,23 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
237
237
|
setReady = _useState6[1];
|
|
238
238
|
|
|
239
239
|
useEffect(function () {
|
|
240
|
-
var maxWidth = 0;
|
|
241
|
-
|
|
242
240
|
if (answers === null || isPlaceholder) {
|
|
243
241
|
return;
|
|
244
242
|
}
|
|
245
243
|
|
|
246
|
-
answers.
|
|
247
|
-
var button = buttonsRefs.current[answerI];
|
|
248
|
-
var label = labelsRefs.current[answerI];
|
|
244
|
+
var maxWidth = answers.reduce(function (currentMaxWidth, answer, answerI) {
|
|
245
|
+
var button = buttonsRefs.current[answerI] || null;
|
|
246
|
+
var label = labelsRefs.current[answerI] || null;
|
|
249
247
|
|
|
250
|
-
if (
|
|
248
|
+
if (button !== null && label !== null) {
|
|
251
249
|
var borderWidth = button.offsetWidth - button.clientWidth;
|
|
252
|
-
var totalWidth = borderWidth + label.
|
|
253
|
-
|
|
254
|
-
setButtonMaxWidth(maxWidth);
|
|
250
|
+
var totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
|
|
251
|
+
return Math.max(currentMaxWidth, totalWidth);
|
|
255
252
|
}
|
|
256
|
-
|
|
253
|
+
|
|
254
|
+
return currentMaxWidth;
|
|
255
|
+
}, 0);
|
|
256
|
+
setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
|
|
257
257
|
setReady(true);
|
|
258
258
|
}, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
|
|
259
259
|
|
package/lib/index.js
CHANGED
|
@@ -258,23 +258,23 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
258
258
|
setReady = _useState6[1];
|
|
259
259
|
|
|
260
260
|
React.useEffect(function () {
|
|
261
|
-
var maxWidth = 0;
|
|
262
|
-
|
|
263
261
|
if (answers === null || isPlaceholder) {
|
|
264
262
|
return;
|
|
265
263
|
}
|
|
266
264
|
|
|
267
|
-
answers.
|
|
268
|
-
var button = buttonsRefs.current[answerI];
|
|
269
|
-
var label = labelsRefs.current[answerI];
|
|
265
|
+
var maxWidth = answers.reduce(function (currentMaxWidth, answer, answerI) {
|
|
266
|
+
var button = buttonsRefs.current[answerI] || null;
|
|
267
|
+
var label = labelsRefs.current[answerI] || null;
|
|
270
268
|
|
|
271
|
-
if (
|
|
269
|
+
if (button !== null && label !== null) {
|
|
272
270
|
var borderWidth = button.offsetWidth - button.clientWidth;
|
|
273
|
-
var totalWidth = borderWidth + label.
|
|
274
|
-
|
|
275
|
-
setButtonMaxWidth(maxWidth);
|
|
271
|
+
var totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
|
|
272
|
+
return Math.max(currentMaxWidth, totalWidth);
|
|
276
273
|
}
|
|
277
|
-
|
|
274
|
+
|
|
275
|
+
return currentMaxWidth;
|
|
276
|
+
}, 0);
|
|
277
|
+
setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
|
|
278
278
|
setReady(true);
|
|
279
279
|
}, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
|
|
280
280
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-survey",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.373",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.2.
|
|
53
|
-
"@micromag/data": "^0.2.
|
|
54
|
-
"@micromag/element-background": "^0.2.
|
|
55
|
-
"@micromag/element-button": "^0.2.
|
|
56
|
-
"@micromag/element-call-to-action": "^0.2.
|
|
57
|
-
"@micromag/element-container": "^0.2.
|
|
58
|
-
"@micromag/element-heading": "^0.2.
|
|
59
|
-
"@micromag/element-layout": "^0.2.
|
|
60
|
-
"@micromag/element-text": "^0.2.
|
|
61
|
-
"@micromag/transforms": "^0.2.
|
|
52
|
+
"@micromag/core": "^0.2.373",
|
|
53
|
+
"@micromag/data": "^0.2.373",
|
|
54
|
+
"@micromag/element-background": "^0.2.373",
|
|
55
|
+
"@micromag/element-button": "^0.2.373",
|
|
56
|
+
"@micromag/element-call-to-action": "^0.2.373",
|
|
57
|
+
"@micromag/element-container": "^0.2.373",
|
|
58
|
+
"@micromag/element-heading": "^0.2.373",
|
|
59
|
+
"@micromag/element-layout": "^0.2.373",
|
|
60
|
+
"@micromag/element-text": "^0.2.373",
|
|
61
|
+
"@micromag/transforms": "^0.2.373",
|
|
62
62
|
"classnames": "^2.2.6",
|
|
63
|
-
"lodash": "^4.17.
|
|
63
|
+
"lodash": "^4.17.21",
|
|
64
64
|
"prop-types": "^15.7.2",
|
|
65
65
|
"react-intl": "^5.12.1",
|
|
66
66
|
"uuid": "^8.3.2"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "613451a824d273954763eaf3a739ec16ac6feb9b"
|
|
72
72
|
}
|