@micromag/screen-survey 0.3.80 → 0.3.86

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-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{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;border:2px solid #6c6c6c}.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;margin-left:50%;padding:10px;-webkit-transform:translate(-50%);-ms-transform:translate(-50%);transform:translate(-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}.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;-webkit-transform:translate(-10px);-ms-transform:translate(-10px);transform:translate(-10px);text-align:left}.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}
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{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{display:inline-block;padding:10px;-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-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;-webkit-transform:translate(-10px);-ms-transform:translate(-10px);transform:translate(-10px);text-align:left}.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
@@ -260,9 +260,9 @@ var SurveyScreen = function SurveyScreen(_ref) {
260
260
  // setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
261
261
 
262
262
 
263
- setButtonMaxWidth(width * 0.75);
263
+ setButtonMaxWidth(withoutResults ? '100%' : width * 0.75);
264
264
  setReady(true);
265
- }, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
265
+ }, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder, withoutResults]);
266
266
 
267
267
  var _ref6 = resultsStyle || {},
268
268
  _ref6$barColor = _ref6.barColor,
@@ -347,7 +347,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
347
347
  refButton: function refButton(el) {
348
348
  buttonsRefs.current[answerIndex] = el;
349
349
  },
350
- disabled: isPreview,
350
+ disabled: isPreview || userAnswerIndex !== null,
351
351
  focusable: current && isView,
352
352
  buttonStyle: !answered ? _objectSpread(_objectSpread({}, getStyleFromBox(buttonsStyle)), getStyleFromBox(answerButtonStyle)) : null
353
353
  }, /*#__PURE__*/React.createElement("span", {
@@ -359,7 +359,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
359
359
  textStyle: textStyle,
360
360
  inline: true,
361
361
  className: styles.itemText
362
- }))))), /*#__PURE__*/React.createElement("div", {
362
+ }))))), !withoutResults ? /*#__PURE__*/React.createElement("div", {
363
363
  className: styles.resultContainer,
364
364
  style: {
365
365
  transitionDuration: finalTransitionDuration
@@ -373,12 +373,12 @@ var SurveyScreen = function SurveyScreen(_ref) {
373
373
  }, /*#__PURE__*/React.createElement("div", {
374
374
  className: styles.result,
375
375
  style: _objectSpread({
376
- width: !withoutResults ? "".concat(percent, "%") : null
376
+ width: percent !== null ? "".concat(percent, "%") : null
377
377
  }, getStyleFromColor(answered ? answerResultBarColor || resultsBarColor || labelColor : null, 'backgroundColor'))
378
- }, withPercentLabels && !withoutResults ? /*#__PURE__*/React.createElement("div", {
378
+ }, withPercentLabels ? /*#__PURE__*/React.createElement("div", {
379
379
  className: styles.resultLabel,
380
380
  style: _objectSpread({}, getStyleFromColor(answered ? answerResultTextColor || resultsTextColor || answerResultBarColor || resultsBarColor || labelColor : null, 'color'))
381
- }, "".concat(percent, "%")) : null))))) : null));
381
+ }, "".concat(percent, "%")) : null))) : null)) : null));
382
382
  })) : null)); // Call to Action
383
383
 
384
384
  if (!isPlaceholder && hasCallToAction) {
@@ -495,7 +495,7 @@ var definition = {
495
495
  }]
496
496
  })
497
497
  }, {
498
- name: 'withoutResult',
498
+ name: 'withoutResults',
499
499
  type: 'toggle',
500
500
  defaultValue: false,
501
501
  label: defineMessage({
package/lib/index.js CHANGED
@@ -281,9 +281,9 @@ var SurveyScreen = function SurveyScreen(_ref) {
281
281
  // setButtonMaxWidth(Math.min(width * 0.75, Math.max(width * 0.2, maxWidth)));
282
282
 
283
283
 
284
- setButtonMaxWidth(width * 0.75);
284
+ setButtonMaxWidth(withoutResults ? '100%' : width * 0.75);
285
285
  setReady(true);
286
- }, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder]);
286
+ }, [answers, width, height, setButtonMaxWidth, finalTransitionDuration, isPlaceholder, withoutResults]);
287
287
 
