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

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.js CHANGED
@@ -224,7 +224,7 @@ var PrevieMultipleCheckboxes = ({
224
224
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
225
225
  question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: question.options[0].label }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
226
226
  var _a2;
227
- return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
227
+ return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.id);
228
228
  }).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
229
229
  " "
230
230
  ] });
@@ -1279,7 +1279,7 @@ function createApiDataObject(data, specialMappedQuestions, translatedAnswers) {
1279
1279
  let translatedAnswer = question.answer;
1280
1280
  if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
1281
1281
  const answerNormalized = normalize(question.answer);
1282
- const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.label))).map((option) => `^${option.id}^`);
1282
+ const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.id))).map((option) => `^${option.id}^`);
1283
1283
  if (matchingIds.length > 0) {
1284
1284
  translatedAnswer = matchingIds.join(",");
1285
1285
  }