@micromag/screen-survey 0.3.79 → 0.3.80
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/es/index.js +15 -16
- package/lib/index.js +15 -16
- package/package.json +13 -13
package/es/index.js
CHANGED
|
@@ -247,21 +247,20 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
247
247
|
useEffect(function () {
|
|
248
248
|
if (answers === null || isPlaceholder) {
|
|
249
249
|
return;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
|
|
250
|
+
} // const maxWidth = answers.reduce((currentMaxWidth, answer, answerI) => {
|
|
251
|
+
// const button = buttonsRefs.current[answerI] || null;
|
|
252
|
+
// const label = labelsRefs.current[answerI] || null;
|
|
253
|
+
// if (button !== null && label !== null) {
|
|
254
|
+
// const borderWidth = button.offsetWidth - button.clientWidth;
|
|
255
|
+
// const totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
|
|
256
|
+
// return Math.max(currentMaxWidth, totalWidth);
|
|
257
|
+
// }
|
|
258
|
+
// return currentMaxWidth;
|
|
259
|
+
// }, 0);
|
|
260
|
+
// setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
setButtonMaxWidth(width * 0.75);
|
|
265
264
|
setReady(true);
|
|
266
265
|
}, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
|
|
267
266
|
|
|
@@ -337,7 +336,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
337
336
|
}, /*#__PURE__*/React.createElement("div", {
|
|
338
337
|
className: styles.itemInner,
|
|
339
338
|
style: {
|
|
340
|
-
width:
|
|
339
|
+
width: buttonMaxWidth,
|
|
341
340
|
transitionDuration: finalTransitionDuration
|
|
342
341
|
}
|
|
343
342
|
}, /*#__PURE__*/React.createElement(Button, {
|
package/lib/index.js
CHANGED
|
@@ -268,21 +268,20 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
268
268
|
React.useEffect(function () {
|
|
269
269
|
if (answers === null || isPlaceholder) {
|
|
270
270
|
return;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
|
|
271
|
+
} // const maxWidth = answers.reduce((currentMaxWidth, answer, answerI) => {
|
|
272
|
+
// const button = buttonsRefs.current[answerI] || null;
|
|
273
|
+
// const label = labelsRefs.current[answerI] || null;
|
|
274
|
+
// if (button !== null && label !== null) {
|
|
275
|
+
// const borderWidth = button.offsetWidth - button.clientWidth;
|
|
276
|
+
// const totalWidth = borderWidth + label.getBoundingClientRect().width + 20;
|
|
277
|
+
// return Math.max(currentMaxWidth, totalWidth);
|
|
278
|
+
// }
|
|
279
|
+
// return currentMaxWidth;
|
|
280
|
+
// }, 0);
|
|
281
|
+
// setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
setButtonMaxWidth(width * 0.75);
|
|
286
285
|
setReady(true);
|
|
287
286
|
}, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
|
|
288
287
|
|
|
@@ -358,7 +357,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
|
|
|
358
357
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
359
358
|
className: styles.itemInner,
|
|
360
359
|
style: {
|
|
361
|
-
width:
|
|
360
|
+
width: buttonMaxWidth,
|
|
362
361
|
transitionDuration: finalTransitionDuration
|
|
363
362
|
}
|
|
364
363
|
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-survey",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.80",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
53
|
-
"@micromag/data": "^0.3.
|
|
54
|
-
"@micromag/element-background": "^0.3.
|
|
55
|
-
"@micromag/element-button": "^0.3.
|
|
56
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
57
|
-
"@micromag/element-container": "^0.3.
|
|
58
|
-
"@micromag/element-heading": "^0.3.
|
|
59
|
-
"@micromag/element-layout": "^0.3.
|
|
60
|
-
"@micromag/element-scroll": "^0.3.
|
|
61
|
-
"@micromag/element-text": "^0.3.
|
|
62
|
-
"@micromag/transforms": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.80",
|
|
53
|
+
"@micromag/data": "^0.3.80",
|
|
54
|
+
"@micromag/element-background": "^0.3.80",
|
|
55
|
+
"@micromag/element-button": "^0.3.80",
|
|
56
|
+
"@micromag/element-call-to-action": "^0.3.80",
|
|
57
|
+
"@micromag/element-container": "^0.3.80",
|
|
58
|
+
"@micromag/element-heading": "^0.3.80",
|
|
59
|
+
"@micromag/element-layout": "^0.3.80",
|
|
60
|
+
"@micromag/element-scroll": "^0.3.80",
|
|
61
|
+
"@micromag/element-text": "^0.3.80",
|
|
62
|
+
"@micromag/transforms": "^0.3.80",
|
|
63
63
|
"classnames": "^2.2.6",
|
|
64
64
|
"lodash": "^4.17.21",
|
|
65
65
|
"prop-types": "^15.7.2",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "3fdbc1c17e63df2cbe671bd08a19d21cd32754b9"
|
|
73
73
|
}
|