optimized-react-component-library-xyz123 0.1.78 → 0.1.81
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.css +842 -0
- package/dist/index.js +233 -153
- package/dist/index.mjs +295 -215
- package/package.json +1 -1
- package/src/css/darkMode.css +1 -25
- package/src/css/styles.css +62 -57
package/dist/index.mjs
CHANGED
|
@@ -756,15 +756,19 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
756
756
|
var DropFilesStandard_default = DropFiles;
|
|
757
757
|
|
|
758
758
|
// src/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.tsx
|
|
759
|
-
import { useRef as useRef2 } from "react";
|
|
759
|
+
import React3, { useEffect as useEffect3, useRef as useRef2 } from "react";
|
|
760
760
|
import clsx2 from "clsx";
|
|
761
761
|
|
|
762
762
|
// src/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.tsx
|
|
763
763
|
import React2 from "react";
|
|
764
|
-
import { Fragment as Fragment7, jsx as jsx7 } from "react/jsx-runtime";
|
|
764
|
+
import { Fragment as Fragment7, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
765
765
|
var ScreenReaderErrors = ({
|
|
766
766
|
errorMessageAddingFile,
|
|
767
|
-
activatedLanguage
|
|
767
|
+
activatedLanguage,
|
|
768
|
+
removeUploadErrors,
|
|
769
|
+
putFocusOnButton = () => {
|
|
770
|
+
alert("no function");
|
|
771
|
+
}
|
|
768
772
|
}) => {
|
|
769
773
|
const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] = React2.useState(false);
|
|
770
774
|
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = React2.useState("");
|
|
@@ -780,14 +784,57 @@ var ScreenReaderErrors = ({
|
|
|
780
784
|
setActivateErrorMessagesForScreenReader(true);
|
|
781
785
|
}
|
|
782
786
|
}, [errorMessageAddingFile]);
|
|
783
|
-
|
|
787
|
+
const handleRemoveErrors = () => {
|
|
788
|
+
const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
|
|
789
|
+
setErrorMessagesForScreenReader(errorMessages);
|
|
790
|
+
removeUploadErrors();
|
|
791
|
+
putFocusOnButton();
|
|
792
|
+
setTimeout(() => {
|
|
793
|
+
setActivateErrorMessagesForScreenReader(false);
|
|
794
|
+
}, 1e3);
|
|
795
|
+
};
|
|
796
|
+
return /* @__PURE__ */ jsxs7(Fragment7, { children: [
|
|
797
|
+
errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsx7(
|
|
798
|
+
"button",
|
|
799
|
+
{
|
|
800
|
+
onClick: handleRemoveErrors,
|
|
801
|
+
style: {
|
|
802
|
+
marginRight: "8px",
|
|
803
|
+
backgroundColor: "transparent",
|
|
804
|
+
border: "none",
|
|
805
|
+
textDecoration: "underline",
|
|
806
|
+
cursor: "pointer"
|
|
807
|
+
},
|
|
808
|
+
className: "errorMessageAddingFile",
|
|
809
|
+
"aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
|
|
810
|
+
children: "Ta bort fel! / Remove errors!"
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
activateErrorMessagesForScreenReader && /* @__PURE__ */ jsx7(
|
|
814
|
+
"p",
|
|
815
|
+
{
|
|
816
|
+
role: "alert",
|
|
817
|
+
style: {
|
|
818
|
+
position: "absolute",
|
|
819
|
+
left: "-9999px",
|
|
820
|
+
top: "auto",
|
|
821
|
+
width: "1px",
|
|
822
|
+
height: "1px",
|
|
823
|
+
overflow: "hidden"
|
|
824
|
+
},
|
|
825
|
+
"aria-atomic": "true",
|
|
826
|
+
children: errorMessagesForScreenReader
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
] });
|
|
784
830
|
};
|
|
785
831
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
786
832
|
|
|
787
833
|
// src/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.tsx
|
|
788
|
-
import { Fragment as Fragment8, jsx as jsx8, jsxs as
|
|
834
|
+
import { Fragment as Fragment8, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
789
835
|
var ExploreFiles = ({
|
|
790
836
|
FilesSelected,
|
|
837
|
+
//UploadButtonText = 'upload files',
|
|
791
838
|
numberOfFiles,
|
|
792
839
|
allowedNumberOfFiles,
|
|
793
840
|
activatedLanguage,
|
|
@@ -797,10 +844,28 @@ var ExploreFiles = ({
|
|
|
797
844
|
errorId,
|
|
798
845
|
questionObject,
|
|
799
846
|
showErrors,
|
|
800
|
-
errorMessageAddingFile
|
|
847
|
+
errorMessageAddingFile,
|
|
848
|
+
removeUploadErrors = () => {
|
|
849
|
+
alert("finns ingen funktion");
|
|
850
|
+
}
|
|
801
851
|
}) => {
|
|
802
852
|
const fileInputRef = useRef2(null);
|
|
803
853
|
const buttonInputRef = useRef2(null);
|
|
854
|
+
const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = React3.useState(false);
|
|
855
|
+
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = React3.useState("");
|
|
856
|
+
useEffect3(() => {
|
|
857
|
+
const button = buttonInputRef.current;
|
|
858
|
+
if (!button) return;
|
|
859
|
+
const handleFocus = () => {
|
|
860
|
+
setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
|
|
861
|
+
console.log("FOCUS!!");
|
|
862
|
+
console.log("Error messages for screen reader: " + errorMessageAddingFile);
|
|
863
|
+
};
|
|
864
|
+
button.addEventListener("focus", handleFocus);
|
|
865
|
+
return () => {
|
|
866
|
+
button.removeEventListener("focus", handleFocus);
|
|
867
|
+
};
|
|
868
|
+
}, []);
|
|
804
869
|
const handleFiles = (event) => {
|
|
805
870
|
const files = Array.from(event.target.files || []);
|
|
806
871
|
FilesSelected(files);
|
|
@@ -810,18 +875,32 @@ var ExploreFiles = ({
|
|
|
810
875
|
var _a;
|
|
811
876
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
812
877
|
};
|
|
878
|
+
const handleRemoveErrors = () => {
|
|
879
|
+
const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
|
|
880
|
+
setErrorMessagesForScreenReader(errorMessages);
|
|
881
|
+
removeUploadErrors();
|
|
882
|
+
putFocusOnButton();
|
|
883
|
+
setTimeout(() => {
|
|
884
|
+
setShowErrorMessagesForScreenReader(false);
|
|
885
|
+
}, 1e3);
|
|
886
|
+
};
|
|
887
|
+
const putFocusOnButton = () => {
|
|
888
|
+
var _a;
|
|
889
|
+
(_a = buttonInputRef.current) == null ? void 0 : _a.focus();
|
|
890
|
+
};
|
|
813
891
|
let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
"div",
|
|
892
|
+
return /* @__PURE__ */ jsx8(Fragment8, { children: /* @__PURE__ */ jsxs8("div", { className: "inputContainer", children: [
|
|
893
|
+
/* @__PURE__ */ jsxs8(
|
|
894
|
+
"label",
|
|
818
895
|
{
|
|
896
|
+
tabIndex: -1,
|
|
819
897
|
className: clsx2(
|
|
820
898
|
["form-control"],
|
|
821
899
|
"filePickLabel",
|
|
822
900
|
showErrors && questionObject.error ? ["form-control error"] : ""
|
|
823
901
|
),
|
|
824
902
|
id: labelId,
|
|
903
|
+
htmlFor: inputId,
|
|
825
904
|
children: [
|
|
826
905
|
/* @__PURE__ */ jsx8(
|
|
827
906
|
"button",
|
|
@@ -832,34 +911,34 @@ var ExploreFiles = ({
|
|
|
832
911
|
"filePickButton",
|
|
833
912
|
showErrors && questionObject.error ? "filePickButton error" : ""
|
|
834
913
|
),
|
|
835
|
-
"aria-describedby": `${aboutId} ${questionObject.
|
|
836
|
-
"aria-label":
|
|
914
|
+
"aria-describedby": `${aboutId} ${showErrors && questionObject.error ? errorId : ""}`.trim(),
|
|
915
|
+
"aria-label": `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`,
|
|
837
916
|
children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
|
|
838
917
|
}
|
|
839
918
|
),
|
|
840
|
-
/* @__PURE__ */ jsx8(
|
|
841
|
-
|
|
919
|
+
/* @__PURE__ */ jsx8(
|
|
920
|
+
"input",
|
|
921
|
+
{
|
|
922
|
+
ref: fileInputRef,
|
|
923
|
+
type: "file",
|
|
924
|
+
className: "invisible",
|
|
925
|
+
multiple: true,
|
|
926
|
+
onChange: handleFiles,
|
|
927
|
+
tabIndex: -1,
|
|
928
|
+
id: inputId
|
|
929
|
+
}
|
|
930
|
+
),
|
|
931
|
+
/* @__PURE__ */ jsx8("span", { className: "filePickText", children: addFilesInfoText })
|
|
842
932
|
]
|
|
843
933
|
}
|
|
844
934
|
),
|
|
845
|
-
/* @__PURE__ */ jsx8(
|
|
846
|
-
"input",
|
|
847
|
-
{
|
|
848
|
-
"aria-hidden": true,
|
|
849
|
-
ref: fileInputRef,
|
|
850
|
-
type: "file",
|
|
851
|
-
className: "invisible",
|
|
852
|
-
multiple: true,
|
|
853
|
-
onChange: handleFiles,
|
|
854
|
-
tabIndex: -1,
|
|
855
|
-
id: inputId
|
|
856
|
-
}
|
|
857
|
-
),
|
|
858
935
|
/* @__PURE__ */ jsx8(
|
|
859
936
|
ScreenReaderErrors_default,
|
|
860
937
|
{
|
|
861
938
|
errorMessageAddingFile,
|
|
862
|
-
|
|
939
|
+
removeUploadErrors,
|
|
940
|
+
activatedLanguage,
|
|
941
|
+
putFocusOnButton
|
|
863
942
|
}
|
|
864
943
|
)
|
|
865
944
|
] }) });
|
|
@@ -883,7 +962,7 @@ var IndicatorStandard_default = Indicator;
|
|
|
883
962
|
|
|
884
963
|
// src/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.tsx
|
|
885
964
|
import clsx4 from "clsx";
|
|
886
|
-
import { Fragment as Fragment10, jsx as jsx10, jsxs as
|
|
965
|
+
import { Fragment as Fragment10, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
887
966
|
var SelectedFiles = ({
|
|
888
967
|
questionObject,
|
|
889
968
|
isTouched,
|
|
@@ -893,12 +972,11 @@ var SelectedFiles = ({
|
|
|
893
972
|
errorMessageAddingFile,
|
|
894
973
|
activatedLanguage,
|
|
895
974
|
numberOfFiles,
|
|
896
|
-
setNumberOfFiles
|
|
897
|
-
removeUploadErrors
|
|
975
|
+
setNumberOfFiles
|
|
898
976
|
}) => {
|
|
899
977
|
const theDiv = useRef3(null);
|
|
900
978
|
const remove = (file) => {
|
|
901
|
-
let newFiles = questionObject.
|
|
979
|
+
let newFiles = questionObject.Files.filter((f) => f !== file);
|
|
902
980
|
const newCountOfFiles = newFiles.length;
|
|
903
981
|
setNumberOfFiles(newCountOfFiles);
|
|
904
982
|
const e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
|
|
@@ -923,62 +1001,66 @@ var SelectedFiles = ({
|
|
|
923
1001
|
return windowWidth2;
|
|
924
1002
|
};
|
|
925
1003
|
const windowWidth = useWindowWidth();
|
|
926
|
-
return /* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
|
|
939
|
-
"span",
|
|
940
|
-
{
|
|
941
|
-
"aria-hidden": "true",
|
|
942
|
-
className: clsx4("uploadedDot", "uploadFailed"),
|
|
943
|
-
children: "!"
|
|
944
|
-
}
|
|
945
|
-
) }),
|
|
946
|
-
/* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }),
|
|
947
|
-
/* @__PURE__ */ jsx10(Col, { className: "lastCol" })
|
|
948
|
-
] }),
|
|
949
|
-
/* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
|
|
950
|
-
Col,
|
|
1004
|
+
return /* @__PURE__ */ jsxs9(Fragment10, { children: [
|
|
1005
|
+
/* @__PURE__ */ jsx10("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs9("ul", { className: "fileListUnorderedList", "aria-label": "Valideringsfelmeddelanden f\xF6r uppladdade filer", children: [
|
|
1006
|
+
" ",
|
|
1007
|
+
errorMessageAddingFile.map((errorObj, index) => {
|
|
1008
|
+
const errorFileName = errorObj.FileName;
|
|
1009
|
+
let mobileFirstFileName = errorObj.FileName.split(".").shift();
|
|
1010
|
+
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
1011
|
+
const fileType = errorObj.FileName.split(".").pop();
|
|
1012
|
+
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
1013
|
+
return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", role: "alert", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
|
|
1014
|
+
/* @__PURE__ */ jsxs9(Row, { children: [
|
|
1015
|
+
/* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10(
|
|
1016
|
+
"span",
|
|
951
1017
|
{
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
},
|
|
956
|
-
className: "errorMessageAddingFile",
|
|
957
|
-
...activatedLanguage === "sv" ? {
|
|
958
|
-
"aria-label": `${errorFileName} ${errorObj.svMessage}`
|
|
959
|
-
} : {
|
|
960
|
-
"aria-label": `${errorFileName} ${errorObj.enMessage}`
|
|
961
|
-
},
|
|
962
|
-
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
1018
|
+
"aria-hidden": "true",
|
|
1019
|
+
className: clsx4("uploadedDot", "uploadFailed"),
|
|
1020
|
+
children: "!"
|
|
963
1021
|
}
|
|
964
1022
|
) }),
|
|
965
|
-
/* @__PURE__ */ jsx10(
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1023
|
+
/* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }),
|
|
1024
|
+
/* @__PURE__ */ jsx10(Col, { className: "lastCol", children: /* @__PURE__ */ jsx10(
|
|
1025
|
+
"button",
|
|
1026
|
+
{
|
|
1027
|
+
className: "selectedFilesLinkButton",
|
|
1028
|
+
onClick: () => {
|
|
1029
|
+
removeError(index);
|
|
1030
|
+
},
|
|
1031
|
+
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet f\xF6r ${errorFileName}` : `Close error message for ${errorFileName}`,
|
|
1032
|
+
children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
|
|
1033
|
+
}
|
|
1034
|
+
) })
|
|
1035
|
+
] }),
|
|
1036
|
+
/* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
|
|
1037
|
+
Col,
|
|
1038
|
+
{
|
|
1039
|
+
style: {
|
|
1040
|
+
width: "100%",
|
|
1041
|
+
color: "#8e0039"
|
|
1042
|
+
},
|
|
1043
|
+
className: "errorMessageAddingFile",
|
|
1044
|
+
...activatedLanguage === "sv" ? {
|
|
1045
|
+
"aria-label": `${errorFileName} ${errorObj.svMessage}`
|
|
1046
|
+
} : {
|
|
1047
|
+
"aria-label": `${errorFileName} ${errorObj.enMessage}`
|
|
1048
|
+
},
|
|
1049
|
+
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
1050
|
+
}
|
|
1051
|
+
) }),
|
|
1052
|
+
/* @__PURE__ */ jsx10(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx10(Col, { className: "makeSpace" }) })
|
|
1053
|
+
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
1054
|
+
})
|
|
1055
|
+
] }) }),
|
|
1056
|
+
questionObject.Files.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
|
|
975
1057
|
const indicatorfileName = file.FileName;
|
|
976
1058
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
977
1059
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
978
1060
|
const fileType = file.FileName.split(".").pop();
|
|
979
1061
|
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
980
|
-
return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
|
|
1063
|
+
/* @__PURE__ */ jsxs9(Row, { children: [
|
|
982
1064
|
/* @__PURE__ */ jsx10(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "uploadedDot", children: /* @__PURE__ */ jsx10(
|
|
983
1065
|
"svg",
|
|
984
1066
|
{
|
|
@@ -998,16 +1080,17 @@ var SelectedFiles = ({
|
|
|
998
1080
|
)
|
|
999
1081
|
}
|
|
1000
1082
|
) }) }),
|
|
1001
|
-
/* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsxs9("span", { className: "mobileFirstFileName", children: [
|
|
1002
1084
|
mobileFirstFileName,
|
|
1003
1085
|
" (",
|
|
1004
1086
|
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
1005
|
-
" "
|
|
1006
|
-
|
|
1007
|
-
] }) : /* @__PURE__ */ jsxs8("span", { className: "desktopFileName", children: [
|
|
1087
|
+
" MB)"
|
|
1088
|
+
] }) : /* @__PURE__ */ jsxs9("span", { className: "desktopFileName", children: [
|
|
1008
1089
|
file.FileName,
|
|
1009
1090
|
" (",
|
|
1010
|
-
file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
|
|
1091
|
+
file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
|
|
1092
|
+
1
|
|
1093
|
+
)} MB`,
|
|
1011
1094
|
")"
|
|
1012
1095
|
] }) }),
|
|
1013
1096
|
/* @__PURE__ */ jsx10(Col, { className: "lastCol", children: /* @__PURE__ */ jsx10(
|
|
@@ -1030,7 +1113,7 @@ var SelectedFiles = ({
|
|
|
1030
1113
|
var SelectedFilesStandard_default = SelectedFiles;
|
|
1031
1114
|
|
|
1032
1115
|
// src/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.tsx
|
|
1033
|
-
import { Fragment as Fragment11, jsx as jsx11, jsxs as
|
|
1116
|
+
import { Fragment as Fragment11, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1034
1117
|
var AddFiles = ({
|
|
1035
1118
|
questionObject,
|
|
1036
1119
|
isTouched = (e, questionObject2) => {
|
|
@@ -1199,9 +1282,10 @@ var AddFiles = ({
|
|
|
1199
1282
|
const handleRemoveErrors = () => {
|
|
1200
1283
|
setErrorMessageAddingFile([]);
|
|
1201
1284
|
};
|
|
1202
|
-
return /* @__PURE__ */
|
|
1203
|
-
!showPreview && visible && /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */
|
|
1204
|
-
questionObject.
|
|
1285
|
+
return /* @__PURE__ */ jsxs10(Fragment11, { children: [
|
|
1286
|
+
!showPreview && visible && /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsxs10("div", { role: "group", children: [
|
|
1287
|
+
!questionObject.hideQuestion && questionObject.questionLabel,
|
|
1288
|
+
questionObject.aboutText && /* @__PURE__ */ jsxs10(
|
|
1205
1289
|
"p",
|
|
1206
1290
|
{
|
|
1207
1291
|
id: aboutId,
|
|
@@ -1211,17 +1295,23 @@ var AddFiles = ({
|
|
|
1211
1295
|
),
|
|
1212
1296
|
children: [
|
|
1213
1297
|
questionObject.aboutText,
|
|
1214
|
-
questionObject.isQuestionMandatory && /* @__PURE__ */
|
|
1298
|
+
questionObject.isQuestionMandatory && /* @__PURE__ */ jsxs10("span", { className: "mandatoryAsterisk", "aria-hidden": "true", children: [
|
|
1215
1299
|
" ",
|
|
1216
1300
|
"*"
|
|
1217
1301
|
] })
|
|
1218
1302
|
]
|
|
1219
1303
|
}
|
|
1220
1304
|
),
|
|
1221
|
-
questionObject.hasValidationError && /* @__PURE__ */
|
|
1305
|
+
questionObject.hasValidationError && /* @__PURE__ */ jsxs10("div", { className: "error addfileserror", id: errorId, children: [
|
|
1222
1306
|
/* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1223
|
-
/* @__PURE__ */ jsx11(
|
|
1224
|
-
|
|
1307
|
+
/* @__PURE__ */ jsx11(
|
|
1308
|
+
"span",
|
|
1309
|
+
{
|
|
1310
|
+
"aria-label": `Felmeddelande. ${questionObject.validationDefaultMessesege}`,
|
|
1311
|
+
className: "errorText",
|
|
1312
|
+
children: questionObject.validationDefaultMessesege
|
|
1313
|
+
}
|
|
1314
|
+
)
|
|
1225
1315
|
] }),
|
|
1226
1316
|
/* @__PURE__ */ jsx11(
|
|
1227
1317
|
ExploreFilesStandard_default,
|
|
@@ -1250,8 +1340,7 @@ var AddFiles = ({
|
|
|
1250
1340
|
errorMessageAddingFile,
|
|
1251
1341
|
activatedLanguage,
|
|
1252
1342
|
numberOfFiles,
|
|
1253
|
-
setNumberOfFiles
|
|
1254
|
-
removeUploadErrors: handleRemoveErrors
|
|
1343
|
+
setNumberOfFiles
|
|
1255
1344
|
}
|
|
1256
1345
|
)
|
|
1257
1346
|
] }) }),
|
|
@@ -1264,7 +1353,7 @@ var PreviewAddFiles = ({
|
|
|
1264
1353
|
activatedLanguage
|
|
1265
1354
|
}) => {
|
|
1266
1355
|
const previewId = `preview-${questionObject.Id}`;
|
|
1267
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsxs10("div", { className: "pts-question-preview pts-addFiles-preview", id: `question-${previewId}`, children: [
|
|
1268
1357
|
/* @__PURE__ */ jsx11("h3", { id: previewId, children: questionObject.Question }),
|
|
1269
1358
|
/* @__PURE__ */ jsx11("div", { className: "pts-root-answer", children: questionObject.Files && questionObject.Files.length > 0 ? /* @__PURE__ */ jsx11("ul", { "aria-labelledby": previewId, children: questionObject.Files.map((file, index) => {
|
|
1270
1359
|
return /* @__PURE__ */ jsx11("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
|
|
@@ -1490,7 +1579,7 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
|
|
|
1490
1579
|
var GroupQuestionsByStepCategoryGroup_default = groupQuestionsByStepCategoryGroup;
|
|
1491
1580
|
|
|
1492
1581
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1493
|
-
import { Fragment as Fragment12, jsx as jsx12, jsxs as
|
|
1582
|
+
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1494
1583
|
var RenderQuestion = ({
|
|
1495
1584
|
question,
|
|
1496
1585
|
isTouched,
|
|
@@ -1498,7 +1587,7 @@ var RenderQuestion = ({
|
|
|
1498
1587
|
showPreview = false,
|
|
1499
1588
|
hideValidationMessage
|
|
1500
1589
|
}) => {
|
|
1501
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1502
1591
|
question.questionType === "Radio" && /* @__PURE__ */ jsx12(
|
|
1503
1592
|
RadioMultipleStandard_default,
|
|
1504
1593
|
{
|
|
@@ -1542,7 +1631,7 @@ var RenderQuestion_default = RenderQuestion;
|
|
|
1542
1631
|
|
|
1543
1632
|
// src/NewRenderFormComponentStandard/RenderQuestionGroup/RenderQuestionGroup.tsx
|
|
1544
1633
|
import React7 from "react";
|
|
1545
|
-
import { Fragment as Fragment13, jsx as jsx13, jsxs as
|
|
1634
|
+
import { Fragment as Fragment13, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1546
1635
|
var RenderQuestionGroup = ({
|
|
1547
1636
|
questionArray,
|
|
1548
1637
|
wrapper,
|
|
@@ -1574,7 +1663,7 @@ var RenderQuestionGroup = ({
|
|
|
1574
1663
|
}) });
|
|
1575
1664
|
switch (wrapper) {
|
|
1576
1665
|
case "fieldset":
|
|
1577
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ jsxs12(
|
|
1578
1667
|
"fieldset",
|
|
1579
1668
|
{
|
|
1580
1669
|
className: "pts-root-question-group-fieldset",
|
|
@@ -1583,14 +1672,14 @@ var RenderQuestionGroup = ({
|
|
|
1583
1672
|
"aria-errormessage": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
|
|
1584
1673
|
"aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
|
|
1585
1674
|
children: [
|
|
1586
|
-
legend && /* @__PURE__ */
|
|
1675
|
+
legend && /* @__PURE__ */ jsxs12("legend", { children: [
|
|
1587
1676
|
/* @__PURE__ */ jsx13("span", { children: legend }),
|
|
1588
|
-
questionArray[0].hasValidationError && /* @__PURE__ */
|
|
1677
|
+
questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("span", { className: "sr-only", children: [
|
|
1589
1678
|
"Valideringsfel. ",
|
|
1590
1679
|
questionArray[0].validationDefaultMessesege
|
|
1591
1680
|
] })
|
|
1592
1681
|
] }),
|
|
1593
|
-
questionArray[0].hasValidationError && /* @__PURE__ */
|
|
1682
|
+
questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("div", { className: "pts-root-error", id: questionArray[0].id + "-error", children: [
|
|
1594
1683
|
/* @__PURE__ */ jsx13("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
|
|
1595
1684
|
/* @__PURE__ */ jsx13("span", { className: "errorText", children: questionArray[0].validationDefaultMessesege })
|
|
1596
1685
|
] }),
|
|
@@ -1692,19 +1781,19 @@ var ILanguageSupportinitialState = {
|
|
|
1692
1781
|
};
|
|
1693
1782
|
|
|
1694
1783
|
// src/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.tsx
|
|
1695
|
-
import { jsx as jsx14, jsxs as
|
|
1784
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1696
1785
|
var EditPreviewLink = ({
|
|
1697
1786
|
step,
|
|
1698
1787
|
changeStepHandler,
|
|
1699
1788
|
activatedLanguage = "sv"
|
|
1700
1789
|
}) => {
|
|
1701
|
-
return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13(
|
|
1702
1791
|
"a",
|
|
1703
1792
|
{
|
|
1704
1793
|
href: "#",
|
|
1705
1794
|
onClick: (e) => {
|
|
1706
1795
|
e.preventDefault();
|
|
1707
|
-
changeStepHandler(step
|
|
1796
|
+
changeStepHandler(step);
|
|
1708
1797
|
},
|
|
1709
1798
|
children: [
|
|
1710
1799
|
/* @__PURE__ */ jsx14(
|
|
@@ -1736,12 +1825,13 @@ var EditPreviewLink = ({
|
|
|
1736
1825
|
var EditPreviewLinkStandard_default = EditPreviewLink;
|
|
1737
1826
|
|
|
1738
1827
|
// src/NewTextComponentStandard/FooterStandard/FooterStandard.tsx
|
|
1739
|
-
import { jsx as jsx15, jsxs as
|
|
1828
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1740
1829
|
var Footer = ({ activatedLanguage = "sv" }) => {
|
|
1741
|
-
return /* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1830
|
+
return /* @__PURE__ */ jsxs14("footer", { className: "pts-footer-container", children: [
|
|
1831
|
+
/* @__PURE__ */ jsxs14(
|
|
1743
1832
|
"svg",
|
|
1744
1833
|
{
|
|
1834
|
+
role: "img",
|
|
1745
1835
|
"aria-label": activatedLanguage === "en" ? "PTS logotype" : "PTS logotyp",
|
|
1746
1836
|
className: "pts-footer-logo",
|
|
1747
1837
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1767,62 +1857,69 @@ var Footer = ({ activatedLanguage = "sv" }) => {
|
|
|
1767
1857
|
]
|
|
1768
1858
|
}
|
|
1769
1859
|
),
|
|
1770
|
-
/* @__PURE__ */ jsx15(
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1860
|
+
/* @__PURE__ */ jsx15(
|
|
1861
|
+
"nav",
|
|
1862
|
+
{
|
|
1863
|
+
className: "pts-footer-linkList",
|
|
1864
|
+
"aria-label": activatedLanguage === "en" ? "Footer navigation" : "Sidfotsnavigering",
|
|
1865
|
+
children: /* @__PURE__ */ jsxs14("ul", { children: [
|
|
1866
|
+
/* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
|
|
1867
|
+
"a",
|
|
1868
|
+
{
|
|
1869
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/contact/" : "https://www.pts.se/kontakt/",
|
|
1870
|
+
target: "_blank",
|
|
1871
|
+
rel: "noopener noreferrer",
|
|
1872
|
+
children: [
|
|
1873
|
+
/* @__PURE__ */ jsx15("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Contact (opens in new tab)" : "PTS Kontakt (\xF6ppnas i ny flik)" }),
|
|
1874
|
+
/* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Contact" : "Kontakt" })
|
|
1875
|
+
]
|
|
1876
|
+
}
|
|
1877
|
+
) }),
|
|
1878
|
+
/* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
|
|
1879
|
+
"a",
|
|
1880
|
+
{
|
|
1881
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/gdpr" : "https://www.pts.se/gdpr/",
|
|
1882
|
+
target: "_blank",
|
|
1883
|
+
rel: "noopener noreferrer",
|
|
1884
|
+
children: [
|
|
1885
|
+
/* @__PURE__ */ jsx15("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Processing of personal data (opens in new tab)" : "PTS Behandling av personuppgifter (\xF6ppnas i ny flik)" }),
|
|
1886
|
+
/* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Processing of personal data" : "Behandling av personuppgifter" })
|
|
1887
|
+
]
|
|
1888
|
+
}
|
|
1889
|
+
) }),
|
|
1890
|
+
/* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
|
|
1891
|
+
"a",
|
|
1892
|
+
{
|
|
1893
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/accessibility-eservices" : "https://www.pts.se/tillganglighet-etjanster",
|
|
1894
|
+
target: "_blank",
|
|
1895
|
+
rel: "noopener noreferrer",
|
|
1896
|
+
children: [
|
|
1897
|
+
/* @__PURE__ */ jsx15("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Accessibility (opens in new tab)" : "PTS Tillg\xE4nglighetsredog\xF6relse (\xF6ppnas i ny flik)" }),
|
|
1898
|
+
/* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Accessibility" : "Tillg\xE4nglighetsredog\xF6relse" })
|
|
1899
|
+
]
|
|
1900
|
+
}
|
|
1901
|
+
) }),
|
|
1902
|
+
/* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsxs14(
|
|
1903
|
+
"a",
|
|
1904
|
+
{
|
|
1905
|
+
href: activatedLanguage === "en" ? "https://pts.se/en/cookies-eservices" : "https://www.pts.se/kakor-etjanster",
|
|
1906
|
+
target: "_blank",
|
|
1907
|
+
rel: "noopener noreferrer",
|
|
1908
|
+
children: [
|
|
1909
|
+
/* @__PURE__ */ jsx15("span", { className: "sr-only", children: activatedLanguage === "en" ? "PTS Cookies (opens in new tab)" : "PTS Kakor (\xF6ppnas i ny flik)" }),
|
|
1910
|
+
/* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: activatedLanguage === "en" ? "Cookies" : "Kakor" })
|
|
1911
|
+
]
|
|
1912
|
+
}
|
|
1913
|
+
) })
|
|
1914
|
+
] })
|
|
1915
|
+
}
|
|
1916
|
+
)
|
|
1820
1917
|
] });
|
|
1821
1918
|
};
|
|
1822
1919
|
var FooterStandard_default = Footer;
|
|
1823
1920
|
|
|
1824
1921
|
// src/NewTextComponentStandard/HeaderStandard/Icons.tsx
|
|
1825
|
-
import { jsx as jsx16, jsxs as
|
|
1922
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1826
1923
|
var LanguageIcon = () => /* @__PURE__ */ jsx16("svg", { width: "15", height: "15", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx16(
|
|
1827
1924
|
"path",
|
|
1828
1925
|
{
|
|
@@ -1830,7 +1927,7 @@ var LanguageIcon = () => /* @__PURE__ */ jsx16("svg", { width: "15", height: "15
|
|
|
1830
1927
|
fill: "#6E3282"
|
|
1831
1928
|
}
|
|
1832
1929
|
) });
|
|
1833
|
-
var Logo_sv = () => /* @__PURE__ */
|
|
1930
|
+
var Logo_sv = () => /* @__PURE__ */ jsxs15("svg", { width: "168.8", height: "46.67", viewBox: "0 0 168.8 46.67", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1834
1931
|
/* @__PURE__ */ jsx16(
|
|
1835
1932
|
"path",
|
|
1836
1933
|
{
|
|
@@ -1976,7 +2073,7 @@ var Logo_sv = () => /* @__PURE__ */ jsxs14("svg", { width: "168.8", height: "46.
|
|
|
1976
2073
|
),
|
|
1977
2074
|
/* @__PURE__ */ jsx16("path", { d: "M82.2223 18.3335V37.2224", stroke: "black", strokeWidth: "0.8", strokeMiterlimit: "10" })
|
|
1978
2075
|
] });
|
|
1979
|
-
var Logo_en = () => /* @__PURE__ */
|
|
2076
|
+
var Logo_en = () => /* @__PURE__ */ jsxs15("svg", { width: "189.0", height: "46.67", viewBox: "0 0 189 46.67", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", children: [
|
|
1980
2077
|
/* @__PURE__ */ jsx16(
|
|
1981
2078
|
"path",
|
|
1982
2079
|
{
|
|
@@ -2199,7 +2296,7 @@ var Logo_en = () => /* @__PURE__ */ jsxs14("svg", { width: "189.0", height: "46.
|
|
|
2199
2296
|
] });
|
|
2200
2297
|
|
|
2201
2298
|
// src/NewTextComponentStandard/HeaderStandard/HeaderStandard.tsx
|
|
2202
|
-
import { jsx as jsx17, jsxs as
|
|
2299
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2203
2300
|
var Header = ({
|
|
2204
2301
|
activatedLanguage = "sv",
|
|
2205
2302
|
useLanguage = true,
|
|
@@ -2218,7 +2315,7 @@ var Header = ({
|
|
|
2218
2315
|
if (activatedLanguage === "sv") return "English";
|
|
2219
2316
|
else return "Svenska";
|
|
2220
2317
|
};
|
|
2221
|
-
return /* @__PURE__ */
|
|
2318
|
+
return /* @__PURE__ */ jsxs16("header", { className: "pts-header-container", children: [
|
|
2222
2319
|
/* @__PURE__ */ jsx17(
|
|
2223
2320
|
"a",
|
|
2224
2321
|
{
|
|
@@ -2229,17 +2326,15 @@ var Header = ({
|
|
|
2229
2326
|
children: activatedLanguage === "en" ? /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx17(Logo_en, {}) }) : /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx17(Logo_sv, {}) })
|
|
2230
2327
|
}
|
|
2231
2328
|
),
|
|
2232
|
-
useLanguage && /* @__PURE__ */
|
|
2329
|
+
useLanguage && /* @__PURE__ */ jsxs16(
|
|
2233
2330
|
"button",
|
|
2234
2331
|
{
|
|
2235
|
-
|
|
2332
|
+
"aria-label": activatedLanguage === "en" ? "Change language to Svenska" : "\xC4ndra spr\xE5k till English",
|
|
2236
2333
|
className: "pts-languageButton",
|
|
2237
2334
|
onClick: handleLanguageClick,
|
|
2238
2335
|
children: [
|
|
2239
2336
|
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx17(LanguageIcon, {}) }),
|
|
2240
|
-
/* @__PURE__ */ jsx17("span", {
|
|
2241
|
-
activatedLanguage === "en" && /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "\xC4ndra spr\xE5k till svenska" }),
|
|
2242
|
-
activatedLanguage === "sv" && /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Change language to English" })
|
|
2337
|
+
/* @__PURE__ */ jsx17("span", { className: "pts-languageButton", children: getLanguageLabel() })
|
|
2243
2338
|
]
|
|
2244
2339
|
}
|
|
2245
2340
|
)
|
|
@@ -2250,7 +2345,7 @@ var HeaderStandard_default = Header;
|
|
|
2250
2345
|
// src/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.tsx
|
|
2251
2346
|
import { useEffect as useEffect6 } from "react";
|
|
2252
2347
|
import DOMPurify4 from "dompurify";
|
|
2253
|
-
import { Fragment as Fragment14, jsx as jsx18, jsxs as
|
|
2348
|
+
import { Fragment as Fragment14, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2254
2349
|
var cleanText = (text) => DOMPurify4.sanitize(text, { ADD_ATTR: ["target", "class"] });
|
|
2255
2350
|
var InfoOnly = ({
|
|
2256
2351
|
questionObject,
|
|
@@ -2270,7 +2365,7 @@ var InfoOnly = ({
|
|
|
2270
2365
|
const e = { target: { value: questionObject2.questionLabel + avoidBugInRedux } };
|
|
2271
2366
|
isTouched(e, questionObject2);
|
|
2272
2367
|
};
|
|
2273
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
2274
2369
|
showConfigure && visible && /* @__PURE__ */ jsx18("div", { className: "pts-infoOnly-container", children: /* @__PURE__ */ jsx18("div", { className: "InfoOnlyText", tabIndex, children: questionObject.questionLabel && /* @__PURE__ */ jsx18(
|
|
2275
2370
|
"p",
|
|
2276
2371
|
{
|
|
@@ -2295,7 +2390,7 @@ var PreviewInfoOnly = ({ questionObject }) => {
|
|
|
2295
2390
|
};
|
|
2296
2391
|
|
|
2297
2392
|
// src/NewTextComponentStandard/ModalStandard/ModalStandard.tsx
|
|
2298
|
-
import { jsx as jsx19, jsxs as
|
|
2393
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2299
2394
|
var CONTENT = {
|
|
2300
2395
|
en: {
|
|
2301
2396
|
heading: "Please wait",
|
|
@@ -2309,8 +2404,8 @@ var CONTENT = {
|
|
|
2309
2404
|
var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
|
|
2310
2405
|
const currentContent = activatedLanguage === "en" ? CONTENT.en : CONTENT.sv;
|
|
2311
2406
|
if (!isOpen) return null;
|
|
2312
|
-
return /* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsxs18("div", { className: "pts-modal-overlay", children: [
|
|
2408
|
+
/* @__PURE__ */ jsxs18("div", { "aria-hidden": true, className: "pts-modal-content", children: [
|
|
2314
2409
|
/* @__PURE__ */ jsx19("h1", { children: currentContent.heading }),
|
|
2315
2410
|
/* @__PURE__ */ jsx19("p", { children: currentContent.message }),
|
|
2316
2411
|
/* @__PURE__ */ jsx19("div", { className: "pts-spinner-border" })
|
|
@@ -2323,21 +2418,23 @@ var ModalStandard_default = Modal;
|
|
|
2323
2418
|
// src/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.tsx
|
|
2324
2419
|
import { createElement } from "react";
|
|
2325
2420
|
import DOMPurify5 from "dompurify";
|
|
2326
|
-
import { jsx as jsx20, jsxs as
|
|
2421
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2327
2422
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
2328
|
-
return /* @__PURE__ */
|
|
2423
|
+
return /* @__PURE__ */ jsxs19(
|
|
2329
2424
|
"section",
|
|
2330
2425
|
{
|
|
2331
2426
|
className: "pts-textHeadlineAndBody-container",
|
|
2427
|
+
"aria-labelledby": "textHeadlineAndBody-headline",
|
|
2332
2428
|
children: [
|
|
2333
2429
|
data.headline && createElement(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
|
|
2334
2430
|
data.body && /* @__PURE__ */ jsx20("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
|
|
2335
|
-
data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx20("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx20("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */
|
|
2431
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx20("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((link, index) => /* @__PURE__ */ jsx20("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs19(
|
|
2336
2432
|
"a",
|
|
2337
2433
|
{
|
|
2338
2434
|
href: link.url,
|
|
2339
2435
|
target: "_blank",
|
|
2340
2436
|
rel: "noopener noreferrer",
|
|
2437
|
+
"aria-label": link.ariaLabel,
|
|
2341
2438
|
children: [
|
|
2342
2439
|
/* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
|
|
2343
2440
|
"svg",
|
|
@@ -2361,7 +2458,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
|
2361
2458
|
]
|
|
2362
2459
|
}
|
|
2363
2460
|
) }, `more-info-${index}`)) }),
|
|
2364
|
-
data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */
|
|
2461
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs19(
|
|
2365
2462
|
"a",
|
|
2366
2463
|
{
|
|
2367
2464
|
href: data.linksForMoreInfo[0].url,
|
|
@@ -2453,12 +2550,12 @@ var PrincipleOfPublicityStandard_default = PrincipleOfPublicity;
|
|
|
2453
2550
|
|
|
2454
2551
|
// src/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.tsx
|
|
2455
2552
|
import DOMPurify6 from "dompurify";
|
|
2456
|
-
import { jsx as jsx22, jsxs as
|
|
2553
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2457
2554
|
var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
2458
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ jsxs20("div", { className: "pts-serviceHeadlineAndBody-container", children: [
|
|
2459
2556
|
data.mainHeadline && /* @__PURE__ */ jsx22("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
|
|
2460
2557
|
activeStep === 1 && data.ingressBody && /* @__PURE__ */ jsx22("div", { dangerouslySetInnerHTML: { __html: DOMPurify6.sanitize(data.ingressBody) } }),
|
|
2461
|
-
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx22("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ jsx22("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */
|
|
2558
|
+
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length > 1 && /* @__PURE__ */ jsx22("ul", { className: "pts-moreinfo-list", children: data.linksForMoreInfo.map((moreInfo, index) => /* @__PURE__ */ jsx22("li", { className: index > 0 ? "notFirstInList" : "", children: /* @__PURE__ */ jsxs20("a", { href: moreInfo.url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
2462
2559
|
/* @__PURE__ */ jsx22(
|
|
2463
2560
|
"svg",
|
|
2464
2561
|
{
|
|
@@ -2479,7 +2576,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
|
2479
2576
|
),
|
|
2480
2577
|
/* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
|
|
2481
2578
|
] }) }, moreInfo.title + index)) }),
|
|
2482
|
-
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */
|
|
2579
|
+
activeStep === 1 && data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs20("a", { href: data.linksForMoreInfo[0].url, target: "_blank", rel: "noopener noreferrer", children: [
|
|
2483
2580
|
/* @__PURE__ */ jsx22(
|
|
2484
2581
|
"svg",
|
|
2485
2582
|
{
|
|
@@ -2507,29 +2604,12 @@ var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
|
|
|
2507
2604
|
// src/NewTextComponentStandard/SkipLinkStandard/SkipLinkStandard.tsx
|
|
2508
2605
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2509
2606
|
var SkipLink = () => {
|
|
2510
|
-
|
|
2511
|
-
const container = document.getElementById(`main-content`);
|
|
2512
|
-
if (container) {
|
|
2513
|
-
container.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
2514
|
-
container.focus();
|
|
2515
|
-
}
|
|
2516
|
-
}
|
|
2517
|
-
return /* @__PURE__ */ jsx23("div", { className: "pts-skipLink-container", children: /* @__PURE__ */ jsx23(
|
|
2518
|
-
"a",
|
|
2519
|
-
{
|
|
2520
|
-
href: "#",
|
|
2521
|
-
onClick: (e) => {
|
|
2522
|
-
e.preventDefault();
|
|
2523
|
-
scrollToMainContent();
|
|
2524
|
-
},
|
|
2525
|
-
children: "Till huvudinneh\xE5ll"
|
|
2526
|
-
}
|
|
2527
|
-
) });
|
|
2607
|
+
return /* @__PURE__ */ jsx23("div", { className: "pts-skipLink-container", children: /* @__PURE__ */ jsx23("a", { href: "#main-content", children: "Till huvudinneh\xE5ll" }) });
|
|
2528
2608
|
};
|
|
2529
2609
|
var SkipLinkStandard_default = SkipLink;
|
|
2530
2610
|
|
|
2531
2611
|
// src/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.tsx
|
|
2532
|
-
import { jsx as jsx24, jsxs as
|
|
2612
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2533
2613
|
var StepperButtons = ({
|
|
2534
2614
|
languageSupported,
|
|
2535
2615
|
handleActiveStep,
|
|
@@ -2539,7 +2619,7 @@ var StepperButtons = ({
|
|
|
2539
2619
|
activeStep
|
|
2540
2620
|
}) => {
|
|
2541
2621
|
const totalSteps = arraySteps ? arraySteps.length : "";
|
|
2542
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ jsxs21("div", { className: "pts-stepperButtons-container", children: [
|
|
2543
2623
|
activeStep !== 0 && /* @__PURE__ */ jsx24(
|
|
2544
2624
|
"button",
|
|
2545
2625
|
{
|
|
@@ -2549,7 +2629,7 @@ var StepperButtons = ({
|
|
|
2549
2629
|
children: languageSupported ? languageSupported.backButton : "<<"
|
|
2550
2630
|
}
|
|
2551
2631
|
),
|
|
2552
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsxs21(
|
|
2553
2633
|
"button",
|
|
2554
2634
|
{
|
|
2555
2635
|
type: activeStep === totalSteps ? "submit" : "button",
|
|
@@ -2567,14 +2647,14 @@ var StepperButtonsStandard_default = StepperButtons;
|
|
|
2567
2647
|
|
|
2568
2648
|
// src/NewTextComponentStandard/StepperStandard/StepperStandard.tsx
|
|
2569
2649
|
import React10 from "react";
|
|
2570
|
-
import { jsx as jsx25, jsxs as
|
|
2650
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2571
2651
|
var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
2572
2652
|
return /* @__PURE__ */ jsx25("div", { className: "pts-stepper-container", "aria-hidden": "true", children: arraySteps.map((step, index) => {
|
|
2573
2653
|
const isActive = step.step === activeStep;
|
|
2574
2654
|
const lastElement = arraySteps.length;
|
|
2575
2655
|
const isDone = step.step < activeStep;
|
|
2576
|
-
return /* @__PURE__ */
|
|
2577
|
-
/* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ jsxs22(React10.Fragment, { children: [
|
|
2657
|
+
/* @__PURE__ */ jsxs22("div", { className: "pts-stepper-step", children: [
|
|
2578
2658
|
/* @__PURE__ */ jsx25(
|
|
2579
2659
|
"div",
|
|
2580
2660
|
{
|
|
@@ -2609,7 +2689,7 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
|
2609
2689
|
var StepperStandard_default = Stepper;
|
|
2610
2690
|
|
|
2611
2691
|
// src/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
|
|
2612
|
-
import { Fragment as Fragment15, jsx as jsx26, jsxs as
|
|
2692
|
+
import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2613
2693
|
var ValidationErrorSummaryList = ({
|
|
2614
2694
|
validationErrorsList,
|
|
2615
2695
|
formQuestions,
|
|
@@ -2657,14 +2737,14 @@ var ValidationErrorSummaryList = ({
|
|
|
2657
2737
|
const found = formQuestions.find((item) => item.id === id);
|
|
2658
2738
|
return (_a = found == null ? void 0 : found.validationSummaryLabel) != null ? _a : found == null ? void 0 : found.questionLabel;
|
|
2659
2739
|
}
|
|
2660
|
-
return /* @__PURE__ */
|
|
2740
|
+
return /* @__PURE__ */ jsxs23("div", { className: "pts-errorSummary-container pts-root-error", children: [
|
|
2661
2741
|
/* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
2662
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
|
|
2663
2743
|
/* @__PURE__ */ jsx26("h2", { id: "errorSummary-headline", children: title }),
|
|
2664
2744
|
/* @__PURE__ */ jsx26("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
|
|
2665
2745
|
"a",
|
|
2666
2746
|
{
|
|
2667
|
-
href:
|
|
2747
|
+
href: `#question-${questionId}`,
|
|
2668
2748
|
onClick: (e) => {
|
|
2669
2749
|
e.preventDefault();
|
|
2670
2750
|
scrollToQuestion(questionId);
|
|
@@ -2679,7 +2759,7 @@ var ValidationErrorSummaryList = ({
|
|
|
2679
2759
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
2680
2760
|
|
|
2681
2761
|
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
2682
|
-
import { jsx as jsx27, jsxs as
|
|
2762
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2683
2763
|
var CookieBanner = ({
|
|
2684
2764
|
visible = false,
|
|
2685
2765
|
onCookieStateChange,
|
|
@@ -2711,11 +2791,11 @@ var CookieBanner = ({
|
|
|
2711
2791
|
"aria-modal": "true",
|
|
2712
2792
|
id: "cookie-banner",
|
|
2713
2793
|
tabIndex: -1,
|
|
2714
|
-
children: /* @__PURE__ */
|
|
2794
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "content", children: [
|
|
2715
2795
|
/* @__PURE__ */ jsx27("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
|
|
2716
2796
|
/* @__PURE__ */ jsx27("p", { id: "cookie-banner-description", children: "PTS skulle vilja anv\xE4nda en statistikkaka i syfte att l\xF6pande f\xF6rb\xE4ttra webbplatsen. Samtycker du till det? Du kan n\xE4r som helst \xE4ndra ditt val. F\xF6r att \xE5terkalla ditt samtycke klickar du p\xE5 \u201DKakor\u201D i avsnittet l\xE4ngst ned p\xE5 webbplatsen." }),
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Links", children: [
|
|
2798
|
+
/* @__PURE__ */ jsxs24(
|
|
2719
2799
|
"svg",
|
|
2720
2800
|
{
|
|
2721
2801
|
width: "27",
|
|
@@ -2738,7 +2818,7 @@ var CookieBanner = ({
|
|
|
2738
2818
|
),
|
|
2739
2819
|
/* @__PURE__ */ jsx27("a", { href: "www.pts.se", target: "_blank", rel: "noopener noreferrer", children: "Kakor (cookies) p\xE5 pts.se (\xD6ppnas i nytt f\xF6nster)" })
|
|
2740
2820
|
] }),
|
|
2741
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
2742
2822
|
/* @__PURE__ */ jsx27("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
2743
2823
|
/* @__PURE__ */ jsx27("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
2744
2824
|
] })
|