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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -142,7 +142,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
142
142
|
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
143
143
|
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx2("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx2("dd", { children: /* @__PURE__ */ jsx2("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
144
144
|
var _a2;
|
|
145
|
-
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.
|
|
145
|
+
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.id);
|
|
146
146
|
}).map((option, index) => /* @__PURE__ */ jsx2("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ jsx2("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
147
147
|
" "
|
|
148
148
|
] });
|
|
@@ -1197,7 +1197,7 @@ function createApiDataObject(data, specialMappedQuestions, translatedAnswers) {
|
|
|
1197
1197
|
let translatedAnswer = question.answer;
|
|
1198
1198
|
if (question.answer && typeof question.answer === "string" && Array.isArray(question.options) && question.mappingId && specialMappedQuestions.has(question.mappingId)) {
|
|
1199
1199
|
const answerNormalized = normalize(question.answer);
|
|
1200
|
-
const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.
|
|
1200
|
+
const matchingIds = question.options.filter((option) => answerNormalized.includes(normalize(option.id))).map((option) => `^${option.id}^`);
|
|
1201
1201
|
if (matchingIds.length > 0) {
|
|
1202
1202
|
translatedAnswer = matchingIds.join(",");
|
|
1203
1203
|
}
|