touchstudy-core 0.1.157 → 0.1.158

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.
@@ -5,6 +5,7 @@ interface Props {
5
5
  onChange: Function;
6
6
  isDisabled?: boolean;
7
7
  rest?: any;
8
+ totalQuestions?: number;
8
9
  }
9
10
  declare const QuestionCountSelector: FC<Props>;
10
11
  export default QuestionCountSelector;
@@ -93,3 +93,4 @@ export declare const CompareTypeOptions: {
93
93
  label: string;
94
94
  value: QuestionAnswerType;
95
95
  }[];
96
+ export declare const MAX_QUESTIONS_IN_QUESTION_GROUP = 20;
package/dist/index.js CHANGED
@@ -7623,10 +7623,22 @@ var QuestionCountSelector = function QuestionCountSelector(_ref) {
7623
7623
  value = _ref.value,
7624
7624
  onChange = _ref.onChange,
7625
7625
  isDisabled = _ref.isDisabled,
7626
- rest = _ref.rest;
7626
+ rest = _ref.rest,
7627
+ totalQuestions = _ref.totalQuestions;
7627
7628
  var _useTranslation = reactI18next.useTranslation(),
7628
7629
  t = _useTranslation.t;
7629
- var questionOptions = QUESTION_OPTIONS.map(function (i) {
7630
+ var questionOptions = totalQuestions && totalQuestions > 1 ? Array.from({
7631
+ length: totalQuestions
7632
+ }, function (_, i) {
7633
+ return i + 1;
7634
+ }).map(function (i) {
7635
+ return {
7636
+ label: t("question_count_format", {
7637
+ number: i
7638
+ }),
7639
+ value: i
7640
+ };
7641
+ }) : QUESTION_OPTIONS.map(function (i) {
7630
7642
  return {
7631
7643
  label: t("question_count_format", {
7632
7644
  number: i
@@ -33561,6 +33573,7 @@ var CompareTypeOptions = [{
33561
33573
  label: "synonym_processing",
33562
33574
  value: exports.QuestionAnswerType.SynonymProcessing
33563
33575
  }];
33576
+ var MAX_QUESTIONS_IN_QUESTION_GROUP = 20;
33564
33577
 
33565
33578
  var CustomTextbookTab = function CustomTextbookTab(props) {
33566
33579
  var children = props.children,
@@ -34895,7 +34908,8 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
34895
34908
  var field = _ref2.field;
34896
34909
  return React__default.createElement(QuestionCountSelector, Object.assign({}, field, {
34897
34910
  onChange: handleChangeQuestionCount,
34898
- isDisabled: disabled
34911
+ isDisabled: disabled,
34912
+ totalQuestions: MAX_QUESTIONS_IN_QUESTION_GROUP
34899
34913
  }));
34900
34914
  }
34901
34915
  }))), isMath && React__default.createElement(material.Grid, {
@@ -36211,6 +36225,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
36211
36225
  onChange: function onChange(event) {
36212
36226
  return !disabled && handleUploadImage(event);
36213
36227
  },
36228
+ disabled: disabled,
36214
36229
  onClick: function onClick(e) {
36215
36230
  if (!disabled) {
36216
36231
  e.target.value = "";
@@ -36850,7 +36865,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
36850
36865
  }, React__default.createElement(material.FormLabel, {
36851
36866
  htmlFor: "type",
36852
36867
  className: "text-center"
36853
- }, i18n.t("korea")), React__default.createElement(formik.Field, {
36868
+ }, i18n.t("korean_language")), React__default.createElement(formik.Field, {
36854
36869
  name: "type",
36855
36870
  render: function render(_ref4) {
36856
36871
  var field = _ref4.field;