@elice/material-quiz 1.220803.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/README.md +3 -0
- package/cjs/components/eb-sortable/EbDraggable.d.ts +18 -0
- package/cjs/components/eb-sortable/EbDraggable.js +112 -0
- package/cjs/components/eb-sortable/EbDroppable.d.ts +13 -0
- package/cjs/components/eb-sortable/EbDroppable.js +60 -0
- package/cjs/components/eb-sortable/EbSortable.d.ts +17 -0
- package/cjs/components/material-quiz/MaterialQuiz.d.ts +4 -0
- package/cjs/components/material-quiz/MaterialQuiz.i18n.d.ts +25 -0
- package/cjs/components/material-quiz/MaterialQuiz.i18n.js +55 -0
- package/cjs/components/material-quiz/MaterialQuiz.js +114 -0
- package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +55 -0
- package/cjs/components/material-quiz/MaterialQuizError.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizInfo.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizInfo.js +74 -0
- package/cjs/components/material-quiz/MaterialQuizSelectMultiple.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +203 -0
- package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +468 -0
- package/cjs/components/material-quiz/MaterialQuizSelectOne.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizSelectOne.js +191 -0
- package/cjs/components/material-quiz/MaterialQuizShimmer.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizShimmer.js +61 -0
- package/cjs/components/material-quiz/MaterialQuizText.d.ts +3 -0
- package/cjs/components/material-quiz/MaterialQuizText.js +181 -0
- package/cjs/components/material-quiz/QuizResultBadge.d.ts +7 -0
- package/cjs/components/material-quiz/QuizResultBadge.js +48 -0
- package/cjs/components/material-quiz/QuizSubmitStatusText.d.ts +7 -0
- package/cjs/components/material-quiz/QuizSubmitStatusText.js +38 -0
- package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +31 -0
- package/cjs/components/material-quiz/context/MaterialQuizContext.js +134 -0
- package/cjs/components/material-quiz/index.d.ts +3 -0
- package/cjs/components/material-quiz-edit/MaterialQuizEdit.d.ts +25 -0
- package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +91 -0
- package/cjs/components/material-quiz-edit/MaterialQuizEditContent.d.ts +3 -0
- package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +463 -0
- package/cjs/components/material-quiz-edit/context.d.ts +6 -0
- package/cjs/components/material-quiz-edit/context.js +15 -0
- package/cjs/components/material-quiz-edit/index.d.ts +2 -0
- package/cjs/components/material-quiz-edit/locales.d.ts +34 -0
- package/cjs/components/material-quiz-edit/locales.js +73 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.d.ts +3 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +204 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.d.ts +3 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +205 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectOne.d.ts +3 -0
- package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +207 -0
- package/cjs/components/material-quiz-edit/options/OptionText.d.ts +3 -0
- package/cjs/components/material-quiz-edit/options/OptionText.js +99 -0
- package/cjs/components/material-quiz-edit/utils/editValue.d.ts +15 -0
- package/cjs/components/material-quiz-edit/utils/editValue.js +37 -0
- package/cjs/components/material-quiz-edit/utils/randomId.d.ts +4 -0
- package/cjs/components/material-quiz-edit/utils/randomId.js +12 -0
- package/cjs/components/shared/QuestionBox.d.ts +16 -0
- package/cjs/components/shared/QuestionBox.js +111 -0
- package/cjs/components/shared/QuizDraggbleDroppedOption.d.ts +12 -0
- package/cjs/components/shared/QuizDraggbleDroppedOption.js +31 -0
- package/cjs/components/shared/QuizDraggbleDummyOption.d.ts +8 -0
- package/cjs/components/shared/QuizDraggbleDummyOption.js +36 -0
- package/cjs/components/shared/QuizDraggbleOption.d.ts +14 -0
- package/cjs/components/shared/QuizDraggbleOption.js +191 -0
- package/cjs/components/shared/StyledMarkdown.d.ts +3 -0
- package/cjs/components/shared/StyledMarkdown.js +14 -0
- package/cjs/components/shared/index.d.ts +7 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckbox.d.ts +8 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +26 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +9 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +42 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.d.ts +9 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +188 -0
- package/cjs/components/shared/question-radio/QuestionRadio.d.ts +8 -0
- package/cjs/components/shared/question-radio/QuestionRadio.js +26 -0
- package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +9 -0
- package/cjs/components/shared/question-radio/QuestionRadioContext.js +42 -0
- package/cjs/components/shared/question-radio/QuestionRadioOption.d.ts +9 -0
- package/cjs/components/shared/question-radio/QuestionRadioOption.js +156 -0
- package/cjs/helpers/index.d.ts +50 -0
- package/cjs/helpers/index.js +86 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +27 -0
- package/es/components/eb-sortable/EbDraggable.d.ts +18 -0
- package/es/components/eb-sortable/EbDraggable.js +105 -0
- package/es/components/eb-sortable/EbDroppable.d.ts +13 -0
- package/es/components/eb-sortable/EbDroppable.js +53 -0
- package/es/components/eb-sortable/EbSortable.d.ts +17 -0
- package/es/components/material-quiz/MaterialQuiz.d.ts +4 -0
- package/es/components/material-quiz/MaterialQuiz.i18n.d.ts +25 -0
- package/es/components/material-quiz/MaterialQuiz.i18n.js +50 -0
- package/es/components/material-quiz/MaterialQuiz.js +106 -0
- package/es/components/material-quiz/MaterialQuizAnswerExplanation.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +48 -0
- package/es/components/material-quiz/MaterialQuizError.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizInfo.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizInfo.js +68 -0
- package/es/components/material-quiz/MaterialQuizSelectMultiple.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizSelectMultiple.js +197 -0
- package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +461 -0
- package/es/components/material-quiz/MaterialQuizSelectOne.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizSelectOne.js +185 -0
- package/es/components/material-quiz/MaterialQuizShimmer.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizShimmer.js +54 -0
- package/es/components/material-quiz/MaterialQuizText.d.ts +3 -0
- package/es/components/material-quiz/MaterialQuizText.js +174 -0
- package/es/components/material-quiz/QuizResultBadge.d.ts +7 -0
- package/es/components/material-quiz/QuizResultBadge.js +42 -0
- package/es/components/material-quiz/QuizSubmitStatusText.d.ts +7 -0
- package/es/components/material-quiz/QuizSubmitStatusText.js +32 -0
- package/es/components/material-quiz/context/MaterialQuizContext.d.ts +31 -0
- package/es/components/material-quiz/context/MaterialQuizContext.js +124 -0
- package/es/components/material-quiz/index.d.ts +3 -0
- package/es/components/material-quiz-edit/MaterialQuizEdit.d.ts +25 -0
- package/es/components/material-quiz-edit/MaterialQuizEdit.js +86 -0
- package/es/components/material-quiz-edit/MaterialQuizEditContent.d.ts +3 -0
- package/es/components/material-quiz-edit/MaterialQuizEditContent.js +456 -0
- package/es/components/material-quiz-edit/context.d.ts +6 -0
- package/es/components/material-quiz-edit/context.js +6 -0
- package/es/components/material-quiz-edit/index.d.ts +2 -0
- package/es/components/material-quiz-edit/locales.d.ts +34 -0
- package/es/components/material-quiz-edit/locales.js +68 -0
- package/es/components/material-quiz-edit/options/OptionSelectMultiple.d.ts +3 -0
- package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +197 -0
- package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.d.ts +3 -0
- package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +198 -0
- package/es/components/material-quiz-edit/options/OptionSelectOne.d.ts +3 -0
- package/es/components/material-quiz-edit/options/OptionSelectOne.js +200 -0
- package/es/components/material-quiz-edit/options/OptionText.d.ts +3 -0
- package/es/components/material-quiz-edit/options/OptionText.js +93 -0
- package/es/components/material-quiz-edit/utils/editValue.d.ts +15 -0
- package/es/components/material-quiz-edit/utils/editValue.js +32 -0
- package/es/components/material-quiz-edit/utils/randomId.d.ts +4 -0
- package/es/components/material-quiz-edit/utils/randomId.js +8 -0
- package/es/components/shared/QuestionBox.d.ts +16 -0
- package/es/components/shared/QuestionBox.js +101 -0
- package/es/components/shared/QuizDraggbleDroppedOption.d.ts +12 -0
- package/es/components/shared/QuizDraggbleDroppedOption.js +25 -0
- package/es/components/shared/QuizDraggbleDummyOption.d.ts +8 -0
- package/es/components/shared/QuizDraggbleDummyOption.js +29 -0
- package/es/components/shared/QuizDraggbleOption.d.ts +14 -0
- package/es/components/shared/QuizDraggbleOption.js +184 -0
- package/es/components/shared/StyledMarkdown.d.ts +3 -0
- package/es/components/shared/StyledMarkdown.js +8 -0
- package/es/components/shared/index.d.ts +7 -0
- package/es/components/shared/question-checkbox/QuestionCheckbox.d.ts +8 -0
- package/es/components/shared/question-checkbox/QuestionCheckbox.js +19 -0
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +9 -0
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +33 -0
- package/es/components/shared/question-checkbox/QuestionCheckboxOption.d.ts +9 -0
- package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +181 -0
- package/es/components/shared/question-radio/QuestionRadio.d.ts +8 -0
- package/es/components/shared/question-radio/QuestionRadio.js +19 -0
- package/es/components/shared/question-radio/QuestionRadioContext.d.ts +9 -0
- package/es/components/shared/question-radio/QuestionRadioContext.js +33 -0
- package/es/components/shared/question-radio/QuestionRadioOption.d.ts +9 -0
- package/es/components/shared/question-radio/QuestionRadioOption.js +149 -0
- package/es/helpers/index.d.ts +50 -0
- package/es/helpers/index.js +78 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +10 -0
- package/package.json +75 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactHookForm = require('react-hook-form');
|
|
5
|
+
var reactIntl = require('react-intl');
|
|
6
|
+
var blocks = require('@elice/blocks');
|
|
7
|
+
var context = require('../context.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
const MIN_TEXT_LENGTH = 1;
|
|
14
|
+
const MAX_TEXT_LENGTH = 128;
|
|
15
|
+
|
|
16
|
+
const OptionText = () => {
|
|
17
|
+
const intl = reactIntl.useIntl();
|
|
18
|
+
const {
|
|
19
|
+
disabled
|
|
20
|
+
} = context.useMaterialQuizEditContext();
|
|
21
|
+
const {
|
|
22
|
+
control,
|
|
23
|
+
watch
|
|
24
|
+
} = reactHookForm.useFormContext();
|
|
25
|
+
const watchedIsAutoGrade = watch('isAutoGrade'); //
|
|
26
|
+
//
|
|
27
|
+
//
|
|
28
|
+
|
|
29
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(reactHookForm.Controller, {
|
|
30
|
+
control: control,
|
|
31
|
+
name: "answerInfo",
|
|
32
|
+
rules: {
|
|
33
|
+
required: {
|
|
34
|
+
value: watchedIsAutoGrade,
|
|
35
|
+
message: intl.formatMessage({
|
|
36
|
+
id: 'option.text.answerInfo.errorMessage.required'
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
minLength: {
|
|
40
|
+
value: MIN_TEXT_LENGTH,
|
|
41
|
+
message: intl.formatMessage({
|
|
42
|
+
id: 'common.errorMessage.range'
|
|
43
|
+
}, {
|
|
44
|
+
min: MIN_TEXT_LENGTH,
|
|
45
|
+
max: MAX_TEXT_LENGTH
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
maxLength: {
|
|
49
|
+
value: MAX_TEXT_LENGTH,
|
|
50
|
+
message: intl.formatMessage({
|
|
51
|
+
id: 'common.errorMessage.range'
|
|
52
|
+
}, {
|
|
53
|
+
min: MIN_TEXT_LENGTH,
|
|
54
|
+
max: MAX_TEXT_LENGTH
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
render: ({
|
|
59
|
+
field,
|
|
60
|
+
fieldState
|
|
61
|
+
}) => {
|
|
62
|
+
var _a;
|
|
63
|
+
|
|
64
|
+
return React__default["default"].createElement(blocks.Input, Object.assign({
|
|
65
|
+
size: "small",
|
|
66
|
+
width: "full",
|
|
67
|
+
minLength: MIN_TEXT_LENGTH,
|
|
68
|
+
maxLength: MAX_TEXT_LENGTH,
|
|
69
|
+
readOnly: disabled,
|
|
70
|
+
disabled: !watchedIsAutoGrade,
|
|
71
|
+
invalid: fieldState.invalid,
|
|
72
|
+
invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message,
|
|
73
|
+
helpText: intl.formatMessage({
|
|
74
|
+
id: 'option.text.answerInfo.hintText'
|
|
75
|
+
})
|
|
76
|
+
}, field, {
|
|
77
|
+
value: field.value
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
}), React__default["default"].createElement(blocks.Vspace, {
|
|
81
|
+
height: 0.5
|
|
82
|
+
}), React__default["default"].createElement(reactHookForm.Controller, {
|
|
83
|
+
control: control,
|
|
84
|
+
name: "isAutoGrade",
|
|
85
|
+
render: ({
|
|
86
|
+
field
|
|
87
|
+
}) => React__default["default"].createElement(blocks.Checkbox, Object.assign({
|
|
88
|
+
size: "small"
|
|
89
|
+
}, field, {
|
|
90
|
+
value: !field.value,
|
|
91
|
+
checked: !field.value,
|
|
92
|
+
onChange: v => field.onChange(!v)
|
|
93
|
+
}), React__default["default"].createElement(reactIntl.FormattedMessage, {
|
|
94
|
+
id: "option.text.isAutoGrade.checkbox.label"
|
|
95
|
+
}))
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
module.exports = OptionText;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MaterialQuizEditValue } from '../MaterialQuizEdit';
|
|
2
|
+
export declare type _QuizEditValue = Omit<MaterialQuizEditValue, 'optionInfo'> & {
|
|
3
|
+
optionInfo: {
|
|
4
|
+
id: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare function manipulateValue(v: MaterialQuizEditValue): _QuizEditValue;
|
|
12
|
+
/**
|
|
13
|
+
* Restore manipulation from `manipulateValue()`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function restoreValue(v: _QuizEditValue): MaterialQuizEditValue;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var randomId = require('./randomId.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function manipulateValue(v) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
|
|
14
|
+
return Object.assign(Object.assign({}, v), {
|
|
15
|
+
// convert string array to object array
|
|
16
|
+
// - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
|
|
17
|
+
optionInfo: Array.isArray(v.optionInfo) ? v.optionInfo.map(option => ({
|
|
18
|
+
id: randomId.createRandomId(),
|
|
19
|
+
value: option
|
|
20
|
+
})) : [],
|
|
21
|
+
// remove `"` mark around value
|
|
22
|
+
answerInfo: typeof v.answerInfo === 'string' ? (_b = (_a = /^"?([^"]*)"?$/.exec(v.answerInfo)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '' : v.answerInfo
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Restore manipulation from `manipulateValue()`.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
function restoreValue(v) {
|
|
30
|
+
return Object.assign(Object.assign({}, v), {
|
|
31
|
+
optionInfo: v.optionInfo.length ? v.optionInfo.map(option => option.value) : null,
|
|
32
|
+
answerInfo: Array.isArray(v.answerInfo) ? v.answerInfo : typeof v.answerInfo === 'object' || typeof v.answerInfo === 'undefined' ? undefined : `"${v.answerInfo}"`
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
exports.manipulateValue = manipulateValue;
|
|
37
|
+
exports.restoreValue = restoreValue;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from '@elice/blocks';
|
|
3
|
+
interface QuestionBoxProps {
|
|
4
|
+
footerActions?: ButtonProps[];
|
|
5
|
+
title?: string;
|
|
6
|
+
submitResult?: React.ReactNode;
|
|
7
|
+
submitStatus?: React.ReactNode;
|
|
8
|
+
onNext?: () => void;
|
|
9
|
+
isNextActive?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const StyledQuestionBox: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
+
vertical: boolean;
|
|
13
|
+
hasFooter: boolean;
|
|
14
|
+
}, never>;
|
|
15
|
+
declare const QuestionBox: React.FC<QuestionBoxProps>;
|
|
16
|
+
export default QuestionBox;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactIntl = require('react-intl');
|
|
8
|
+
var blocks = require('@elice/blocks');
|
|
9
|
+
var designTokens = require('@elice/design-tokens');
|
|
10
|
+
var styled = require('styled-components');
|
|
11
|
+
var MaterialQuizContext = require('../material-quiz/context/MaterialQuizContext.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
17
|
+
|
|
18
|
+
const StyledQuestionBox = styled__default["default"].div.withConfig({
|
|
19
|
+
componentId: "sc-6qfyxj-0"
|
|
20
|
+
})(["display:flex;flex-direction:column;border-radius:", ";overflow:hidden;width:100%;max-height:", ";min-height:", ";"], ({
|
|
21
|
+
vertical
|
|
22
|
+
}) => vertical ? '0' : '8px', ({
|
|
23
|
+
hasFooter
|
|
24
|
+
}) => hasFooter ? '100%' : '', ({
|
|
25
|
+
hasFooter
|
|
26
|
+
}) => hasFooter ? '' : '100%');
|
|
27
|
+
const StyledQuestionBoxHeader = styled__default["default"].div.withConfig({
|
|
28
|
+
componentId: "sc-6qfyxj-1"
|
|
29
|
+
})(["display:flex;justify-content:space-between;background-color:", ";padding:1rem 1.5rem;flex:none;height:3.5rem;"], designTokens.base.color.navy6);
|
|
30
|
+
const StyledQuestionBoxBody = styled__default["default"].div.withConfig({
|
|
31
|
+
componentId: "sc-6qfyxj-2"
|
|
32
|
+
})(["padding:1.5rem;background-color:", ";flex:auto;", ""], designTokens.base.color.navy7, ({
|
|
33
|
+
hasFooter
|
|
34
|
+
}) => hasFooter ? 'height: 100%; overflow-y: auto;' : '');
|
|
35
|
+
const StyledQuestionBoxFooter = styled__default["default"].div.withConfig({
|
|
36
|
+
componentId: "sc-6qfyxj-3"
|
|
37
|
+
})(["flex:none;display:flex;justify-content:space-between;align-items:center;padding:0.75rem 1.5rem;background-color:", ";", ""], designTokens.base.color.navy6, ({
|
|
38
|
+
vertical
|
|
39
|
+
}) => {
|
|
40
|
+
return vertical ? `
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
align-items: flex-start;
|
|
43
|
+
` : '';
|
|
44
|
+
});
|
|
45
|
+
const StyledQuestionBoxFooterActions = styled__default["default"].div.withConfig({
|
|
46
|
+
componentId: "sc-6qfyxj-4"
|
|
47
|
+
})(["display:flex;"]);
|
|
48
|
+
const StyledQuestionBoxFooterStatus = styled__default["default"].div.withConfig({
|
|
49
|
+
componentId: "sc-6qfyxj-5"
|
|
50
|
+
})(["margin-left:0.75rem;", ""], ({
|
|
51
|
+
vertical
|
|
52
|
+
}) => {
|
|
53
|
+
return vertical ? `
|
|
54
|
+
margin-left: 0;
|
|
55
|
+
margin-top: 0.75rem;
|
|
56
|
+
` : '';
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const QuestionBox = _a => {
|
|
60
|
+
var {
|
|
61
|
+
children,
|
|
62
|
+
footerActions = [],
|
|
63
|
+
title,
|
|
64
|
+
submitResult,
|
|
65
|
+
submitStatus,
|
|
66
|
+
onNext,
|
|
67
|
+
isNextActive
|
|
68
|
+
} = _a,
|
|
69
|
+
props = tslib.__rest(_a, ["children", "footerActions", "title", "submitResult", "submitStatus", "onNext", "isNextActive"]);
|
|
70
|
+
|
|
71
|
+
const intl = reactIntl.useIntl();
|
|
72
|
+
const {
|
|
73
|
+
vertical
|
|
74
|
+
} = MaterialQuizContext.useMaterialQuizState();
|
|
75
|
+
const hasFooter = footerActions.length > 0;
|
|
76
|
+
const header = React__default["default"].createElement(StyledQuestionBoxHeader, null, React__default["default"].createElement(blocks.Text, {
|
|
77
|
+
bold: true,
|
|
78
|
+
customStyles: {
|
|
79
|
+
color: designTokens.base.color.navy0
|
|
80
|
+
}
|
|
81
|
+
}, title || ' '), submitResult ? submitResult : null);
|
|
82
|
+
const body = React__default["default"].createElement(StyledQuestionBoxBody, {
|
|
83
|
+
hasFooter: hasFooter
|
|
84
|
+
}, children);
|
|
85
|
+
const footer = React__default["default"].createElement(StyledQuestionBoxFooter, {
|
|
86
|
+
vertical: vertical
|
|
87
|
+
}, React__default["default"].createElement(StyledQuestionBoxFooterActions, null, footerActions.map((action, index) => React__default["default"].createElement(blocks.Button, Object.assign({
|
|
88
|
+
key: index,
|
|
89
|
+
size: "small"
|
|
90
|
+
}, action), action.children)), isNextActive ? React__default["default"].createElement(blocks.Box, {
|
|
91
|
+
marginleft: "0.75rem"
|
|
92
|
+
}, React__default["default"].createElement(blocks.Button, {
|
|
93
|
+
size: "small",
|
|
94
|
+
border: true,
|
|
95
|
+
tabIndex: 0,
|
|
96
|
+
transparent: false,
|
|
97
|
+
role: "lightpurple",
|
|
98
|
+
onClick: onNext
|
|
99
|
+
}, intl.formatMessage({
|
|
100
|
+
id: 'materialQuiz.next'
|
|
101
|
+
}))) : null), React__default["default"].createElement(StyledQuestionBoxFooterStatus, {
|
|
102
|
+
vertical: vertical
|
|
103
|
+
}, submitStatus));
|
|
104
|
+
return React__default["default"].createElement(StyledQuestionBox, Object.assign({}, props, {
|
|
105
|
+
hasFooter: hasFooter,
|
|
106
|
+
vertical: vertical
|
|
107
|
+
}), header, body, footerActions.length > 0 ? footer : null);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
exports.StyledQuestionBox = StyledQuestionBox;
|
|
111
|
+
exports["default"] = QuestionBox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuizDraggbleOptionRole } from './QuizDraggbleOption';
|
|
3
|
+
interface QuizDraggbleDroppedOptionProps {
|
|
4
|
+
id: string;
|
|
5
|
+
content: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
role: QuizDraggbleOptionRole;
|
|
8
|
+
indexOrder?: number;
|
|
9
|
+
isMarkdown?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const QuizDraggbleDroppedOption: React.FC<QuizDraggbleDroppedOptionProps>;
|
|
12
|
+
export default QuizDraggbleDroppedOption;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var QuizDraggbleOption = require('./QuizDraggbleOption.js');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
|
|
10
|
+
const QuizDraggbleDroppedOption = ({
|
|
11
|
+
id,
|
|
12
|
+
content,
|
|
13
|
+
disabled = false,
|
|
14
|
+
role,
|
|
15
|
+
indexOrder,
|
|
16
|
+
isMarkdown
|
|
17
|
+
}) => {
|
|
18
|
+
return React__default["default"].createElement(QuizDraggbleOption, {
|
|
19
|
+
id: id,
|
|
20
|
+
key: id,
|
|
21
|
+
content: content,
|
|
22
|
+
className: "quiz-answer",
|
|
23
|
+
disabled: disabled,
|
|
24
|
+
role: role,
|
|
25
|
+
indexOrder: indexOrder,
|
|
26
|
+
clone: true,
|
|
27
|
+
isMarkdown: isMarkdown
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
module.exports = QuizDraggbleDroppedOption;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EbDroppableProps } from '../eb-sortable/EbDroppable';
|
|
3
|
+
interface QuizDraggbleDummyOptionProps {
|
|
4
|
+
indexOrder: number;
|
|
5
|
+
onDrop: EbDroppableProps['onDrop'];
|
|
6
|
+
}
|
|
7
|
+
declare const QuizDraggbleDummyOption: React.FC<QuizDraggbleDummyOptionProps>;
|
|
8
|
+
export default QuizDraggbleDummyOption;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var blocks = require('@elice/blocks');
|
|
5
|
+
var designTokens = require('@elice/design-tokens');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
var EbDroppable = require('../eb-sortable/EbDroppable.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
|
+
|
|
14
|
+
const StyledQuizDraggbleDummyOption = styled__default["default"](EbDroppable).withConfig({
|
|
15
|
+
componentId: "sc-1ayp8c1-0"
|
|
16
|
+
})(["display:flex;justify-content:space-between;align-items:center;border:1px dashed ", ";border-radius:8px;overflow:hidden;background-color:", ";padding:0.875rem;color:", ";font-size:0.875rem;&.ui-droppable-hover{outline:1px dashed ", ";}"], designTokens.base.color.navy4, designTokens.base.color.navy5, designTokens.base.color.navy0, designTokens.base.color.navy0);
|
|
17
|
+
const StyledOrder = styled__default["default"].div.withConfig({
|
|
18
|
+
componentId: "sc-1ayp8c1-1"
|
|
19
|
+
})(["width:1.5rem;height:1.5rem;display:flex;border-radius:4px;align-items:center;justify-content:center;color:", ";background-color:", ";flex:none;margin-left:0.5rem;"], designTokens.base.color.navy0, designTokens.base.color.navy4);
|
|
20
|
+
|
|
21
|
+
const QuizDraggbleDummyOption = ({
|
|
22
|
+
indexOrder,
|
|
23
|
+
onDrop
|
|
24
|
+
}) => {
|
|
25
|
+
return React__default["default"].createElement(StyledQuizDraggbleDummyOption, {
|
|
26
|
+
onDrop: onDrop
|
|
27
|
+
}, React__default["default"].createElement(blocks.Text, {
|
|
28
|
+
size: "small",
|
|
29
|
+
wordBreak: "break-all",
|
|
30
|
+
customStyles: {
|
|
31
|
+
color: designTokens.base.color.navy0
|
|
32
|
+
}
|
|
33
|
+
}, '답안을 드래그 앤 드롭하세요.'), React__default["default"].createElement(StyledOrder, null, indexOrder));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
module.exports = QuizDraggbleDummyOption;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type QuizDraggbleOptionRole = 'default' | 'correct' | 'wrong' | 'answer';
|
|
3
|
+
export interface QuizDraggbleOptionProps {
|
|
4
|
+
id: string;
|
|
5
|
+
className: string;
|
|
6
|
+
content: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
role?: QuizDraggbleOptionRole;
|
|
9
|
+
indexOrder?: number;
|
|
10
|
+
clone?: boolean;
|
|
11
|
+
isMarkdown?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const QuizDraggbleOption: React.FC<QuizDraggbleOptionProps>;
|
|
14
|
+
export default QuizDraggbleOption;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var blocks = require('@elice/blocks');
|
|
5
|
+
var designTokens = require('@elice/design-tokens');
|
|
6
|
+
var icons = require('@elice/icons');
|
|
7
|
+
var styled = require('styled-components');
|
|
8
|
+
var EbDraggable = require('../eb-sortable/EbDraggable.js');
|
|
9
|
+
var MaterialQuizContext = require('../material-quiz/context/MaterialQuizContext.js');
|
|
10
|
+
var StyledMarkdown = require('./StyledMarkdown.js');
|
|
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 styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
16
|
+
|
|
17
|
+
const StyledQuizDraggbleOptionHandle = styled__default["default"].div.withConfig({
|
|
18
|
+
componentId: "sc-19b0zkq-0"
|
|
19
|
+
})(["display:flex;align-items:center;justify-content:center;background-color:", ";width:1.5rem;flex:none;"], designTokens.base.color.navy3);
|
|
20
|
+
const StyledQuizDraggbleOptionContent = styled__default["default"].div.withConfig({
|
|
21
|
+
componentId: "sc-19b0zkq-1"
|
|
22
|
+
})(["display:flex;justify-content:space-between;min-width:0;align-items:center;flex:auto;padding:0.875rem;border:", ";background-color:", ";"], ({
|
|
23
|
+
role
|
|
24
|
+
}) => {
|
|
25
|
+
switch (role) {
|
|
26
|
+
case 'correct':
|
|
27
|
+
return `1px solid ${designTokens.base.color.primary6}`;
|
|
28
|
+
|
|
29
|
+
case 'wrong':
|
|
30
|
+
return `1px solid ${designTokens.base.color.red6}`;
|
|
31
|
+
|
|
32
|
+
default:
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
}, ({
|
|
36
|
+
role
|
|
37
|
+
}) => {
|
|
38
|
+
switch (role) {
|
|
39
|
+
case 'answer':
|
|
40
|
+
return designTokens.base.color.primary6;
|
|
41
|
+
|
|
42
|
+
default:
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const StyledOrder = styled__default["default"].div.withConfig({
|
|
47
|
+
componentId: "sc-19b0zkq-2"
|
|
48
|
+
})(["width:1.5rem;height:1.5rem;display:flex;border-radius:4px;align-items:center;justify-content:center;color:", ";background-color:", ";flex:none;margin-left:0.5rem;"], designTokens.base.color.navy0, designTokens.base.color.navy4);
|
|
49
|
+
const StyledQuizDraggbleOption = styled__default["default"](EbDraggable).withConfig({
|
|
50
|
+
componentId: "sc-19b0zkq-3"
|
|
51
|
+
})(["display:flex;border-radius:8px;border:1px solid ", ";background-color:", ";overflow:hidden;z-index:999 !important;", "{background-color:", ";color:", ";}", "{background-color:", ";& *{color:", ";}}", "{background-color:", ";color:", ";}&.ui-draggable-dragging{z-index:1000 !important;color:", " !important;border:none !important;", "{background-color:", ";}", "{background-color:", ";border:1px solid ", " !important;}", "{color:", ";background-color:", ";}& *{color:", " !important;}}&.ui-draggable-dragging.quiz-answer{width:calc(100% - 1rem * 2);}"], designTokens.base.color.navy4, designTokens.base.color.navy5, StyledQuizDraggbleOptionHandle, ({
|
|
52
|
+
role
|
|
53
|
+
}) => {
|
|
54
|
+
switch (role) {
|
|
55
|
+
case 'answer':
|
|
56
|
+
return designTokens.base.color.primary4;
|
|
57
|
+
// todos
|
|
58
|
+
|
|
59
|
+
case 'correct':
|
|
60
|
+
return designTokens.base.color.green4;
|
|
61
|
+
|
|
62
|
+
case 'wrong':
|
|
63
|
+
return designTokens.base.color.red4;
|
|
64
|
+
|
|
65
|
+
default:
|
|
66
|
+
return designTokens.base.color.navy3;
|
|
67
|
+
}
|
|
68
|
+
}, ({
|
|
69
|
+
role
|
|
70
|
+
}) => {
|
|
71
|
+
switch (role) {
|
|
72
|
+
case 'answer':
|
|
73
|
+
return designTokens.base.color.primary9;
|
|
74
|
+
// todos
|
|
75
|
+
|
|
76
|
+
case 'correct':
|
|
77
|
+
return designTokens.base.color.green9;
|
|
78
|
+
|
|
79
|
+
case 'wrong':
|
|
80
|
+
return designTokens.base.color.red9;
|
|
81
|
+
|
|
82
|
+
default:
|
|
83
|
+
return designTokens.base.color.navy5;
|
|
84
|
+
}
|
|
85
|
+
}, StyledQuizDraggbleOptionContent, ({
|
|
86
|
+
role
|
|
87
|
+
}) => {
|
|
88
|
+
switch (role) {
|
|
89
|
+
case 'answer':
|
|
90
|
+
return designTokens.base.color.primary1;
|
|
91
|
+
// todos
|
|
92
|
+
|
|
93
|
+
case 'correct':
|
|
94
|
+
return designTokens.base.color.green1;
|
|
95
|
+
|
|
96
|
+
case 'wrong':
|
|
97
|
+
return designTokens.base.color.red1;
|
|
98
|
+
|
|
99
|
+
default:
|
|
100
|
+
return designTokens.base.color.navy5;
|
|
101
|
+
}
|
|
102
|
+
}, ({
|
|
103
|
+
role
|
|
104
|
+
}) => {
|
|
105
|
+
switch (role) {
|
|
106
|
+
case 'answer':
|
|
107
|
+
return designTokens.base.color.primary9;
|
|
108
|
+
// todos
|
|
109
|
+
|
|
110
|
+
case 'correct':
|
|
111
|
+
return designTokens.base.color.green9;
|
|
112
|
+
|
|
113
|
+
case 'wrong':
|
|
114
|
+
return designTokens.base.color.red9;
|
|
115
|
+
|
|
116
|
+
default:
|
|
117
|
+
return designTokens.base.color.navy0;
|
|
118
|
+
}
|
|
119
|
+
}, StyledOrder, ({
|
|
120
|
+
role
|
|
121
|
+
}) => {
|
|
122
|
+
switch (role) {
|
|
123
|
+
case 'answer':
|
|
124
|
+
return designTokens.base.color.primary3;
|
|
125
|
+
// todos
|
|
126
|
+
|
|
127
|
+
case 'correct':
|
|
128
|
+
return designTokens.base.color.green3;
|
|
129
|
+
|
|
130
|
+
case 'wrong':
|
|
131
|
+
return designTokens.base.color.red3;
|
|
132
|
+
|
|
133
|
+
default:
|
|
134
|
+
return designTokens.base.color.navy4;
|
|
135
|
+
}
|
|
136
|
+
}, ({
|
|
137
|
+
role
|
|
138
|
+
}) => {
|
|
139
|
+
switch (role) {
|
|
140
|
+
case 'answer':
|
|
141
|
+
return designTokens.base.color.primary9;
|
|
142
|
+
// todos
|
|
143
|
+
|
|
144
|
+
case 'correct':
|
|
145
|
+
return designTokens.base.color.green9;
|
|
146
|
+
|
|
147
|
+
case 'wrong':
|
|
148
|
+
return designTokens.base.color.red9;
|
|
149
|
+
|
|
150
|
+
default:
|
|
151
|
+
return designTokens.base.color.navy0;
|
|
152
|
+
}
|
|
153
|
+
}, designTokens.base.color.navy0, StyledQuizDraggbleOptionHandle, designTokens.base.color.navy5, StyledQuizDraggbleOptionContent, designTokens.base.color.navy4, designTokens.base.color.navy4, StyledOrder, designTokens.base.color.navy0, designTokens.base.color.navy5, designTokens.base.color.navy0);
|
|
154
|
+
|
|
155
|
+
const QuizDraggbleOption = ({
|
|
156
|
+
id,
|
|
157
|
+
className,
|
|
158
|
+
content,
|
|
159
|
+
disabled = false,
|
|
160
|
+
role = 'default',
|
|
161
|
+
indexOrder,
|
|
162
|
+
clone = false,
|
|
163
|
+
isMarkdown = false
|
|
164
|
+
}) => {
|
|
165
|
+
const {
|
|
166
|
+
vertical
|
|
167
|
+
} = MaterialQuizContext.useMaterialQuizState();
|
|
168
|
+
return React__default["default"].createElement(StyledQuizDraggbleOption, {
|
|
169
|
+
id: id,
|
|
170
|
+
className: className,
|
|
171
|
+
disabled: disabled,
|
|
172
|
+
role: role,
|
|
173
|
+
clone: clone,
|
|
174
|
+
vertical: vertical
|
|
175
|
+
}, React__default["default"].createElement(StyledQuizDraggbleOptionHandle, null, React__default["default"].createElement(blocks.Icon, {
|
|
176
|
+
size: "large",
|
|
177
|
+
icon: icons.eilDraggableVertical
|
|
178
|
+
})), React__default["default"].createElement(StyledQuizDraggbleOptionContent, null, isMarkdown ? React__default["default"].createElement(StyledMarkdown, {
|
|
179
|
+
children: content,
|
|
180
|
+
dark: true,
|
|
181
|
+
paddingx: 0,
|
|
182
|
+
paddingy: 0
|
|
183
|
+
}) : React__default["default"].createElement(blocks.Text, {
|
|
184
|
+
size: "small",
|
|
185
|
+
userSelect: "none",
|
|
186
|
+
wordBreak: "break-all",
|
|
187
|
+
role: role === 'answer' ? 'white' : 'default'
|
|
188
|
+
}, content), indexOrder ? React__default["default"].createElement(StyledOrder, null, indexOrder) : null));
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
module.exports = QuizDraggbleOption;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const StyledMarkdown: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/markdown").MarkdownProps & import("react").RefAttributes<HTMLParagraphElement>>, any, {}, never>;
|
|
3
|
+
export default StyledMarkdown;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var markdown = require('@elice/markdown');
|
|
4
|
+
var styled = require('styled-components');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
9
|
+
|
|
10
|
+
const StyledMarkdown = styled__default["default"](markdown.Markdown).withConfig({
|
|
11
|
+
componentId: "sc-l6r531-0"
|
|
12
|
+
})(["p{margin:0 !important;}"]);
|
|
13
|
+
|
|
14
|
+
module.exports = StyledMarkdown;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as QuizDraggbleDroppedOption } from './QuizDraggbleDroppedOption';
|
|
2
|
+
export { default as QuizDraggbleDummyOption } from './QuizDraggbleDummyOption';
|
|
3
|
+
export { default as QuizDraggbleOption } from './QuizDraggbleOption';
|
|
4
|
+
export { default as QuestionRadio } from './question-radio/QuestionRadio';
|
|
5
|
+
export { default as QuestionRadioOption } from './question-radio/QuestionRadioOption';
|
|
6
|
+
export { default as QuestionCheckbox } from './question-checkbox/QuestionCheckbox';
|
|
7
|
+
export { default as QuestionCheckboxOption } from './question-checkbox/QuestionCheckboxOption';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
var QuestionCheckboxContext = require('./QuestionCheckboxContext.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
+
|
|
13
|
+
const StyledQuestionCheckbox = styled__default["default"].div.withConfig({
|
|
14
|
+
componentId: "sc-1jgy6x5-0"
|
|
15
|
+
})(["display:flex;flex-direction:column;"]);
|
|
16
|
+
|
|
17
|
+
const QuestionCheckbox = _a => {
|
|
18
|
+
var {
|
|
19
|
+
children
|
|
20
|
+
} = _a,
|
|
21
|
+
props = tslib.__rest(_a, ["children"]);
|
|
22
|
+
|
|
23
|
+
return React__default["default"].createElement(QuestionCheckboxContext.QuestionCheckboxContextProvider, Object.assign({}, props), React__default["default"].createElement(StyledQuestionCheckbox, null, children));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
module.exports = QuestionCheckbox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuestionCheckboxProps } from './QuestionCheckbox';
|
|
3
|
+
declare type Value = Pick<QuestionCheckboxProps, 'selectedOptions' | 'disabled' | 'onSelect'>;
|
|
4
|
+
interface QuestionCheckboxProviderProps extends QuestionCheckboxProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): JSX.Element;
|
|
8
|
+
declare function useQuestionCheckboxContext(): Value;
|
|
9
|
+
export { QuestionCheckboxContextProvider, useQuestionCheckboxContext };
|