@elice/material-survey 1.240401.0 → 1.240508.0-globalization.1
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 +9 -10
- package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +4 -4
- package/cjs/components/material-survey/MaterialSurveySelectOne.js +4 -4
- package/cjs/components/material-survey/MaterialSurveyText.js +5 -5
- package/cjs/components/material-survey/SurveyResultBadge.js +3 -3
- package/cjs/components/material-survey/SurveySubmitStatusText.js +4 -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 +12 -10
- package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +20 -20
- package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +8 -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 +3 -3
- package/es/components/material-survey/MaterialSurvey.d.ts +3 -2
- package/es/components/material-survey/MaterialSurvey.js +9 -11
- package/es/components/material-survey/MaterialSurveySelectMultiple.js +2 -2
- package/es/components/material-survey/MaterialSurveySelectOne.js +2 -2
- package/es/components/material-survey/MaterialSurveyText.js +2 -2
- package/es/components/material-survey/SurveyResultBadge.js +2 -2
- package/es/components/material-survey/SurveySubmitStatusText.js +2 -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 +12 -11
- package/es/components/material-survey-edit/MaterialSurveyEditContent.js +8 -8
- package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +4 -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 +2 -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,20 +80,17 @@ 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
|
-
locale: locale,
|
|
87
|
-
defaultLocale: "en",
|
|
88
|
-
messages: locale in MaterialSurvey_i18n ? MaterialSurvey_i18n[locale] : MaterialSurvey_i18n.en
|
|
89
|
-
}, React.createElement(MaterialSurveyContext.MaterialSurveyProvider, {
|
|
87
|
+
return React.createElement(intl.RawEliceIntlProvider, Object.assign({}, __intl), React.createElement(MaterialSurveyContext.MaterialSurveyProvider, {
|
|
90
88
|
materialSurveyId: materialSurveyId,
|
|
91
89
|
userId: userId,
|
|
92
90
|
onSubmit: onSubmit,
|
|
93
91
|
onNext: onNext
|
|
94
92
|
}, React.createElement(MaterialSurvey, null)));
|
|
95
93
|
};
|
|
94
|
+
var MaterialSurvey$1 = new intl.IntlComponentBuilder(MaterialSurveyContainer).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
|
|
96
95
|
|
|
97
|
-
exports.default =
|
|
96
|
+
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,7 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
31
31
|
refreshOrgMaterialSurvey
|
|
32
32
|
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
33
33
|
// state
|
|
34
|
-
const intl =
|
|
34
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
35
35
|
const [selectedAnswer, setSelectedAnswer] = React.useState([]);
|
|
36
36
|
const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
|
|
37
37
|
const [submitStatus, setSubmitStatus] = React.useState('idle');
|
|
@@ -122,7 +122,7 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
return React.createElement(SurveyContentBox.default, {
|
|
125
|
-
title: intl.formatMessage({
|
|
125
|
+
title: intl$1.formatMessage({
|
|
126
126
|
id: 'materialSurvey.myAnswer'
|
|
127
127
|
}),
|
|
128
128
|
onNext: onNext,
|
|
@@ -140,7 +140,7 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
140
140
|
transparent: false,
|
|
141
141
|
role: 'primary',
|
|
142
142
|
onClick: handleSubmit,
|
|
143
|
-
children: intl.formatMessage({
|
|
143
|
+
children: intl$1.formatMessage({
|
|
144
144
|
id: 'materialSurvey.submit'
|
|
145
145
|
})
|
|
146
146
|
}]
|
|
@@ -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,7 @@ const MaterialSurveySelectOne = () => {
|
|
|
30
30
|
refreshOrgMaterialSurvey
|
|
31
31
|
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
32
32
|
// state
|
|
33
|
-
const intl =
|
|
33
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
34
34
|
const [selectedAnswer, setSelectedAnswer] = React.useState();
|
|
35
35
|
const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
|
|
36
36
|
const [submitStatus, setSubmitStatus] = React.useState('idle');
|
|
@@ -110,7 +110,7 @@ const MaterialSurveySelectOne = () => {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
return React.createElement(SurveyContentBox.default, {
|
|
113
|
-
title: intl.formatMessage({
|
|
113
|
+
title: intl$1.formatMessage({
|
|
114
114
|
id: 'materialSurvey.myAnswer'
|
|
115
115
|
}),
|
|
116
116
|
onNext: onNext,
|
|
@@ -128,7 +128,7 @@ const MaterialSurveySelectOne = () => {
|
|
|
128
128
|
transparent: false,
|
|
129
129
|
role: 'primary',
|
|
130
130
|
onClick: handleSubmit,
|
|
131
|
-
children: intl.formatMessage({
|
|
131
|
+
children: intl$1.formatMessage({
|
|
132
132
|
id: 'materialSurvey.submit'
|
|
133
133
|
})
|
|
134
134
|
}]
|
|
@@ -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,7 @@ const MaterialSurveyText = () => {
|
|
|
31
31
|
refreshOrgMaterialSurvey
|
|
32
32
|
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
33
33
|
// state
|
|
34
|
-
const intl =
|
|
34
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
35
35
|
const [materialSurveyResponse, setMaterialSurveyResponse] = React.useState();
|
|
36
36
|
const [submitStatus, setSubmitStatus] = React.useState('idle');
|
|
37
37
|
const [answer, setAnswer] = React.useState('');
|
|
@@ -113,7 +113,7 @@ const MaterialSurveyText = () => {
|
|
|
113
113
|
type: 'text',
|
|
114
114
|
autoFocus: answer.length === 0,
|
|
115
115
|
disabled: submitStatus === 'pending' || index.checkUserLectureTestEnded(lecture) || !!userId,
|
|
116
|
-
placeholder: intl.formatMessage({
|
|
116
|
+
placeholder: intl$1.formatMessage({
|
|
117
117
|
id: 'materialSurvey.text.placeholder'
|
|
118
118
|
}),
|
|
119
119
|
value: answer,
|
|
@@ -122,7 +122,7 @@ const MaterialSurveyText = () => {
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
return React.createElement(SurveyContentBox.default, {
|
|
125
|
-
title: intl.formatMessage({
|
|
125
|
+
title: intl$1.formatMessage({
|
|
126
126
|
id: 'materialSurvey.myAnswer'
|
|
127
127
|
}),
|
|
128
128
|
onNext: onNext,
|
|
@@ -134,7 +134,7 @@ const MaterialSurveyText = () => {
|
|
|
134
134
|
}),
|
|
135
135
|
footerActions: [{
|
|
136
136
|
border: true,
|
|
137
|
-
children: intl.formatMessage({
|
|
137
|
+
children: intl$1.formatMessage({
|
|
138
138
|
id: 'materialSurvey.submit'
|
|
139
139
|
}),
|
|
140
140
|
disabled: answer.length === 0 || index.checkUserLectureTestEnded(lecture) || !!userId,
|
|
@@ -3,21 +3,21 @@
|
|
|
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 intl =
|
|
13
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
14
14
|
const status = React.useMemo(() => index.getSurveyResultStatus(materialSurveyResponse), [materialSurveyResponse]);
|
|
15
15
|
switch (status) {
|
|
16
16
|
case index.SurveyResultStatus.Submitted:
|
|
17
17
|
return React.createElement(blocks.BadgeNext, {
|
|
18
18
|
type: "quiet",
|
|
19
19
|
role: "primary"
|
|
20
|
-
}, intl.formatMessage({
|
|
20
|
+
}, intl$1.formatMessage({
|
|
21
21
|
id: 'materialSurvey.resultStatus.submitted'
|
|
22
22
|
}));
|
|
23
23
|
default:
|
|
@@ -3,26 +3,26 @@
|
|
|
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 intl =
|
|
12
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
13
13
|
switch (status) {
|
|
14
14
|
case 'resolved':
|
|
15
15
|
return React.createElement(blocks.StatusText, {
|
|
16
16
|
role: "success",
|
|
17
17
|
size: "small"
|
|
18
|
-
}, intl.formatMessage({
|
|
18
|
+
}, intl$1.formatMessage({
|
|
19
19
|
id: 'materialSurvey.submitStatus.success'
|
|
20
20
|
}));
|
|
21
21
|
case 'rejected':
|
|
22
22
|
return React.createElement(blocks.StatusText, {
|
|
23
23
|
role: "danger",
|
|
24
24
|
size: "small"
|
|
25
|
-
}, intl.formatMessage({
|
|
25
|
+
}, intl$1.formatMessage({
|
|
26
26
|
id: 'materialSurvey.submitStatus.failure'
|
|
27
27
|
}));
|
|
28
28
|
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,15 @@ const MaterialSurveyEdit = React.forwardRef(({
|
|
|
73
78
|
//
|
|
74
79
|
//
|
|
75
80
|
//
|
|
76
|
-
return React.createElement("form", {
|
|
81
|
+
return React.createElement(intl.RawEliceIntlProvider, Object.assign({}, __intl), React.createElement("form", {
|
|
77
82
|
ref: formElRef
|
|
78
83
|
}, React.createElement(context.default.Provider, {
|
|
79
84
|
value: {
|
|
80
85
|
disabled,
|
|
81
86
|
onFileUploadRequest
|
|
82
87
|
}
|
|
83
|
-
}, React.createElement(reactIntl.IntlProvider, {
|
|
84
|
-
locale: locale,
|
|
85
|
-
defaultLocale: "en",
|
|
86
|
-
messages: locale in locales ? locales[locale] : locales.en
|
|
87
88
|
}, React.createElement(reactHookForm.FormProvider, Object.assign({}, useFormMethods), React.createElement(MaterialSurveyEditContent.default, null)))));
|
|
88
89
|
});
|
|
90
|
+
var MaterialSurveyEdit$1 = new intl.IntlComponentBuilder(MaterialSurveyEdit).add('en', en.default).add('ko', ko.default).add('th', th.default).build();
|
|
89
91
|
|
|
90
|
-
exports.default = MaterialSurveyEdit;
|
|
92
|
+
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,7 @@ const StyledSurveyOptionTypeSelectWrap = styled.div.withConfig({
|
|
|
19
19
|
componentId: "sc-r4ms68-0"
|
|
20
20
|
})(["display:flex;max-width:12rem;"]);
|
|
21
21
|
const MaterialSurveyEditContent = () => {
|
|
22
|
-
const intl =
|
|
22
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
23
23
|
const {
|
|
24
24
|
disabled,
|
|
25
25
|
onFileUploadRequest
|
|
@@ -42,14 +42,14 @@ const MaterialSurveyEditContent = () => {
|
|
|
42
42
|
// add default option info
|
|
43
43
|
[{
|
|
44
44
|
id: randomId.createRandomId(),
|
|
45
|
-
value: intl.formatMessage({
|
|
45
|
+
value: intl$1.formatMessage({
|
|
46
46
|
id: 'common.option'
|
|
47
47
|
}, {
|
|
48
48
|
number: 1
|
|
49
49
|
})
|
|
50
50
|
}, {
|
|
51
51
|
id: randomId.createRandomId(),
|
|
52
|
-
value: intl.formatMessage({
|
|
52
|
+
value: intl$1.formatMessage({
|
|
53
53
|
id: 'common.option'
|
|
54
54
|
}, {
|
|
55
55
|
number: 2
|
|
@@ -64,7 +64,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
64
64
|
setValue('questionInfoList.0.optionInfo', get());
|
|
65
65
|
},
|
|
66
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
|
-
[watchedOptionType, setValue, intl]);
|
|
67
|
+
[watchedOptionType, setValue, intl$1]);
|
|
68
68
|
/**
|
|
69
69
|
* Input of option info and answer info,
|
|
70
70
|
* according to option type.
|
|
@@ -87,8 +87,8 @@ const MaterialSurveyEditContent = () => {
|
|
|
87
87
|
label: React.createElement(blocks.Label, {
|
|
88
88
|
size: "small",
|
|
89
89
|
required: true
|
|
90
|
-
},
|
|
91
|
-
id:
|
|
90
|
+
}, intl$1.formatMessage({
|
|
91
|
+
id: 'content.title'
|
|
92
92
|
})),
|
|
93
93
|
input: React.createElement(reactHookForm.Controller, {
|
|
94
94
|
control: control,
|
|
@@ -96,13 +96,13 @@ const MaterialSurveyEditContent = () => {
|
|
|
96
96
|
rules: {
|
|
97
97
|
required: {
|
|
98
98
|
value: true,
|
|
99
|
-
message: intl.formatMessage({
|
|
99
|
+
message: intl$1.formatMessage({
|
|
100
100
|
id: 'content.title.errorMessage.required'
|
|
101
101
|
})
|
|
102
102
|
},
|
|
103
103
|
minLength: {
|
|
104
104
|
value: MIN_TEXT_LENGTH,
|
|
105
|
-
message: intl.formatMessage({
|
|
105
|
+
message: intl$1.formatMessage({
|
|
106
106
|
id: 'common.errorMessage.range'
|
|
107
107
|
}, {
|
|
108
108
|
min: MIN_TEXT_LENGTH,
|
|
@@ -111,7 +111,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
111
111
|
},
|
|
112
112
|
maxLength: {
|
|
113
113
|
value: MAX_TEXT_LENGTH,
|
|
114
|
-
message: intl.formatMessage({
|
|
114
|
+
message: intl$1.formatMessage({
|
|
115
115
|
id: 'common.errorMessage.range'
|
|
116
116
|
}, {
|
|
117
117
|
min: MIN_TEXT_LENGTH,
|
|
@@ -129,7 +129,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
129
129
|
width: "full",
|
|
130
130
|
minLength: MIN_TEXT_LENGTH,
|
|
131
131
|
maxLength: MAX_TEXT_LENGTH,
|
|
132
|
-
placeholder: intl.formatMessage({
|
|
132
|
+
placeholder: intl$1.formatMessage({
|
|
133
133
|
id: 'content.title.placeholder'
|
|
134
134
|
}),
|
|
135
135
|
invalid: fieldState.invalid,
|
|
@@ -146,8 +146,8 @@ const MaterialSurveyEditContent = () => {
|
|
|
146
146
|
return React.createElement(blocks.FormInputVerticalLayout, {
|
|
147
147
|
label: React.createElement(blocks.Label, {
|
|
148
148
|
size: "small"
|
|
149
|
-
},
|
|
150
|
-
id:
|
|
149
|
+
}, intl$1.formatMessage({
|
|
150
|
+
id: 'content.description.title'
|
|
151
151
|
})),
|
|
152
152
|
input: React.createElement(reactHookForm.Controller, {
|
|
153
153
|
control: control,
|
|
@@ -156,7 +156,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
156
156
|
field
|
|
157
157
|
}) => React.createElement(markdown.MarkdownEditor, Object.assign({
|
|
158
158
|
enableFooter: true,
|
|
159
|
-
placeholder: intl.formatMessage({
|
|
159
|
+
placeholder: intl$1.formatMessage({
|
|
160
160
|
id: 'content.description.placeholder'
|
|
161
161
|
}),
|
|
162
162
|
onFileUploadRequest: onFileUploadRequest
|
|
@@ -172,8 +172,8 @@ const MaterialSurveyEditContent = () => {
|
|
|
172
172
|
label: React.createElement(blocks.Label, {
|
|
173
173
|
size: "small",
|
|
174
174
|
required: true
|
|
175
|
-
},
|
|
176
|
-
id:
|
|
175
|
+
}, intl$1.formatMessage({
|
|
176
|
+
id: 'content.option.title'
|
|
177
177
|
})),
|
|
178
178
|
input: React.createElement(React.Fragment, null, React.createElement(reactHookForm.Controller, {
|
|
179
179
|
control: control,
|
|
@@ -181,7 +181,7 @@ const MaterialSurveyEditContent = () => {
|
|
|
181
181
|
render: ({
|
|
182
182
|
field
|
|
183
183
|
}) => React.createElement(blocks.Tooltip, {
|
|
184
|
-
title: disabled ? intl.formatMessage({
|
|
184
|
+
title: disabled ? intl$1.formatMessage({
|
|
185
185
|
id: 'content.option.tooltip.disabled'
|
|
186
186
|
}) : undefined,
|
|
187
187
|
placement: "top-end"
|
|
@@ -193,17 +193,17 @@ const MaterialSurveyEditContent = () => {
|
|
|
193
193
|
onChange: v => field.onChange(Number(v))
|
|
194
194
|
}), React.createElement("option", {
|
|
195
195
|
value: types.enums.SurveyOptionType.SelectOne,
|
|
196
|
-
children: intl.formatMessage({
|
|
196
|
+
children: intl$1.formatMessage({
|
|
197
197
|
id: 'content.option.select.items.selectOne'
|
|
198
198
|
})
|
|
199
199
|
}), React.createElement("option", {
|
|
200
200
|
value: types.enums.SurveyOptionType.SelectMultiple,
|
|
201
|
-
children: intl.formatMessage({
|
|
201
|
+
children: intl$1.formatMessage({
|
|
202
202
|
id: 'content.option.select.items.selectMultiple'
|
|
203
203
|
})
|
|
204
204
|
}), React.createElement("option", {
|
|
205
205
|
value: types.enums.SurveyOptionType.Text,
|
|
206
|
-
children: intl.formatMessage({
|
|
206
|
+
children: intl$1.formatMessage({
|
|
207
207
|
id: 'content.option.select.items.text'
|
|
208
208
|
})
|
|
209
209
|
}))))
|
|
@@ -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,7 @@ 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 intl =
|
|
23
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
24
24
|
const {
|
|
25
25
|
disabled
|
|
26
26
|
} = context.useMaterialSurveyEditContext();
|
|
@@ -63,7 +63,7 @@ const OptionSelectOne = () => {
|
|
|
63
63
|
rules: {
|
|
64
64
|
required: {
|
|
65
65
|
value: true,
|
|
66
|
-
message: intl.formatMessage({
|
|
66
|
+
message: intl$1.formatMessage({
|
|
67
67
|
id: 'option.common.select.errorMessage.required'
|
|
68
68
|
})
|
|
69
69
|
}
|
|
@@ -76,11 +76,11 @@ const OptionSelectOne = () => {
|
|
|
76
76
|
return React.createElement(blocks.Input, Object.assign({
|
|
77
77
|
size: "small",
|
|
78
78
|
width: "full",
|
|
79
|
-
placeholder: intl.formatMessage({
|
|
79
|
+
placeholder: intl$1.formatMessage({
|
|
80
80
|
id: 'option.common.select.placeholder'
|
|
81
81
|
}),
|
|
82
82
|
suffix: React.createElement(blocks.Tooltip, {
|
|
83
|
-
title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl.formatMessage({
|
|
83
|
+
title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl$1.formatMessage({
|
|
84
84
|
id: 'option.common.select.tooltip.minOptionInfoItem'
|
|
85
85
|
}) : undefined,
|
|
86
86
|
placement: "top-start"
|
|
@@ -101,7 +101,7 @@ const OptionSelectOne = () => {
|
|
|
101
101
|
}))), React.createElement(blocks.Vspace, {
|
|
102
102
|
height: 0.5
|
|
103
103
|
}), React.createElement(blocks.Tooltip, {
|
|
104
|
-
title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl.formatMessage({
|
|
104
|
+
title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl$1.formatMessage({
|
|
105
105
|
id: 'option.common.select.tooltip.maxOptionInfoItem'
|
|
106
106
|
}) : undefined,
|
|
107
107
|
placement: "bottom"
|
|
@@ -115,8 +115,8 @@ const OptionSelectOne = () => {
|
|
|
115
115
|
}),
|
|
116
116
|
disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
|
|
117
117
|
onClick: appendOptionInfo
|
|
118
|
-
},
|
|
119
|
-
id:
|
|
118
|
+
}, intl$1.formatMessage({
|
|
119
|
+
id: 'option.common.select.addButton'
|
|
120
120
|
})))));
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -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,7 @@ const SurveyContentBox = _a => {
|
|
|
60
60
|
onNext
|
|
61
61
|
} = _a,
|
|
62
62
|
props = tslib.__rest(_a, ["children", "footerActions", "title", "submitResult", "submitStatus", "onNext"]);
|
|
63
|
-
const intl =
|
|
63
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
64
64
|
const {
|
|
65
65
|
vertical
|
|
66
66
|
} = MaterialSurveyContext.useMaterialSurveyState();
|
|
@@ -86,7 +86,7 @@ const SurveyContentBox = _a => {
|
|
|
86
86
|
transparent: false,
|
|
87
87
|
role: "lightpurple",
|
|
88
88
|
onClick: onNext
|
|
89
|
-
}, intl.formatMessage({
|
|
89
|
+
}, intl$1.formatMessage({
|
|
90
90
|
id: 'materialSurvey.next'
|
|
91
91
|
})) : null), React.createElement(StyledQuestionBoxFooterStatus, {
|
|
92
92
|
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;
|