optimized-react-component-library-xyz123 0.23.3 → 0.23.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 +20 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -75
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// src/components/input-components/InfoTextStandard/InfoTextStandard.tsx
|
|
2
2
|
import DOMPurify from "dompurify";
|
|
3
|
-
import {
|
|
4
|
-
var InfoTextStandard = ({ text, value, questionId, activatedLanguage
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var InfoTextStandard = ({ text, value, questionId, activatedLanguage }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
id: "textinfo-questionId",
|
|
9
|
+
"aria-live": "polite",
|
|
10
|
+
"aria-atomic": "true",
|
|
11
|
+
children: text.length > 0 && /* @__PURE__ */ jsxs("div", { id: questionId, className: "pts-root-question pts-infoTextdStandard-container", children: [
|
|
12
|
+
/* @__PURE__ */ jsx("h2", { className: "sr-only", children: activatedLanguage === "sv" ? `Information om valt alternativ - ${value}` : `Information about selected alternative - ${value}` }),
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
12
14
|
"div",
|
|
13
15
|
{
|
|
14
16
|
id: questionId,
|
|
@@ -17,38 +19,37 @@ var InfoTextStandard = ({ text, value, questionId, activatedLanguage, showPrevie
|
|
|
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
33
|
showPreview = false
|
|
33
34
|
}) => {
|
|
34
|
-
var _a, _b, _c, _d;
|
|
35
|
+
var _a, _b, _c, _d, _e;
|
|
35
36
|
const questionId = `question-${question.id}`;
|
|
36
37
|
const groupId = `radio-group-${question.id}`;
|
|
37
38
|
const errorId = `error-${question.id}`;
|
|
38
39
|
const languageObj = question.languageSupport[0];
|
|
39
40
|
var optionsInfoText = [];
|
|
40
41
|
if ("optionsInfoText" in languageObj) {
|
|
41
|
-
optionsInfoText
|
|
42
|
+
optionsInfoText = languageObj.optionsInfoText;
|
|
42
43
|
console.log(languageObj.optionsInfoText, "q", optionsInfoText, question);
|
|
43
44
|
}
|
|
44
45
|
console.log((_a = optionsInfoText.find(
|
|
45
46
|
(op) => op.value === question.answer
|
|
46
|
-
)) == null ? void 0 : _a.text);
|
|
47
|
+
)) == null ? void 0 : _a.text, question.answer);
|
|
47
48
|
const handleInputChange = (event) => {
|
|
48
49
|
const e = { target: { value: event.target.value } };
|
|
49
50
|
handleQuestionInputChange(e, question);
|
|
50
51
|
};
|
|
51
|
-
return /* @__PURE__ */ jsxs2(
|
|
52
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
52
53
|
!showPreview && question.visible && /* @__PURE__ */ jsxs2("div", { className: "pts-root-question pts-radioMultiple-container", id: questionId, children: [
|
|
53
54
|
/* @__PURE__ */ jsxs2(
|
|
54
55
|
"fieldset",
|
|
@@ -87,23 +88,11 @@ var InputRadio = ({
|
|
|
87
88
|
}
|
|
88
89
|
),
|
|
89
90
|
optionsInfoText.length > 0 && /* @__PURE__ */ jsx2(
|
|
90
|
-
|
|
91
|
+
InfoTextStandard_default,
|
|
91
92
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
children: /* @__PURE__ */ jsx2(
|
|
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
|
-
)
|
|
93
|
+
text: (_d = (_c = optionsInfoText.find((op) => op.value === question.answer)) == null ? void 0 : _c.text) != null ? _d : "",
|
|
94
|
+
value: (_e = question.answer) != null ? _e : "",
|
|
95
|
+
questionId
|
|
107
96
|
}
|
|
108
97
|
)
|
|
109
98
|
] }),
|
|
@@ -114,7 +103,7 @@ var RadioMultipleStandard_default = InputRadio;
|
|
|
114
103
|
var PreviewRadio = ({ question }) => {
|
|
115
104
|
var _a, _b;
|
|
116
105
|
const previewId = `preview-${question.id}`;
|
|
117
|
-
return /* @__PURE__ */ jsxs2(
|
|
106
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
118
107
|
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
119
108
|
((_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
109
|
"dd",
|
|
@@ -129,7 +118,7 @@ var PreviewRadio = ({ question }) => {
|
|
|
129
118
|
|
|
130
119
|
// src/components/input-components/MultipleCheckboxesStandard/MultipleCheckboxesStandard.tsx
|
|
131
120
|
import { useEffect, useState } from "react";
|
|
132
|
-
import { Fragment as
|
|
121
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
133
122
|
var MultipleCheckboxes = ({
|
|
134
123
|
question,
|
|
135
124
|
handleQuestionInputChange,
|
|
@@ -159,7 +148,7 @@ var MultipleCheckboxes = ({
|
|
|
159
148
|
const e = { target: { value: updatedValues.toString() } };
|
|
160
149
|
handleQuestionInputChange(e, question);
|
|
161
150
|
};
|
|
162
|
-
return /* @__PURE__ */ jsxs3(
|
|
151
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
163
152
|
!showPreview && question.visible && /* @__PURE__ */ jsx3("div", { id: questionId, className: "pts-root-question pts-multipleCheckboxes-container", children: /* @__PURE__ */ jsxs3("fieldset", { children: [
|
|
164
153
|
/* @__PURE__ */ jsxs3("legend", { className: "multipleCheckboxes-legend", id: `label-${questionId}`, children: [
|
|
165
154
|
question.questionLabel,
|
|
@@ -167,7 +156,7 @@ var MultipleCheckboxes = ({
|
|
|
167
156
|
question.isQuestionMandatory && /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: "pts-root-mandatoryAsterisk", children: "*" }),
|
|
168
157
|
" "
|
|
169
158
|
] }),
|
|
170
|
-
/* @__PURE__ */ jsx3("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(
|
|
159
|
+
/* @__PURE__ */ jsx3("ul", { children: (_a = question.options) == null ? void 0 : _a.map((option, index) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
171
160
|
" ",
|
|
172
161
|
/* @__PURE__ */ jsx3(
|
|
173
162
|
"input",
|
|
@@ -195,7 +184,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
195
184
|
}) => {
|
|
196
185
|
var _a, _b;
|
|
197
186
|
const previewId = `preview-${question.id}`;
|
|
198
|
-
return /* @__PURE__ */ jsxs3(
|
|
187
|
+
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
199
188
|
/* @__PURE__ */ jsx3("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
200
189
|
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
190
|
var _a2;
|
|
@@ -207,7 +196,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
207
196
|
|
|
208
197
|
// src/components/input-components/CheckboxGroupStandard/CheckboxGroupStandard.tsx
|
|
209
198
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
210
|
-
import { Fragment as
|
|
199
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
211
200
|
var CheckboxGroup = ({
|
|
212
201
|
question,
|
|
213
202
|
handleQuestionInputChange,
|
|
@@ -238,7 +227,7 @@ var CheckboxGroup = ({
|
|
|
238
227
|
const e = { target: { value: updatedValues.toString() } };
|
|
239
228
|
handleQuestionInputChange(e, question);
|
|
240
229
|
};
|
|
241
|
-
return /* @__PURE__ */ jsxs4(
|
|
230
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
242
231
|
!showPreview && question.visible && /* @__PURE__ */ jsx4("div", { id: questionId, className: "pts-root-question pts-checkboxGroup-container", children: /* @__PURE__ */ jsxs4(
|
|
243
232
|
"fieldset",
|
|
244
233
|
{
|
|
@@ -284,7 +273,7 @@ var PreviewCheckboxGroup = ({
|
|
|
284
273
|
}) => {
|
|
285
274
|
var _a, _b;
|
|
286
275
|
const previewId = `preview-${question.id}`;
|
|
287
|
-
return /* @__PURE__ */ jsxs4(
|
|
276
|
+
return /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
288
277
|
/* @__PURE__ */ jsx4("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
289
278
|
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
279
|
var _a2;
|
|
@@ -296,7 +285,7 @@ var PreviewCheckboxGroup = ({
|
|
|
296
285
|
|
|
297
286
|
// src/components/input-components/TextAreaStandard/TextAreaStandard.tsx
|
|
298
287
|
import DOMPurify2 from "dompurify";
|
|
299
|
-
import { Fragment as
|
|
288
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
300
289
|
var InputTextarea = ({
|
|
301
290
|
question,
|
|
302
291
|
handleQuestionInputChange,
|
|
@@ -309,7 +298,7 @@ var InputTextarea = ({
|
|
|
309
298
|
const aboutId = `about-${question.id}`;
|
|
310
299
|
const errorId = `error-${question.id}`;
|
|
311
300
|
const defaultMaxLength = 1e3;
|
|
312
|
-
return /* @__PURE__ */ jsxs5(
|
|
301
|
+
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
313
302
|
!showPreview && question.visible && /* @__PURE__ */ jsxs5(
|
|
314
303
|
"div",
|
|
315
304
|
{
|
|
@@ -377,7 +366,7 @@ var PreviewTextarea = ({
|
|
|
377
366
|
}) => {
|
|
378
367
|
var _a, _b;
|
|
379
368
|
const previewId = `preview-${question.id}`;
|
|
380
|
-
return /* @__PURE__ */ jsxs5(
|
|
369
|
+
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
381
370
|
/* @__PURE__ */ jsx5("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
382
371
|
((_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
372
|
"dd",
|
|
@@ -392,7 +381,7 @@ var PreviewTextarea = ({
|
|
|
392
381
|
|
|
393
382
|
// src/components/input-components/TextFieldStandard/TextFieldStandard.tsx
|
|
394
383
|
import DOMPurify3 from "dompurify";
|
|
395
|
-
import { Fragment as
|
|
384
|
+
import { Fragment as Fragment5, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
396
385
|
var TextFieldStandard = ({
|
|
397
386
|
question,
|
|
398
387
|
handleQuestionInputChange,
|
|
@@ -405,7 +394,7 @@ var TextFieldStandard = ({
|
|
|
405
394
|
const aboutId = `about-${question.id}`;
|
|
406
395
|
const errorId = `error-${question.id}`;
|
|
407
396
|
const defaultMaxLength = 1e3;
|
|
408
|
-
return /* @__PURE__ */ jsxs6(
|
|
397
|
+
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
409
398
|
!showPreview && question.visible && /* @__PURE__ */ jsxs6(
|
|
410
399
|
"div",
|
|
411
400
|
{
|
|
@@ -467,7 +456,7 @@ var PreviewTextField = ({
|
|
|
467
456
|
}) => {
|
|
468
457
|
var _a, _b;
|
|
469
458
|
const previewId = `preview-${question.id}`;
|
|
470
|
-
return /* @__PURE__ */ jsxs6(
|
|
459
|
+
return /* @__PURE__ */ jsxs6(Fragment5, { children: [
|
|
471
460
|
/* @__PURE__ */ jsx6("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
472
461
|
((_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
462
|
"dd",
|
|
@@ -486,7 +475,7 @@ import clsx3 from "clsx";
|
|
|
486
475
|
|
|
487
476
|
// src/components/input-components/AddFilesStandard/DropFilesStandard.tsx
|
|
488
477
|
import { useDropzone } from "react-dropzone";
|
|
489
|
-
import { Fragment as
|
|
478
|
+
import { Fragment as Fragment6, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
490
479
|
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
|
|
491
480
|
const onDrop = FilesSelected;
|
|
492
481
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, noKeyboard: true });
|
|
@@ -494,7 +483,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
494
483
|
event.preventDefault();
|
|
495
484
|
event.stopPropagation();
|
|
496
485
|
};
|
|
497
|
-
return /* @__PURE__ */ jsx7(
|
|
486
|
+
return /* @__PURE__ */ jsx7(Fragment6, { children: /* @__PURE__ */ jsx7("div", { className: "DropZoneContainer", children: /* @__PURE__ */ jsxs7("div", { className: "DropZone", ...getRootProps(), onClick: handleFileExplorer, children: [
|
|
498
487
|
/* @__PURE__ */ jsxs7("label", { htmlFor: "fileDropInput", hidden: true, children: [
|
|
499
488
|
"Dra och sl\xE4pp filer h\xE4r omr\xE5de",
|
|
500
489
|
/* @__PURE__ */ jsx7(
|
|
@@ -538,7 +527,7 @@ import clsx from "clsx";
|
|
|
538
527
|
|
|
539
528
|
// src/components/input-components/AddFilesStandard/ScreenReaderErrors.tsx
|
|
540
529
|
import React from "react";
|
|
541
|
-
import { Fragment as
|
|
530
|
+
import { Fragment as Fragment7, jsx as jsx8 } from "react/jsx-runtime";
|
|
542
531
|
var ScreenReaderErrors = ({
|
|
543
532
|
errorMessageAddingFile,
|
|
544
533
|
activatedLanguage
|
|
@@ -557,12 +546,12 @@ var ScreenReaderErrors = ({
|
|
|
557
546
|
setActivateErrorMessagesForScreenReader(true);
|
|
558
547
|
}
|
|
559
548
|
}, [errorMessageAddingFile]);
|
|
560
|
-
return /* @__PURE__ */ jsx8(
|
|
549
|
+
return /* @__PURE__ */ jsx8(Fragment7, { children: activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx8("p", { role: "alert", className: "sr-only", "aria-atomic": "true", children: errorMessagesForScreenReader }) });
|
|
561
550
|
};
|
|
562
551
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
563
552
|
|
|
564
553
|
// src/components/input-components/AddFilesStandard/ExploreFilesStandard.tsx
|
|
565
|
-
import { Fragment as
|
|
554
|
+
import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
566
555
|
var ExploreFiles = ({
|
|
567
556
|
FilesSelected,
|
|
568
557
|
numberOfFiles,
|
|
@@ -589,7 +578,7 @@ var ExploreFiles = ({
|
|
|
589
578
|
};
|
|
590
579
|
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
580
|
const ariaLabelText = `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`;
|
|
592
|
-
return /* @__PURE__ */ jsx9(
|
|
581
|
+
return /* @__PURE__ */ jsx9(Fragment8, { children: /* @__PURE__ */ jsxs8("div", { className: "inputContainer", children: [
|
|
593
582
|
/* @__PURE__ */ jsxs8(
|
|
594
583
|
"div",
|
|
595
584
|
{
|
|
@@ -651,16 +640,16 @@ import { Col, Row } from "react-bootstrap";
|
|
|
651
640
|
// src/components/input-components/AddFilesStandard/IndicatorStandard.tsx
|
|
652
641
|
import { useState as useState3 } from "react";
|
|
653
642
|
import clsx2 from "clsx";
|
|
654
|
-
import { Fragment as
|
|
643
|
+
import { Fragment as Fragment9, jsx as jsx10 } from "react/jsx-runtime";
|
|
655
644
|
var Indicator = (filename) => {
|
|
656
645
|
const [uploadPercentage, setUploadPercentage] = useState3(0);
|
|
657
646
|
const [uploadDone, setUploadDone] = useState3(false);
|
|
658
|
-
return /* @__PURE__ */ jsx10(
|
|
647
|
+
return /* @__PURE__ */ jsx10(Fragment9, { children: /* @__PURE__ */ jsx10("div", { className: clsx2("uploadIndicator", "uploadDone") }) });
|
|
659
648
|
};
|
|
660
649
|
var IndicatorStandard_default = Indicator;
|
|
661
650
|
|
|
662
651
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
663
|
-
import { Fragment as
|
|
652
|
+
import { Fragment as Fragment10, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
664
653
|
var SelectedFiles = ({
|
|
665
654
|
questionObject,
|
|
666
655
|
isTouched,
|
|
@@ -700,7 +689,7 @@ var SelectedFiles = ({
|
|
|
700
689
|
return windowWidth2;
|
|
701
690
|
};
|
|
702
691
|
const windowWidth = useWindowWidth();
|
|
703
|
-
return /* @__PURE__ */ jsxs9(
|
|
692
|
+
return /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
704
693
|
/* @__PURE__ */ jsx11("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "pts-errorSummary-container pts-addFile-error-container", children: [
|
|
705
694
|
/* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
706
695
|
/* @__PURE__ */ jsx11("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ jsxs9("ul", { "aria-hidden": true, className: "fileListUnorderedList", id: "errorSummary-ul", children: [
|
|
@@ -818,7 +807,7 @@ var SelectedFiles = ({
|
|
|
818
807
|
var SelectedFilesStandard_default = SelectedFiles;
|
|
819
808
|
|
|
820
809
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
821
|
-
import { Fragment as
|
|
810
|
+
import { Fragment as Fragment11, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
822
811
|
var AddFiles = ({
|
|
823
812
|
questionObject,
|
|
824
813
|
handleQuestionInputChange = (e, questionObject2) => {
|
|
@@ -990,7 +979,7 @@ var AddFiles = ({
|
|
|
990
979
|
const handleRemoveErrors = () => {
|
|
991
980
|
setErrorMessageAddingFile([]);
|
|
992
981
|
};
|
|
993
|
-
return /* @__PURE__ */ jsxs10(
|
|
982
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
994
983
|
!showPreview && visible && /* @__PURE__ */ jsx12("div", { className: "root-question addFile-question-container", id: `question-${questionObject.id}`, children: /* @__PURE__ */ jsxs10("div", { role: "group", children: [
|
|
995
984
|
questionObject.aboutText && /* @__PURE__ */ jsxs10(
|
|
996
985
|
"p",
|
|
@@ -1062,7 +1051,7 @@ var PreviewAddFiles = ({
|
|
|
1062
1051
|
activatedLanguage
|
|
1063
1052
|
}) => {
|
|
1064
1053
|
const previewId = `preview-${questionObject.Id}`;
|
|
1065
|
-
return /* @__PURE__ */ jsxs10(
|
|
1054
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
1066
1055
|
/* @__PURE__ */ jsx12("dt", { id: `question-${previewId}`, children: questionObject.questionLabel ? questionObject.questionLabel : activatedLanguage === "en" ? "Attached files" : "Bifogade filer" }),
|
|
1067
1056
|
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
1057
|
return /* @__PURE__ */ jsx12("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
|
|
@@ -1072,7 +1061,7 @@ var PreviewAddFiles = ({
|
|
|
1072
1061
|
|
|
1073
1062
|
// src/components/input-components/SingleCheckboxStandard/SingleCheckboxStandard.tsx
|
|
1074
1063
|
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1075
|
-
import { Fragment as
|
|
1064
|
+
import { Fragment as Fragment12, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1076
1065
|
var SingleCheckbox = ({
|
|
1077
1066
|
question,
|
|
1078
1067
|
handleQuestionInputChange,
|
|
@@ -1098,7 +1087,7 @@ var SingleCheckbox = ({
|
|
|
1098
1087
|
const e = { target: { value: answer } };
|
|
1099
1088
|
handleQuestionInputChange(e, question);
|
|
1100
1089
|
};
|
|
1101
|
-
return /* @__PURE__ */ jsxs11(
|
|
1090
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1102
1091
|
!showPreview && question.visible && /* @__PURE__ */ jsxs11("div", { id: questionId, className: "pts-root-question pts-singleCheckbox-container", children: [
|
|
1103
1092
|
/* @__PURE__ */ jsxs11("div", { className: "pts-singleCheckbox-row", children: [
|
|
1104
1093
|
/* @__PURE__ */ jsx13(
|
|
@@ -1150,7 +1139,7 @@ var PreviewSingleCheckbox = ({
|
|
|
1150
1139
|
}) => {
|
|
1151
1140
|
var _a, _b;
|
|
1152
1141
|
const previewId = `preview-${question.id}`;
|
|
1153
|
-
return /* @__PURE__ */ jsxs11(
|
|
1142
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1154
1143
|
/* @__PURE__ */ jsx13("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
1155
1144
|
((_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
1145
|
"dd",
|
|
@@ -1872,14 +1861,14 @@ var useCookieConsent = ({
|
|
|
1872
1861
|
};
|
|
1873
1862
|
|
|
1874
1863
|
// src/components/question-rendering/QuestionRenderer/QuestionRenderer.tsx
|
|
1875
|
-
import { Fragment as
|
|
1864
|
+
import { Fragment as Fragment13, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1876
1865
|
var QuestionRenderer = ({
|
|
1877
1866
|
question,
|
|
1878
1867
|
handleQuestionInputChange,
|
|
1879
1868
|
activatedLanguage = "sv",
|
|
1880
1869
|
showPreview = false
|
|
1881
1870
|
}) => {
|
|
1882
|
-
return /* @__PURE__ */ jsxs12(
|
|
1871
|
+
return /* @__PURE__ */ jsxs12(Fragment13, { children: [
|
|
1883
1872
|
question.questionType === "Radio" && /* @__PURE__ */ jsx14(
|
|
1884
1873
|
RadioMultipleStandard_default,
|
|
1885
1874
|
{
|
|
@@ -1947,8 +1936,8 @@ var QuestionRenderer = ({
|
|
|
1947
1936
|
var QuestionRenderer_default = QuestionRenderer;
|
|
1948
1937
|
|
|
1949
1938
|
// src/components/question-rendering/QuestionGroup/QuestionGroup.tsx
|
|
1950
|
-
import { useEffect as useEffect11, Fragment as
|
|
1951
|
-
import { Fragment as
|
|
1939
|
+
import { useEffect as useEffect11, Fragment as Fragment14 } from "react";
|
|
1940
|
+
import { Fragment as Fragment15, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1952
1941
|
var QuestionGroup = ({
|
|
1953
1942
|
questions,
|
|
1954
1943
|
wrapperElement = "none",
|
|
@@ -1971,8 +1960,8 @@ var QuestionGroup = ({
|
|
|
1971
1960
|
}
|
|
1972
1961
|
});
|
|
1973
1962
|
}, [questions]);
|
|
1974
|
-
const groupQuestions = /* @__PURE__ */ jsx15(
|
|
1975
|
-
return /* @__PURE__ */ jsx15(
|
|
1963
|
+
const groupQuestions = /* @__PURE__ */ jsx15(Fragment15, { children: questions.map((question, index) => {
|
|
1964
|
+
return /* @__PURE__ */ jsx15(Fragment14, { children: /* @__PURE__ */ jsx15(
|
|
1976
1965
|
QuestionRenderer_default,
|
|
1977
1966
|
{
|
|
1978
1967
|
question,
|
|
@@ -2017,7 +2006,7 @@ var QuestionGroup = ({
|
|
|
2017
2006
|
return /* @__PURE__ */ jsx15("div", { className: "pts-root-question-group-div", children: groupQuestions });
|
|
2018
2007
|
case "none":
|
|
2019
2008
|
default:
|
|
2020
|
-
return /* @__PURE__ */ jsx15(
|
|
2009
|
+
return /* @__PURE__ */ jsx15(Fragment14, { children: groupQuestions });
|
|
2021
2010
|
}
|
|
2022
2011
|
};
|
|
2023
2012
|
var QuestionGroup_default = QuestionGroup;
|
|
@@ -2984,7 +2973,7 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
|
2984
2973
|
var StepperStandard_default = Stepper;
|
|
2985
2974
|
|
|
2986
2975
|
// src/components/validation-and-status/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
|
|
2987
|
-
import { Fragment as
|
|
2976
|
+
import { Fragment as Fragment16, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2988
2977
|
var ValidationErrorSummaryList = ({
|
|
2989
2978
|
validationErrorsList,
|
|
2990
2979
|
questions,
|
|
@@ -3021,7 +3010,7 @@ var ValidationErrorSummaryList = ({
|
|
|
3021
3010
|
}, 300);
|
|
3022
3011
|
}
|
|
3023
3012
|
}
|
|
3024
|
-
if (!validationErrorsList.length) return /* @__PURE__ */ jsx29(
|
|
3013
|
+
if (!validationErrorsList.length) return /* @__PURE__ */ jsx29(Fragment16, {});
|
|
3025
3014
|
const filteredIds = filterIdsByGroupCheck(validationErrorsList, questions);
|
|
3026
3015
|
const count = filteredIds.length;
|
|
3027
3016
|
const title = summaryText.replace("{count}", count.toString()).replace(
|
|
@@ -3055,9 +3044,9 @@ var ValidationErrorSummaryList = ({
|
|
|
3055
3044
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
3056
3045
|
|
|
3057
3046
|
// src/components/validation-and-status/FormStatusMessagesScreenReader/FormStatusMessagesScreenReader.tsx
|
|
3058
|
-
import { Fragment as
|
|
3047
|
+
import { Fragment as Fragment17, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3059
3048
|
var FormStatusMessagesScreenReader = ({ formStatus }) => {
|
|
3060
|
-
return /* @__PURE__ */ jsxs24(
|
|
3049
|
+
return /* @__PURE__ */ jsxs24(Fragment17, { children: [
|
|
3061
3050
|
/* @__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
3051
|
/* @__PURE__ */ jsx30("div", { "aria-live": "polite", className: "visually-hidden", children: formStatus === "loading" ? "Ditt \xE4rende registreras. Uppdatera eller st\xE4ng inte sidan." : "" })
|
|
3063
3052
|
] });
|