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