optimized-react-component-library-xyz123 0.26.5 → 0.26.6

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
@@ -166,8 +166,8 @@ var CheckboxGroup = ({
166
166
  var _a2;
167
167
  const initialValues = ((_a2 = question.options) == null ? void 0 : _a2.filter((option) => {
168
168
  var _a3;
169
- return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.label);
170
- }).map((option) => option.label)) || [];
169
+ return (_a3 = question.answer) == null ? void 0 : _a3.includes(option.id);
170
+ }).map((option) => option.id)) || [];
171
171
  setCheckedValues(initialValues);
172
172
  }, [question.answer, question.options]);
173
173
  const handleInputChange = (event, optionValue) => {
@@ -201,9 +201,9 @@ var CheckboxGroup = ({
201
201
  type: "checkbox",
202
202
  name: `name-${question.id}`,
203
203
  id: `${groupId}-option-${index}`,
204
- value: option.label,
205
- checked: checkedValues.includes(option.label),
206
- onChange: (e) => handleInputChange(e, option.label),
204
+ value: option.id,
205
+ checked: checkedValues.includes(option.id),
206
+ onChange: (e) => handleInputChange(e, option.id),
207
207
  className: question.hasValidationError ? "pts-root-question-input-error-border" : void 0
208
208
  }
209
209
  ),
@@ -231,7 +231,7 @@ var PreviewCheckboxGroup = ({
231
231
  /* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
232
232
  question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx3("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx3("dd", { children: /* @__PURE__ */ jsx3("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
233
233
  var _a2;
234
- return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
234
+ return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.id);
235
235
  }).map((option, index) => /* @__PURE__ */ jsx3("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ jsx3("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
236
236
  " "
237
237
  ] });