@elice/material-quiz 1.230614.0 → 1.230619.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-quiz-edit/options/OptionEditor.d.ts +11 -0
- package/cjs/components/material-quiz-edit/options/OptionEditor.js +71 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +8 -12
- package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +3 -4
- package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +8 -9
- package/cjs/components/shared/StyledMarkdown.js +1 -1
- package/es/components/material-quiz-edit/options/OptionEditor.d.ts +11 -0
- package/es/components/material-quiz-edit/options/OptionEditor.js +61 -0
- package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +9 -13
- package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +4 -5
- package/es/components/material-quiz-edit/options/OptionSelectOne.js +9 -10
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface OptionTextareaProps extends Omit<React.HTMLAttributes<HTMLTextAreaElement>, 'prefix'> {
|
|
3
|
+
prefix?: React.ReactNode;
|
|
4
|
+
suffix?: React.ReactNode;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
invalidText?: string;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const OptionEditor: React.ForwardRefExoticComponent<OptionTextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
11
|
+
export default OptionEditor;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var blocks = require('@elice/blocks');
|
|
8
|
+
var designTokens = require('@elice/design-tokens');
|
|
9
|
+
var classNames = require('classnames');
|
|
10
|
+
var styled = require('styled-components');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
16
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
17
|
+
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
var PREFIX = 'em-option-editor';
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
//
|
|
25
|
+
var StyledTextarea = styled__default["default"](blocks.Textarea).withConfig({
|
|
26
|
+
componentId: "sc-50ghuz-0"
|
|
27
|
+
})(["padding:0.75rem 3rem;&.focus{border:1px solid ", ";}", ";", ";", ";"], designTokens.base.color.primary6, function (props) {
|
|
28
|
+
return props.invalid ? styled.css(["border:1px solid ", " !important;"], designTokens.base.color.red8) : null;
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.disabled ? styled.css(["background-color:", ";cursor:not-allowed;"], designTokens.base.color.gray2) : null;
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.readOnly ? styled.css(["background-color:#f0f1f3;"]) : null;
|
|
33
|
+
});
|
|
34
|
+
var StyledTextareaWrap = styled__default["default"].div.withConfig({
|
|
35
|
+
componentId: "sc-50ghuz-1"
|
|
36
|
+
})(["display:flex;position:relative;.em-option-editor-adornment{position:absolute;top:50%;transform:translateY(-50%);z-index:1;&.prefix{left:1rem;}&.suffix{right:1rem;}}"]);
|
|
37
|
+
//
|
|
38
|
+
//
|
|
39
|
+
//
|
|
40
|
+
var OptionEditor = React__default["default"].forwardRef(function (_a, ref) {
|
|
41
|
+
var suffix = _a.suffix,
|
|
42
|
+
prefix = _a.prefix,
|
|
43
|
+
invalid = _a.invalid,
|
|
44
|
+
invalidText = _a.invalidText,
|
|
45
|
+
readOnly = _a.readOnly,
|
|
46
|
+
props = tslib.__rest(_a, ["suffix", "prefix", "invalid", "invalidText", "readOnly"]);
|
|
47
|
+
return React__default["default"].createElement("div", {
|
|
48
|
+
className: classNames__default["default"](PREFIX, props.className)
|
|
49
|
+
}, React__default["default"].createElement(StyledTextareaWrap, {
|
|
50
|
+
className: "".concat(PREFIX, "-textarea-wrapper")
|
|
51
|
+
}, prefix ? React__default["default"].createElement("div", {
|
|
52
|
+
className: "".concat(PREFIX, "-adornment prefix")
|
|
53
|
+
}, prefix) : null, React__default["default"].createElement(StyledTextarea, Object.assign({}, props, {
|
|
54
|
+
ref: ref,
|
|
55
|
+
invalid: invalid,
|
|
56
|
+
readOnly: readOnly,
|
|
57
|
+
"aria-disabled": props.disabled
|
|
58
|
+
})), suffix ? React__default["default"].createElement("div", {
|
|
59
|
+
className: "".concat(PREFIX, "-adornment suffix")
|
|
60
|
+
}, suffix) : null), invalid ? React__default["default"].createElement(blocks.Box, {
|
|
61
|
+
padding: "0 0.75rem",
|
|
62
|
+
margintop: "0.25rem",
|
|
63
|
+
className: "".concat(PREFIX, "-helperText-wrap")
|
|
64
|
+
}, React__default["default"].createElement(blocks.Text, {
|
|
65
|
+
role: "red",
|
|
66
|
+
size: "tiny",
|
|
67
|
+
className: "".concat(PREFIX, "-helperText")
|
|
68
|
+
}, invalidText !== null && invalidText !== void 0 ? invalidText : '')) : null);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
exports["default"] = OptionEditor;
|
|
@@ -12,6 +12,7 @@ var icons = require('@elice/icons');
|
|
|
12
12
|
var styled = require('styled-components');
|
|
13
13
|
var context = require('../context.js');
|
|
14
14
|
var randomId = require('../utils/randomId.js');
|
|
15
|
+
var OptionEditor = require('./OptionEditor.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
@@ -25,7 +26,7 @@ var StyledWrap = styled__default["default"].div.withConfig({
|
|
|
25
26
|
})([""]);
|
|
26
27
|
var StyledInputGroup = styled__default["default"].div.withConfig({
|
|
27
28
|
componentId: "sc-1nbx9b8-1"
|
|
28
|
-
})(["width:100%;.
|
|
29
|
+
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
29
30
|
var OptionSelectMultiple = function OptionSelectMultiple() {
|
|
30
31
|
var intl = reactIntl.useIntl();
|
|
31
32
|
var _useMaterialQuizEditC = context.useMaterialQuizEditContext(),
|
|
@@ -138,12 +139,10 @@ var OptionSelectMultiple = function OptionSelectMultiple() {
|
|
|
138
139
|
var field = _ref3.field,
|
|
139
140
|
fieldState = _ref3.fieldState;
|
|
140
141
|
var _a;
|
|
141
|
-
return React__default["default"].createElement(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
id: 'option.common.select.placeholder'
|
|
146
|
-
}),
|
|
142
|
+
return React__default["default"].createElement(OptionEditor["default"], Object.assign({}, field, {
|
|
143
|
+
invalid: fieldState.invalid,
|
|
144
|
+
invalidText: (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.error) === null || _a === void 0 ? void 0 : _a.message,
|
|
145
|
+
readOnly: disabled,
|
|
147
146
|
prefix: React__default["default"].createElement(blocks.Checkbox, {
|
|
148
147
|
checked: watchedAnswerInfo.includes(index),
|
|
149
148
|
disabled: disabled,
|
|
@@ -169,11 +168,8 @@ var OptionSelectMultiple = function OptionSelectMultiple() {
|
|
|
169
168
|
onClick: function onClick() {
|
|
170
169
|
return removeOptionInfo(index);
|
|
171
170
|
}
|
|
172
|
-
})))
|
|
173
|
-
|
|
174
|
-
invalid: fieldState.invalid,
|
|
175
|
-
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
176
|
-
}, field));
|
|
171
|
+
})))
|
|
172
|
+
}));
|
|
177
173
|
}
|
|
178
174
|
});
|
|
179
175
|
})), React__default["default"].createElement(blocks.Vspace, {
|
|
@@ -12,6 +12,7 @@ var icons = require('@elice/icons');
|
|
|
12
12
|
var styled = require('styled-components');
|
|
13
13
|
var context = require('../context.js');
|
|
14
14
|
var randomId = require('../utils/randomId.js');
|
|
15
|
+
var OptionEditor = require('./OptionEditor.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
@@ -25,7 +26,7 @@ var StyledWrap = styled__default["default"].div.withConfig({
|
|
|
25
26
|
})([""]);
|
|
26
27
|
var StyledInputGroup = styled__default["default"].div.withConfig({
|
|
27
28
|
componentId: "sc-1xufc1p-1"
|
|
28
|
-
})(["width:100%;.
|
|
29
|
+
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
29
30
|
var OptionSelectMultipleOrder = function OptionSelectMultipleOrder() {
|
|
30
31
|
var intl = reactIntl.useIntl();
|
|
31
32
|
var _useMaterialQuizEditC = context.useMaterialQuizEditContext(),
|
|
@@ -138,9 +139,7 @@ var OptionSelectMultipleOrder = function OptionSelectMultipleOrder() {
|
|
|
138
139
|
var field = _ref3.field,
|
|
139
140
|
fieldState = _ref3.fieldState;
|
|
140
141
|
var _a;
|
|
141
|
-
return React__default["default"].createElement(
|
|
142
|
-
size: "small",
|
|
143
|
-
width: "full",
|
|
142
|
+
return React__default["default"].createElement(OptionEditor["default"], Object.assign({
|
|
144
143
|
placeholder: intl.formatMessage({
|
|
145
144
|
id: 'option.common.select.placeholder'
|
|
146
145
|
}),
|
|
@@ -11,6 +11,7 @@ var icons = require('@elice/icons');
|
|
|
11
11
|
var styled = require('styled-components');
|
|
12
12
|
var context = require('../context.js');
|
|
13
13
|
var randomId = require('../utils/randomId.js');
|
|
14
|
+
var OptionEditor = require('./OptionEditor.js');
|
|
14
15
|
|
|
15
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
17
|
|
|
@@ -24,7 +25,7 @@ var StyledWrap = styled__default["default"].div.withConfig({
|
|
|
24
25
|
})([""]);
|
|
25
26
|
var StyledInputGroup = styled__default["default"].div.withConfig({
|
|
26
27
|
componentId: "sc-vizer2-1"
|
|
27
|
-
})(["width:100%;.
|
|
28
|
+
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
28
29
|
var StyledInputPrefixRadioOption = styled__default["default"](blocks.RadioOption).withConfig({
|
|
29
30
|
componentId: "sc-vizer2-2"
|
|
30
31
|
})([".eb-radio-option__label{display:none;}"]);
|
|
@@ -133,12 +134,13 @@ var OptionSelectOne = function OptionSelectOne() {
|
|
|
133
134
|
var field = _ref3.field,
|
|
134
135
|
fieldState = _ref3.fieldState;
|
|
135
136
|
var _a;
|
|
136
|
-
return React__default["default"].createElement(
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
return React__default["default"].createElement(OptionEditor["default"], Object.assign({}, field, {
|
|
138
|
+
invalid: fieldState.invalid,
|
|
139
|
+
invalidText: (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.error) === null || _a === void 0 ? void 0 : _a.message,
|
|
139
140
|
placeholder: intl.formatMessage({
|
|
140
141
|
id: 'option.common.select.placeholder'
|
|
141
142
|
}),
|
|
143
|
+
readOnly: disabled,
|
|
142
144
|
prefix: React__default["default"].createElement(blocks.Radio, {
|
|
143
145
|
value: watchedAnswerInfo[0],
|
|
144
146
|
disabled: disabled,
|
|
@@ -161,11 +163,8 @@ var OptionSelectOne = function OptionSelectOne() {
|
|
|
161
163
|
onClick: function onClick() {
|
|
162
164
|
return removeOptionInfo(index);
|
|
163
165
|
}
|
|
164
|
-
})))
|
|
165
|
-
|
|
166
|
-
invalid: fieldState.invalid,
|
|
167
|
-
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
168
|
-
}, field));
|
|
166
|
+
})))
|
|
167
|
+
}));
|
|
169
168
|
}
|
|
170
169
|
});
|
|
171
170
|
})), React__default["default"].createElement(blocks.Vspace, {
|
|
@@ -11,6 +11,6 @@ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
|
11
11
|
|
|
12
12
|
var StyledMarkdown = styled__default["default"](markdown.Markdown).withConfig({
|
|
13
13
|
componentId: "sc-l6r531-0"
|
|
14
|
-
})(["p{margin:0 !important;}"]);
|
|
14
|
+
})(["p{margin:0 !important;}code{white-space:pre-wrap;word-break:break-all;}"]);
|
|
15
15
|
|
|
16
16
|
exports["default"] = StyledMarkdown;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface OptionTextareaProps extends Omit<React.HTMLAttributes<HTMLTextAreaElement>, 'prefix'> {
|
|
3
|
+
prefix?: React.ReactNode;
|
|
4
|
+
suffix?: React.ReactNode;
|
|
5
|
+
invalid?: boolean;
|
|
6
|
+
invalidText?: string;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const OptionEditor: React.ForwardRefExoticComponent<OptionTextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
11
|
+
export default OptionEditor;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Textarea, Box, Text } from '@elice/blocks';
|
|
4
|
+
import { base } from '@elice/design-tokens';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import styled, { css } from 'styled-components';
|
|
7
|
+
|
|
8
|
+
//
|
|
9
|
+
//
|
|
10
|
+
//
|
|
11
|
+
var PREFIX = 'em-option-editor';
|
|
12
|
+
//
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
var StyledTextarea = styled(Textarea).withConfig({
|
|
16
|
+
componentId: "sc-50ghuz-0"
|
|
17
|
+
})(["padding:0.75rem 3rem;&.focus{border:1px solid ", ";}", ";", ";", ";"], base.color.primary6, function (props) {
|
|
18
|
+
return props.invalid ? css(["border:1px solid ", " !important;"], base.color.red8) : null;
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return props.disabled ? css(["background-color:", ";cursor:not-allowed;"], base.color.gray2) : null;
|
|
21
|
+
}, function (props) {
|
|
22
|
+
return props.readOnly ? css(["background-color:#f0f1f3;"]) : null;
|
|
23
|
+
});
|
|
24
|
+
var StyledTextareaWrap = styled.div.withConfig({
|
|
25
|
+
componentId: "sc-50ghuz-1"
|
|
26
|
+
})(["display:flex;position:relative;.em-option-editor-adornment{position:absolute;top:50%;transform:translateY(-50%);z-index:1;&.prefix{left:1rem;}&.suffix{right:1rem;}}"]);
|
|
27
|
+
//
|
|
28
|
+
//
|
|
29
|
+
//
|
|
30
|
+
var OptionEditor = React.forwardRef(function (_a, ref) {
|
|
31
|
+
var suffix = _a.suffix,
|
|
32
|
+
prefix = _a.prefix,
|
|
33
|
+
invalid = _a.invalid,
|
|
34
|
+
invalidText = _a.invalidText,
|
|
35
|
+
readOnly = _a.readOnly,
|
|
36
|
+
props = __rest(_a, ["suffix", "prefix", "invalid", "invalidText", "readOnly"]);
|
|
37
|
+
return React.createElement("div", {
|
|
38
|
+
className: classNames(PREFIX, props.className)
|
|
39
|
+
}, React.createElement(StyledTextareaWrap, {
|
|
40
|
+
className: "".concat(PREFIX, "-textarea-wrapper")
|
|
41
|
+
}, prefix ? React.createElement("div", {
|
|
42
|
+
className: "".concat(PREFIX, "-adornment prefix")
|
|
43
|
+
}, prefix) : null, React.createElement(StyledTextarea, Object.assign({}, props, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
invalid: invalid,
|
|
46
|
+
readOnly: readOnly,
|
|
47
|
+
"aria-disabled": props.disabled
|
|
48
|
+
})), suffix ? React.createElement("div", {
|
|
49
|
+
className: "".concat(PREFIX, "-adornment suffix")
|
|
50
|
+
}, suffix) : null), invalid ? React.createElement(Box, {
|
|
51
|
+
padding: "0 0.75rem",
|
|
52
|
+
margintop: "0.25rem",
|
|
53
|
+
className: "".concat(PREFIX, "-helperText-wrap")
|
|
54
|
+
}, React.createElement(Text, {
|
|
55
|
+
role: "red",
|
|
56
|
+
size: "tiny",
|
|
57
|
+
className: "".concat(PREFIX, "-helperText")
|
|
58
|
+
}, invalidText !== null && invalidText !== void 0 ? invalidText : '')) : null);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { OptionEditor as default };
|
|
@@ -3,11 +3,12 @@ import React from 'react';
|
|
|
3
3
|
import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
|
|
4
4
|
import { useIntl, FormattedMessage } from 'react-intl';
|
|
5
5
|
import { Transition } from 'react-transition-group';
|
|
6
|
-
import { StatusText, Vspace,
|
|
6
|
+
import { StatusText, Vspace, Checkbox, Tooltip, IconButton, Button, Icon } from '@elice/blocks';
|
|
7
7
|
import { eilMathsignMultiplyBasic, eilMathsignAddCircle } from '@elice/icons';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import { useMaterialQuizEditContext } from '../context.js';
|
|
10
10
|
import { createRandomId } from '../utils/randomId.js';
|
|
11
|
+
import OptionEditor from './OptionEditor.js';
|
|
11
12
|
|
|
12
13
|
var MIN_OPTION_INFO_COUNT = 2;
|
|
13
14
|
var MAX_OPTION_INFO_COUNT = 20;
|
|
@@ -16,7 +17,7 @@ var StyledWrap = styled.div.withConfig({
|
|
|
16
17
|
})([""]);
|
|
17
18
|
var StyledInputGroup = styled.div.withConfig({
|
|
18
19
|
componentId: "sc-1nbx9b8-1"
|
|
19
|
-
})(["width:100%;.
|
|
20
|
+
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
20
21
|
var OptionSelectMultiple = function OptionSelectMultiple() {
|
|
21
22
|
var intl = useIntl();
|
|
22
23
|
var _useMaterialQuizEditC = useMaterialQuizEditContext(),
|
|
@@ -129,12 +130,10 @@ var OptionSelectMultiple = function OptionSelectMultiple() {
|
|
|
129
130
|
var field = _ref3.field,
|
|
130
131
|
fieldState = _ref3.fieldState;
|
|
131
132
|
var _a;
|
|
132
|
-
return React.createElement(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
id: 'option.common.select.placeholder'
|
|
137
|
-
}),
|
|
133
|
+
return React.createElement(OptionEditor, Object.assign({}, field, {
|
|
134
|
+
invalid: fieldState.invalid,
|
|
135
|
+
invalidText: (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.error) === null || _a === void 0 ? void 0 : _a.message,
|
|
136
|
+
readOnly: disabled,
|
|
138
137
|
prefix: React.createElement(Checkbox, {
|
|
139
138
|
checked: watchedAnswerInfo.includes(index),
|
|
140
139
|
disabled: disabled,
|
|
@@ -160,11 +159,8 @@ var OptionSelectMultiple = function OptionSelectMultiple() {
|
|
|
160
159
|
onClick: function onClick() {
|
|
161
160
|
return removeOptionInfo(index);
|
|
162
161
|
}
|
|
163
|
-
})))
|
|
164
|
-
|
|
165
|
-
invalid: fieldState.invalid,
|
|
166
|
-
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
167
|
-
}, field));
|
|
162
|
+
})))
|
|
163
|
+
}));
|
|
168
164
|
}
|
|
169
165
|
});
|
|
170
166
|
})), React.createElement(Vspace, {
|
|
@@ -3,11 +3,12 @@ import React from 'react';
|
|
|
3
3
|
import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
|
|
4
4
|
import { useIntl, FormattedMessage } from 'react-intl';
|
|
5
5
|
import { Transition } from 'react-transition-group';
|
|
6
|
-
import { StatusText, Vspace,
|
|
6
|
+
import { StatusText, Vspace, Checkbox, Tooltip, IconButton, Button, Icon } from '@elice/blocks';
|
|
7
7
|
import { eilMathsignMultiplyBasic, eilMathsignAddCircle } from '@elice/icons';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import { useMaterialQuizEditContext } from '../context.js';
|
|
10
10
|
import { createRandomId } from '../utils/randomId.js';
|
|
11
|
+
import OptionEditor from './OptionEditor.js';
|
|
11
12
|
|
|
12
13
|
var MIN_OPTION_INFO_COUNT = 2;
|
|
13
14
|
var MAX_OPTION_INFO_COUNT = 20;
|
|
@@ -16,7 +17,7 @@ var StyledWrap = styled.div.withConfig({
|
|
|
16
17
|
})([""]);
|
|
17
18
|
var StyledInputGroup = styled.div.withConfig({
|
|
18
19
|
componentId: "sc-1xufc1p-1"
|
|
19
|
-
})(["width:100%;.
|
|
20
|
+
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
20
21
|
var OptionSelectMultipleOrder = function OptionSelectMultipleOrder() {
|
|
21
22
|
var intl = useIntl();
|
|
22
23
|
var _useMaterialQuizEditC = useMaterialQuizEditContext(),
|
|
@@ -129,9 +130,7 @@ var OptionSelectMultipleOrder = function OptionSelectMultipleOrder() {
|
|
|
129
130
|
var field = _ref3.field,
|
|
130
131
|
fieldState = _ref3.fieldState;
|
|
131
132
|
var _a;
|
|
132
|
-
return React.createElement(
|
|
133
|
-
size: "small",
|
|
134
|
-
width: "full",
|
|
133
|
+
return React.createElement(OptionEditor, Object.assign({
|
|
135
134
|
placeholder: intl.formatMessage({
|
|
136
135
|
id: 'option.common.select.placeholder'
|
|
137
136
|
}),
|
|
@@ -2,11 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
|
|
3
3
|
import { useIntl, FormattedMessage } from 'react-intl';
|
|
4
4
|
import { Transition } from 'react-transition-group';
|
|
5
|
-
import { RadioOption, StatusText, Vspace,
|
|
5
|
+
import { RadioOption, StatusText, Vspace, Radio, Tooltip, IconButton, Button, Icon } from '@elice/blocks';
|
|
6
6
|
import { eilMathsignMultiplyBasic, eilMathsignAddCircle } from '@elice/icons';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { useMaterialQuizEditContext } from '../context.js';
|
|
9
9
|
import { createRandomId } from '../utils/randomId.js';
|
|
10
|
+
import OptionEditor from './OptionEditor.js';
|
|
10
11
|
|
|
11
12
|
var MIN_OPTION_INFO_COUNT = 2;
|
|
12
13
|
var MAX_OPTION_INFO_COUNT = 20;
|
|
@@ -15,7 +16,7 @@ var StyledWrap = styled.div.withConfig({
|
|
|
15
16
|
})([""]);
|
|
16
17
|
var StyledInputGroup = styled.div.withConfig({
|
|
17
18
|
componentId: "sc-vizer2-1"
|
|
18
|
-
})(["width:100%;.
|
|
19
|
+
})(["width:100%;.em-option-editor{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
|
|
19
20
|
var StyledInputPrefixRadioOption = styled(RadioOption).withConfig({
|
|
20
21
|
componentId: "sc-vizer2-2"
|
|
21
22
|
})([".eb-radio-option__label{display:none;}"]);
|
|
@@ -124,12 +125,13 @@ var OptionSelectOne = function OptionSelectOne() {
|
|
|
124
125
|
var field = _ref3.field,
|
|
125
126
|
fieldState = _ref3.fieldState;
|
|
126
127
|
var _a;
|
|
127
|
-
return React.createElement(
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
return React.createElement(OptionEditor, Object.assign({}, field, {
|
|
129
|
+
invalid: fieldState.invalid,
|
|
130
|
+
invalidText: (_a = fieldState === null || fieldState === void 0 ? void 0 : fieldState.error) === null || _a === void 0 ? void 0 : _a.message,
|
|
130
131
|
placeholder: intl.formatMessage({
|
|
131
132
|
id: 'option.common.select.placeholder'
|
|
132
133
|
}),
|
|
134
|
+
readOnly: disabled,
|
|
133
135
|
prefix: React.createElement(Radio, {
|
|
134
136
|
value: watchedAnswerInfo[0],
|
|
135
137
|
disabled: disabled,
|
|
@@ -152,11 +154,8 @@ var OptionSelectOne = function OptionSelectOne() {
|
|
|
152
154
|
onClick: function onClick() {
|
|
153
155
|
return removeOptionInfo(index);
|
|
154
156
|
}
|
|
155
|
-
})))
|
|
156
|
-
|
|
157
|
-
invalid: fieldState.invalid,
|
|
158
|
-
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
|
|
159
|
-
}, field));
|
|
157
|
+
})))
|
|
158
|
+
}));
|
|
160
159
|
}
|
|
161
160
|
});
|
|
162
161
|
})), React.createElement(Vspace, {
|
|
@@ -3,6 +3,6 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
var StyledMarkdown = styled(Markdown).withConfig({
|
|
5
5
|
componentId: "sc-l6r531-0"
|
|
6
|
-
})(["p{margin:0 !important;}"]);
|
|
6
|
+
})(["p{margin:0 !important;}code{white-space:pre-wrap;word-break:break-all;}"]);
|
|
7
7
|
|
|
8
8
|
export { StyledMarkdown as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-quiz",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.230619.0",
|
|
4
4
|
"description": "User view and editing components of Elice material quiz",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@elice/icons": "^1.220803.0",
|
|
59
59
|
"@elice/icons-legacy": "npm:@elice/icons@0.220803.1",
|
|
60
60
|
"@elice/markdown": "^1.220803.0",
|
|
61
|
-
"@elice/material-shared-types": "1.
|
|
62
|
-
"@elice/material-shared-utils": "1.
|
|
61
|
+
"@elice/material-shared-types": "1.230619.0",
|
|
62
|
+
"@elice/material-shared-utils": "1.230619.0",
|
|
63
63
|
"@elice/types": "1.230522.0",
|
|
64
64
|
"@types/classnames": "^2.3.1",
|
|
65
65
|
"@types/jquery": "^3.5.13",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"react-use": "^17.2.4",
|
|
74
74
|
"styled-components": "^5.3.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "26306efb9ea6c3574539eb00edaf19781244efba"
|
|
77
77
|
}
|