288
288
  var _ref6 = resultsStyle || {},
289
289
  _ref6$barColor = _ref6.barColor,
@@ -368,7 +368,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
368
368
  refButton: function refButton(el) {
369
369
  buttonsRefs.current[answerIndex] = el;
370
370
  },
371
- disabled: isPreview,
371
+ disabled: isPreview || userAnswerIndex !== null,
372
372
  focusable: current && isView,
373
373
  buttonStyle: !answered ? _objectSpread__default["default"](_objectSpread__default["default"]({}, utils.getStyleFromBox(buttonsStyle)), utils.getStyleFromBox(answerButtonStyle)) : null
374
374
  }, /*#__PURE__*/React__default["default"].createElement("span", {
@@ -380,7 +380,7 @@ var SurveyScreen = function SurveyScreen(_ref) {
380
380
  textStyle: textStyle,
381
381
  inline: true,
382
382
  className: styles.itemText
383
- }))))), /*#__PURE__*/React__default["default"].createElement("div", {
383
+ }))))), !withoutResults ? /*#__PURE__*/React__default["default"].createElement("div", {
384
384
  className: styles.resultContainer,
385
385
  style: {
386
386
  transitionDuration: finalTransitionDuration
@@ -394,12 +394,12 @@ var SurveyScreen = function SurveyScreen(_ref) {
394
394
  }, /*#__PURE__*/React__default["default"].createElement("div", {
395
395
  className: styles.result,
396
396
  style: _objectSpread__default["default"]({
397
- width: !withoutResults ? "".concat(percent, "%") : null
397
+ width: percent !== null ? "".concat(percent, "%") : null
398
398
  }, utils.getStyleFromColor(answered ? answerResultBarColor || resultsBarColor || labelColor : null, 'backgroundColor'))
399
- }, withPercentLabels && !withoutResults ? /*#__PURE__*/React__default["default"].createElement("div", {
399
+ }, withPercentLabels ? /*#__PURE__*/React__default["default"].createElement("div", {
400
400
  className: styles.resultLabel,
401
401
  style: _objectSpread__default["default"]({}, utils.getStyleFromColor(answered ? answerResultTextColor || resultsTextColor || answerResultBarColor || resultsBarColor || labelColor : null, 'color'))
402
- }, "".concat(percent, "%")) : null))))) : null));
402
+ }, "".concat(percent, "%")) : null))) : null)) : null));
403
403
  })) : null)); // Call to Action
404
404
 
405
405
  if (!isPlaceholder && hasCallToAction) {
@@ -516,7 +516,7 @@ var definition = {
516
516
  }]
517
517
  })
518
518
  }, {
519
- name: 'withoutResult',
519
+ name: 'withoutResults',
520
520
  type: 'toggle',
521
521
  defaultValue: false,
522
522
  label: reactIntl.defineMessage({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-survey",
3
- "version": "0.3.80",
3
+ "version": "0.3.86",
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.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",
52
+ "@micromag/core": "^0.3.86",
53
+ "@micromag/data": "^0.3.86",
54
+ "@micromag/element-background": "^0.3.86",
55
+ "@micromag/element-button": "^0.3.86",
56
+ "@micromag/element-call-to-action": "^0.3.86",
57
+ "@micromag/element-container": "^0.3.86",
58
+ "@micromag/element-heading": "^0.3.86",
59
+ "@micromag/element-layout": "^0.3.86",
60
+ "@micromag/element-scroll": "^0.3.86",
61
+ "@micromag/element-text": "^0.3.86",
62
+ "@micromag/transforms": "^0.3.86",
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": "3fdbc1c17e63df2cbe671bd08a19d21cd32754b9"
72
+ "gitHead": "063af274982885b7696d265e6567ab8d44c8b9ad"
73
73
  }