optimized-react-component-library-xyz123 0.23.4 → 0.23.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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +27 -41
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -85
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,54 +1,52 @@
|
|
|
1
1
|
// src/components/input-components/InfoTextStandard/InfoTextStandard.tsx
|
|
2
2
|
import DOMPurify from "dompurify";
|
|
3
|
-
import {
|
|
4
|
-
var InfoTextStandard = ({
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var InfoTextStandard = ({ infoText, selectedValue, questionId, activatedLanguage }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
id: `textinfo-${questionId}-${selectedValue}`,
|
|
9
|
+
"aria-live": "polite",
|
|
10
|
+
"aria-atomic": "true",
|
|
11
|
+
children: infoText.length > 0 && /* @__PURE__ */ jsxs("div", { id: questionId, className: "pts-root-question pts-infoTextdStandard-container", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("h2", { className: "sr-only", children: activatedLanguage === "en" ? `Information about selected alternative - ${selectedValue}` : `Information om valt alternativ - ${selectedValue}` }),
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
12
14
|
"div",
|
|
13
15
|
{
|
|
14
16
|
id: questionId,
|
|
15
17
|
dangerouslySetInnerHTML: {
|
|
16
|
-
__html: DOMPurify.sanitize(
|
|
18
|
+
__html: DOMPurify.sanitize(infoText != null ? infoText : "")
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
] });
|
|
22
|
+
] })
|
|
23
|
+
}
|
|
24
|
+
);
|
|
24
25
|
};
|
|
25
26
|
var InfoTextStandard_default = InfoTextStandard;
|
|
26
27
|
|
|
27
28
|
// src/components/input-components/RadioMultipleStandard/RadioMultipleStandard.tsx
|
|
28
|
-
import { Fragment
|
|
29
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
29
30
|
var InputRadio = ({
|
|
30
31
|
question,
|
|
31
32
|
handleQuestionInputChange,
|
|
32
|
-
showPreview = false
|
|
33
|
+
showPreview = false,
|
|
34
|
+
activatedLanguage = "sv"
|
|
33
35
|
}) => {
|
|
34
36
|
var _a, _b, _c, _d;
|
|
35
37
|
const questionId = `question-${question.id}`;
|
|
36
38
|
const groupId = `radio-group-${question.id}`;
|
|
37
39
|
const errorId = `error-${question.id}`;
|
|
40
|
+
const handleInputChange = (event) => {
|
|
41
|
+
const e = { target: { value: event.target.value } };
|
|
42
|
+
handleQuestionInputChange(e, question);
|
|
43
|
+
};
|
|
38
44
|
const languageObj = question.languageSupport[0];
|
|
39
45
|
var optionsInfoText = [];
|
|
40
46
|
if ("optionsInfoText" in languageObj) {
|
|
41
47
|
optionsInfoText = languageObj.optionsInfoText;
|
|
42
|
-
console.log(languageObj.optionsInfoText, "q", optionsInfoText, question);
|
|
43
48
|
}
|
|
44
|
-
|
|
45
|
-
(op) => op.value === question.answer
|
|
46
|
-
)) == null ? void 0 : _a.text, question.answer);
|
|
47
|
-
const handleInputChange = (event) => {
|
|
48
|
-
const e = { target: { value: event.target.value } };
|
|
49
|
-
handleQuestionInputChange(e, question);
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
49
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
52
50
|
!showPreview && question.visible && /* @__PURE__ */ jsxs2("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: [
|
|
53
51
|
/* @__PURE__ */ jsxs2(
|
|
54
52
|
"fieldset",
|
|
@@ -62,7 +60,7 @@ var InputRadio = ({
|
|
|
62
60
|
" ",
|
|
63
61
|
question.isQuestionMandatory && /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" })
|
|
64
62
|
] }),
|
|
65
|
-
(
|
|
63
|
+
(_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsxs2("div", { className: "pts-radio-option", children: [
|
|
66
64
|
/* @__PURE__ */ jsx2(
|
|
67
65
|
"input",
|
|
68
66
|
{
|
|
@@ -71,8 +69,7 @@ var InputRadio = ({
|
|
|
71
69
|
id: `${groupId}-option-${index}`,
|
|
72
70
|
value: option.value,
|
|
73
71
|
checked: question.answer === option.value,
|
|
74
|
-
onChange: handleInputChange
|
|
75
|
-
"aria-describedby": "about_" + option.value
|
|
72
|
+
onChange: handleInputChange
|
|
76
73
|
}
|
|
77
74
|
),
|
|
78
75
|
/* @__PURE__ */ jsx2("label", { htmlFor: `${groupId}-option-${index}`, children: option.label }),
|
|
@@ -87,23 +84,12 @@ var InputRadio = ({
|
|
|
87
84
|
}
|
|
88
85
|
),
|
|
89
86
|
optionsInfoText.length > 0 && /* @__PURE__ */ jsx2(
|
|
90
|
-
|
|
87
|
+
InfoTextStandard_default,
|
|
91
88
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
InfoTextStandard_default,
|
|
97
|
-
{
|
|
98
|
-
text: (_d = (_c = optionsInfoText.find(
|
|
99
|
-
(op) => op.value === question.answer
|
|
100
|
-
)) == null ? void 0 : _c.text) != null ? _d : "",
|
|
101
|
-
value: "",
|
|
102
|
-
showPreview: false,
|
|
103
|
-
questionId,
|
|
104
|
-
showText: true
|
|
105
|
-
}
|
|
106
|
-
)
|
|
89
|
+
infoText: (_c = (_b = optionsInfoText.find((op) => op.selectedValue === question.answer)) == null ? void 0 : _b.infoText) != null ? _c : "",
|
|
90
|
+
selectedValue: (_d = question.answer) != null ? _d : "",
|
|
91
|
+
questionId,
|
|
92
|
+
activatedLanguage: activatedLanguage != null ? activatedLanguage : "sv"
|
|
107
93
|
}
|
|
108
94
|
)
|
|
109
95
|
] }),
|
|
@@ -114,7 +100,7 @@ var RadioMultipleStandard_default = InputRadio;
|
|
|
114
100
|
var PreviewRadio = ({ question }) => {
|
|
115
101
|
var _a, _b;
|
|
116
102
|
const previewId = `preview-${question.id}`;
|
|
117
|
-
return /* @__PURE__ */ jsxs2(
|
|
103
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
118
104
|
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
119
105
|
((_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(
|
|
120
106
|
"dd",
|
|
@@ -129,7 +115,7 @@ var PreviewRadio = ({ question }) => {
|
|
|
129
115
|
|
|
130
116
|
// src/components/input-components/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
131
117
|
import { useEffect, useState } from "react";
|
|
132
|
-
import { Fragment as
|
|
118
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
133
119
|
var MultipleCheckboxes = ({
|
|
134
120
|
question,
|
|
135
121
|
handleQuestionInputChange,
|
|
@@ -159,7 +145,7 @@ var MultipleCheckboxes = ({
|
|
|
159
145
|
const e = { target: { value: updatedValues.toString() } };
|
|
160
146
|
handleQuestionInputChange(e, question);
|
|
161
147
|
};
|
|
162
|
-
return /* @__PURE__ */ jsxs3(
|
|
148
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
163
149
|
!showPreview && question.visible && /* @__PURE__ */ jsx3("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs3("fieldset", { children: [
|
|
164
150
|
/* @__PURE__ */ jsxs3("legend", { className: "multipleCheckboxes-legend", id: `label-${questionId}`, children: [
|
|
165
151
|
question.questionLabel,
|
|
@@ -167,7 +153,7 @@ var MultipleCheckboxes = ({
|
|
|
167
153
|
question.isQuestionMandatory && /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
168
154
|
" "
|
|
169
155
|
] }),
|
|
170
|
-
/* @__PURE__ */ jsx3("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(
|
|
156
|
+
/* @__PURE__ */ jsx3("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
171
157
|
" ",
|
|
172
158
|
/* @__PURE__ */ jsx3(
|
|
173
159
|
"input",
|
|
@@ -195,7 +181,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
195
181
|
}) => {
|
|
196
182
|
var _a, _b;
|
|
197
183
|
const previewId = `preview-${question.id}`;
|
|
198
|
-
return /* @__PURE__ */ jsxs3(
|
|
184
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
199
185
|
/* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
200
186
|
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) => {
|
|
201
187
|
var _a2;
|
|
@@ -207,7 +193,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
207
193
|
|
|
208
194
|
// src/components/input-components/CheckboxGroupStandard/CheckboxGroupStandard.tsx
|
|
209
195
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
210
|
-
import { Fragment as
|
|
196
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
211
197
|
var CheckboxGroup = ({
|
|
212
198
|
question,
|
|
213
199
|
handleQuestionInputChange,
|
|
@@ -238,7 +224,7 @@ var CheckboxGroup = ({
|
|
|
238
224
|
const e = { target: { value: updatedValues.toString() } };
|
|
239
225
|
handleQuestionInputChange(e, question);
|
|
240
226
|
};
|
|
241
|
-
return /* @__PURE__ */ jsxs4(
|
|
227
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
242
228
|
!showPreview && question.visible && /* @__PURE__ */ jsx4("div", { id: questionId, className: "pts-root-question pts-checkboxGroup-container", children: /* @__PURE__ */ jsxs4(
|
|
243
229
|
"fieldset",
|
|
244
230
|
{
|
|
@@ -284,7 +270,7 @@ var PreviewCheckboxGroup = ({
|
|
|
284
270
|
}) => {
|
|
285
271
|
var _a, _b;
|
|
286
272
|
const previewId = `preview-${question.id}`;
|
|
287
|
-
return /* @__PURE__ */ jsxs4(
|
|
273
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
288
274
|
/* @__PURE__ */ jsx4("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
289
275
|
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx4("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx4("dd", { children: /* @__PURE__ */ jsx4("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
290
276
|
var _a2;
|
|
@@ -296,7 +282,7 @@ var PreviewCheckboxGroup = ({
|
|
|
296
282
|
|
|
297
283
|
// src/components/input-components/TextAreaStandard/TextAreaStandard.tsx
|
|
298
284
|
import DOMPurify2 from "dompurify";
|
|
299
|
-
import { Fragment as
|
|
285
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
300
286
|
var InputTextarea = ({
|
|
301
287
|
question,
|
|
302
288
|
handleQuestionInputChange,
|
|
@@ -309,7 +295,7 @@ var InputTextarea = ({
|
|
|
309
295
|
const aboutId = `about-${question.id}`;
|
|
310
296
|
const errorId = `error-${question.id}`;
|
|
311
297
|
const defaultMaxLength = 1e3;
|
|
312
|
-
return /* @__PURE__ */ jsxs5(
|
|
298
|
+
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
313
299
|
!showPreview && question.visible && /* @__PURE__ */ jsxs5(
|
|
314
300
|
"div",
|
|
315
301
|
{
|
|
@@ -377,7 +363,7 @@ var PreviewTextarea = ({
|
|
|
377
363
|
}) => {
|
|
378
364
|
var _a, _b;
|
|
379
365
|
const previewId = `preview-${question.id}`;
|
|
380
|
-
return /* @__PURE__ */ jsxs5(
|
|
366
|
+
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
381
367
|
/* @__PURE__ */ jsx5("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
382
368
|
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx5("dd", { className: "pts-textArea-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx5(
|
|
383
369
|
"dd",
|
|
@@ -392,7 +378,7 @@ var PreviewTextarea = ({
|
|
|
392
378
|
|
|
393
379
|
// src/components/input-components/TextFieldStandard/TextFieldStandard.tsx
|
|
394
380
|
import DOMPurify3 from "dompurify";
|
|
395
|
-
import { Fragment as
|
|
381
|
+
import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
396
382
|
var TextFieldStandard = ({
|
|
397
383
|
question,
|
|
398
384
|
handleQuestionInputChange,
|
|
@@ -405,7 +391,7 @@ var TextFieldStandard = ({
|
|
|
405
391
|
const aboutId = `about-${question.id}`;
|
|
406
392
|
const errorId = `error-${question.id}`;
|
|
407
393
|
const defaultMaxLength = 1e3;
|
|
408
|
-
return /* @__PURE__ */ jsxs6(
|
|
394
|
+
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
409
395
|
!showPreview && question.visible && /* @__PURE__ */ jsxs6(
|
|
410
396
|
"div",
|
|
411
397
|
{
|
|
@@ -467,7 +453,7 @@ var PreviewTextField = ({
|
|
|
467
453
|
}) => {
|
|
468
454
|
var _a, _b;
|
|
469
455
|
const previewId = `preview-${question.id}`;
|
|
470
|
-
return /* @__PURE__ */ jsxs6(
|
|
456
|
+
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
471
457
|
/* @__PURE__ */ jsx6("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
472
458
|
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx6("dd", { className: "pts-textField-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer }) : /* @__PURE__ */ jsx6(
|
|
473
459
|
"dd",
|
|
@@ -486,7 +472,7 @@ import clsx3 from "clsx";
|
|
|
486
472
|
|
|
487
473
|
// src/components/input-components/AddFilesStandard/DropFilesStandard.tsx
|
|
488
474
|
import { useDropzone } from "react-dropzone";
|
|
489
|
-
import { Fragment as
|
|
475
|
+
import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
490
476
|
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
|
|
491
477
|
const onDrop = FilesSelected;
|
|
492
478
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, noKeyboard: true });
|
|
@@ -494,7 +480,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
494
480
|
event.preventDefault();
|
|
495
481
|
event.stopPropagation();
|
|
496
482
|
};
|
|
497
|
-
return /* @__PURE__ */ jsx7(
|
|
483
|
+
return /* @__PURE__ */ jsx7(Fragment6, { children: /* @__PURE__ */ jsx7("div", { className: "DropZoneContainer", children: /* @__PURE__ */ jsxs7("div", { className: "DropZone", ...getRootProps(), onClick: handleFileExplorer, children: [
|
|
498
484
|
/* @__PURE__ */ jsxs7("label", { htmlFor: "fileDropInput", hidden: true, children: [
|
|
499
485
|
"Dra och sl\xE4pp filer h\xE4r omr\xE5de",
|
|
500
486
|
/* @__PURE__ */ jsx7(
|
|
@@ -538,7 +524,7 @@ import clsx from "clsx";
|
|
|
538
524
|
|
|
539
525
|
// src/components/input-components/AddFilesStandard/ScreenReaderErrors.tsx
|
|
540
526
|
import React from "react";
|
|
541
|
-
import { Fragment as
|
|
527
|
+
import { Fragment as Fragment7, jsx as jsx8 } from "react/jsx-runtime";
|
|
542
528
|
var ScreenReaderErrors = ({
|
|
543
529
|
errorMessageAddingFile,
|
|
544
530
|
activatedLanguage
|
|
@@ -557,12 +543,12 @@ var ScreenReaderErrors = ({
|
|
|
557
543
|
setActivateErrorMessagesForScreenReader(true);
|
|
558
544
|
}
|
|
559
545
|
}, [errorMessageAddingFile]);
|
|
560
|
-
return /* @__PURE__ */ jsx8(
|
|
546
|
+
return /* @__PURE__ */ jsx8(Fragment7, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx8("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
|
|
561
547
|
};
|
|
562
548
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
563
549
|
|
|
564
550
|
// src/components/input-components/AddFilesStandard/ExploreFilesStandard.tsx
|
|
565
|
-
import { Fragment as
|
|
551
|
+
import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
566
552
|
var ExploreFiles = ({
|
|
567
553
|
FilesSelected,
|
|
568
554
|
numberOfFiles,
|
|
@@ -589,7 +575,7 @@ var ExploreFiles = ({
|
|
|
589
575
|
};
|
|
590
576
|
let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
|
|
591
577
|
const ariaLabelText = `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`;
|
|
592
|
-
return /* @__PURE__ */ jsx9(
|
|
578
|
+
return /* @__PURE__ */ jsx9(Fragment8, { children: /* @__PURE__ */ jsxs8("div", { className: "inputContainer", children: [
|
|
593
579
|
/* @__PURE__ */ jsxs8(
|
|
594
580
|
"div",
|
|
595
581
|
{
|
|
@@ -651,16 +637,16 @@ import { Col, Row } from "react-bootstrap";
|
|
|
651
637
|
// src/components/input-components/AddFilesStandard/IndicatorStandard.tsx
|
|
652
638
|
import { useState as useState3 } from "react";
|
|
653
639
|
import clsx2 from "clsx";
|
|
654
|
-
import { Fragment as
|
|
640
|
+
import { Fragment as Fragment9, jsx as jsx10 } from "react/jsx-runtime";
|
|
655
641
|
var Indicator = (filename) => {
|
|
656
642
|
const [uploadPercentage, setUploadPercentage] = useState3(0);
|
|
657
643
|
const [uploadDone, setUploadDone] = useState3(false);
|
|
658
|
-
return /* @__PURE__ */ jsx10(
|
|
644
|
+
return /* @__PURE__ */ jsx10(Fragment9, { children: /* @__PURE__ */ jsx10("div", { className: clsx2("uploadIndicator", "uploadDone") }) });
|
|
659
645
|
};
|
|
660
646
|
var IndicatorStandard_default = Indicator;
|
|
661
647
|
|
|
662
648
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
663
|
-
import { Fragment as
|
|
649
|
+
import { Fragment as Fragment10, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
664
650
|
var SelectedFiles = ({
|
|
665
651
|
questionObject,
|
|
666
652
|
isTouched,
|
|
@@ -700,7 +686,7 @@ var SelectedFiles = ({
|
|
|
700
686
|
return windowWidth2;
|
|
701
687
|
};
|
|
702
688
|
const windowWidth = useWindowWidth();
|
|
703
|
-
return /* @__PURE__ */ jsxs9(
|
|
689
|
+
return /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
704
690
|
/* @__PURE__ */ jsx11("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "pts-errorSummary-container pts-addFile-error-container", children: [
|
|
705
691
|
/* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
706
692
|
/* @__PURE__ */ jsx11("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ jsxs9("ul", { "aria-hidden": true, className: "fileListUnorderedList", id: "errorSummary-ul", children: [
|
|
@@ -818,7 +804,7 @@ var SelectedFiles = ({
|
|
|
818
804
|
var SelectedFilesStandard_default = SelectedFiles;
|
|
819
805
|
|
|
820
806
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
821
|
-
import { Fragment as
|
|
807
|
+
import { Fragment as Fragment11, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
822
808
|
var AddFiles = ({
|
|
823
809
|
questionObject,
|
|
824
810
|
handleQuestionInputChange = (e, questionObject2) => {
|
|
@@ -990,7 +976,7 @@ var AddFiles = ({
|
|
|
990
976
|
const handleRemoveErrors = () => {
|
|
991
977
|
setErrorMessageAddingFile([]);
|
|
992
978
|
};
|
|
993
|
-
return /* @__PURE__ */ jsxs10(
|
|
979
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
994
980
|
!showPreview && visible && /* @__PURE__ */ jsx12("div", { className: "root-question addFile-question-container", id: `question-${questionObject.id}`, children: /* @__PURE__ */ jsxs10("div", { role: "group", children: [
|
|
995
981
|
questionObject.aboutText && /* @__PURE__ */ jsxs10(
|
|
996
982
|
"p",
|
|
@@ -1062,7 +1048,7 @@ var PreviewAddFiles = ({
|
|
|
1062
1048
|
activatedLanguage
|
|
1063
1049
|
}) => {
|
|
1064
1050
|
const previewId = `preview-${questionObject.Id}`;
|
|
1065
|
-
return /* @__PURE__ */ jsxs10(
|
|
1051
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
1066
1052
|
/* @__PURE__ */ jsx12("dt", { id: `question-${previewId}`, children: questionObject.questionLabel ? questionObject.questionLabel : activatedLanguage === "en" ? "Attached files" : "Bifogade filer" }),
|
|
1067
1053
|
questionObject.files && questionObject.files.length > 0 ? /* @__PURE__ */ jsx12("dd", { className: "pts-addFiles-answer", children: /* @__PURE__ */ jsx12("ul", { "aria-labelledby": previewId, className: "pts-preview-answer-list", children: questionObject.files.map((file, index) => {
|
|
1068
1054
|
return /* @__PURE__ */ jsx12("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
|
|
@@ -1072,7 +1058,7 @@ var PreviewAddFiles = ({
|
|
|
1072
1058
|
|
|
1073
1059
|
// src/components/input-components/SingleCheckboxStandard/SingleCheckboxStandard.tsx
|
|
1074
1060
|
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1075
|
-
import { Fragment as
|
|
1061
|
+
import { Fragment as Fragment12, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1076
1062
|
var SingleCheckbox = ({
|
|
1077
1063
|
question,
|
|
1078
1064
|
handleQuestionInputChange,
|
|
@@ -1098,7 +1084,7 @@ var SingleCheckbox = ({
|
|
|
1098
1084
|
const e = { target: { value: answer } };
|
|
1099
1085
|
handleQuestionInputChange(e, question);
|
|
1100
1086
|
};
|
|
1101
|
-
return /* @__PURE__ */ jsxs11(
|
|
1087
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1102
1088
|
!showPreview && question.visible && /* @__PURE__ */ jsxs11("div", { id: questionId, className: "pts-root-question pts-singleCheckbox-container", children: [
|
|
1103
1089
|
/* @__PURE__ */ jsxs11("div", { className: "pts-singleCheckbox-row", children: [
|
|
1104
1090
|
/* @__PURE__ */ jsx13(
|
|
@@ -1150,7 +1136,7 @@ var PreviewSingleCheckbox = ({
|
|
|
1150
1136
|
}) => {
|
|
1151
1137
|
var _a, _b;
|
|
1152
1138
|
const previewId = `preview-${question.id}`;
|
|
1153
|
-
return /* @__PURE__ */ jsxs11(
|
|
1139
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1154
1140
|
/* @__PURE__ */ jsx13("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1155
1141
|
((_b = question.answer) == null ? void 0 : _b.trim()) ? /* @__PURE__ */ jsx13("dd", { className: "pts-singleCheckbox-preview pts-root-answer", id: `answer-${previewId}`, children: question.answer === "false" ? activatedLanguage === "sv" ? "Nej" : "No" : activatedLanguage === "sv" ? "Ja" : "Yes" }) : /* @__PURE__ */ jsx13(
|
|
1156
1142
|
"dd",
|
|
@@ -1872,14 +1858,14 @@ var useCookieConsent = ({
|
|
|
1872
1858
|
};
|
|
1873
1859
|
|
|
1874
1860
|
// src/components/question-rendering/QuestionRenderer/QuestionRenderer.tsx
|
|
1875
|
-
import { Fragment as
|
|
1861
|
+
import { Fragment as Fragment13, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1876
1862
|
var QuestionRenderer = ({
|
|
1877
1863
|
question,
|
|
1878
1864
|
handleQuestionInputChange,
|
|
1879
1865
|
activatedLanguage = "sv",
|
|
1880
1866
|
showPreview = false
|
|
1881
1867
|
}) => {
|
|
1882
|
-
return /* @__PURE__ */ jsxs12(
|
|
1868
|
+
return /* @__PURE__ */ jsxs12(Fragment13, { children: [
|
|
1883
1869
|
question.questionType === "Radio" && /* @__PURE__ */ jsx14(
|
|
1884
1870
|
RadioMultipleStandard_default,
|
|
1885
1871
|
{
|
|
@@ -1947,8 +1933,8 @@ var QuestionRenderer = ({
|
|
|
1947
1933
|
var QuestionRenderer_default = QuestionRenderer;
|
|
1948
1934
|
|
|
1949
1935
|
// src/components/question-rendering/QuestionGroup/QuestionGroup.tsx
|
|
1950
|
-
import { useEffect as useEffect11, Fragment as
|
|
1951
|
-
import { Fragment as
|
|
1936
|
+
import { useEffect as useEffect11, Fragment as Fragment14 } from "react";
|
|
1937
|
+
import { Fragment as Fragment15, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1952
1938
|
var QuestionGroup = ({
|
|
1953
1939
|
questions,
|
|
1954
1940
|
wrapperElement = "none",
|
|
@@ -1971,8 +1957,8 @@ var QuestionGroup = ({
|
|
|
1971
1957
|
}
|
|
1972
1958
|
});
|
|
1973
1959
|
}, [questions]);
|
|
1974
|
-
const groupQuestions = /* @__PURE__ */ jsx15(
|
|
1975
|
-
return /* @__PURE__ */ jsx15(
|
|
1960
|
+
const groupQuestions = /* @__PURE__ */ jsx15(Fragment15, { children: questions.map((question, index) => {
|
|
1961
|
+
return /* @__PURE__ */ jsx15(Fragment14, { children: /* @__PURE__ */ jsx15(
|
|
1976
1962
|
QuestionRenderer_default,
|
|
1977
1963
|
{
|
|
1978
1964
|
question,
|
|
@@ -2017,7 +2003,7 @@ var QuestionGroup = ({
|
|
|
2017
2003
|
return /* @__PURE__ */ jsx15("div", { className: "pts-root-question-group-div", children: groupQuestions });
|
|
2018
2004
|
case "none":
|
|
2019
2005
|
default:
|
|
2020
|
-
return /* @__PURE__ */ jsx15(
|
|
2006
|
+
return /* @__PURE__ */ jsx15(Fragment14, { children: groupQuestions });
|
|
2021
2007
|
}
|
|
2022
2008
|
};
|
|
2023
2009
|
var QuestionGroup_default = QuestionGroup;
|
|
@@ -2984,7 +2970,7 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
|
2984
2970
|
var StepperStandard_default = Stepper;
|
|
2985
2971
|
|
|
2986
2972
|
// src/components/validation-and-status/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
|
|
2987
|
-
import { Fragment as
|
|
2973
|
+
import { Fragment as Fragment16, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2988
2974
|
var ValidationErrorSummaryList = ({
|
|
2989
2975
|
validationErrorsList,
|
|
2990
2976
|
questions,
|
|
@@ -3021,7 +3007,7 @@ var ValidationErrorSummaryList = ({
|
|
|
3021
3007
|
}, 300);
|
|
3022
3008
|
}
|
|
3023
3009
|
}
|
|
3024
|
-
if (!validationErrorsList.length) return /* @__PURE__ */ jsx29(
|
|
3010
|
+
if (!validationErrorsList.length) return /* @__PURE__ */ jsx29(Fragment16, {});
|
|
3025
3011
|
const filteredIds = filterIdsByGroupCheck(validationErrorsList, questions);
|
|
3026
3012
|
const count = filteredIds.length;
|
|
3027
3013
|
const title = summaryText.replace("{count}", count.toString()).replace(
|
|
@@ -3055,9 +3041,9 @@ var ValidationErrorSummaryList = ({
|
|
|
3055
3041
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
3056
3042
|
|
|
3057
3043
|
// src/components/validation-and-status/FormStatusMessagesScreenReader/FormStatusMessagesScreenReader.tsx
|
|
3058
|
-
import { Fragment as
|
|
3044
|
+
import { Fragment as Fragment17, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3059
3045
|
var FormStatusMessagesScreenReader = ({ formStatus }) => {
|
|
3060
|
-
return /* @__PURE__ */ jsxs24(
|
|
3046
|
+
return /* @__PURE__ */ jsxs24(Fragment17, { children: [
|
|
3061
3047
|
/* @__PURE__ */ jsx30("p", { "aria-live": "assertive", children: formStatus === "failed" && /* @__PURE__ */ jsx30("span", { className: "pts-root-mandatoryAsterisk", children: "N\xE5got gick fel, f\xF6rs\xF6k igen senare eller kontakta oss!" }) }),
|
|
3062
3048
|
/* @__PURE__ */ jsx30("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
|
|
3063
3049
|
] });
|