@elice/material-survey 1.231227.0 → 1.240112.0-cloud.0

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.
Files changed (54) hide show
  1. package/cjs/components/material-survey/MaterialSurvey.i18n.js +2 -4
  2. package/cjs/components/material-survey/MaterialSurvey.js +50 -67
  3. package/cjs/components/material-survey/MaterialSurveyInfo.js +18 -21
  4. package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +74 -112
  5. package/cjs/components/material-survey/MaterialSurveySelectOne.js +71 -107
  6. package/cjs/components/material-survey/MaterialSurveyShimmer.js +19 -24
  7. package/cjs/components/material-survey/MaterialSurveyText.js +72 -110
  8. package/cjs/components/material-survey/SurveyResultBadge.js +7 -12
  9. package/cjs/components/material-survey/SurveySubmitStatusText.js +7 -10
  10. package/cjs/components/material-survey/context/MaterialSurveyContext.js +70 -110
  11. package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +33 -41
  12. package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +82 -92
  13. package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +72 -76
  14. package/cjs/components/material-survey-edit/context.js +3 -9
  15. package/cjs/components/material-survey-edit/locales.js +2 -4
  16. package/cjs/components/material-survey-edit/utils/editValue.js +11 -19
  17. package/cjs/components/material-survey-edit/utils/randomId.js +0 -2
  18. package/cjs/components/shared/StyledMarkdown.js +2 -6
  19. package/cjs/components/shared/SurveyContentBox.js +54 -55
  20. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +7 -10
  21. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +15 -22
  22. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +80 -54
  23. package/cjs/components/shared/question-radio/QuestionRadio.js +7 -10
  24. package/cjs/components/shared/question-radio/QuestionRadioContext.js +15 -22
  25. package/cjs/components/shared/question-radio/QuestionRadioOption.js +71 -47
  26. package/cjs/helpers/index.js +0 -2
  27. package/cjs/index.js +7 -9
  28. package/es/components/material-survey/MaterialSurvey.i18n.js +2 -2
  29. package/es/components/material-survey/MaterialSurvey.js +39 -51
  30. package/es/components/material-survey/MaterialSurveyInfo.js +4 -3
  31. package/es/components/material-survey/MaterialSurveySelectMultiple.js +67 -101
  32. package/es/components/material-survey/MaterialSurveySelectOne.js +64 -96
  33. package/es/components/material-survey/MaterialSurveyShimmer.js +10 -10
  34. package/es/components/material-survey/MaterialSurveyText.js +67 -100
  35. package/es/components/material-survey/SurveyResultBadge.js +5 -6
  36. package/es/components/material-survey/SurveySubmitStatusText.js +4 -3
  37. package/es/components/material-survey/context/MaterialSurveyContext.js +69 -103
  38. package/es/components/material-survey-edit/MaterialSurveyEdit.js +28 -32
  39. package/es/components/material-survey-edit/MaterialSurveyEditContent.js +63 -68
  40. package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +67 -66
  41. package/es/components/material-survey-edit/context.js +2 -4
  42. package/es/components/material-survey-edit/locales.js +2 -2
  43. package/es/components/material-survey-edit/utils/editValue.js +11 -17
  44. package/es/components/shared/StyledMarkdown.js +1 -1
  45. package/es/components/shared/SurveyContentBox.js +51 -47
  46. package/es/components/shared/question-checkbox/QuestionCheckbox.js +5 -3
  47. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +14 -15
  48. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +76 -45
  49. package/es/components/shared/question-radio/QuestionRadio.js +5 -3
  50. package/es/components/shared/question-radio/QuestionRadioContext.js +14 -15
  51. package/es/components/shared/question-radio/QuestionRadioOption.js +67 -38
  52. package/package.json +7 -7
  53. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -404
  54. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -389
@@ -11,37 +11,35 @@ var styled = require('styled-components');
11
11
  var randomId = require('./utils/randomId.js');
12
12
  var context = require('./context.js');
