@elice/material-quiz 1.240718.0-trasncript.1 → 1.240718.0-trasncript.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/_virtual/_rollupPluginBabelHelpers.js +423 -0
- package/cjs/components/eb-sortable/EbDraggable.js +42 -33
- package/cjs/components/eb-sortable/EbDroppable.js +27 -20
- package/cjs/components/markdown-editor/index.d.ts +1 -2
- package/cjs/components/markdown-editor/index.js +19 -10
- package/cjs/components/material-quiz/MaterialQuiz.js +114 -83
- package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +36 -29
- package/cjs/components/material-quiz/MaterialQuizInfo.js +151 -149
- package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +175 -127
- package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +360 -286
- package/cjs/components/material-quiz/MaterialQuizSelectOne.js +172 -126
- package/cjs/components/material-quiz/MaterialQuizShimmer.js +46 -39
- package/cjs/components/material-quiz/MaterialQuizText.js +163 -115
- package/cjs/components/material-quiz/QuizResultBadge.js +32 -22
- package/cjs/components/material-quiz/QuizSubmitStatusText.js +21 -16
- package/cjs/components/material-quiz/constants/color.js +5 -5
- package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
- package/cjs/components/material-quiz/context/MaterialQuizContext.js +156 -93
- package/cjs/components/material-quiz/index.js +9 -0
- package/cjs/components/material-quiz/locales/index.js +13 -0
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +259 -161
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +134 -100
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +130 -101
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +64 -52
- package/cjs/components/material-quiz/material-quiz-group/context/context.js +5 -1
- package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +47 -36
- package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +280 -232
- package/cjs/components/material-quiz-edit/context.js +8 -2
- package/cjs/components/material-quiz-edit/index.js +7 -0
- package/cjs/components/material-quiz-edit/locales/index.js +13 -0
- package/cjs/components/material-quiz-edit/options/OptionEditor.js +70 -46
- package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +174 -148
- package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +175 -149
- package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +164 -144
- package/cjs/components/material-quiz-edit/options/OptionText.js +90 -82
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +156 -112
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +288 -196
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +88 -75
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +108 -92
- package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
- package/cjs/components/material-quiz-edit/utils/editValue.js +21 -12
- package/cjs/components/shared/QuestionBox.js +198 -165
- package/cjs/components/shared/QuizDraggbleDroppedOption.js +11 -12
- package/cjs/components/shared/QuizDraggbleDummyOption.js +23 -16
- package/cjs/components/shared/QuizDraggbleOption.js +65 -59
- package/cjs/components/shared/StyledMarkdown.js +5 -1
- package/cjs/components/shared/index.js +19 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
- package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +59 -68
- package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
- package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
- package/cjs/components/shared/question-radio/QuestionRadioOption.js +52 -59
- package/cjs/components/shared/utils/getQuestionStatusStyle.js +7 -9
- package/cjs/components/shared/utils/mergeRefs.js +15 -6
- package/cjs/constant/element.js +3 -3
- package/cjs/constant/index.js +9 -0
- package/cjs/helpers/index.js +8 -10
- package/cjs/hooks/index.js +7 -0
- package/cjs/hooks/useCaculatePassage.js +21 -20
- package/es/_virtual/_rollupPluginBabelHelpers.js +408 -0
- package/es/components/eb-sortable/EbDraggable.js +37 -33
- package/es/components/eb-sortable/EbDroppable.js +22 -20
- package/es/components/markdown-editor/index.d.ts +1 -2
- package/es/components/markdown-editor/index.js +15 -10
- package/es/components/material-quiz/MaterialQuiz.js +109 -83
- package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +32 -29
- package/es/components/material-quiz/MaterialQuizInfo.js +148 -150
- package/es/components/material-quiz/MaterialQuizSelectMultiple.js +171 -127
- package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +356 -287
- package/es/components/material-quiz/MaterialQuizSelectOne.js +168 -126
- package/es/components/material-quiz/MaterialQuizShimmer.js +42 -39
- package/es/components/material-quiz/MaterialQuizText.js +158 -115
- package/es/components/material-quiz/QuizResultBadge.js +27 -22
- package/es/components/material-quiz/QuizSubmitStatusText.js +17 -16
- package/es/components/material-quiz/constants/color.js +5 -5
- package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
- package/es/components/material-quiz/context/MaterialQuizContext.js +153 -94
- package/es/components/material-quiz/index.js +2 -0
- package/es/components/material-quiz/locales/index.js +4 -0
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +253 -161
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +129 -100
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +125 -101
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +60 -52
- package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
- package/es/components/material-quiz-edit/MaterialQuizEdit.js +43 -36
- package/es/components/material-quiz-edit/MaterialQuizEditContent.js +272 -229
- package/es/components/material-quiz-edit/context.js +4 -2
- package/es/components/material-quiz-edit/index.js +1 -0
- package/es/components/material-quiz-edit/locales/index.js +4 -0
- package/es/components/material-quiz-edit/options/OptionEditor.js +64 -46
- package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +170 -148
- package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +171 -149
- package/es/components/material-quiz-edit/options/OptionSelectOne.js +159 -144
- package/es/components/material-quiz-edit/options/OptionText.js +86 -82
- package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
- package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +151 -112
- package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +283 -197
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +83 -75
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +103 -92
- package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
- package/es/components/material-quiz-edit/utils/editValue.js +17 -12
- package/es/components/shared/QuestionBox.js +192 -165
- package/es/components/shared/QuizDraggbleDroppedOption.js +11 -12
- package/es/components/shared/QuizDraggbleDummyOption.js +19 -16
- package/es/components/shared/QuizDraggbleOption.js +61 -59
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/es/components/shared/index.js +7 -0
- package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
- package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +54 -68
- package/es/components/shared/question-radio/QuestionRadio.js +9 -7
- package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
- package/es/components/shared/question-radio/QuestionRadioOption.js +47 -59
- package/es/components/shared/utils/getQuestionStatusStyle.js +7 -9
- package/es/components/shared/utils/mergeRefs.js +15 -6
- package/es/constant/element.js +3 -3
- package/es/constant/index.js +1 -0
- package/es/helpers/index.js +8 -10
- package/es/hooks/index.js +1 -0
- package/es/hooks/useCaculatePassage.js +21 -20
- package/package.json +12 -15
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var reactHookForm = require('react-hook-form');
|
|
7
8
|
var reactSortableHoc = require('react-sortable-hoc');
|
|
8
9
|
var reactTransitionGroup = require('react-transition-group');
|
|
@@ -15,55 +16,60 @@ var context = require('../context.js');
|
|
|
15
16
|
var randomId = require('../utils/randomId.js');
|
|
16
17
|
var OptionEditor = require('./OptionEditor.js');
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
|
+
|
|
21
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
22
|
+
|
|
23
|
+
var MIN_OPTION_INFO_COUNT = 2;
|
|
24
|
+
var MAX_OPTION_INFO_COUNT = 20;
|
|
25
|
+
var StyledWrap = styled__default.default.div.withConfig({
|
|
21
26
|
componentId: "sc-1xufc1p-0"
|
|
22
27
|
})(["& > ul{display:flex;flex-direction:column;gap:0.75rem;}"]);
|
|
23
|
-
|
|
28
|
+
var StyledInputGroup = styled__default.default(blocks.SortableListGroup).withConfig({
|
|
24
29
|
componentId: "sc-1xufc1p-1"
|
|
25
30
|
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
disabled
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
const watchedAnswerInfo = reactHookForm.useWatch({
|
|
47
|
-
control,
|
|
31
|
+
var OptionSelectMultipleOrder = function OptionSelectMultipleOrder() {
|
|
32
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
33
|
+
var _useMaterialQuizEditC = context.useMaterialQuizEditContext(),
|
|
34
|
+
disabled = _useMaterialQuizEditC.disabled;
|
|
35
|
+
var _useFormContext = reactHookForm.useFormContext(),
|
|
36
|
+
control = _useFormContext.control,
|
|
37
|
+
getValues = _useFormContext.getValues,
|
|
38
|
+
setValue = _useFormContext.setValue;
|
|
39
|
+
var _useFieldArray = reactHookForm.useFieldArray({
|
|
40
|
+
name: 'optionsDefault',
|
|
41
|
+
keyName: 'id',
|
|
42
|
+
shouldUnregister: true
|
|
43
|
+
}),
|
|
44
|
+
optionInfoFields = _useFieldArray.fields,
|
|
45
|
+
appendOptionInfoFieldItem = _useFieldArray.append,
|
|
46
|
+
removeOptionInfoFieldItem = _useFieldArray.remove,
|
|
47
|
+
moveOptionInfoFieldItem = _useFieldArray.move;
|
|
48
|
+
var watchedAnswerInfo = reactHookForm.useWatch({
|
|
49
|
+
control: control,
|
|
48
50
|
name: 'answerInfoDefault'
|
|
49
51
|
});
|
|
50
|
-
|
|
51
|
-
control,
|
|
52
|
+
var watchedOptions = reactHookForm.useWatch({
|
|
53
|
+
control: control,
|
|
52
54
|
name: 'optionsDefault'
|
|
53
55
|
});
|
|
54
56
|
/**
|
|
55
57
|
* Update answer info.
|
|
56
58
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
var updateAnswerInfo = function updateAnswerInfo(option) {
|
|
60
|
+
var prevAnswerInfo = getValues('answerInfoDefault');
|
|
59
61
|
if (!Array.isArray(prevAnswerInfo)) {
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
|
-
setValue('answerInfoDefault', !option.checked ? prevAnswerInfo.filter(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
setValue('answerInfoDefault', !option.checked ? prevAnswerInfo.filter(function (answerIndex) {
|
|
65
|
+
return answerIndex !== option.index;
|
|
66
|
+
}).map(function (answerIndex) {
|
|
67
|
+
return option.removed ?
|
|
68
|
+
// if answer removed, re-calculate answer index
|
|
69
|
+
answerIndex < option.index ? answerIndex : answerIndex - 1 :
|
|
70
|
+
// or maintain current answer index
|
|
71
|
+
answerIndex;
|
|
72
|
+
}) : [].concat(_rollupPluginBabelHelpers.toConsumableArray(prevAnswerInfo), [option.index]), {
|
|
67
73
|
shouldDirty: true,
|
|
68
74
|
shouldValidate: true
|
|
69
75
|
});
|
|
@@ -71,7 +77,7 @@ const OptionSelectMultipleOrder = () => {
|
|
|
71
77
|
/**
|
|
72
78
|
* Append option info.
|
|
73
79
|
*/
|
|
74
|
-
|
|
80
|
+
var appendOptionInfo = function appendOptionInfo() {
|
|
75
81
|
appendOptionInfoFieldItem({
|
|
76
82
|
id: randomId.createRandomId(),
|
|
77
83
|
title: '',
|
|
@@ -81,9 +87,9 @@ const OptionSelectMultipleOrder = () => {
|
|
|
81
87
|
/**
|
|
82
88
|
* Remove item from option info at index.
|
|
83
89
|
*/
|
|
84
|
-
|
|
90
|
+
var removeOptionInfo = function removeOptionInfo(index) {
|
|
85
91
|
updateAnswerInfo({
|
|
86
|
-
index,
|
|
92
|
+
index: index,
|
|
87
93
|
checked: false,
|
|
88
94
|
removed: true
|
|
89
95
|
});
|
|
@@ -92,15 +98,20 @@ const OptionSelectMultipleOrder = () => {
|
|
|
92
98
|
/**
|
|
93
99
|
* Sort options based on the old and new index.
|
|
94
100
|
*/
|
|
95
|
-
|
|
96
|
-
oldIndex,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
var handleSortEnd = function handleSortEnd(_ref) {
|
|
102
|
+
var oldIndex = _ref.oldIndex,
|
|
103
|
+
newIndex = _ref.newIndex;
|
|
104
|
+
var prevOptions = lodashEs.cloneDeep(watchedOptions).map(function (option, index) {
|
|
105
|
+
return Object.assign(Object.assign({}, option), {
|
|
106
|
+
originIndex: index
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
var updatedOptions = reactSortableHoc.arrayMove(prevOptions, oldIndex, newIndex);
|
|
110
|
+
var updatedAnswerInfo = watchedAnswerInfo.map(function (answerIndex) {
|
|
111
|
+
return updatedOptions.findIndex(function (option) {
|
|
112
|
+
return option.originIndex === answerIndex;
|
|
113
|
+
});
|
|
114
|
+
});
|
|
104
115
|
setValue('answerInfoDefault', updatedAnswerInfo);
|
|
105
116
|
moveOptionInfoFieldItem(oldIndex, newIndex);
|
|
106
117
|
};
|
|
@@ -110,110 +121,125 @@ const OptionSelectMultipleOrder = () => {
|
|
|
110
121
|
if (!Array.isArray(watchedAnswerInfo)) {
|
|
111
122
|
return null;
|
|
112
123
|
}
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
return jsxRuntime.jsxs(StyledWrap, {
|
|
125
|
+
children: [jsxRuntime.jsx(reactHookForm.Controller, {
|
|
126
|
+
name: "answerInfoDefault",
|
|
127
|
+
control: control,
|
|
128
|
+
rules: {
|
|
129
|
+
validate: function validate(v) {
|
|
130
|
+
if (Array.isArray(v) && v.length < 1) {
|
|
131
|
+
return intl$1.formatMessage({
|
|
132
|
+
id: 'content.option.errorMessage.required'
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
122
136
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
height: 0.5
|
|
140
|
-
})));
|
|
141
|
-
}
|
|
142
|
-
}), React.createElement(StyledInputGroup, {
|
|
143
|
-
useDragHandle: true,
|
|
144
|
-
onSortEnd: handleSortEnd
|
|
145
|
-
}, optionInfoFields.map(({
|
|
146
|
-
id
|
|
147
|
-
}, index) => React.createElement(reactHookForm.Controller, {
|
|
148
|
-
key: id,
|
|
149
|
-
control: control,
|
|
150
|
-
name: `optionsDefault.${index}.content`,
|
|
151
|
-
rules: {
|
|
152
|
-
required: {
|
|
153
|
-
value: true,
|
|
154
|
-
message: intl$1.formatMessage({
|
|
155
|
-
id: 'option.common.select.errorMessage.required'
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
render: ({
|
|
160
|
-
field,
|
|
161
|
-
fieldState
|
|
162
|
-
}) => {
|
|
163
|
-
var _a;
|
|
164
|
-
return React.createElement(OptionEditor.default, Object.assign({
|
|
165
|
-
index: index,
|
|
166
|
-
placeholder: intl$1.formatMessage({
|
|
167
|
-
id: 'option.common.select.placeholder'
|
|
168
|
-
}),
|
|
169
|
-
prefix: React.createElement(blocks.Checkbox, {
|
|
170
|
-
disabled: disabled,
|
|
171
|
-
checked: watchedAnswerInfo.includes(index),
|
|
172
|
-
altChar: watchedAnswerInfo.indexOf(index) + 1,
|
|
173
|
-
onChange: checked => updateAnswerInfo({
|
|
174
|
-
index,
|
|
175
|
-
checked
|
|
137
|
+
},
|
|
138
|
+
render: function render(_ref2) {
|
|
139
|
+
var fieldState = _ref2.fieldState;
|
|
140
|
+
var _a;
|
|
141
|
+
return jsxRuntime.jsx(reactTransitionGroup.Transition, {
|
|
142
|
+
in: fieldState.invalid,
|
|
143
|
+
timeout: 0,
|
|
144
|
+
mountOnEnter: true,
|
|
145
|
+
unmountOnExit: true,
|
|
146
|
+
children: jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
147
|
+
children: [jsxRuntime.jsx(blocks.StatusText, {
|
|
148
|
+
children: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message,
|
|
149
|
+
role: "danger"
|
|
150
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
151
|
+
height: 0.5
|
|
152
|
+
})]
|
|
176
153
|
})
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}), jsxRuntime.jsx(StyledInputGroup, {
|
|
157
|
+
useDragHandle: true,
|
|
158
|
+
onSortEnd: handleSortEnd,
|
|
159
|
+
children: optionInfoFields.map(function (_ref3, index) {
|
|
160
|
+
var id = _ref3.id;
|
|
161
|
+
return jsxRuntime.jsx(reactHookForm.Controller, {
|
|
162
|
+
control: control,
|
|
163
|
+
name: "optionsDefault.".concat(index, ".content"),
|
|
164
|
+
rules: {
|
|
165
|
+
required: {
|
|
166
|
+
value: true,
|
|
167
|
+
message: intl$1.formatMessage({
|
|
168
|
+
id: 'option.common.select.errorMessage.required'
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
render: function render(_ref4) {
|
|
173
|
+
var field = _ref4.field,
|
|
174
|
+
fieldState = _ref4.fieldState;
|
|
175
|
+
var _a;
|
|
176
|
+
return jsxRuntime.jsx(OptionEditor.default, Object.assign({
|
|
177
|
+
index: index,
|
|
178
|
+
placeholder: intl$1.formatMessage({
|
|
179
|
+
id: 'option.common.select.placeholder'
|
|
180
|
+
}),
|
|
181
|
+
prefix: jsxRuntime.jsx(blocks.Checkbox, {
|
|
182
|
+
disabled: disabled,
|
|
183
|
+
checked: watchedAnswerInfo.includes(index),
|
|
184
|
+
altChar: watchedAnswerInfo.indexOf(index) + 1,
|
|
185
|
+
onChange: function onChange(checked) {
|
|
186
|
+
return updateAnswerInfo({
|
|
187
|
+
index: index,
|
|
188
|
+
checked: checked
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}),
|
|
192
|
+
suffix: jsxRuntime.jsx(blocks.Tooltip, {
|
|
193
|
+
title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl$1.formatMessage({
|
|
194
|
+
id: 'option.common.select.tooltip.minOptionInfoItem'
|
|
195
|
+
}) : undefined,
|
|
196
|
+
placement: "top-start",
|
|
197
|
+
children: jsxRuntime.jsx("span", {
|
|
198
|
+
children: jsxRuntime.jsx(blocks.IconButton, {
|
|
199
|
+
icon: icons.eilMathsignMultiplyBasic,
|
|
200
|
+
size: "tiny",
|
|
201
|
+
role: "grey9",
|
|
202
|
+
border: false,
|
|
203
|
+
transparent: true,
|
|
204
|
+
disabled: optionInfoFields.length <= MIN_OPTION_INFO_COUNT || disabled,
|
|
205
|
+
onClick: function onClick() {
|
|
206
|
+
return removeOptionInfo(index);
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
}),
|
|
211
|
+
readOnly: disabled,
|
|
212
|
+
invalid: fieldState.invalid,
|
|
213
|
+
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
214
|
+
}, field));
|
|
215
|
+
}
|
|
216
|
+
}, id);
|
|
217
|
+
})
|
|
218
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
219
|
+
height: 0.5
|
|
220
|
+
}), jsxRuntime.jsx(blocks.Tooltip, {
|
|
221
|
+
title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl$1.formatMessage({
|
|
222
|
+
id: 'option.common.select.tooltip.maxOptionInfoItem'
|
|
223
|
+
}) : undefined,
|
|
224
|
+
placement: "bottom",
|
|
225
|
+
children: jsxRuntime.jsx("span", {
|
|
226
|
+
children: jsxRuntime.jsx(blocks.Button, {
|
|
227
|
+
block: true,
|
|
228
|
+
size: "micro",
|
|
229
|
+
borderDashed: true,
|
|
188
230
|
transparent: true,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
id: 'option.common.select.tooltip.maxOptionInfoItem'
|
|
202
|
-
}) : undefined,
|
|
203
|
-
placement: "bottom"
|
|
204
|
-
}, React.createElement("span", null, React.createElement(blocks.Button, {
|
|
205
|
-
block: true,
|
|
206
|
-
size: "micro",
|
|
207
|
-
borderDashed: true,
|
|
208
|
-
transparent: true,
|
|
209
|
-
icon: React.createElement(blocks.Icon, {
|
|
210
|
-
icon: icons.eilMathsignAddCircle
|
|
211
|
-
}),
|
|
212
|
-
disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
|
|
213
|
-
onClick: appendOptionInfo
|
|
214
|
-
}, intl$1.formatMessage({
|
|
215
|
-
id: 'option.common.select.addButton'
|
|
216
|
-
})))));
|
|
231
|
+
icon: jsxRuntime.jsx(blocks.Icon, {
|
|
232
|
+
icon: icons.eilMathsignAddCircle
|
|
233
|
+
}),
|
|
234
|
+
disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
|
|
235
|
+
onClick: appendOptionInfo,
|
|
236
|
+
children: intl$1.formatMessage({
|
|
237
|
+
id: 'option.common.select.addButton'
|
|
238
|
+
})
|
|
239
|
+
})
|
|
240
|
+
})
|
|
241
|
+
})]
|
|
242
|
+
});
|
|
217
243
|
};
|
|
218
244
|
|
|
219
245
|
exports.default = OptionSelectMultipleOrder;
|