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