13
13
 
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
18
-
19
- var MIN_OPTION_INFO_COUNT = 2;
20
- var MAX_OPTION_INFO_COUNT = 20;
21
- var StyledWrap = styled__default["default"].div.withConfig({
14
+ const MIN_OPTION_INFO_COUNT = 2;
15
+ const MAX_OPTION_INFO_COUNT = 20;
16
+ const StyledWrap = styled.div.withConfig({
22
17
  componentId: "sc-1eiyk6z-0"
23
18
  })([""]);
24
- var StyledInputGroup = styled__default["default"].div.withConfig({
19
+ const StyledInputGroup = styled.div.withConfig({
25
20
  componentId: "sc-1eiyk6z-1"
26
21
  })(["width:100%;.eb-input{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
27
- var OptionSelectOne = function OptionSelectOne() {
28
- var intl = reactIntl.useIntl();
29
- var _useMaterialSurveyEdi = context.useMaterialSurveyEditContext(),
30
- disabled = _useMaterialSurveyEdi.disabled;
31
- var _useFormContext = reactHookForm.useFormContext(),
32
- control = _useFormContext.control;
33
- var _useFieldArray = reactHookForm.useFieldArray({
34
- name: 'questionInfoList.0.optionInfo',
35
- keyName: 'id',
36
- shouldUnregister: true
37
- }),
38
- optionInfoFields = _useFieldArray.fields,
39
- appendOptionInfoFieldItem = _useFieldArray.append,
40
- removeOptionInfoFieldItem = _useFieldArray.remove;
22
+ const OptionSelectOne = () => {
23
+ const intl = reactIntl.useIntl();
24
+ const {
25
+ disabled
26
+ } = context.useMaterialSurveyEditContext();
27
+ const {
28
+ control
29
+ } = reactHookForm.useFormContext();
30
+ const {
31
+ fields: optionInfoFields,
32
+ append: appendOptionInfoFieldItem,
33
+ remove: removeOptionInfoFieldItem
34
+ } = reactHookForm.useFieldArray({
35
+ name: 'questionInfoList.0.optionInfo',
36
+ keyName: 'id',
37
+ shouldUnregister: true
38
+ });
41
39
  /**
42
40
  * Append option info.
43
41
  */
44
- var appendOptionInfo = function appendOptionInfo() {
42
+ const appendOptionInfo = () => {
45
43
  appendOptionInfoFieldItem({
46
44
  id: randomId.createRandomId(),
47
45
  value: ''
@@ -50,78 +48,76 @@ var OptionSelectOne = function OptionSelectOne() {
50
48
  /**
51
49
  * Remove item from option info at index.
52
50
  */
53
- var removeOptionInfo = function removeOptionInfo(index) {
51
+ const removeOptionInfo = index => {
54
52
  removeOptionInfoFieldItem(index);
55
53
  };
56
54
  //
57
55
  //
58
56
  //
59
- return React__default["default"].createElement(StyledWrap, null, React__default["default"].createElement(StyledInputGroup, null, optionInfoFields.map(function (_ref, index) {
60
- var id = _ref.id;
61
- return React__default["default"].createElement(reactHookForm.Controller, {
62
- key: id,
63
- control: control,
64
- name: "questionInfoList.0.optionInfo.".concat(index, ".value"),
65
- rules: {
66
- required: {
67
- value: true,
68
- message: intl.formatMessage({
69
- id: 'option.common.select.errorMessage.required'
70
- })
71
- }
72
- },
73
- render: function render(_ref2) {
74
- var field = _ref2.field,
75
- fieldState = _ref2.fieldState;
76
- var _a;
77
- return React__default["default"].createElement(blocks.Input, Object.assign({
78
- size: "small",
79
- width: "full",
80
- placeholder: intl.formatMessage({
81
- id: 'option.common.select.placeholder'
82
- }),
83
- suffix: React__default["default"].createElement(blocks.Tooltip, {
84
- title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl.formatMessage({
85
- id: 'option.common.select.tooltip.minOptionInfoItem'
86
- }) : undefined,
87
- placement: "top-start"
88
- }, React__default["default"].createElement("span", null, React__default["default"].createElement(blocks.IconButton, {
89
- icon: icons.eilMathsignMultiplyBasic,
90
- role: "grey9",
91
- size: "tiny",
92
- border: false,
93
- transparent: true,
94
- disabled: optionInfoFields.length <= MIN_OPTION_INFO_COUNT || disabled,
95
- onClick: function onClick() {
96
- return removeOptionInfo(index);
97
- }
98
- }))),
99
- readOnly: disabled,
100
- invalid: fieldState.invalid,
101
- invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
102
- }, field));
57
+ return React.createElement(StyledWrap, null, React.createElement(StyledInputGroup, null, optionInfoFields.map(({
58
+ id
59
+ }, index) => React.createElement(reactHookForm.Controller, {
60
+ key: id,
61
+ control: control,
62
+ name: `questionInfoList.0.optionInfo.${index}.value`,
63
+ rules: {
64
+ required: {
65
+ value: true,
66
+ message: intl.formatMessage({
67
+ id: 'option.common.select.errorMessage.required'
68
+ })
103
69
  }
104
- });
105
- })), React__default["default"].createElement(blocks.Vspace, {
70
+ },
71
+ render: ({
72
+ field,
73
+ fieldState
74
+ }) => {
75
+ var _a;
76
+ return React.createElement(blocks.Input, Object.assign({
77
+ size: "small",
78
+ width: "full",
79
+ placeholder: intl.formatMessage({
80
+ id: 'option.common.select.placeholder'
81
+ }),
82
+ suffix: React.createElement(blocks.Tooltip, {
83
+ title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl.formatMessage({
84
+ id: 'option.common.select.tooltip.minOptionInfoItem'
85
+ }) : undefined,
86
+ placement: "top-start"
87
+ }, React.createElement("span", null, React.createElement(blocks.IconButton, {
88
+ icon: icons.eilMathsignMultiplyBasic,
89
+ role: "grey9",
90
+ size: "tiny",
91
+ border: false,
92
+ transparent: true,
93
+ disabled: optionInfoFields.length <= MIN_OPTION_INFO_COUNT || disabled,
94
+ onClick: () => removeOptionInfo(index)
95
+ }))),
96
+ readOnly: disabled,
97
+ invalid: fieldState.invalid,
98
+ invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
99
+ }, field));
100
+ }
101
+ }))), React.createElement(blocks.Vspace, {
106
102
  height: 0.5
107
- }), React__default["default"].createElement(blocks.Tooltip, {
103
+ }), React.createElement(blocks.Tooltip, {
108
104
  title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl.formatMessage({
109
105
  id: 'option.common.select.tooltip.maxOptionInfoItem'
110
106
  }) : undefined,
111
107
  placement: "bottom"
112
- }, React__default["default"].createElement("span", null, React__default["default"].createElement(blocks.Button, {
108
+ }, React.createElement("span", null, React.createElement(blocks.Button, {
113
109
  block: true,
114
110
  size: "micro",
115
111
  borderDashed: true,
116
112
  transparent: true,
117
- icon: React__default["default"].createElement(blocks.Icon, {
113
+ icon: React.createElement(blocks.Icon, {
118
114
  icon: icons.eilMathsignAddCircle
119
115
  }),
120
116
  disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
121
117
  onClick: appendOptionInfo
122
- }, React__default["default"].createElement(reactIntl.FormattedMessage, {
118
+ }, React.createElement(reactIntl.FormattedMessage, {
123
119
  id: "option.common.select.addButton"
124
120
  })))));
125
121
  };
126
122
 
127
- exports["default"] = OptionSelectOne;
123
+ exports.default = OptionSelectOne;
@@ -4,14 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+ const MaterialSurveyEditContext = React.createContext(null);
8
+ const useMaterialSurveyEditContext = () => React.useContext(MaterialSurveyEditContext);
8
9
 
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
-
11
- var MaterialSurveyEditContext = React__default["default"].createContext(null);
12
- var useMaterialSurveyEditContext = function useMaterialSurveyEditContext() {
13
- return React__default["default"].useContext(MaterialSurveyEditContext);
14
- };
15
-
16
- exports["default"] = MaterialSurveyEditContext;
10
+ exports.default = MaterialSurveyEditContext;
17
11
  exports.useMaterialSurveyEditContext = useMaterialSurveyEditContext;
@@ -1,8 +1,6 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var en = {
3
+ const en = {
6
4
  'common.option': 'Option {number}',
7
5
  'common.errorMessage.range': 'Please enter within {min} ~ {max} characters.',
8
6
  'content.title': 'Question',
@@ -21,7 +19,7 @@ var en = {
21
19
  'option.common.select.tooltip.maxOptionInfoItem': 'You cannot enter more than 20 options.',
22
20
  'option.common.select.addButton': 'Add Option'
23
21
  };
24
- var ko = {
22
+ const ko = {
25
23
  'common.option': '옵션 {number}',
26
24
  'common.errorMessage.range': '{min} ~ {max}자 이내로 입력해주세요.',
27
25
  'content.title': '질문',
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var randomId = require('./randomId.js');
6
4
 
7
5
  /**
@@ -9,18 +7,14 @@ var randomId = require('./randomId.js');
9
7
  */
10
8
  function manipulateValue(v) {
11
9
  return Object.assign(Object.assign({}, v), {
12
- questionInfoList: v.questionInfoList.map(function (questionInfo) {
13
- return Object.assign(Object.assign({}, questionInfo), {
14
- // convert string array to object array
15
- // - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
16
- optionInfo: Array.isArray(questionInfo.optionInfo) ? questionInfo.optionInfo.map(function (option) {
17
- return {
18
- id: randomId.createRandomId(),
19
- value: option
20
- };
21
- }) : []
22
- });
23
- })
10
+ questionInfoList: v.questionInfoList.map(questionInfo => Object.assign(Object.assign({}, questionInfo), {
11
+ // convert string array to object array
12
+ // - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
13
+ optionInfo: Array.isArray(questionInfo.optionInfo) ? questionInfo.optionInfo.map(option => ({
14
+ id: randomId.createRandomId(),
15
+ value: option
16
+ })) : []
17
+ }))
24
18
  });
25
19
  }
26
20
  /**
@@ -28,12 +22,10 @@ function manipulateValue(v) {
28
22
  */
29
23
  function restoreValue(v) {
30
24
  return Object.assign(Object.assign({}, v), {
31
- questionInfoList: v.questionInfoList.map(function (questionInfo) {
25
+ questionInfoList: v.questionInfoList.map(questionInfo => {
32
26
  var _a;
33
- var newQuestionInfo = Object.assign(Object.assign({}, questionInfo), {
34
- optionInfo: ((_a = questionInfo.optionInfo) === null || _a === void 0 ? void 0 : _a.length) ? questionInfo.optionInfo.map(function (option) {
35
- return option.value;
36
- }) : null
27
+ const newQuestionInfo = Object.assign(Object.assign({}, questionInfo), {
28
+ optionInfo: ((_a = questionInfo.optionInfo) === null || _a === void 0 ? void 0 : _a.length) ? questionInfo.optionInfo.map(option => option.value) : null
37
29
  });
38
30
  if (!newQuestionInfo.optionInfo) {
39
31
  delete newQuestionInfo.optionInfo;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  /**
6
4
  * Create random ID.
7
5
  */
@@ -5,12 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var markdown = require('@elice/markdown');
6
6
  var styled = require('styled-components');
7
7
 
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
-
12
- var StyledMarkdown = styled__default["default"](markdown.Markdown).withConfig({
8
+ const StyledMarkdown = styled(markdown.Markdown).withConfig({
13
9
  componentId: "sc-h8kc9g-0"
14
10
  })(["p{margin:0 !important;}"]);
15
11
 
16
- exports["default"] = StyledMarkdown;
12
+ exports.default = StyledMarkdown;
@@ -10,77 +10,76 @@ var designTokens = require('@elice/design-tokens');
10
10
  var styled = require('styled-components');
11
11
  var MaterialSurveyContext = require('../material-survey/context/MaterialSurveyContext.js');
12
12
 
13
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
-
15
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
17
-
18
- var StyledQuestionBox = styled__default["default"].div.withConfig({
13
+ const StyledQuestionBox = styled.div.withConfig({
19
14
  componentId: "sc-h8ztvr-0"
20
- })(["display:flex;flex-direction:column;border-radius:", ";overflow:hidden;width:100%;max-height:", ";min-height:", ";"], function (_ref) {
21
- var vertical = _ref.vertical;
22
- return vertical ? '0' : '8px';
23
- }, function (_ref2) {
24
- var hasFooter = _ref2.hasFooter;
25
- return hasFooter ? '100%' : '';
26
- }, function (_ref3) {
27
- var hasFooter = _ref3.hasFooter;
28
- return hasFooter ? '' : '100%';
29
- });
30
- var StyledQuestionBoxHeader = styled__default["default"].div.withConfig({
15
+ })(["display:flex;flex-direction:column;border-radius:", ";overflow:hidden;width:100%;max-height:", ";min-height:", ";"], ({
16
+ vertical
17
+ }) => vertical ? '0' : '8px', ({
18
+ hasFooter
19
+ }) => hasFooter ? '100%' : '', ({
20
+ hasFooter
21
+ }) => hasFooter ? '' : '100%');
22
+ const StyledQuestionBoxHeader = styled.div.withConfig({
31
23
  componentId: "sc-h8ztvr-1"
32
24
  })(["display:flex;justify-content:space-between;background-color:", ";padding:1rem 1.5rem;flex:none;height:3.5rem;"], designTokens.base.color.navy6);
33
- var StyledQuestionBoxBody = styled__default["default"].div.withConfig({
25
+ const StyledQuestionBoxBody = styled.div.withConfig({
34
26
  componentId: "sc-h8ztvr-2"
35
- })(["padding:1.5rem;background-color:", ";flex:auto;", "})"], designTokens.base.color.navy7, function (_ref4) {
36
- var hasFooter = _ref4.hasFooter;
37
- return hasFooter ? 'height: 100%; overflow-y: auto;' : '';
38
- });
39
- var StyledQuestionBoxFooter = styled__default["default"].div.withConfig({
27
+ })(["padding:1.5rem;background-color:", ";flex:auto;", "})"], designTokens.base.color.navy7, ({
28
+ hasFooter
29
+ }) => hasFooter ? 'height: 100%; overflow-y: auto;' : '');
30
+ const StyledQuestionBoxFooter = styled.div.withConfig({
40
31
  componentId: "sc-h8ztvr-3"
41
- })(["flex:none;display:flex;justify-content:space-between;align-items:center;padding:0.75rem 1.5rem;background-color:", ";", ""], designTokens.base.color.navy6, function (_ref5) {
42
- var vertical = _ref5.vertical;
43
- return vertical ? "\n flex-direction: column;\n align-items: flex-start;\n " : '';
32
+ })(["flex:none;display:flex;justify-content:space-between;align-items:center;padding:0.75rem 1.5rem;background-color:", ";", ""], designTokens.base.color.navy6, ({
33
+ vertical
34
+ }) => {
35
+ return vertical ? `
36
+ flex-direction: column;
37
+ align-items: flex-start;
38
+ ` : '';
44
39
  });
45
- var StyledQuestionBoxFooterActions = styled__default["default"].div.withConfig({
40
+ const StyledQuestionBoxFooterActions = styled.div.withConfig({
46
41
  componentId: "sc-h8ztvr-4"
47
42
  })(["display:flex;> *:not(:last-child){margin-right:0.75rem;}"]);
48
- var StyledQuestionBoxFooterStatus = styled__default["default"].div.withConfig({
43
+ const StyledQuestionBoxFooterStatus = styled.div.withConfig({
49
44
  componentId: "sc-h8ztvr-5"
50
- })(["margin-left:0.75rem;", ""], function (_ref6) {
51
- var vertical = _ref6.vertical;
52
- return vertical ? "\n margin-left: 0;\n margin-top: 0.75rem;\n " : '';
45
+ })(["margin-left:0.75rem;", ""], ({
46
+ vertical
47
+ }) => {
48
+ return vertical ? `
49
+ margin-left: 0;
50
+ margin-top: 0.75rem;
51
+ ` : '';
53
52
  });
54
- var SurveyContentBox = function SurveyContentBox(_a) {
55
- var children = _a.children,
56
- _a$footerActions = _a.footerActions,
57
- footerActions = _a$footerActions === void 0 ? [] : _a$footerActions,
58
- title = _a.title,
59
- submitResult = _a.submitResult,
60
- submitStatus = _a.submitStatus,
61
- onNext = _a.onNext,
53
+ const SurveyContentBox = _a => {
54
+ var {
55
+ children,
56
+ footerActions = [],
57
+ title,
58
+ submitResult,
59
+ submitStatus,
60
+ onNext
61
+ } = _a,
62
62
  props = tslib.__rest(_a, ["children", "footerActions", "title", "submitResult", "submitStatus", "onNext"]);
63
- var intl = reactIntl.useIntl();
64
- var _useMaterialSurveySta = MaterialSurveyContext.useMaterialSurveyState(),
65
- vertical = _useMaterialSurveySta.vertical;
66
- var hasFooter = footerActions.length > 0;
67
- var header = React__default["default"].createElement(StyledQuestionBoxHeader, null, React__default["default"].createElement(blocks.Text, {
63
+ const intl = reactIntl.useIntl();
64
+ const {
65
+ vertical
66
+ } = MaterialSurveyContext.useMaterialSurveyState();
67
+ const hasFooter = footerActions.length > 0;
68
+ const header = React.createElement(StyledQuestionBoxHeader, null, React.createElement(blocks.Text, {
68
69
  bold: true,
69
70
  customStyles: {
70
71
  color: designTokens.base.color.navy0
71
72
  }
72
73
  }, title), submitResult ? submitResult : null);
73
- var body = React__default["default"].createElement(StyledQuestionBoxBody, {
74
+ const body = React.createElement(StyledQuestionBoxBody, {
74
75
  hasFooter: hasFooter
75
76
  }, children);
76
- var footer = React__default["default"].createElement(StyledQuestionBoxFooter, {
77
+ const footer = React.createElement(StyledQuestionBoxFooter, {
77
78
  vertical: vertical
78
- }, React__default["default"].createElement(StyledQuestionBoxFooterActions, null, footerActions.map(function (action, index) {
79
- return React__default["default"].createElement(blocks.Button, Object.assign({
80
- key: index,
81
- size: "small"
82
- }, action), action.children);
83
- }), typeof onNext === 'function' ? React__default["default"].createElement(blocks.Button, {
79
+ }, React.createElement(StyledQuestionBoxFooterActions, null, footerActions.map((action, index) => React.createElement(blocks.Button, Object.assign({
80
+ key: index,
81
+ size: "small"
82
+ }, action), action.children)), typeof onNext === 'function' ? React.createElement(blocks.Button, {
84
83
  size: "small",
85
84
  border: true,
86
85
  tabIndex: 0,
@@ -89,14 +88,14 @@ var SurveyContentBox = function SurveyContentBox(_a) {
89
88
  onClick: onNext
90
89
  }, intl.formatMessage({
91
90
  id: 'materialSurvey.next'
92
- })) : null), React__default["default"].createElement(StyledQuestionBoxFooterStatus, {
91
+ })) : null), React.createElement(StyledQuestionBoxFooterStatus, {
93
92
  vertical: vertical
94
93
  }, submitStatus));
95
- return React__default["default"].createElement(StyledQuestionBox, Object.assign({}, props, {
94
+ return React.createElement(StyledQuestionBox, Object.assign({}, props, {
96
95
  vertical: vertical,
97
96
  hasFooter: hasFooter
98
97
  }), header, body, footerActions.length > 0 ? footer : null);
99
98
  };
100
99
 
101
100
  exports.StyledQuestionBox = StyledQuestionBox;
102
- exports["default"] = SurveyContentBox;
101
+ exports.default = SurveyContentBox;
@@ -7,18 +7,15 @@ var React = require('react');
7
7
  var styled = require('styled-components');
8
8
  var QuestionCheckboxContext = require('./QuestionCheckboxContext.js');
9
9
 
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
14
-
15
- var StyledQuestionCheckbox = styled__default["default"].div.withConfig({
10
+ const StyledQuestionCheckbox = styled.div.withConfig({
16
11
  componentId: "sc-1ovh9lp-0"
17
12
  })(["display:flex;flex-direction:column;"]);
18
- var QuestionCheckbox = function QuestionCheckbox(_a) {
19
- var children = _a.children,
13
+ const QuestionCheckbox = _a => {
14
+ var {
15
+ children
16
+ } = _a,
20
17
  props = tslib.__rest(_a, ["children"]);
21
- return React__default["default"].createElement(QuestionCheckboxContext.QuestionCheckboxContextProvider, Object.assign({}, props), React__default["default"].createElement(StyledQuestionCheckbox, null, children));
18
+ return React.createElement(QuestionCheckboxContext.QuestionCheckboxContextProvider, Object.assign({}, props), React.createElement(StyledQuestionCheckbox, null, children));
22
19
  };
23
20
 
24
- exports["default"] = QuestionCheckbox;
21
+ exports.default = QuestionCheckbox;
@@ -1,35 +1,28 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var React = require('react');
6
4
 
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
-
11
- var QuestionCheckboxContext = React__default["default"].createContext(undefined);
5
+ const QuestionCheckboxContext = React.createContext(undefined);
12
6
  QuestionCheckboxContext.displayName = 'QuestionCheckboxContext';
13
- function QuestionCheckboxContextProvider(_ref) {
14
- var selectedOptions = _ref.selectedOptions,
15
- onSelect = _ref.onSelect,
16
- disabled = _ref.disabled,
17
- children = _ref.children;
7
+ function QuestionCheckboxContextProvider({
8
+ selectedOptions,
9
+ onSelect,
10
+ disabled,
11
+ children
12
+ }) {
18
13
  // eslint-disable-next-line react-hooks/exhaustive-deps
19
- var onSelectValue = React__default["default"].useCallback(onSelect, []);
20
- var value = React__default["default"].useMemo(function () {
21
- return {
22
- selectedOptions: selectedOptions,
23
- disabled: disabled,
24
- onSelect: onSelectValue
25
- };
26
- }, [selectedOptions, disabled, onSelectValue]);
27
- return React__default["default"].createElement(QuestionCheckboxContext.Provider, {
14
+ const onSelectValue = React.useCallback(onSelect, []);
15
+ const value = React.useMemo(() => ({
16
+ selectedOptions,
17
+ disabled,
18
+ onSelect: onSelectValue
19
+ }), [selectedOptions, disabled, onSelectValue]);
20
+ return React.createElement(QuestionCheckboxContext.Provider, {
28
21
  value: value
29
22
  }, children);
30
23
  }
31
24
  function useQuestionCheckboxContext() {
32
- var context = React__default["default"].useContext(QuestionCheckboxContext);
25
+ const context = React.useContext(QuestionCheckboxContext);
33
26
  if (context === undefined) {
34
27
  throw new Error('useQuestionCheckboxContext must be used within a QuestionCheckboxContextProvider');
35
28
  }