@elice/material-survey 1.240718.0-trasncript.2 → 1.240718.2
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/cjs/components/markdown-editor/index.d.ts +2 -1
- package/cjs/components/markdown-editor/index.js +10 -19
- package/cjs/components/material-survey/MaterialSurvey.js +57 -82
- package/cjs/components/material-survey/MaterialSurveyInfo.js +59 -69
- package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +90 -131
- package/cjs/components/material-survey/MaterialSurveySelectOne.js +86 -125
- package/cjs/components/material-survey/MaterialSurveyShimmer.js +40 -47
- package/cjs/components/material-survey/MaterialSurveyText.js +75 -114
- package/cjs/components/material-survey/SurveyResultBadge.js +10 -17
- package/cjs/components/material-survey/SurveySubmitStatusText.js +16 -21
- package/cjs/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
- package/cjs/components/material-survey/context/MaterialSurveyContext.js +74 -115
- package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +36 -49
- package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +91 -113
- package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +87 -100
- package/cjs/components/material-survey-edit/context.js +2 -8
- package/cjs/components/material-survey-edit/utils/editValue.js +11 -17
- package/cjs/components/shared/StyledMarkdown.js +1 -5
- package/cjs/components/shared/SurveyContentBox.js +74 -85
- package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +7 -13
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +17 -24
- package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +89 -66
- package/cjs/components/shared/question-radio/QuestionRadio.js +7 -13
- package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/cjs/components/shared/question-radio/QuestionRadioContext.js +17 -24
- package/cjs/components/shared/question-radio/QuestionRadioOption.js +80 -59
- package/es/components/markdown-editor/index.d.ts +2 -1
- package/es/components/markdown-editor/index.js +10 -15
- package/es/components/material-survey/MaterialSurvey.js +57 -77
- package/es/components/material-survey/MaterialSurveyInfo.js +59 -65
- package/es/components/material-survey/MaterialSurveySelectMultiple.js +90 -127
- package/es/components/material-survey/MaterialSurveySelectOne.js +86 -121
- package/es/components/material-survey/MaterialSurveyShimmer.js +40 -43
- package/es/components/material-survey/MaterialSurveyText.js +75 -109
- package/es/components/material-survey/SurveyResultBadge.js +10 -13
- package/es/components/material-survey/SurveySubmitStatusText.js +16 -17
- package/es/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
- package/es/components/material-survey/context/MaterialSurveyContext.js +75 -112
- package/es/components/material-survey-edit/MaterialSurveyEdit.js +36 -45
- package/es/components/material-survey-edit/MaterialSurveyEditContent.js +90 -107
- package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +87 -96
- package/es/components/material-survey-edit/context.js +2 -4
- package/es/components/material-survey-edit/utils/editValue.js +11 -17
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/es/components/shared/SurveyContentBox.js +74 -81
- package/es/components/shared/question-checkbox/QuestionCheckbox.js +7 -9
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +17 -20
- package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +89 -61
- package/es/components/shared/question-radio/QuestionRadio.js +7 -9
- package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/es/components/shared/question-radio/QuestionRadioContext.js +17 -20
- package/es/components/shared/question-radio/QuestionRadioOption.js +80 -54
- package/package.json +12 -9
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -399
- package/cjs/components/material-survey/index.js +0 -9
- package/cjs/components/material-survey/locales/index.js +0 -13
- package/cjs/components/material-survey-edit/index.js +0 -7
- package/cjs/components/material-survey-edit/locales/index.js +0 -13
- package/cjs/components/shared/index.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -386
- package/es/components/material-survey/index.js +0 -2
- package/es/components/material-survey/locales/index.js +0 -4
- package/es/components/material-survey-edit/index.js +0 -1
- package/es/components/material-survey-edit/locales/index.js +0 -4
- package/es/components/shared/index.js +0 -4
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
3
|
var React = require('react');
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
9
|
-
|
|
10
|
-
var QuestionRadioContext = React__default.default.createContext(undefined);
|
|
5
|
+
const QuestionRadioContext = React.createContext(undefined);
|
|
11
6
|
QuestionRadioContext.displayName = 'QuestionRadioContext';
|
|
12
|
-
function QuestionRadioContextProvider(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
function QuestionRadioContextProvider({
|
|
8
|
+
selectedValue,
|
|
9
|
+
onSelect,
|
|
10
|
+
disabled,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
17
13
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
value: value,
|
|
28
|
-
children: children
|
|
29
|
-
});
|
|
14
|
+
const onSelectValue = React.useCallback(onSelect, []);
|
|
15
|
+
const value = React.useMemo(() => ({
|
|
16
|
+
selectedValue,
|
|
17
|
+
disabled,
|
|
18
|
+
onSelect: onSelectValue
|
|
19
|
+
}), [selectedValue, disabled, onSelectValue]);
|
|
20
|
+
return React.createElement(QuestionRadioContext.Provider, {
|
|
21
|
+
value: value
|
|
22
|
+
}, children);
|
|
30
23
|
}
|
|
31
24
|
function useQuestionRadioContext() {
|
|
32
|
-
|
|
25
|
+
const context = React.useContext(QuestionRadioContext);
|
|
33
26
|
if (context === undefined) {
|
|
34
27
|
throw new Error('useQuestionRadioContext must be used within a QuestionRadioContextProvider');
|
|
35
28
|
}
|
|
@@ -2,22 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var designTokens = require('@elice/design-tokens');
|
|
8
7
|
var styled = require('styled-components');
|
|
9
8
|
var QuestionRadioContext = require('./QuestionRadioContext.js');
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
-
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
15
|
-
|
|
16
|
-
var StyledQuestionRadioOption = styled__default.default.div.withConfig({
|
|
10
|
+
const StyledQuestionRadioOption = styled.div.withConfig({
|
|
17
11
|
componentId: "sc-zgbv8k-0"
|
|
18
|
-
})(["display:flex;align-items:center;padding:1.125rem;border-radius:8px;background-color:", ";&:not(:last-of-type){margin-bottom:1rem;}&:hover,& *:hover{cursor:", ";}", ""],
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
})(["display:flex;align-items:center;padding:1.125rem;border-radius:8px;background-color:", ";&:not(:last-of-type){margin-bottom:1rem;}&:hover,& *:hover{cursor:", ";}", ""], ({
|
|
13
|
+
checked,
|
|
14
|
+
status
|
|
15
|
+
}) => {
|
|
21
16
|
if (checked) {
|
|
22
17
|
return designTokens.base.color.primary1;
|
|
23
18
|
}
|
|
@@ -29,18 +24,17 @@ var StyledQuestionRadioOption = styled__default.default.div.withConfig({
|
|
|
29
24
|
default:
|
|
30
25
|
return designTokens.base.color.navy5;
|
|
31
26
|
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
var StyledQuestionRadioInput = styled__default.default.input.withConfig({
|
|
27
|
+
}, ({
|
|
28
|
+
disabled
|
|
29
|
+
}) => disabled ? 'not-allowed' : 'pointer', ({
|
|
30
|
+
isAnswer
|
|
31
|
+
}) => isAnswer ? `border: 3px solid ${designTokens.base.color.green5}` : '');
|
|
32
|
+
const StyledQuestionRadioInput = styled.input.withConfig({
|
|
40
33
|
componentId: "sc-zgbv8k-1"
|
|
41
|
-
})(["flex:none;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;border-radius:50%;width:1.25rem;height:1.25rem;margin-right:0.875rem;border:2px solid ", ";", ""],
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
})(["flex:none;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;border-radius:50%;width:1.25rem;height:1.25rem;margin-right:0.875rem;border:2px solid ", ";", ""], ({
|
|
35
|
+
checked,
|
|
36
|
+
status
|
|
37
|
+
}) => {
|
|
44
38
|
if (checked) {
|
|
45
39
|
return designTokens.base.color.primary6;
|
|
46
40
|
}
|
|
@@ -52,14 +46,27 @@ var StyledQuestionRadioInput = styled__default.default.input.withConfig({
|
|
|
52
46
|
default:
|
|
53
47
|
return designTokens.base.color.gray3;
|
|
54
48
|
}
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
}, ({
|
|
50
|
+
status,
|
|
51
|
+
checked
|
|
52
|
+
}) => {
|
|
58
53
|
if (checked) {
|
|
59
|
-
return
|
|
54
|
+
return `
|
|
55
|
+
&:after {
|
|
56
|
+
content: '';
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 50%;
|
|
59
|
+
left: 50%;
|
|
60
|
+
transform: translate(-50%, -50%);
|
|
61
|
+
width: 70%;
|
|
62
|
+
height: 70%;
|
|
63
|
+
border-radius: 50%;
|
|
64
|
+
background-color: ${designTokens.base.color.primary6};
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
60
67
|
}
|
|
61
68
|
if (status) {
|
|
62
|
-
|
|
69
|
+
let bgColor;
|
|
63
70
|
switch (status) {
|
|
64
71
|
case 'correct':
|
|
65
72
|
bgColor = designTokens.base.color.green9;
|
|
@@ -71,14 +78,27 @@ var StyledQuestionRadioInput = styled__default.default.input.withConfig({
|
|
|
71
78
|
bgColor = designTokens.base.color.gray3;
|
|
72
79
|
break;
|
|
73
80
|
}
|
|
74
|
-
return
|
|
81
|
+
return `
|
|
82
|
+
&:after {
|
|
83
|
+
content: '';
|
|
84
|
+
position: absolute;
|
|
85
|
+
top: 50%;
|
|
86
|
+
left: 50%;
|
|
87
|
+
transform: translate(-50%, -50%);
|
|
88
|
+
width: 70%;
|
|
89
|
+
height: 70%;
|
|
90
|
+
border-radius: 50%;
|
|
91
|
+
background-color: ${bgColor};
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
75
94
|
}
|
|
76
95
|
});
|
|
77
|
-
|
|
96
|
+
const StyledLabel = styled.label.withConfig({
|
|
78
97
|
componentId: "sc-zgbv8k-2"
|
|
79
|
-
})(["word-break:break-all;margin-right:0.875rem;font-size:", ";color:", ";& p{color:", ";}"], designTokens.base.size.body3,
|
|
80
|
-
|
|
81
|
-
|
|
98
|
+
})(["word-break:break-all;margin-right:0.875rem;font-size:", ";color:", ";& p{color:", ";}"], designTokens.base.size.body3, ({
|
|
99
|
+
checked,
|
|
100
|
+
status
|
|
101
|
+
}) => {
|
|
82
102
|
if (checked) {
|
|
83
103
|
return designTokens.base.color.primary6;
|
|
84
104
|
}
|
|
@@ -90,9 +110,10 @@ var StyledLabel = styled__default.default.label.withConfig({
|
|
|
90
110
|
default:
|
|
91
111
|
return designTokens.base.color.navy0;
|
|
92
112
|
}
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
113
|
+
}, ({
|
|
114
|
+
checked,
|
|
115
|
+
status
|
|
116
|
+
}) => {
|
|
96
117
|
if (checked) {
|
|
97
118
|
return designTokens.base.color.primary6;
|
|
98
119
|
}
|
|
@@ -105,40 +126,40 @@ var StyledLabel = styled__default.default.label.withConfig({
|
|
|
105
126
|
return designTokens.base.color.navy0;
|
|
106
127
|
}
|
|
107
128
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
const QuestionRadioOption = React.memo(({
|
|
130
|
+
value,
|
|
131
|
+
status,
|
|
132
|
+
isAnswer,
|
|
133
|
+
children
|
|
134
|
+
}) => {
|
|
135
|
+
const {
|
|
136
|
+
selectedValue,
|
|
137
|
+
disabled,
|
|
138
|
+
onSelect
|
|
139
|
+
} = QuestionRadioContext.useQuestionRadioContext();
|
|
140
|
+
return React.createElement(StyledQuestionRadioOption, {
|
|
118
141
|
isAnswer: isAnswer,
|
|
119
142
|
disabled: disabled,
|
|
120
143
|
checked: selectedValue === value,
|
|
121
|
-
onClick:
|
|
144
|
+
onClick: e => {
|
|
122
145
|
e.preventDefault();
|
|
123
146
|
if (disabled) {
|
|
124
147
|
return;
|
|
125
148
|
}
|
|
126
149
|
onSelect(value);
|
|
127
150
|
},
|
|
128
|
-
status: status
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
})]
|
|
141
|
-
});
|
|
151
|
+
status: status
|
|
152
|
+
}, React.createElement(StyledQuestionRadioInput, {
|
|
153
|
+
id: value,
|
|
154
|
+
type: "radio",
|
|
155
|
+
readOnly: true,
|
|
156
|
+
checked: selectedValue === value,
|
|
157
|
+
status: status
|
|
158
|
+
}), React.createElement(StyledLabel, {
|
|
159
|
+
htmlFor: value,
|
|
160
|
+
checked: selectedValue === value,
|
|
161
|
+
status: status
|
|
162
|
+
}, children));
|
|
142
163
|
});
|
|
143
164
|
|
|
144
165
|
exports.default = QuestionRadioOption;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { EliceWysiwygEditorProps } from '@elice/wysiwyg';
|
|
2
|
-
export declare const MarkdownEditor: ({ value, onChange, ...props }: EliceWysiwygEditorProps) => JSX.Element;
|
|
3
|
+
export declare const MarkdownEditor: ({ value, onChange, ...props }: EliceWysiwygEditorProps) => React.JSX.Element;
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { __rest } from 'tslib';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import { useDebounce } from 'react-use';
|
|
6
4
|
import { EliceWysiwygEditor } from '@elice/wysiwyg';
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
6
|
+
const STATE_SYNC_DEBOUNCE_TIME = 50;
|
|
7
|
+
const MarkdownEditor = _a => {
|
|
8
|
+
var {
|
|
9
|
+
value,
|
|
10
|
+
onChange
|
|
11
|
+
} = _a,
|
|
12
12
|
props = __rest(_a, ["value", "onChange"]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__setValue = _React$useState2[1];
|
|
17
|
-
useDebounce(function () {
|
|
18
|
-
return __setValue(value);
|
|
19
|
-
}, STATE_SYNC_DEBOUNCE_TIME, [value]);
|
|
20
|
-
useDebounce(function () {
|
|
13
|
+
const [__value, __setValue] = React.useState(value);
|
|
14
|
+
useDebounce(() => __setValue(value), STATE_SYNC_DEBOUNCE_TIME, [value]);
|
|
15
|
+
useDebounce(() => {
|
|
21
16
|
if (__value !== value && typeof onChange === 'function') {
|
|
22
17
|
onChange(__value !== null && __value !== void 0 ? __value : '');
|
|
23
18
|
}
|
|
24
19
|
}, STATE_SYNC_DEBOUNCE_TIME, [__value]);
|
|
25
|
-
return
|
|
20
|
+
return React.createElement(EliceWysiwygEditor, Object.assign({
|
|
26
21
|
value: value,
|
|
27
22
|
onChange: __setValue
|
|
28
23
|
}, props));
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import { useMeasure } from 'react-use';
|
|
5
3
|
import { base } from '@elice/design-tokens';
|
|
@@ -12,101 +10,83 @@ import messageKo from './locales/ko.json.js';
|
|
|
12
10
|
import MaterialSurveyShimmer from './MaterialSurveyShimmer.js';
|
|
13
11
|
import MaterialSurveyInfo from './MaterialSurveyInfo.js';
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return import('./MaterialSurveyText.js');
|
|
20
|
-
});
|
|
21
|
-
var AsyncMaterialSurveySelectOne = React.lazy(function () {
|
|
22
|
-
return import('./MaterialSurveySelectOne.js');
|
|
23
|
-
});
|
|
24
|
-
var StyledMaterialSurveyInfo = styled.div.withConfig({
|
|
13
|
+
const AsyncMaterialSurveySelectMultiple = React.lazy(() => import('./MaterialSurveySelectMultiple.js'));
|
|
14
|
+
const AsyncMaterialSurveyText = React.lazy(() => import('./MaterialSurveyText.js'));
|
|
15
|
+
const AsyncMaterialSurveySelectOne = React.lazy(() => import('./MaterialSurveySelectOne.js'));
|
|
16
|
+
const StyledMaterialSurveyInfo = styled.div.withConfig({
|
|
25
17
|
componentId: "sc-1fyzkvm-0"
|
|
26
18
|
})([""]);
|
|
27
|
-
|
|
19
|
+
const StyledMaterialSurveyContent = styled.div.withConfig({
|
|
28
20
|
componentId: "sc-1fyzkvm-1"
|
|
29
21
|
})([""]);
|
|
30
|
-
|
|
22
|
+
const StyledMaterialSurveyWrapper = styled.div.withConfig({
|
|
31
23
|
componentId: "sc-1fyzkvm-2"
|
|
32
|
-
})(["display:flex;height:100%;flex-direction:", ";& > *{flex:", ";}& > *:first-child{margin-right:", ";margin-bottom:", ";}", "{height:", ";overflow-y:", ";}"],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var _useMeasure = useMeasure(),
|
|
58
|
-
_useMeasure2 = _slicedToArray(_useMeasure, 2),
|
|
59
|
-
ref = _useMeasure2[0],
|
|
60
|
-
width = _useMeasure2[1].width;
|
|
61
|
-
React.useEffect(function () {
|
|
24
|
+
})(["display:flex;height:100%;flex-direction:", ";& > *{flex:", ";}& > *:first-child{margin-right:", ";margin-bottom:", ";}", "{height:", ";overflow-y:", ";}"], ({
|
|
25
|
+
vertical
|
|
26
|
+
}) => vertical ? 'column' : 'row', ({
|
|
27
|
+
vertical
|
|
28
|
+
}) => vertical ? 'auto' : '1 0 calc(50% - 1rem);', ({
|
|
29
|
+
vertical
|
|
30
|
+
}) => vertical ? '0' : '1rem', ({
|
|
31
|
+
vertical
|
|
32
|
+
}) => vertical ? '1rem' : '0', StyledMaterialSurveyInfo, ({
|
|
33
|
+
vertical
|
|
34
|
+
}) => vertical ? 'auto' : '100%', ({
|
|
35
|
+
vertical
|
|
36
|
+
}) => vertical ? 'intial' : 'auto');
|
|
37
|
+
const MaterialSurvey = () => {
|
|
38
|
+
const {
|
|
39
|
+
materialSurvey,
|
|
40
|
+
vertical
|
|
41
|
+
} = useMaterialSurveyState();
|
|
42
|
+
const {
|
|
43
|
+
setVertical
|
|
44
|
+
} = useMaterialSurveyDispatch();
|
|
45
|
+
const [ref, {
|
|
46
|
+
width
|
|
47
|
+
}] = useMeasure();
|
|
48
|
+
React.useEffect(() => {
|
|
62
49
|
if (width > 0) {
|
|
63
50
|
setVertical(width <= base.screen.medium);
|
|
64
51
|
}
|
|
65
52
|
}, [width, setVertical]);
|
|
66
|
-
|
|
53
|
+
let Component = null;
|
|
67
54
|
switch (materialSurvey === null || materialSurvey === void 0 ? void 0 : materialSurvey.questionInfoList[0].optionType) {
|
|
68
55
|
case enums.SurveyOptionType.SelectOne:
|
|
69
|
-
Component =
|
|
56
|
+
Component = React.createElement(AsyncMaterialSurveySelectOne, null);
|
|
70
57
|
break;
|
|
71
58
|
case enums.SurveyOptionType.SelectMultiple:
|
|
72
|
-
Component =
|
|
59
|
+
Component = React.createElement(AsyncMaterialSurveySelectMultiple, null);
|
|
73
60
|
break;
|
|
74
61
|
case enums.SurveyOptionType.Text:
|
|
75
|
-
Component =
|
|
62
|
+
Component = React.createElement(AsyncMaterialSurveyText, null);
|
|
76
63
|
break;
|
|
77
64
|
default:
|
|
78
|
-
Component =
|
|
65
|
+
Component = React.createElement(MaterialSurveyShimmer, null);
|
|
79
66
|
break;
|
|
80
67
|
}
|
|
81
|
-
return
|
|
82
|
-
fallback: null
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
children: jsx(MaterialSurveyInfo, {})
|
|
88
|
-
}), jsx(StyledMaterialSurveyContent, {
|
|
89
|
-
children: Component
|
|
90
|
-
})]
|
|
91
|
-
})
|
|
92
|
-
});
|
|
68
|
+
return React.createElement(React.Suspense, {
|
|
69
|
+
fallback: null
|
|
70
|
+
}, React.createElement(StyledMaterialSurveyWrapper, {
|
|
71
|
+
ref: ref,
|
|
72
|
+
vertical: vertical
|
|
73
|
+
}, React.createElement(StyledMaterialSurveyInfo, null, React.createElement(MaterialSurveyInfo, null)), React.createElement(StyledMaterialSurveyContent, null, Component)));
|
|
93
74
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
75
|
+
const MaterialSurveyContainer = ({
|
|
76
|
+
materialSurveyId,
|
|
77
|
+
userId,
|
|
78
|
+
onSubmit,
|
|
79
|
+
onNext,
|
|
80
|
+
__intl
|
|
81
|
+
}) => {
|
|
82
|
+
return React.createElement(RawEliceIntlProvider, {
|
|
83
|
+
value: __intl
|
|
84
|
+
}, React.createElement(MaterialSurveyProvider, {
|
|
85
|
+
materialSurveyId: materialSurveyId,
|
|
86
|
+
userId: userId,
|
|
87
|
+
onSubmit: onSubmit,
|
|
88
|
+
onNext: onNext
|
|
89
|
+
}, React.createElement(MaterialSurvey, null)));
|
|
110
90
|
};
|
|
111
91
|
var MaterialSurvey$1 = new IntlComponentBuilder(MaterialSurveyContainer).add('en', messageEn).add('ko', messageKo).addAsync('th', import('./locales/th.json.js')).addAsync('ja', import('./locales/ja.json.js')).build();
|
|
112
92
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Flex, Text, Shimmer, Vspace } from '@elice/blocks';
|
|
3
3
|
import { base } from '@elice/design-tokens';
|
|
4
4
|
import { MarkdownSSR } from '@elice/markdown';
|
|
@@ -7,72 +7,66 @@ import styled from 'styled-components';
|
|
|
7
7
|
import SurveyContentBox from '../shared/SurveyContentBox.js';
|
|
8
8
|
import { useMaterialSurveyState } from './context/MaterialSurveyContext.js';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
|
|
11
11
|
componentId: "sc-1b9l43w-0"
|
|
12
12
|
})(["", ""], EliceWysiwygEditorTheme.resetMarkdownSSR);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
materialSurvey
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
borderRadius: '4px',
|
|
71
|
-
width: "100%",
|
|
72
|
-
height: '40px'
|
|
73
|
-
})]
|
|
74
|
-
})]
|
|
75
|
-
});
|
|
13
|
+
const MaterialSurveyInfo = () => {
|
|
14
|
+
const {
|
|
15
|
+
materialSurvey
|
|
16
|
+
} = useMaterialSurveyState();
|
|
17
|
+
return React.createElement(SurveyContentBox, {
|
|
18
|
+
title: materialSurvey === null || materialSurvey === void 0 ? void 0 : materialSurvey.title
|
|
19
|
+
}, materialSurvey ? React.createElement(Flex, null, React.createElement(Text, {
|
|
20
|
+
bold: true,
|
|
21
|
+
size: "large",
|
|
22
|
+
customStyles: {
|
|
23
|
+
color: base.color.primary3,
|
|
24
|
+
marginRight: '0.5rem'
|
|
25
|
+
}
|
|
26
|
+
}, 'Q.'), React.createElement(Text, {
|
|
27
|
+
bold: true,
|
|
28
|
+
role: "white",
|
|
29
|
+
size: "large",
|
|
30
|
+
wordBreak: "break-word"
|
|
31
|
+
}, materialSurvey.questionInfoList[0].questionTitle)) : React.createElement(Shimmer, {
|
|
32
|
+
dark: true,
|
|
33
|
+
borderRadius: '4px',
|
|
34
|
+
width: "80%",
|
|
35
|
+
height: '40px'
|
|
36
|
+
}), React.createElement(Vspace, {
|
|
37
|
+
height: 1
|
|
38
|
+
}), materialSurvey ? React.createElement(StyledMarkdownSSR, {
|
|
39
|
+
children: materialSurvey.questionInfoList[0].questionDescription,
|
|
40
|
+
dark: true,
|
|
41
|
+
paddingx: 0,
|
|
42
|
+
paddingy: 0
|
|
43
|
+
}) : React.createElement(React.Fragment, null, React.createElement(Shimmer, {
|
|
44
|
+
dark: true,
|
|
45
|
+
borderRadius: '4px',
|
|
46
|
+
width: "80%",
|
|
47
|
+
height: '40px'
|
|
48
|
+
}), React.createElement(Vspace, {
|
|
49
|
+
height: 1
|
|
50
|
+
}), React.createElement(Shimmer, {
|
|
51
|
+
dark: true,
|
|
52
|
+
borderRadius: '4px',
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: '40px'
|
|
55
|
+
}), React.createElement(Vspace, {
|
|
56
|
+
height: 1
|
|
57
|
+
}), React.createElement(Shimmer, {
|
|
58
|
+
dark: true,
|
|
59
|
+
borderRadius: '4px',
|
|
60
|
+
width: "100%",
|
|
61
|
+
height: '40px'
|
|
62
|
+
}), React.createElement(Vspace, {
|
|
63
|
+
height: 1
|
|
64
|
+
}), React.createElement(Shimmer, {
|
|
65
|
+
dark: true,
|
|
66
|
+
borderRadius: '4px',
|
|
67
|
+
width: "100%",
|
|
68
|
+
height: '40px'
|
|
69
|
+
})));
|
|
76
70
|
};
|
|
77
71
|
|
|
78
72
|
export { MaterialSurveyInfo as default };
|