optimized-react-component-library-xyz123 0.28.6 → 0.28.7
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 +125 -133
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -133
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/css/darkMode.css +0 -9
- package/src/css/questions.css +0 -9
package/dist/index.js
CHANGED
|
@@ -80,25 +80,32 @@ __export(index_exports, {
|
|
|
80
80
|
});
|
|
81
81
|
module.exports = __toCommonJS(index_exports);
|
|
82
82
|
|
|
83
|
-
// src/components/
|
|
83
|
+
// src/components/input-components/InfoTextStandard/InfoTextStandard.tsx
|
|
84
|
+
var import_dompurify = __toESM(require("dompurify"));
|
|
84
85
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
86
|
+
var InfoTextStandard = ({ infoText, selectedValue, questionId, activatedLanguage }) => {
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
id: `textinfo-${questionId}-${selectedValue}`,
|
|
91
|
+
"aria-live": "polite",
|
|
92
|
+
"aria-atomic": "true",
|
|
93
|
+
children: infoText.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id: questionId, className: "pts-root-question pts-infoTextdStandard-container", children: [
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "sr-only", children: activatedLanguage === "en" ? `Information about selected alternative - ${selectedValue}` : `Information om valt alternativ - ${selectedValue}` }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
id: questionId,
|
|
99
|
+
dangerouslySetInnerHTML: {
|
|
100
|
+
__html: import_dompurify.default.sanitize(infoText != null ? infoText : "")
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] })
|
|
105
|
+
}
|
|
106
|
+
);
|
|
100
107
|
};
|
|
101
|
-
var
|
|
108
|
+
var InfoTextStandard_default = InfoTextStandard;
|
|
102
109
|
|
|
103
110
|
// src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
|
|
104
111
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -108,7 +115,7 @@ var InputRadio = ({
|
|
|
108
115
|
showPreview = false,
|
|
109
116
|
activatedLanguage = "sv"
|
|
110
117
|
}) => {
|
|
111
|
-
var _a, _b, _c;
|
|
118
|
+
var _a, _b, _c, _d;
|
|
112
119
|
const questionId = `question-${question.id}`;
|
|
113
120
|
const groupId = `radio-group-${question.id}`;
|
|
114
121
|
const errorId = `error-${question.id}`;
|
|
@@ -116,46 +123,59 @@ var InputRadio = ({
|
|
|
116
123
|
const e = { target: { value: event.target.value } };
|
|
117
124
|
handleQuestionInputChange(e, question);
|
|
118
125
|
};
|
|
126
|
+
const languageObj = question.languageSupport[0];
|
|
127
|
+
var optionsInfoText = [];
|
|
128
|
+
if ("optionsInfoText" in languageObj) {
|
|
129
|
+
optionsInfoText = languageObj.optionsInfoText;
|
|
130
|
+
}
|
|
131
|
+
console.log(optionsInfoText);
|
|
119
132
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
120
|
-
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
133
|
+
!showPreview && question.visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
135
|
+
"fieldset",
|
|
136
|
+
{
|
|
137
|
+
"aria-required": question.isQuestionMandatory,
|
|
138
|
+
"aria-invalid": question.hasValidationError ? question.hasValidationError : void 0,
|
|
139
|
+
"aria-errormessage": question.hasValidationError ? errorId : void 0,
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("legend", { id: `label-${groupId}`, children: [
|
|
142
|
+
question.questionLabel,
|
|
143
|
+
" ",
|
|
144
|
+
question.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
145
|
+
] }),
|
|
146
|
+
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pts-radio-option", children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
148
|
+
"input",
|
|
149
|
+
{
|
|
150
|
+
type: "radio",
|
|
151
|
+
name: `name-${question.id}`,
|
|
152
|
+
id: `${groupId}-option-${index}`,
|
|
153
|
+
value: option.value,
|
|
154
|
+
checked: question.answer === option.value,
|
|
155
|
+
onChange: handleInputChange
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: `${groupId}-option-${index}`, children: option.label }),
|
|
159
|
+
" "
|
|
160
|
+
] }, index)),
|
|
161
|
+
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
165
|
+
] })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
optionsInfoText.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
170
|
+
InfoTextStandard_default,
|
|
171
|
+
{
|
|
172
|
+
infoText: (_c = (_b = optionsInfoText.find((op) => op.selectedValue === question.answer)) == null ? void 0 : _b.infoText) != null ? _c : "",
|
|
173
|
+
selectedValue: (_d = question.answer) != null ? _d : "",
|
|
174
|
+
questionId,
|
|
175
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] }),
|
|
159
179
|
showPreview && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PreviewRadio, { question })
|
|
160
180
|
] });
|
|
161
181
|
};
|
|
@@ -263,7 +283,7 @@ var CheckboxGroup = ({
|
|
|
263
283
|
showPreview = false,
|
|
264
284
|
activatedLanguage = "sv"
|
|
265
285
|
}) => {
|
|
266
|
-
var _a
|
|
286
|
+
var _a;
|
|
267
287
|
const questionId = `question-${question.id}`;
|
|
268
288
|
const errorId = `error-${question.id}`;
|
|
269
289
|
const groupId = `checkbox-group-${question.id}`;
|
|
@@ -315,15 +335,11 @@ var CheckboxGroup = ({
|
|
|
315
335
|
),
|
|
316
336
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${groupId}-option-${index}`, children: option.label })
|
|
317
337
|
] }, index)),
|
|
318
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
319
|
-
|
|
320
|
-
{
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
324
|
-
activatedLanguage
|
|
325
|
-
}
|
|
326
|
-
)
|
|
338
|
+
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
339
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
340
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
342
|
+
] })
|
|
327
343
|
]
|
|
328
344
|
}
|
|
329
345
|
) }),
|
|
@@ -348,7 +364,7 @@ var PreviewCheckboxGroup = ({
|
|
|
348
364
|
};
|
|
349
365
|
|
|
350
366
|
// src/components/input-components/TextAreaStandard/TextAreaStandard.tsx
|
|
351
|
-
var
|
|
367
|
+
var import_dompurify2 = __toESM(require("dompurify"));
|
|
352
368
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
353
369
|
var InputTextarea = ({
|
|
354
370
|
question,
|
|
@@ -356,7 +372,7 @@ var InputTextarea = ({
|
|
|
356
372
|
showPreview = false,
|
|
357
373
|
activatedLanguage
|
|
358
374
|
}) => {
|
|
359
|
-
var _a, _b, _c, _d, _e
|
|
375
|
+
var _a, _b, _c, _d, _e;
|
|
360
376
|
const questionId = `question-${question.id}`;
|
|
361
377
|
const inputId = `textarea-${question.id}`;
|
|
362
378
|
const aboutId = `about-${question.id}`;
|
|
@@ -380,7 +396,7 @@ var InputTextarea = ({
|
|
|
380
396
|
id: aboutId,
|
|
381
397
|
className: "pts-about",
|
|
382
398
|
dangerouslySetInnerHTML: {
|
|
383
|
-
__html:
|
|
399
|
+
__html: import_dompurify2.default.sanitize(question.aboutText)
|
|
384
400
|
}
|
|
385
401
|
}
|
|
386
402
|
),
|
|
@@ -399,24 +415,19 @@ var InputTextarea = ({
|
|
|
399
415
|
}
|
|
400
416
|
),
|
|
401
417
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "pts-textarea-counter-error-container", children: [
|
|
402
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.
|
|
403
|
-
|
|
404
|
-
{
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
validationMessesege: (_c = question.validationDefaultMessesege) != null ? _c : "",
|
|
408
|
-
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
409
|
-
}
|
|
410
|
-
),
|
|
411
|
-
!((_d = question.questionExtraAttribute) == null ? void 0 : _d.hideTextCounter) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
418
|
+
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
419
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-label": "Felmeddelande.", className: "errorDot", children: "!" }),
|
|
420
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
421
|
+
] }),
|
|
422
|
+
!((_b = question.questionExtraAttribute) == null ? void 0 : _b.hideTextCounter) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
412
423
|
"div",
|
|
413
424
|
{
|
|
414
|
-
className: `pts-character-counter ${question.answer && (((
|
|
425
|
+
className: `pts-character-counter ${question.answer && (((_c = question.questionExtraAttribute) == null ? void 0 : _c.answerMaxLength) || defaultMaxLength) && question.answer.length > (((_d = question.questionExtraAttribute) == null ? void 0 : _d.answerMaxLength) || defaultMaxLength) ? "error" : ""}`,
|
|
415
426
|
children: [
|
|
416
427
|
question.answer ? question.answer.length : 0,
|
|
417
428
|
" av",
|
|
418
429
|
" ",
|
|
419
|
-
((
|
|
430
|
+
((_e = question.questionExtraAttribute) == null ? void 0 : _e.answerMaxLength) || defaultMaxLength,
|
|
420
431
|
" tecken"
|
|
421
432
|
]
|
|
422
433
|
}
|
|
@@ -449,7 +460,7 @@ var PreviewTextarea = ({
|
|
|
449
460
|
};
|
|
450
461
|
|
|
451
462
|
// src/components/input-components/TextFieldStandard/TextFieldStandard.tsx
|
|
452
|
-
var
|
|
463
|
+
var import_dompurify3 = __toESM(require("dompurify"));
|
|
453
464
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
454
465
|
var TextFieldStandard = ({
|
|
455
466
|
question,
|
|
@@ -457,7 +468,7 @@ var TextFieldStandard = ({
|
|
|
457
468
|
showPreview = false,
|
|
458
469
|
activatedLanguage
|
|
459
470
|
}) => {
|
|
460
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
471
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
461
472
|
const questionId = `question-${question.id}`;
|
|
462
473
|
const inputId = `textField-${question.id}`;
|
|
463
474
|
const aboutId = `about-${question.id}`;
|
|
@@ -481,7 +492,7 @@ var TextFieldStandard = ({
|
|
|
481
492
|
id: aboutId,
|
|
482
493
|
className: "pts-about",
|
|
483
494
|
dangerouslySetInnerHTML: {
|
|
484
|
-
__html:
|
|
495
|
+
__html: import_dompurify3.default.sanitize(question.aboutText)
|
|
485
496
|
}
|
|
486
497
|
}
|
|
487
498
|
),
|
|
@@ -507,15 +518,11 @@ var TextFieldStandard = ({
|
|
|
507
518
|
autoCapitalize: (_m = (_l = question.questionExtraAttribute) == null ? void 0 : _l.autoCapitalize) != null ? _m : void 0
|
|
508
519
|
}
|
|
509
520
|
),
|
|
510
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
511
|
-
|
|
512
|
-
{
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
validationMessesege: (_o = question.validationDefaultMessesege) != null ? _o : "",
|
|
516
|
-
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
517
|
-
}
|
|
518
|
-
)
|
|
521
|
+
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
522
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
525
|
+
] })
|
|
519
526
|
]
|
|
520
527
|
}
|
|
521
528
|
),
|
|
@@ -894,7 +901,6 @@ var AddFiles = ({
|
|
|
894
901
|
allowedTotalFileSize = 20971520
|
|
895
902
|
// 20MB = (1024 * 1024) * 20
|
|
896
903
|
}) => {
|
|
897
|
-
var _a, _b;
|
|
898
904
|
if (allowedFileTypes.length < 1) {
|
|
899
905
|
allowedFileTypes = [
|
|
900
906
|
"pdf",
|
|
@@ -938,7 +944,7 @@ var AddFiles = ({
|
|
|
938
944
|
}, []);
|
|
939
945
|
const onDrop = (0, import_react7.useCallback)(
|
|
940
946
|
(acceptedFiles) => {
|
|
941
|
-
var
|
|
947
|
+
var _a, _b, _c;
|
|
942
948
|
const validationErrors = [];
|
|
943
949
|
const validFiles = [];
|
|
944
950
|
const currentTotalFileSize = (questionObject.files || []).reduce(
|
|
@@ -946,7 +952,7 @@ var AddFiles = ({
|
|
|
946
952
|
0
|
|
947
953
|
);
|
|
948
954
|
setTotalFileSize(currentTotalFileSize);
|
|
949
|
-
if ((((
|
|
955
|
+
if ((((_a = questionObject.files) == null ? void 0 : _a.length) || 0) >= allowedNumberOfFiles) {
|
|
950
956
|
acceptedFiles.forEach((file) => {
|
|
951
957
|
validationErrors.push({
|
|
952
958
|
FileName: file.name,
|
|
@@ -959,7 +965,7 @@ var AddFiles = ({
|
|
|
959
965
|
}
|
|
960
966
|
let accumulatedNewSize = 0;
|
|
961
967
|
for (const file of acceptedFiles) {
|
|
962
|
-
const fileExtension = ((
|
|
968
|
+
const fileExtension = ((_b = file.name.split(".").pop()) == null ? void 0 : _b.toLowerCase()) || "";
|
|
963
969
|
if (!allowedFileTypes.includes(fileExtension)) {
|
|
964
970
|
validationErrors.push({
|
|
965
971
|
FileName: file.name,
|
|
@@ -1072,16 +1078,11 @@ var AddFiles = ({
|
|
|
1072
1078
|
]
|
|
1073
1079
|
}
|
|
1074
1080
|
),
|
|
1075
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
|
1076
|
-
|
|
1077
|
-
{
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
validationMessesege: (_b = questionObject.validationDefaultMessesege) != null ? _b : "",
|
|
1081
|
-
activatedLanguage,
|
|
1082
|
-
extraCssClass: "error addfileserror"
|
|
1083
|
-
}
|
|
1084
|
-
),
|
|
1081
|
+
questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1083
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1084
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
|
|
1085
|
+
] }),
|
|
1085
1086
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1086
1087
|
ExploreFilesStandard_default,
|
|
1087
1088
|
{
|
|
@@ -1147,7 +1148,7 @@ var SingleCheckbox = ({
|
|
|
1147
1148
|
showPreview = false,
|
|
1148
1149
|
activatedLanguage = "sv"
|
|
1149
1150
|
}) => {
|
|
1150
|
-
var _a, _b
|
|
1151
|
+
var _a, _b;
|
|
1151
1152
|
const questionId = `question-${question.id}`;
|
|
1152
1153
|
const inputId = `checkbox-${question.id}`;
|
|
1153
1154
|
const aboutId = `about-${question.id}`;
|
|
@@ -1200,15 +1201,12 @@ var SingleCheckbox = ({
|
|
|
1200
1201
|
}
|
|
1201
1202
|
),
|
|
1202
1203
|
" ",
|
|
1203
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.
|
|
1204
|
-
|
|
1205
|
-
{
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
activatedLanguage
|
|
1210
|
-
}
|
|
1211
|
-
)
|
|
1204
|
+
question.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "pts-root-error", id: errorId, children: [
|
|
1205
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "errorText", children: question.validationDefaultMessesege })
|
|
1208
|
+
] }),
|
|
1209
|
+
" "
|
|
1212
1210
|
] }),
|
|
1213
1211
|
" ",
|
|
1214
1212
|
showPreview && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PreviewSingleCheckbox, { activatedLanguage, question })
|
|
@@ -2026,12 +2024,11 @@ var QuestionGroup = ({
|
|
|
2026
2024
|
showPreview = false,
|
|
2027
2025
|
markQuestionAsDisplayed
|
|
2028
2026
|
}) => {
|
|
2029
|
-
var _a
|
|
2027
|
+
var _a;
|
|
2030
2028
|
if (!questions || questions.length === 0) {
|
|
2031
2029
|
return null;
|
|
2032
2030
|
}
|
|
2033
2031
|
const firstQuestion = questions[0];
|
|
2034
|
-
const errorId = firstQuestion.id + "-error";
|
|
2035
2032
|
const groupMandatory = (_a = firstQuestion.validationType) == null ? void 0 : _a.find((e) => e.startsWith("groupCheck-"));
|
|
2036
2033
|
(0, import_react12.useEffect)(() => {
|
|
2037
2034
|
questions.forEach((question) => {
|
|
@@ -2072,15 +2069,10 @@ var QuestionGroup = ({
|
|
|
2072
2069
|
firstQuestion.validationDefaultMessesege
|
|
2073
2070
|
] })
|
|
2074
2071
|
] }),
|
|
2075
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.
|
|
2076
|
-
|
|
2077
|
-
{
|
|
2078
|
-
|
|
2079
|
-
validationId: errorId,
|
|
2080
|
-
validationMessesege: (_c = firstQuestion.validationDefaultMessesege) != null ? _c : "",
|
|
2081
|
-
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
2082
|
-
}
|
|
2083
|
-
),
|
|
2072
|
+
firstQuestion.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "pts-root-error", id: firstQuestion.id + "-error", children: [
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "errorText", children: firstQuestion.validationDefaultMessesege })
|
|
2075
|
+
] }),
|
|
2084
2076
|
groupQuestions
|
|
2085
2077
|
]
|
|
2086
2078
|
}
|
|
@@ -2738,7 +2730,7 @@ var SkipLinkStandard_default = SkipLink;
|
|
|
2738
2730
|
|
|
2739
2731
|
// src/components/text-blocks/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.tsx
|
|
2740
2732
|
var import_react13 = require("react");
|
|
2741
|
-
var
|
|
2733
|
+
var import_dompurify4 = __toESM(require("dompurify"));
|
|
2742
2734
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2743
2735
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
2744
2736
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
@@ -2747,7 +2739,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
|
2747
2739
|
className: "pts-textHeadlineAndBody-container",
|
|
2748
2740
|
children: [
|
|
2749
2741
|
data.headline && (0, import_react13.createElement)(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
|
|
2750
|
-
data.body && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { dangerouslySetInnerHTML: { __html:
|
|
2742
|
+
data.body && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify4.default.sanitize(data.body) } }),
|
|
2751
2743
|
data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2752
2744
|
"a",
|
|
2753
2745
|
{
|
|
@@ -2868,11 +2860,11 @@ var PrincipleOfPublicity = ({ activatedLanguage = "" }) => {
|
|
|
2868
2860
|
var PrincipleOfPublicityStandard_default = PrincipleOfPublicity;
|
|
2869
2861
|
|
|
2870
2862
|
// src/components/text-blocks/TextBody/TextBody.tsx
|
|
2871
|
-
var
|
|
2863
|
+
var import_dompurify5 = __toESM(require("dompurify"));
|
|
2872
2864
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2873
2865
|
var TextBody = ({ data }) => {
|
|
2874
2866
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "pts-textBody-container", children: [
|
|
2875
|
-
data.body && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { dangerouslySetInnerHTML: { __html:
|
|
2867
|
+
data.body && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { dangerouslySetInnerHTML: { __html: import_dompurify5.default.sanitize(data.body) } }),
|
|
2876
2868
|
data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2877
2869
|
"a",
|
|
2878
2870
|
{
|