optimized-react-component-library-xyz123 2.12.1 → 2.12.2
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 +23 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -24,6 +24,22 @@ var ValidationMessage = ({
|
|
|
24
24
|
};
|
|
25
25
|
var ValidationMessage_default = ValidationMessage;
|
|
26
26
|
|
|
27
|
+
// src/helpers/setPreviewAnswerLabel/setPreviewAnswerLabel.ts
|
|
28
|
+
var setPreviewAnswerLabel = (question, activatedLanguage = "sv") => {
|
|
29
|
+
var _a;
|
|
30
|
+
if ((question == null ? void 0 : question.answer) && question.answer.length > 0) {
|
|
31
|
+
const language = question.languageSupport.find((lang) => lang.language === activatedLanguage);
|
|
32
|
+
if (language && setPreviewAnswerLabel.length > 0) {
|
|
33
|
+
const answerOption = language.options.find(
|
|
34
|
+
(option) => option.value === question.answer
|
|
35
|
+
);
|
|
36
|
+
return (_a = answerOption.label) != null ? _a : "";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return "";
|
|
40
|
+
};
|
|
41
|
+
var setPreviewAnswerLabel_default = setPreviewAnswerLabel;
|
|
42
|
+
|
|
27
43
|
// src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
|
|
28
44
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
29
45
|
var InputRadio = ({
|
|
@@ -87,9 +103,10 @@ var RadioMultipleStandard_default = InputRadio;
|
|
|
87
103
|
var PreviewRadio = ({ question, activatedLanguage }) => {
|
|
88
104
|
var _a, _b;
|
|
89
105
|
const previewId = `preview-${question.id}`;
|
|
106
|
+
const questionAnswer = setPreviewAnswerLabel_default(question, activatedLanguage);
|
|
90
107
|
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
91
108
|
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
92
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx2("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx2(
|
|
109
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx2("dd", { className: "pts-radioMultiple-preview pts-root-answer", id: `answer-${previewId}`, children: questionAnswer.length > 0 ? questionAnswer : question.answer }) : /* @__PURE__ */ jsx2(
|
|
93
110
|
"dd",
|
|
94
111
|
{
|
|
95
112
|
className: "pts-radioMultiple-preview pts-root-answer no-answer-preview-page",
|
|
@@ -2182,9 +2199,10 @@ var RadioWithInfo = ({
|
|
|
2182
2199
|
] });
|
|
2183
2200
|
};
|
|
2184
2201
|
var RadioMultipleWithInfo2Standard_default = RadioWithInfo;
|
|
2185
|
-
var PreviewRadio2 = ({ question }) => {
|
|
2202
|
+
var PreviewRadio2 = ({ question, activatedLanguage = "sv" }) => {
|
|
2186
2203
|
var _a, _b;
|
|
2187
2204
|
const previewId = `preview-${question.id}`;
|
|
2205
|
+
const questionAnswer = setPreviewAnswerLabel_default(question, activatedLanguage);
|
|
2188
2206
|
return /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
2189
2207
|
/* @__PURE__ */ jsx21("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
2190
2208
|
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx21(
|
|
@@ -2192,7 +2210,7 @@ var PreviewRadio2 = ({ question }) => {
|
|
|
2192
2210
|
{
|
|
2193
2211
|
className: "pts-radioMultipleWithInfo2-preview pts-root-answer",
|
|
2194
2212
|
id: `answer-${previewId}`,
|
|
2195
|
-
children: question.answer
|
|
2213
|
+
children: questionAnswer.length > 0 ? questionAnswer : question.answer
|
|
2196
2214
|
}
|
|
2197
2215
|
) : /* @__PURE__ */ jsx21(
|
|
2198
2216
|
"dd",
|
|
@@ -2338,9 +2356,10 @@ var DropdownStandard_default = CustomDropdownStandard;
|
|
|
2338
2356
|
var PreviewDropdown = ({ question, activatedLanguage = "sv" }) => {
|
|
2339
2357
|
var _a, _b;
|
|
2340
2358
|
const previewId = `preview-${question.id}`;
|
|
2359
|
+
const questionAnswer = setPreviewAnswerLabel_default(question, activatedLanguage);
|
|
2341
2360
|
return /* @__PURE__ */ jsxs19(Fragment16, { children: [
|
|
2342
2361
|
/* @__PURE__ */ jsx23("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
2343
|
-
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx23("dd", { className: "pts-dropdown-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx23(
|
|
2362
|
+
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx23("dd", { className: "pts-dropdown-preview pts-root-answer", id: `answer-${previewId}`, children: questionAnswer.length > 0 ? questionAnswer : question.answer }) : /* @__PURE__ */ jsx23(
|
|
2344
2363
|
"dd",
|
|
2345
2364
|
{
|
|
2346
2365
|
className: "pts-dropdown-preview pts-root-answer no-answer-preview-page",
|