@elice/material-survey 1.240401.0 → 1.240508.0-globalization.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.
- package/cjs/components/material-survey/MaterialSurvey.d.ts +3 -2
- package/cjs/components/material-survey/MaterialSurvey.js +12 -9
- package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +6 -4
- package/cjs/components/material-survey/MaterialSurveySelectOne.js +6 -4
- package/cjs/components/material-survey/MaterialSurveyText.js +7 -5
- package/cjs/components/material-survey/SurveyResultBadge.js +5 -3
- package/cjs/components/material-survey/SurveySubmitStatusText.js +6 -4
- package/cjs/components/material-survey/locales/en.json.js +7 -0
- package/cjs/components/material-survey/locales/index.d.ts +3 -0
- package/cjs/components/material-survey/locales/ko.json.js +7 -0
- package/cjs/components/material-survey/locales/th.json.js +7 -0
- package/cjs/components/material-survey-edit/MaterialSurveyEdit.d.ts +4 -4
- package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +16 -10
- package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +22 -20
- package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +10 -8
- package/cjs/components/material-survey-edit/locales/en.json.js +7 -0
- package/cjs/components/material-survey-edit/locales/index.d.ts +3 -0
- package/cjs/components/material-survey-edit/locales/ko.json.js +7 -0
- package/cjs/components/material-survey-edit/locales/th.json.js +7 -0
- package/cjs/components/shared/SurveyContentBox.js +5 -3
- package/es/components/material-survey/MaterialSurvey.d.ts +3 -2
- package/es/components/material-survey/MaterialSurvey.js +12 -10
- package/es/components/material-survey/MaterialSurveySelectMultiple.js +4 -2
- package/es/components/material-survey/MaterialSurveySelectOne.js +4 -2
- package/es/components/material-survey/MaterialSurveyText.js +4 -2
- package/es/components/material-survey/SurveyResultBadge.js +4 -2
- package/es/components/material-survey/SurveySubmitStatusText.js +4 -2
- package/es/components/material-survey/locales/en.json.js +3 -0
- package/es/components/material-survey/locales/index.d.ts +3 -0
- package/es/components/material-survey/locales/ko.json.js +3 -0
- package/es/components/material-survey/locales/th.json.js +3 -0
- package/es/components/material-survey-edit/MaterialSurveyEdit.d.ts +4 -4
- package/es/components/material-survey-edit/MaterialSurveyEdit.js +16 -11
- package/es/components/material-survey-edit/MaterialSurveyEditContent.js +10 -8
- package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +6 -4
- package/es/components/material-survey-edit/locales/en.json.js +3 -0
- package/es/components/material-survey-edit/locales/index.d.ts +3 -0
- package/es/components/material-survey-edit/locales/ko.json.js +3 -0
- package/es/components/material-survey-edit/locales/th.json.js +3 -0
- package/es/components/shared/SurveyContentBox.js +4 -2
- package/package.json +6 -6
- package/cjs/components/material-survey/MaterialSurvey.i18n.d.ts +0 -16
- package/cjs/components/material-survey/MaterialSurvey.i18n.js +0 -35
- package/cjs/components/material-survey-edit/locales.d.ts +0 -20
- package/cjs/components/material-survey-edit/locales.js +0 -43
- package/es/components/material-survey/MaterialSurvey.i18n.d.ts +0 -16
- package/es/components/material-survey/MaterialSurvey.i18n.js +0 -32
- package/es/components/material-survey-edit/locales.d.ts +0 -20
- package/es/components/material-survey-edit/locales.js +0 -40
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { WithIntlComponentBuilderProps } from '@elice/intl';
|
|
2
3
|
import type { MaterialSurveyProps } from './context/MaterialSurveyContext';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialSurveyProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var reactUse = require('react-use');
|
|
8
7
|
var designTokens = require('@elice/design-tokens');
|
|
8
|
+
var intl = require('@elice/intl');
|
|
9
9
|
var types = require('@elice/types');
|
|
10
10
|
var styled = require('styled-components');
|
|
11
11
|
var MaterialSurveyContext = require('./context/MaterialSurveyContext.js');
|
|
12
|
+
var en = require('./locales/en.json.js');
|
|
13
|
+
var ko = require('./locales/ko.json.js');
|
|
14
|
+
var th = require('./locales/th.json.js');
|
|
12
15
|
var MaterialSurveyShimmer = require('./MaterialSurveyShimmer.js');
|
|
13
16
|
var MaterialSurveyInfo = require('./MaterialSurveyInfo.js');
|
|
14
|
-
var MaterialSurvey_i18n = require('./MaterialSurvey.i18n.js');
|
|
15
17
|
|
|
16
18
|
const AsyncMaterialSurveySelectMultiple = React.lazy(() => Promise.resolve().then(function () { return require('./MaterialSurveySelectMultiple.js'); }));
|
|
17
19
|
const AsyncMaterialSurveyText = React.lazy(() => Promise.resolve().then(function () { return require('./MaterialSurveyText.js'); }));
|
|
@@ -78,14 +80,14 @@ const MaterialSurvey = () => {
|
|
|
78
80
|
const MaterialSurveyContainer = ({
|
|
79
81
|
materialSurveyId,
|
|
80
82
|
userId,
|
|
81
|
-
locale = 'en',
|
|
82
83
|
onSubmit,
|
|
83
|
-
onNext
|
|
84
|
+
onNext,
|
|
85
|
+
__intl
|
|
84
86
|
}) => {
|
|
85
|
-
return React.createElement(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
return React.createElement(intl.RawEliceIntlProvider, {
|
|
88
|
+
value: {
|
|
89
|
+
intl: __intl
|
|
90
|
+
}
|
|
89
91
|
}, React.createElement(MaterialSurveyContext.MaterialSurveyProvider, {
|
|
90
92
|
materialSurveyId: materialSurveyId,
|
|
91
93
|
userId: userId,
|
|
@@ -93,5 +95,6 @@ const MaterialSurveyContainer = ({
|
|
|
93
95
|
onNext: onNext
|
|
94
96
|
}, React.createElement(MaterialSurvey, null)));
|
|
95
97
|
};
|
|
98
|
+
var MaterialSurvey$1 = new intl.IntlComponentBuilder(MaterialSurveyContainer).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
|
|
96
99
|
|
|
97
|
-
exports.default =
|
|
100
|
+
exports.default = MaterialSurvey$1;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var apiClient = require('@elice/api-client');
|
|
7
|
+
var intl = require('@elice/intl');
|
|
8
8
|
var index = require('../../helpers/index.js');
|
|
9
9
|
require('../shared/question-radio/QuestionRadio.js');
|
|
10
10
|
require('../shared/question-radio/QuestionRadioOption.js');
|
|
@@ -31,7 +31,9 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
31
31
|
refreshOrgMaterialSurvey
|
|
32
32
|
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
33
33
|
// state
|
|
34
|
-
const
|
|
34
|
+
const {
|
|
35
|
+
intl: intl$1
|
|
36
|
+
} = intl.useRawEliceIntl();
|
|
35
37
|
const [selectedAnswer, setSelectedAnswer] = React.useState([]);
|
|
36
38
|
const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
|
|
37
39
|
const [submitStatus, setSubmitStatus] = React.useState('idle');
|
|
@@ -122,7 +124,7 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
122
124
|
}
|
|
123
125
|
};
|
|
124
126
|
return React.createElement(SurveyContentBox.default, {
|
|
125
|
-
title: intl.formatMessage({
|
|
127
|
+
title: intl$1.formatMessage({
|
|
126
128
|
id: 'materialSurvey.myAnswer'
|
|
127
129
|
}),
|
|
128
130
|
onNext: onNext,
|
|
@@ -140,7 +142,7 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
140
142
|
transparent: false,
|
|
141
143
|
role: 'primary',
|
|
142
144
|
onClick: handleSubmit,
|
|
143
|
-
children: intl.formatMessage({
|
|
145
|
+
children: intl$1.formatMessage({
|
|
144
146
|
id: 'materialSurvey.submit'
|
|
145
147
|
})
|
|
146
148
|
}]
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var apiClient = require('@elice/api-client');
|
|
7
|
+
var intl = require('@elice/intl');
|
|
8
8
|
var index = require('../../helpers/index.js');
|
|
9
9
|
var QuestionRadio = require('../shared/question-radio/QuestionRadio.js');
|
|
10
10
|
var QuestionRadioOption = require('../shared/question-radio/QuestionRadioOption.js');
|
|
@@ -30,7 +30,9 @@ const MaterialSurveySelectOne = () => {
|
|
|
30
30
|
refreshOrgMaterialSurvey
|
|
31
31
|
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
32
32
|
// state
|
|
33
|
-
const
|
|
33
|
+
const {
|
|
34
|
+
intl: intl$1
|
|
35
|
+
} = intl.useRawEliceIntl();
|
|
34
36
|
const [selectedAnswer, setSelectedAnswer] = React.useState();
|
|
35
37
|
const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
|
|
36
38
|
const [submitStatus, setSubmitStatus] = React.useState('idle');
|
|
@@ -110,7 +112,7 @@ const MaterialSurveySelectOne = () => {
|
|
|
110
112
|
}
|
|
111
113
|
};
|
|
112
114
|
return React.createElement(SurveyContentBox.default, {
|
|
113
|
-
title: intl.formatMessage({
|
|
115
|
+
title: intl$1.formatMessage({
|
|
114
116
|
id: 'materialSurvey.myAnswer'
|
|
115
117
|
}),
|
|
116
118
|
onNext: onNext,
|
|
@@ -128,7 +130,7 @@ const MaterialSurveySelectOne = () => {
|
|
|
128
130
|
transparent: false,
|
|
129
131
|
role: 'primary',
|
|
130
132
|
onClick: handleSubmit,
|
|
131
|
-
children: intl.formatMessage({
|
|
133
|
+
children: intl$1.formatMessage({
|
|
132
134
|
id: 'materialSurvey.submit'
|
|
133
135
|
})
|
|
134
136
|
}]
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var apiClient = require('@elice/api-client');
|
|
8
7
|
var designTokens = require('@elice/design-tokens');
|
|
8
|
+
var intl = require('@elice/intl');
|
|
9
9
|
var styled = require('styled-components');
|
|
10
10
|
var index = require('../../helpers/index.js');
|
|
11
11
|
var SurveyContentBox = require('../shared/SurveyContentBox.js');
|
|
@@ -31,7 +31,9 @@ const MaterialSurveyText = () => {
|
|
|
31
31
|
refreshOrgMaterialSurvey
|
|
32
32
|
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
33
33
|
// state
|
|
34
|
-
const
|
|
34
|
+
const {
|
|
35
|
+
intl: intl$1
|
|
36
|
+
} = intl.useRawEliceIntl();
|
|
35
37
|
const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
|
|
36
38
|
const [submitStatus, setSubmitStatus] = React.useState('idle');
|
|
37
39
|
const [answer, setAnswer] = React.useState('');
|
|
@@ -113,7 +115,7 @@ const MaterialSurveyText = () => {
|
|
|
113
115
|
type: 'text',
|
|
114
116
|
autoFocus: answer.length === 0,
|
|
115
117
|
disabled: submitStatus === 'pending' || index.checkUserLectureTestEnded(lecture) || !!userId,
|
|
116
|
-
placeholder: intl.formatMessage({
|
|
118
|
+
placeholder: intl$1.formatMessage({
|
|
117
119
|
id: 'materialSurvey.text.placeholder'
|
|
118
120
|
}),
|
|
119
121
|
value: answer,
|
|
@@ -122,7 +124,7 @@ const MaterialSurveyText = () => {
|
|
|
122
124
|
}
|
|
123
125
|
};
|
|
124
126
|
return React.createElement(SurveyContentBox.default, {
|
|
125
|
-
title: intl.formatMessage({
|
|
127
|
+
title: intl$1.formatMessage({
|
|
126
128
|
id: 'materialSurvey.myAnswer'
|
|
127
129
|
}),
|
|
128
130
|
onNext: onNext,
|
|
@@ -134,7 +136,7 @@ const MaterialSurveyText = () => {
|
|
|
134
136
|
}),
|
|
135
137
|
footerActions: [{
|
|
136
138
|
border: true,
|
|
137
|
-
children: intl.formatMessage({
|
|
139
|
+
children: intl$1.formatMessage({
|
|
138
140
|
id: 'materialSurvey.submit'
|
|
139
141
|
}),
|
|
140
142
|
disabled: answer.length === 0 || index.checkUserLectureTestEnded(lecture) || !!userId,
|
|
@@ -3,21 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var blocks = require('@elice/blocks');
|
|
7
|
+
var intl = require('@elice/intl');
|
|
8
8
|
var index = require('../../helpers/index.js');
|
|
9
9
|
|
|
10
10
|
const SurveyResultBadge = ({
|
|
11
11
|
materialSurveyResponse
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const {
|
|
14
|
+
intl: intl$1
|
|
15
|
+
} = intl.useRawEliceIntl();
|
|
14
16
|
const status = React.useMemo(() => index.getSurveyResultStatus(materialSurveyResponse), [materialSurveyResponse]);
|
|
15
17
|
switch (status) {
|
|
16
18
|
case index.SurveyResultStatus.Submitted:
|
|
17
19
|
return React.createElement(blocks.BadgeNext, {
|
|
18
20
|
type: "quiet",
|
|
19
21
|
role: "primary"
|
|
20
|
-
}, intl.formatMessage({
|
|
22
|
+
}, intl$1.formatMessage({
|
|
21
23
|
id: 'materialSurvey.resultStatus.submitted'
|
|
22
24
|
}));
|
|
23
25
|
default:
|
|
@@ -3,26 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var blocks = require('@elice/blocks');
|
|
7
|
+
var intl = require('@elice/intl');
|
|
8
8
|
|
|
9
9
|
const SurveySubmitStatusText = ({
|
|
10
10
|
status
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
12
|
+
const {
|
|
13
|
+
intl: intl$1
|
|
14
|
+
} = intl.useRawEliceIntl();
|
|
13
15
|
switch (status) {
|
|
14
16
|
case 'resolved':
|
|
15
17
|
return React.createElement(blocks.StatusText, {
|
|
16
18
|
role: "success",
|
|
17
19
|
size: "small"
|
|
18
|
-
}, intl.formatMessage({
|
|
20
|
+
}, intl$1.formatMessage({
|
|
19
21
|
id: 'materialSurvey.submitStatus.success'
|
|
20
22
|
}));
|
|
21
23
|
case 'rejected':
|
|
22
24
|
return React.createElement(blocks.StatusText, {
|
|
23
25
|
role: "danger",
|
|
24
26
|
size: "small"
|
|
25
|
-
}, intl.formatMessage({
|
|
27
|
+
}, intl$1.formatMessage({
|
|
26
28
|
id: 'materialSurvey.submitStatus.failure'
|
|
27
29
|
}));
|
|
28
30
|
default:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageEn = {"materialSurvey.error":"Failed to fetch survey","materialSurvey.submit":"Submit","materialSurvey.submittedAnswer":"Submitted Answer","materialSurvey.next":"Next question >","materialSurvey.myAnswer":"My answer","materialSurvey.empty.title":"Survey is now preparing.","materialSurvey.empty.description":"Please check again after survey posting!","materialSurvey.survey.empty.title":"Survey is now preparing.","materialSurvey.survey.empty.description":"Please check again after survey posting!","materialSurvey.submitStatus.success":"Submitted","materialSurvey.submitStatus.failure":"Failed to submit","materialSurvey.resultStatus.submitted":"Submitted","materialSurvey.text.placeholder":"please fill the answer"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageEn;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageKo = {"materialSurvey.error":"설문조사를 불러오는데 실패했습니다.\n잠시 후 다시 시도해주세요.","materialSurvey.submit":"제출","materialSurvey.submittedAnswer":"제출한 답","materialSurvey.next":"다음으로 이동 >","materialSurvey.myAnswer":"내 답변","materialSurvey.empty.title":"설문조사가 준비 중 입니다.","materialSurvey.empty.description":"설문조사 게시 후 다시 확인해주세요!","materialSurvey.survey.empty.title":"설문조사가 준비 중 입니다.","materialSurvey.survey.empty.description":"설문지 게시 후 다시 확인해주세요!","materialSurvey.submitStatus.success":"제출되었습니다.","materialSurvey.submitStatus.failure":"제출에 실패하였습니다.","materialSurvey.resultStatus.submitted":"제출완료","materialSurvey.text.placeholder":"답변을 입력하세요."};
|
|
6
|
+
|
|
7
|
+
exports.default = messageKo;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageTh = {"materialSurvey.error":"การโหลดแบบสำรวจล้มเหลว\nโปรดลองอีกครั้งในภายหลัง","materialSurvey.submit":"ส่ง","materialSurvey.submittedAnswer":"ส่งคำตอบ","materialSurvey.next":"ย้ายไปที่ต่อไป >","materialSurvey.myAnswer":"การตอบของฉัน","materialSurvey.empty.title":"การสำรวจกำลังจะเริ่มขึ้นค่ะ.","materialSurvey.empty.description":"โปสต์แบบสำรวจแล้ว กรุณาตรวจสอบอีกครั้งค่ะ!","materialSurvey.survey.empty.title":"การสำรวจกำลังจะเริ่มต้น โปรดรอสัก{_termCourseRoleEducator}่.","materialSurvey.survey.empty.description":"กรุณาตรวจสอบแบบสำรวจอีกครั้งหลังจากที่โพสต์แล้วค่ะ!","materialSurvey.submitStatus.success":"ส่งแล้วครับ.","materialSurvey.submitStatus.failure":"การส่งล้มเหลวแล้วค่ะ.","materialSurvey.resultStatus.submitted":"การส่งแบบทำเสร็จแล้ว","materialSurvey.text.placeholder":"โปรดใส่คำตอบของคุณ."};
|
|
6
|
+
|
|
7
|
+
exports.default = messageTh;
|
|
@@ -12,8 +12,6 @@ export interface MaterialSurveyEditProps {
|
|
|
12
12
|
* When true, cannot change `optionType`, `optionInfo` and `answerInfo`.
|
|
13
13
|
*/
|
|
14
14
|
disabled?: boolean;
|
|
15
|
-
/** Locale of edit form. */
|
|
16
|
-
locale: string;
|
|
17
15
|
/** Handle form change event. */
|
|
18
16
|
onChange: (value: MaterialSurveyEditValue) => void;
|
|
19
17
|
/** Handle form state changes. (`FormState` from react-hook-form) */
|
|
@@ -21,5 +19,7 @@ export interface MaterialSurveyEditProps {
|
|
|
21
19
|
/** Handle file upload. */
|
|
22
20
|
onFileUploadRequest: MarkdownEditorFileUploadReqFn;
|
|
23
21
|
}
|
|
24
|
-
declare const
|
|
25
|
-
|
|
22
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<MaterialSurveyEditProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
|
|
23
|
+
__intl: import("@elice/intl").EliceIntlShape;
|
|
24
|
+
} & React.RefAttributes<HTMLFormElement>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<HTMLFormElement>>;
|
|
25
|
+
export default _default;
|
|
@@ -4,20 +4,25 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactHookForm = require('react-hook-form');
|
|
7
|
-
var
|
|
7
|
+
var intl = require('@elice/intl');
|
|
8
8
|
var materialSharedUtils = require('@elice/material-shared-utils');
|
|
9
9
|
var editValue = require('./utils/editValue.js');
|
|
10
10
|
var context = require('./context.js');
|
|
11
|
-
var
|
|
11
|
+
var en = require('./locales/en.json.js');
|
|
12
|
+
var ko = require('./locales/ko.json.js');
|
|
13
|
+
var th = require('./locales/th.json.js');
|
|
12
14
|
var MaterialSurveyEditContent = require('./MaterialSurveyEditContent.js');
|
|
13
15
|
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
14
19
|
const MaterialSurveyEdit = React.forwardRef(({
|
|
15
20
|
value,
|
|
16
21
|
disabled = false,
|
|
17
|
-
locale = 'en',
|
|
18
22
|
onChange,
|
|
19
23
|
onFormStateChange,
|
|
20
|
-
onFileUploadRequest
|
|
24
|
+
onFileUploadRequest,
|
|
25
|
+
__intl
|
|
21
26
|
}, ref) => {
|
|
22
27
|
const formElRef = React.useRef(null);
|
|
23
28
|
const useFormMethods = reactHookForm.useForm({
|
|
@@ -73,18 +78,19 @@ const MaterialSurveyEdit = React.forwardRef(({
|
|
|
73
78
|
//
|
|
74
79
|
//
|
|
75
80
|
//
|
|
76
|
-
return React.createElement(
|
|
81
|
+
return React.createElement(intl.RawEliceIntlProvider, {
|
|
82
|
+
value: {
|
|
83
|
+
intl: __intl
|
|
84
|
+
}
|
|
85
|
+
}, React.createElement("form", {
|
|
77
86
|
ref: formElRef
|
|
78
87
|
}, React.createElement(context.default.Provider, {
|
|
79
88
|
value: {
|
|
80
89
|
disabled,
|
|
81
90
|
onFileUploadRequest
|
|
82
91
|
}
|
|
83
|
-
}, React.createElement(reactIntl.IntlProvider, {
|
|
84
|
-
locale: locale,
|
|
85
|
-
defaultLocale: "en",
|
|
86
|
-
messages: locale in locales ? locales[locale] : locales.en
|
|
87
92
|
}, React.createElement(reactHookForm.FormProvider, Object.assign({}, useFormMethods), React.createElement(MaterialSurveyEditContent.default, null)))));
|
|
88
93
|
});
|
|
94
|
+
var MaterialSurveyEdit$1 = new intl.IntlComponentBuilder(MaterialSurveyEdit).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
|
|
89
95
|
|
|
90
|
-
exports.default = MaterialSurveyEdit;
|
|
96
|
+
exports.default = MaterialSurveyEdit$1;
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactHookForm = require('react-hook-form');
|
|
7
|
-
var reactIntl = require('react-intl');
|
|
8
7
|
var blocks = require('@elice/blocks');
|
|
8
|
+
var intl = require('@elice/intl');
|
|
9
9
|
var markdown = require('@elice/markdown');
|
|
10
10
|
var types = require('@elice/types');
|
|
11
11
|
var styled = require('styled-components');
|
|
@@ -19,7 +19,9 @@ const StyledSurveyOptionTypeSelectWrap = styled.div.withConfig({
|
|
|
19
19
|
componentId: "sc-r4ms68-0"
|
|
20
20
|
})(["display:flex;max-width:12rem;"]);
|
|
21
21
|
const MaterialSurveyEditContent = () => {
|
|
22
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
intl: intl$1
|
|
24
|
+
} = intl.useRawEliceIntl();
|
|
23
25
|
const {
|
|
24
26
|
disabled,
|
|
25
27
|
onFileUploadRequest
|
|
@@ -42,14 +44,14 @@ const MaterialSurveyEditContent = () => {
|
|
|
42
44
|
// add default option info
|
|
43
45
|
[{
|
|
44
46
|
id: randomId.createRandomId(),
|
|
45
|
-
value: intl.formatMessage({
|
|
47
|
+
value: intl$1.formatMessage({
|
|
46
48
|
id: 'common.option'
|
|
47
49
|
}, {
|
|
48
50
|
number: 1
|
|
49
51
|
})
|
|
50
52
|
}, {
|
|
51
53
|
id: randomId.createRandomId(),
|
|
52
|
-
value: intl.formatMessage({
|
|
54
|
+
value: intl$1.formatMessage({
|
|
53
55
|
id: 'common.option'
|
|
54
56
|
}, {
|
|
55
57
|
number: 2
|
|
@@ -64,7 +66,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
64
66
|
setValue('questionInfoList.0.optionInfo', get());
|
|
65
67
|
},
|
|
66
68
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
-
[watchedOptionType, setValue, intl]);
|
|
69
|
+
[watchedOptionType, setValue, intl$1]);
|
|
68
70
|
/**
|
|
69
71
|
* Input of option info and answer info,
|
|
70
72
|
* according to option type.
|
|
@@ -87,8 +89,8 @@ const MaterialSurveyEditContent = () => {
|
|
|
87
89
|
label: React.createElement(blocks.Label, {
|
|
88
90
|
size: "small",
|
|
89
91
|
required: true
|
|
90
|
-
},
|
|
91
|
-
id:
|
|
92
|
+
}, intl$1.formatMessage({
|
|
93
|
+
id: 'content.title'
|
|
92
94
|
})),
|
|
93
95
|
input: React.createElement(reactHookForm.Controller, {
|
|
94
96
|
control: control,
|
|
@@ -96,13 +98,13 @@ const MaterialSurveyEditContent = () => {
|
|
|
96
98
|
rules: {
|
|
97
99
|
required: {
|
|
98
100
|
value: true,
|
|
99
|
-
message: intl.formatMessage({
|
|
101
|
+
message: intl$1.formatMessage({
|
|
100
102
|
id: 'content.title.errorMessage.required'
|
|
101
103
|
})
|
|
102
104
|
},
|
|
103
105
|
minLength: {
|
|
104
106
|
value: MIN_TEXT_LENGTH,
|
|
105
|
-
message: intl.formatMessage({
|
|
107
|
+
message: intl$1.formatMessage({
|
|
106
108
|
id: 'common.errorMessage.range'
|
|
107
109
|
}, {
|
|
108
110
|
min: MIN_TEXT_LENGTH,
|
|
@@ -111,7 +113,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
111
113
|
},
|
|
112
114
|
maxLength: {
|
|
113
115
|
value: MAX_TEXT_LENGTH,
|
|
114
|
-
message: intl.formatMessage({
|
|
116
|
+
message: intl$1.formatMessage({
|
|
115
117
|
id: 'common.errorMessage.range'
|
|
116
118
|
}, {
|
|
117
119
|
min: MIN_TEXT_LENGTH,
|
|
@@ -129,7 +131,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
129
131
|
width: "full",
|
|
130
132
|
minLength: MIN_TEXT_LENGTH,
|
|
131
133
|
maxLength: MAX_TEXT_LENGTH,
|
|
132
|
-
placeholder: intl.formatMessage({
|
|
134
|
+
placeholder: intl$1.formatMessage({
|
|
133
135
|
id: 'content.title.placeholder'
|
|
134
136
|
}),
|
|
135
137
|
invalid: fieldState.invalid,
|
|
@@ -146,8 +148,8 @@ const MaterialSurveyEditContent = () => {
|
|
|
146
148
|
return React.createElement(blocks.FormInputVerticalLayout, {
|
|
147
149
|
label: React.createElement(blocks.Label, {
|
|
148
150
|
size: "small"
|
|
149
|
-
},
|
|
150
|
-
id:
|
|
151
|
+
}, intl$1.formatMessage({
|
|
152
|
+
id: 'content.description.title'
|
|
151
153
|
})),
|
|
152
154
|
input: React.createElement(reactHookForm.Controller, {
|
|
153
155
|
control: control,
|
|
@@ -156,7 +158,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
156
158
|
field
|
|
157
159
|
}) => React.createElement(markdown.MarkdownEditor, Object.assign({
|
|
158
160
|
enableFooter: true,
|
|
159
|
-
placeholder: intl.formatMessage({
|
|
161
|
+
placeholder: intl$1.formatMessage({
|
|
160
162
|
id: 'content.description.placeholder'
|
|
161
163
|
}),
|
|
162
164
|
onFileUploadRequest: onFileUploadRequest
|
|
@@ -172,8 +174,8 @@ const MaterialSurveyEditContent = () => {
|
|
|
172
174
|
label: React.createElement(blocks.Label, {
|
|
173
175
|
size: "small",
|
|
174
176
|
required: true
|
|
175
|
-
},
|
|
176
|
-
id:
|
|
177
|
+
}, intl$1.formatMessage({
|
|
178
|
+
id: 'content.option.title'
|
|
177
179
|
})),
|
|
178
180
|
input: React.createElement(React.Fragment, null, React.createElement(reactHookForm.Controller, {
|
|
179
181
|
control: control,
|
|
@@ -181,7 +183,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
181
183
|
render: ({
|
|
182
184
|
field
|
|
183
185
|
}) => React.createElement(blocks.Tooltip, {
|
|
184
|
-
title: disabled ? intl.formatMessage({
|
|
186
|
+
title: disabled ? intl$1.formatMessage({
|
|
185
187
|
id: 'content.option.tooltip.disabled'
|
|
186
188
|
}) : undefined,
|
|
187
189
|
placement: "top-end"
|
|
@@ -193,17 +195,17 @@ const MaterialSurveyEditContent = () => {
|
|
|
193
195
|
onChange: v => field.onChange(Number(v))
|
|
194
196
|
}), React.createElement("option", {
|
|
195
197
|
value: types.enums.SurveyOptionType.SelectOne,
|
|
196
|
-
children: intl.formatMessage({
|
|
198
|
+
children: intl$1.formatMessage({
|
|
197
199
|
id: 'content.option.select.items.selectOne'
|
|
198
200
|
})
|
|
199
201
|
}), React.createElement("option", {
|
|
200
202
|
value: types.enums.SurveyOptionType.SelectMultiple,
|
|
201
|
-
children: intl.formatMessage({
|
|
203
|
+
children: intl$1.formatMessage({
|
|
202
204
|
id: 'content.option.select.items.selectMultiple'
|
|
203
205
|
})
|
|
204
206
|
}), React.createElement("option", {
|
|
205
207
|
value: types.enums.SurveyOptionType.Text,
|
|
206
|
-
children: intl.formatMessage({
|
|
208
|
+
children: intl$1.formatMessage({
|
|
207
209
|
id: 'content.option.select.items.text'
|
|
208
210
|
})
|
|
209
211
|
}))))
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactHookForm = require('react-hook-form');
|
|
7
|
-
var reactIntl = require('react-intl');
|
|
8
7
|
var blocks = require('@elice/blocks');
|
|
9
8
|
var icons = require('@elice/icons');
|
|
9
|
+
var intl = require('@elice/intl');
|
|
10
10
|
var styled = require('styled-components');
|
|
11
11
|
var randomId = require('./utils/randomId.js');
|
|
12
12
|
var context = require('./context.js');
|
|
@@ -20,7 +20,9 @@ const StyledInputGroup = styled.div.withConfig({
|
|
|
20
20
|
componentId: "sc-1eiyk6z-1"
|
|
21
21
|
})(["width:100%;.eb-input{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
22
22
|
const OptionSelectOne = () => {
|
|
23
|
-
const
|
|
23
|
+
const {
|
|
24
|
+
intl: intl$1
|
|
25
|
+
} = intl.useRawEliceIntl();
|
|
24
26
|
const {
|
|
25
27
|
disabled
|
|
26
28
|
} = context.useMaterialSurveyEditContext();
|
|
@@ -63,7 +65,7 @@ const OptionSelectOne = () => {
|
|
|
63
65
|
rules: {
|
|
64
66
|
required: {
|
|
65
67
|
value: true,
|
|
66
|
-
message: intl.formatMessage({
|
|
68
|
+
message: intl$1.formatMessage({
|
|
67
69
|
id: 'option.common.select.errorMessage.required'
|
|
68
70
|
})
|
|
69
71
|
}
|
|
@@ -76,11 +78,11 @@ const OptionSelectOne = () => {
|
|
|
76
78
|
return React.createElement(blocks.Input, Object.assign({
|
|
77
79
|
size: "small",
|
|
78
80
|
width: "full",
|
|
79
|
-
placeholder: intl.formatMessage({
|
|
81
|
+
placeholder: intl$1.formatMessage({
|
|
80
82
|
id: 'option.common.select.placeholder'
|
|
81
83
|
}),
|
|
82
84
|
suffix: React.createElement(blocks.Tooltip, {
|
|
83
|
-
title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl.formatMessage({
|
|
85
|
+
title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl$1.formatMessage({
|
|
84
86
|
id: 'option.common.select.tooltip.minOptionInfoItem'
|
|
85
87
|
}) : undefined,
|
|
86
88
|
placement: "top-start"
|
|
@@ -101,7 +103,7 @@ const OptionSelectOne = () => {
|
|
|
101
103
|
}))), React.createElement(blocks.Vspace, {
|
|
102
104
|
height: 0.5
|
|
103
105
|
}), React.createElement(blocks.Tooltip, {
|
|
104
|
-
title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl.formatMessage({
|
|
106
|
+
title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl$1.formatMessage({
|
|
105
107
|
id: 'option.common.select.tooltip.maxOptionInfoItem'
|
|
106
108
|
}) : undefined,
|
|
107
109
|
placement: "bottom"
|
|
@@ -115,8 +117,8 @@ const OptionSelectOne = () => {
|
|
|
115
117
|
}),
|
|
116
118
|
disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
|
|
117
119
|
onClick: appendOptionInfo
|
|
118
|
-
},
|
|
119
|
-
id:
|
|
120
|
+
}, intl$1.formatMessage({
|
|
121
|
+
id: 'option.common.select.addButton'
|
|
120
122
|
})))));
|
|
121
123
|
};
|
|
122
124
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageEn = {"common.option":"Option {number}","common.errorMessage.range":"Please enter within {min} ~ {max} characters.","content.title":"Question","content.title.errorMessage.required":"Please fill the question.","content.title.placeholder":"Please enter question.","content.description.title":"Detailed Contents","content.description.placeholder":"Please enter a detailed question description or image, etc.","content.option.title":"Answer","content.option.tooltip.disabled":"Editing is not possible if the question is public or if there are {_termPathRoleStudent} who have submitted the question.\nYou can check the configured question in the Learner's {_termLibraryLecturePage} tab on the left.","content.option.select.items.selectOne":"Single Choice","content.option.select.items.selectMultiple":"Multiple Choice","content.option.select.items.text":"Short Answer","option.common.select.errorMessage.required":"Please enter options.","option.common.select.placeholder":"Enter options","option.common.select.tooltip.minOptionInfoItem":"You must enter at least 2 options.","option.common.select.tooltip.maxOptionInfoItem":"You cannot enter more than 20 options.","option.common.select.addButton":"Add Option"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageEn;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageKo = {"common.option":"옵션 {number}","common.errorMessage.range":"{min} ~ {max}자 이내로 입력해주세요.","content.title":"질문","content.title.errorMessage.required":"질문을 입력해주세요.","content.title.placeholder":"질문을 입력해주세요.","content.description.title":"세부 내용","content.description.placeholder":"자세한 질문 설명이나 이미지 등을 입력해주세요.","content.option.title":"답변","content.option.tooltip.disabled":"설문 조사가 공개된 상태이거나 제출한 {_termPathRoleStudent}이 존재하면\n수정이 불가능합니다.","content.option.select.items.selectOne":"객관식 (단일 답변)","content.option.select.items.selectMultiple":"객관식 (복수 답변)","content.option.select.items.text":"주관식 답변","option.common.select.errorMessage.required":"선택지를 입력해주세요.","option.common.select.placeholder":"선택지 입력","option.common.select.tooltip.minOptionInfoItem":"선택지는 2개 이상 입력해야 합니다.","option.common.select.tooltip.maxOptionInfoItem":"선택지는 20개 초과하여 입력할 수 없습니다.","option.common.select.addButton":"보기 추가"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageKo;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var messageTh = {"common.option":"ตัวเลือก {number}","common.errorMessage.range":"โปรดป้อนข้อความระหว่าง {min} ถึง {max} ตัวอักษร","content.title":"คำถาม","content.title.errorMessage.required":"กรุณาใส่คำถาม","content.title.placeholder":"กรุณาใส่คำถาม","content.description.title":"รายละเอียด","content.description.placeholder":"โปรดใส่คำอธิบายหรือรูปภาพสำหรับคำถามของคุณ","content.option.title":"คำตอบ","content.option.tooltip.disabled":"หากการสำรวจถูกเปิดเผยแล้วหรือมี{_termCourseRoleStudent}ที่ส่งแล้ว\nจะไม่สามารถแก้ไขได้","content.option.select.items.selectOne":"ปรนัย (เลือกหนึ่ง)","content.option.select.items.selectMultiple":"ปรนัย (เลือกหลายอย่าง)","content.option.select.items.text":"คำตอบอัตนัย","option.common.select.errorMessage.required":"กรุณาใส่ตัวเลือก","option.common.select.placeholder":"ใส่ตัวเลือก","option.common.select.tooltip.minOptionInfoItem":"ต้องใส่ตัวเลือกอย่างน้อย 2 ตัว","option.common.select.tooltip.maxOptionInfoItem":"ไม่สามารถใส่ตัวเลือกได้เกิน 20 ตัว","option.common.select.addButton":"เพิ่มตัวเลือก"};
|
|
6
|
+
|
|
7
|
+
exports.default = messageTh;
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var reactIntl = require('react-intl');
|
|
8
7
|
var blocks = require('@elice/blocks');
|
|
9
8
|
var designTokens = require('@elice/design-tokens');
|
|
9
|
+
var intl = require('@elice/intl');
|
|
10
10
|
var styled = require('styled-components');
|
|
11
11
|
var MaterialSurveyContext = require('../material-survey/context/MaterialSurveyContext.js');
|
|
12
12
|
|
|
@@ -60,7 +60,9 @@ const SurveyContentBox = _a => {
|
|
|
60
60
|
onNext
|
|
61
61
|
} = _a,
|
|
62
62
|
props = tslib.__rest(_a, ["children", "footerActions", "title", "submitResult", "submitStatus", "onNext"]);
|
|
63
|
-
const
|
|
63
|
+
const {
|
|
64
|
+
intl: intl$1
|
|
65
|
+
} = intl.useRawEliceIntl();
|
|
64
66
|
const {
|
|
65
67
|
vertical
|
|
66
68
|
} = MaterialSurveyContext.useMaterialSurveyState();
|
|
@@ -86,7 +88,7 @@ const SurveyContentBox = _a => {
|
|
|
86
88
|
transparent: false,
|
|
87
89
|
role: "lightpurple",
|
|
88
90
|
onClick: onNext
|
|
89
|
-
}, intl.formatMessage({
|
|
91
|
+
}, intl$1.formatMessage({
|
|
90
92
|
id: 'materialSurvey.next'
|
|
91
93
|
})) : null), React.createElement(StyledQuestionBoxFooterStatus, {
|
|
92
94
|
vertical: vertical
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { WithIntlComponentBuilderProps } from '@elice/intl';
|
|
2
3
|
import type { MaterialSurveyProps } from './context/MaterialSurveyContext';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<import("@elice/intl").IntlComponentExtraProps & Omit<WithIntlComponentBuilderProps<MaterialSurveyProps>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & React.RefAttributes<any>>;
|
|
5
|
+
export default _default;
|