optimized-react-component-library-xyz123 0.1.134 → 0.1.136

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/dist/index.mjs CHANGED
@@ -1,13 +1,17 @@
1
1
  // src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- var InputRadio = ({ question, isTouched, showPreview = false }) => {
3
+ var InputRadio = ({
4
+ question,
5
+ handleQuestionInputChange,
6
+ showPreview = false
7
+ }) => {
4
8
  var _a;
5
9
  const questionId = `question-${question.id}`;
6
10
  const groupId = `radio-group-${question.id}`;
7
11
  const errorId = `error-${question.id}`;
8
12
  const handleInputChange = (event) => {
9
13
  const e = { target: { value: event.target.value } };
10
- isTouched(e, question);
14
+ handleQuestionInputChange(e, question);
11
15
  };
12
16
  return /* @__PURE__ */ jsxs(Fragment, { children: [
13
17
  !showPreview && question.visible && /* @__PURE__ */ jsx("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: /* @__PURE__ */ jsxs(
@@ -70,7 +74,7 @@ import { useEffect, useState } from "react";
70
74
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
71
75
  var MultipleCheckboxes = ({
72
76
  question,
73
- isTouched,
77
+ handleQuestionInputChange,
74
78
  showPreview = false,
75
79
  activatedLanguage = "sv"
76
80
  }) => {
@@ -95,7 +99,7 @@ var MultipleCheckboxes = ({
95
99
  }
96
100
  setCheckedValues(updatedValues);
97
101
  const e = { target: { value: updatedValues.toString() } };
98
- isTouched(e, question);
102
+ handleQuestionInputChange(e, question);
99
103
  };
100
104
  return /* @__PURE__ */ jsxs2(Fragment2, { children: [
101
105
  !showPreview && question.visible && /* @__PURE__ */ jsx2("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs2("fieldset", { children: [
@@ -148,7 +152,7 @@ import DOMPurify from "dompurify";
148
152
  import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
149
153
  var InputTextarea = ({
150
154
  question,
151
- isTouched,
155
+ handleQuestionInputChange,
152
156
  showPreview = false,
153
157
  activatedLanguage
154
158
  }) => {
@@ -184,7 +188,7 @@ var InputTextarea = ({
184
188
  "textarea",
185
189
  {
186
190
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0,
187
- onChange: (e) => isTouched(e, question),
191
+ onChange: (e) => handleQuestionInputChange(e, question),
188
192
  value: question.answer,
189
193
  required: question.isQuestionMandatory,
190
194
  "aria-required": question.isQuestionMandatory,
@@ -244,7 +248,7 @@ import DOMPurify2 from "dompurify";
244
248
  import { Fragment as Fragment4, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
245
249
  var TextFieldStandard = ({
246
250
  question,
247
- isTouched,
251
+ handleQuestionInputChange,
248
252
  showPreview = false,
249
253
  activatedLanguage
250
254
  }) => {
@@ -284,7 +288,7 @@ var TextFieldStandard = ({
284
288
  inputMode: (_g = (_f = question.questionExtraAttribute) == null ? void 0 : _f.inputMode) != null ? _g : void 0,
285
289
  name: `question-name-${question.id}`,
286
290
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0,
287
- onChange: (e) => isTouched(e, question),
291
+ onChange: (e) => handleQuestionInputChange(e, question),
288
292
  value: question.answer,
289
293
  maxLength: ((_h = question.questionExtraAttribute) == null ? void 0 : _h.answerMaxLength) || defaultMaxLength,
290
294
  id: inputId,
@@ -658,7 +662,7 @@ var SelectedFilesStandard_default = SelectedFiles;
658
662
  import { Fragment as Fragment10, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
659
663
  var AddFiles = ({
660
664
  questionObject,
661
- isTouched = (e, questionObject2) => {
665
+ handleQuestionInputChange = (e, questionObject2) => {
662
666
  alert("no function");
663
667
  },
664
668
  visible,
@@ -809,7 +813,7 @@ var AddFiles = ({
809
813
  files: [...currentFiles, ...newFiles]
810
814
  }
811
815
  };
812
- isTouched(e, questionObject);
816
+ handleQuestionInputChange(e, questionObject);
813
817
  setNumberOfFiles(currentFiles.length + newFiles.length);
814
818
  setNewFiles([]);
815
819
  }
@@ -879,7 +883,7 @@ var AddFiles = ({
879
883
  SelectedFilesStandard_default,
880
884
  {
881
885
  questionObject,
882
- isTouched,
886
+ isTouched: handleQuestionInputChange,
883
887
  removeFile: removeFileFromNumberOfFiles,
884
888
  removeError,
885
889
  errorMessageAddingFile,
@@ -1617,7 +1621,7 @@ var useCookieConsent = ({
1617
1621
  import { Fragment as Fragment11, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1618
1622
  var QuestionRenderer = ({
1619
1623
  question,
1620
- isTouched,
1624
+ handleQuestionInputChange,
1621
1625
  activatedLanguage = "sv",
1622
1626
  showPreview = false
1623
1627
  }) => {
@@ -1626,7 +1630,7 @@ var QuestionRenderer = ({
1626
1630
  RadioMultipleStandard_default,
1627
1631
  {
1628
1632
  question,
1629
- isTouched,
1633
+ handleQuestionInputChange,
1630
1634
  showPreview
1631
1635
  }
1632
1636
  ),
@@ -1634,7 +1638,7 @@ var QuestionRenderer = ({
1634
1638
  TextFieldStandard_default,
1635
1639
  {
1636
1640
  question,
1637
- isTouched,
1641
+ handleQuestionInputChange,
1638
1642
  showPreview,
1639
1643
  activatedLanguage
1640
1644
  }
@@ -1643,7 +1647,7 @@ var QuestionRenderer = ({
1643
1647
  AddFilesStandard_default,
1644
1648
  {
1645
1649
  questionObject: question,
1646
- isTouched,
1650
+ handleQuestionInputChange,
1647
1651
  showPreview,
1648
1652
  activatedLanguage,
1649
1653
  visible: question.visible
@@ -1653,12 +1657,19 @@ var QuestionRenderer = ({
1653
1657
  MultipleCheckboxesStandard_default,
1654
1658
  {
1655
1659
  question,
1656
- isTouched,
1660
+ handleQuestionInputChange,
1657
1661
  showPreview,
1658
1662
  activatedLanguage
1659
1663
  }
1660
1664
  ),
1661
- question.questionType === "TextArea" && /* @__PURE__ */ jsx11(TextAreaStandard_default, { question, isTouched, showPreview })
1665
+ question.questionType === "TextArea" && /* @__PURE__ */ jsx11(
1666
+ TextAreaStandard_default,
1667
+ {
1668
+ question,
1669
+ handleQuestionInputChange,
1670
+ showPreview
1671
+ }
1672
+ )
1662
1673
  ] });
1663
1674
  };
1664
1675
  var QuestionRenderer_default = QuestionRenderer;
@@ -1692,10 +1703,9 @@ var QuestionGroup = ({
1692
1703
  QuestionRenderer2,
1693
1704
  {
1694
1705
  question,
1695
- isTouched: handleQuestionInputChange,
1706
+ handleQuestionInputChange,
1696
1707
  activatedLanguage,
1697
- showPreview,
1698
- showConfigure: !showPreview
1708
+ showPreview
1699
1709
  }
1700
1710
  ) }, "question-" + index);
1701
1711
  }) });