@elice/material-quiz 1.250325.0-edit.0 → 1.250325.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.
@@ -77,7 +77,9 @@ var OptionEditor = React__default.default.forwardRef(function (_a, ref) {
77
77
  ref: handleTextAreaApi,
78
78
  invalid: invalid,
79
79
  readOnly: readOnly,
80
- resetFocus: props.onBlur
80
+ resetFocus: props.onBlur,
81
+ disabled: readOnly,
82
+ "aria-disabled": props.disabled
81
83
  })), suffix ? jsxRuntime.jsx("div", {
82
84
  className: "".concat(PREFIX, "-adornment suffix"),
83
85
  onDragStart: function onDragStart(e) {
@@ -6,6 +6,7 @@ var jsxRuntime = require('react/jsx-runtime');
6
6
  var reactHookForm = require('react-hook-form');
7
7
  var intl = require('@elice/intl');
8
8
  var material = require('@mui/material');
9
+ var context = require('../../context.js');
9
10
 
10
11
  //
11
12
  //
@@ -21,6 +22,8 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
21
22
  //
22
23
  var intl$1 = intl.useRawEliceIntl();
23
24
  //
25
+ var _useMaterialQuizEditC = context.useMaterialQuizEditContext(),
26
+ disabled = _useMaterialQuizEditC.disabled;
24
27
  var _useFormContext = reactHookForm.useFormContext(),
25
28
  control = _useFormContext.control;
26
29
  //
@@ -72,7 +75,7 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
72
75
  max: MAX_TEXT_LENGTH
73
76
  }
74
77
  },
75
- disabled: !watchedIsAutoGrade,
78
+ disabled: !watchedIsAutoGrade || disabled,
76
79
  error: fieldState.invalid,
77
80
  helperText: ((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || ((_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _b === void 0 ? void 0 : _b.helperText),
78
81
  placeholder: ((_c = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _c === void 0 ? void 0 : _c.placeholder) || intl$1.formatMessage({
@@ -81,7 +81,8 @@ var OptionGroupGroupListItem = function OptionGroupGroupListItem(_ref2) {
81
81
  fieldState = _ref3.fieldState;
82
82
  return jsxRuntime.jsx(StyledInputGroup, Object.assign({
83
83
  invalid: fieldState.invalid || !isGroupChildAnswer,
84
- width: "full"
84
+ width: "full",
85
+ disabled: disabled
85
86
  }, field, {
86
87
  ref: null
87
88
  }));
@@ -67,7 +67,9 @@ var OptionEditor = React.forwardRef(function (_a, ref) {
67
67
  ref: handleTextAreaApi,
68
68
  invalid: invalid,
69
69
  readOnly: readOnly,
70
- resetFocus: props.onBlur
70
+ resetFocus: props.onBlur,
71
+ disabled: readOnly,
72
+ "aria-disabled": props.disabled
71
73
  })), suffix ? jsx("div", {
72
74
  className: "".concat(PREFIX, "-adornment suffix"),
73
75
  onDragStart: function onDragStart(e) {
@@ -2,6 +2,7 @@ import { jsx } from 'react/jsx-runtime';
2
2
  import { useFormContext, useWatch, Controller } from 'react-hook-form';
3
3
  import { useRawEliceIntl } from '@elice/intl';
4
4
  import { TextField } from '@mui/material';
5
+ import { useMaterialQuizEditContext } from '../../context.js';
5
6
 
6
7
  //
7
8
  //
@@ -17,6 +18,8 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
17
18
  //
18
19
  var intl = useRawEliceIntl();
19
20
  //
21
+ var _useMaterialQuizEditC = useMaterialQuizEditContext(),
22
+ disabled = _useMaterialQuizEditC.disabled;
20
23
  var _useFormContext = useFormContext(),
21
24
  control = _useFormContext.control;
22
25
  //
@@ -68,7 +71,7 @@ var AnswerInfoDefaultController = function AnswerInfoDefaultController(_ref) {
68
71
  max: MAX_TEXT_LENGTH
69
72
  }
70
73
  },
71
- disabled: !watchedIsAutoGrade,
74
+ disabled: !watchedIsAutoGrade || disabled,
72
75
  error: fieldState.invalid,
73
76
  helperText: ((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || ((_b = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _b === void 0 ? void 0 : _b.helperText),
74
77
  placeholder: ((_c = slotProps === null || slotProps === void 0 ? void 0 : slotProps.TextField) === null || _c === void 0 ? void 0 : _c.placeholder) || intl.formatMessage({
@@ -72,7 +72,8 @@ var OptionGroupGroupListItem = function OptionGroupGroupListItem(_ref2) {
72
72
  fieldState = _ref3.fieldState;
73
73
  return jsx(StyledInputGroup, Object.assign({
74
74
  invalid: fieldState.invalid || !isGroupChildAnswer,
75
- width: "full"
75
+ width: "full",
76
+ disabled: disabled
76
77
  }, field, {
77
78
  ref: null
78
79
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-quiz",
3
- "version": "1.250325.0-edit.0",
3
+ "version": "1.250325.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",
@@ -76,8 +76,8 @@
76
76
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
77
77
  "@elice/intl": "0.241127.0",
78
78
  "@elice/markdown": "1.241015.0",
79
- "@elice/material-shared-types": "1.250325.0-edit.0",
80
- "@elice/material-shared-utils": "1.250325.0-edit.0",
79
+ "@elice/material-shared-types": "1.250325.0",
80
+ "@elice/material-shared-utils": "1.250325.0",
81
81
  "@elice/mui-elements": "^5.250108.0-controllabel.0",
82
82
  "@elice/mui-system": "^5.250108.0-controllabel.0",
83
83
  "@elice/openapi-client-course": "^1.241220.0",