optimized-react-component-library-xyz123 0.1.113 → 0.1.114
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 -1
- package/dist/index.d.mts +1 -298
- package/dist/index.d.ts +1 -298
- package/dist/index.js +251 -677
- package/dist/index.mjs +309 -724
- package/package.json +8 -9
- package/src/css/darkMode.css +1 -25
- package/src/css/styles.css +90 -117
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -135,7 +135,7 @@ var PrevieMultipleCheckboxes = ({
|
|
|
135
135
|
const previewId = `preview-${question.id}`;
|
|
136
136
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
137
137
|
/* @__PURE__ */ jsx2("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
138
|
-
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx2("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx2("dd", { children: /* @__PURE__ */ jsx2("ul", { className: "preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
138
|
+
question.answer ? question.options && question.options.length === 1 ? /* @__PURE__ */ jsx2("dd", { children: question.options[0].label }) : /* @__PURE__ */ jsx2("dd", { children: /* @__PURE__ */ jsx2("ul", { className: "pts-preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
139
139
|
var _a2;
|
|
140
140
|
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
141
141
|
}).map((option, index) => /* @__PURE__ */ jsx2("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ jsx2("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
@@ -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,11 +1353,11 @@ var PreviewAddFiles = ({
|
|
|
1264
1353
|
activatedLanguage
|
|
1265
1354
|
}) => {
|
|
1266
1355
|
const previewId = `preview-${questionObject.Id}`;
|
|
1267
|
-
return /* @__PURE__ */
|
|
1268
|
-
/* @__PURE__ */ jsx11("
|
|
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) => {
|
|
1356
|
+
return /* @__PURE__ */ jsxs10("div", { className: "pts-question-preview pts-addFiles-preview", id: `question-${previewId}`, children: [
|
|
1357
|
+
/* @__PURE__ */ jsx11("dd", { id: previewId, children: questionObject.Id ? questionObject.Question : activatedLanguage === "en" ? "Attached files" : "Bifogade filer" }),
|
|
1358
|
+
/* @__PURE__ */ jsx11("div", { className: "pts-root-answer", children: questionObject.Files && questionObject.Files.length > 0 ? /* @__PURE__ */ jsx11("dt", { children: /* @__PURE__ */ jsx11("ul", { "aria-labelledby": previewId, className: "pts-preview-answer-list", children: questionObject.Files.map((file, index) => {
|
|
1270
1359
|
return /* @__PURE__ */ jsx11("li", { children: file.FileName }, `file-${index}-${file.FileName}`);
|
|
1271
|
-
}) }) : /* @__PURE__ */ jsx11("
|
|
1360
|
+
}) }) }) : /* @__PURE__ */ jsx11("dt", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No attached files" : "Inga bifogade filer" }) })
|
|
1272
1361
|
] });
|
|
1273
1362
|
};
|
|
1274
1363
|
|
|
@@ -1489,488 +1578,8 @@ function groupQuestionsByStepCategoryGroup(questions, steps, validationErrorsLis
|
|
|
1489
1578
|
}
|
|
1490
1579
|
var GroupQuestionsByStepCategoryGroup_default = groupQuestionsByStepCategoryGroup;
|
|
1491
1580
|
|
|
1492
|
-
// src/NewHelpMethodsStandard/ApplicationContentSlice/applicationContentSlice.ts
|
|
1493
|
-
import { createSlice, createSelector } from "@reduxjs/toolkit";
|
|
1494
|
-
var pickLang = (cfg, lang) => {
|
|
1495
|
-
var _a;
|
|
1496
|
-
return (_a = cfg.languageSupport.find((l) => l.language === lang)) != null ? _a : cfg.languageSupport[0];
|
|
1497
|
-
};
|
|
1498
|
-
var createLanguageSlice = (initialConfig, options) => {
|
|
1499
|
-
var _a;
|
|
1500
|
-
const name = (_a = options == null ? void 0 : options.name) != null ? _a : "applicationContent";
|
|
1501
|
-
const initialLang = pickLang(initialConfig, initialConfig.activatedLanguage);
|
|
1502
|
-
const initialState = {
|
|
1503
|
-
activatedLanguage: initialConfig.activatedLanguage,
|
|
1504
|
-
languageSupport: initialConfig.languageSupport,
|
|
1505
|
-
languageSupportLoaded: true,
|
|
1506
|
-
backButton: initialLang.backButton,
|
|
1507
|
-
forwardButton: initialLang.forwardButton,
|
|
1508
|
-
sendButton: initialLang.sendButton
|
|
1509
|
-
};
|
|
1510
|
-
const slice = createSlice({
|
|
1511
|
-
name,
|
|
1512
|
-
initialState,
|
|
1513
|
-
reducers: {
|
|
1514
|
-
setActivatedLanguage: (state, action) => {
|
|
1515
|
-
state.activatedLanguage = action.payload;
|
|
1516
|
-
const lang = pickLang(
|
|
1517
|
-
{ activatedLanguage: state.activatedLanguage, languageSupport: state.languageSupport },
|
|
1518
|
-
action.payload
|
|
1519
|
-
);
|
|
1520
|
-
state.backButton = lang.backButton;
|
|
1521
|
-
state.forwardButton = lang.forwardButton;
|
|
1522
|
-
state.sendButton = lang.sendButton;
|
|
1523
|
-
},
|
|
1524
|
-
setLabelsFromLanguageEntry: (state, action) => {
|
|
1525
|
-
state.backButton = action.payload.backButton;
|
|
1526
|
-
state.forwardButton = action.payload.forwardButton;
|
|
1527
|
-
state.sendButton = action.payload.sendButton;
|
|
1528
|
-
},
|
|
1529
|
-
replaceLanguageSupport: (state, action) => {
|
|
1530
|
-
state.languageSupport = action.payload.languageSupport;
|
|
1531
|
-
state.activatedLanguage = action.payload.activatedLanguage;
|
|
1532
|
-
const lang = pickLang(action.payload, action.payload.activatedLanguage);
|
|
1533
|
-
state.backButton = lang.backButton;
|
|
1534
|
-
state.forwardButton = lang.forwardButton;
|
|
1535
|
-
state.sendButton = lang.sendButton;
|
|
1536
|
-
state.languageSupportLoaded = true;
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
});
|
|
1540
|
-
return slice;
|
|
1541
|
-
};
|
|
1542
|
-
var makeLanguageSelectors = (selectSlice) => {
|
|
1543
|
-
const selectState = selectSlice;
|
|
1544
|
-
const selectActivatedLanguage = (state) => selectState(state).activatedLanguage;
|
|
1545
|
-
const selectLanguageSupportLoaded = (state) => selectState(state).languageSupportLoaded;
|
|
1546
|
-
const selectLanguageSupport = (state) => selectState(state).languageSupport;
|
|
1547
|
-
const selectOverallContentState = (state) => selectState(state);
|
|
1548
|
-
const selectOverallContentFromLanguageSupport = createSelector(
|
|
1549
|
-
[selectState, (_, activatedLanguage) => activatedLanguage],
|
|
1550
|
-
(applicationContent, activatedLanguage) => {
|
|
1551
|
-
const match = applicationContent.languageSupport.find(
|
|
1552
|
-
(l) => l.language === activatedLanguage
|
|
1553
|
-
);
|
|
1554
|
-
if (!match) return { ...applicationContent };
|
|
1555
|
-
return {
|
|
1556
|
-
...applicationContent,
|
|
1557
|
-
backButton: match.backButton,
|
|
1558
|
-
forwardButton: match.forwardButton,
|
|
1559
|
-
sendButton: match.sendButton
|
|
1560
|
-
};
|
|
1561
|
-
}
|
|
1562
|
-
);
|
|
1563
|
-
return {
|
|
1564
|
-
selectActivatedLanguage,
|
|
1565
|
-
selectLanguageSupportLoaded,
|
|
1566
|
-
selectLanguageSupport,
|
|
1567
|
-
selectOverallContentState,
|
|
1568
|
-
selectOverallContentFromLanguageSupport
|
|
1569
|
-
};
|
|
1570
|
-
};
|
|
1571
|
-
|
|
1572
|
-
// src/NewHelpMethodsStandard/QuestionSlice/questionSlice.ts
|
|
1573
|
-
import {
|
|
1574
|
-
createSlice as createSlice2,
|
|
1575
|
-
createSelector as createSelector2
|
|
1576
|
-
} from "@reduxjs/toolkit";
|
|
1577
|
-
var createQuestionsSlice = (initialState, options) => {
|
|
1578
|
-
var _a;
|
|
1579
|
-
const slice = createSlice2({
|
|
1580
|
-
name: (_a = options == null ? void 0 : options.name) != null ? _a : "Form",
|
|
1581
|
-
initialState,
|
|
1582
|
-
reducers: {
|
|
1583
|
-
AddApplicationContentFromLanguageSupport: (state, action) => {
|
|
1584
|
-
state.applicationContent = action.payload;
|
|
1585
|
-
state.questionsLoaded = true;
|
|
1586
|
-
},
|
|
1587
|
-
AddStepsFromLanguageSupport: (state, action) => {
|
|
1588
|
-
state.steps = action.payload;
|
|
1589
|
-
},
|
|
1590
|
-
AddQuestionsFromLanguageSupport: (state, action) => {
|
|
1591
|
-
state.questions = action.payload;
|
|
1592
|
-
},
|
|
1593
|
-
AddAnswer: (state, action) => {
|
|
1594
|
-
state.questions = state.questions.map((qObject) => {
|
|
1595
|
-
if (qObject.id === action.payload.id) {
|
|
1596
|
-
return {
|
|
1597
|
-
...qObject,
|
|
1598
|
-
answer: action.payload.answer
|
|
1599
|
-
};
|
|
1600
|
-
}
|
|
1601
|
-
return qObject;
|
|
1602
|
-
});
|
|
1603
|
-
},
|
|
1604
|
-
AddFiles: (state, action) => {
|
|
1605
|
-
state.questions = state.questions.map((qObject) => {
|
|
1606
|
-
if (qObject.id === action.payload.id) {
|
|
1607
|
-
return {
|
|
1608
|
-
...qObject,
|
|
1609
|
-
files: action.payload.files
|
|
1610
|
-
};
|
|
1611
|
-
}
|
|
1612
|
-
return qObject;
|
|
1613
|
-
});
|
|
1614
|
-
},
|
|
1615
|
-
RemoveAllQuestionsDisplayedInStep: (state, action) => {
|
|
1616
|
-
const { activeStep } = action.payload;
|
|
1617
|
-
state.questions = state.questions.map((qObject) => {
|
|
1618
|
-
if (qObject.step >= activeStep) {
|
|
1619
|
-
return {
|
|
1620
|
-
...qObject,
|
|
1621
|
-
isDisplayed: false
|
|
1622
|
-
};
|
|
1623
|
-
}
|
|
1624
|
-
return qObject;
|
|
1625
|
-
});
|
|
1626
|
-
},
|
|
1627
|
-
AddQuestionDisplayed: (state, action) => {
|
|
1628
|
-
state.questions = state.questions.map((qObject) => {
|
|
1629
|
-
if (qObject.id === action.payload.id) {
|
|
1630
|
-
return {
|
|
1631
|
-
...qObject,
|
|
1632
|
-
isDisplayed: action.payload.isDisplayed
|
|
1633
|
-
};
|
|
1634
|
-
}
|
|
1635
|
-
return qObject;
|
|
1636
|
-
});
|
|
1637
|
-
},
|
|
1638
|
-
RemoveAllAnswersForward: (state, action) => {
|
|
1639
|
-
state.questions = state.questions.map((qObject) => {
|
|
1640
|
-
let questionExistInLinkedToQuestion = false;
|
|
1641
|
-
if (qObject.dependsOnOtherQuestion !== void 0) {
|
|
1642
|
-
questionExistInLinkedToQuestion = qObject.dependsOnOtherQuestion.some(
|
|
1643
|
-
(innerArray) => innerArray.some((item) => item.LinkedToQuestionId === action.payload.id)
|
|
1644
|
-
);
|
|
1645
|
-
}
|
|
1646
|
-
const shouldClear = qObject.id > action.payload.id && !qObject.isDisplayed && qObject.dependsOnOtherQuestion !== void 0 && questionExistInLinkedToQuestion;
|
|
1647
|
-
if (shouldClear) {
|
|
1648
|
-
return {
|
|
1649
|
-
...qObject,
|
|
1650
|
-
answer: ""
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
return qObject;
|
|
1654
|
-
});
|
|
1655
|
-
}
|
|
1656
|
-
},
|
|
1657
|
-
extraReducers: (builder) => {
|
|
1658
|
-
if (options == null ? void 0 : options.extraReducers) {
|
|
1659
|
-
options.extraReducers(builder);
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1662
|
-
});
|
|
1663
|
-
return slice;
|
|
1664
|
-
};
|
|
1665
|
-
var makeQuestionsSelectors = (selectSlice) => {
|
|
1666
|
-
const selectStateQuestion = (state) => selectSlice(state);
|
|
1667
|
-
const selectIsQuestionLoaded = (state) => selectSlice(state).questionsLoaded;
|
|
1668
|
-
const selectApplicationContentFromLanguageSupport = createSelector2(
|
|
1669
|
-
[
|
|
1670
|
-
(state) => selectSlice(state).applicationContent,
|
|
1671
|
-
(_, activatedLanguage) => activatedLanguage
|
|
1672
|
-
],
|
|
1673
|
-
(applicationContent, activatedLanguage) => {
|
|
1674
|
-
var _a;
|
|
1675
|
-
const languageSupport = (_a = applicationContent == null ? void 0 : applicationContent.languageSupport) == null ? void 0 : _a.find(
|
|
1676
|
-
(lang) => lang.language === activatedLanguage
|
|
1677
|
-
);
|
|
1678
|
-
if (!languageSupport) {
|
|
1679
|
-
return {
|
|
1680
|
-
mainHeadline: "",
|
|
1681
|
-
ingressBody: "",
|
|
1682
|
-
linksForMoreInfo: [],
|
|
1683
|
-
pageTitle: "",
|
|
1684
|
-
textblocks: []
|
|
1685
|
-
};
|
|
1686
|
-
}
|
|
1687
|
-
return {
|
|
1688
|
-
mainHeadline: languageSupport.mainHeadline,
|
|
1689
|
-
ingressBody: languageSupport.ingressBody,
|
|
1690
|
-
linksForMoreInfo: languageSupport.linksForMoreInfo,
|
|
1691
|
-
pageTitle: languageSupport.pageTitle,
|
|
1692
|
-
textblocks: languageSupport.textblocks,
|
|
1693
|
-
languageSupport: applicationContent == null ? void 0 : applicationContent.languageSupport
|
|
1694
|
-
};
|
|
1695
|
-
}
|
|
1696
|
-
);
|
|
1697
|
-
const selectStepFromLanguageSupport = createSelector2(
|
|
1698
|
-
[
|
|
1699
|
-
(state) => selectSlice(state).steps,
|
|
1700
|
-
(_, activatedLanguage) => activatedLanguage
|
|
1701
|
-
],
|
|
1702
|
-
(steps, activatedLanguage) => {
|
|
1703
|
-
return steps.map((stepperObject) => {
|
|
1704
|
-
let languageSupport = stepperObject.languageSupport.find(
|
|
1705
|
-
(lang) => lang.language === activatedLanguage
|
|
1706
|
-
);
|
|
1707
|
-
if (!languageSupport) {
|
|
1708
|
-
languageSupport = {};
|
|
1709
|
-
}
|
|
1710
|
-
return {
|
|
1711
|
-
...stepperObject,
|
|
1712
|
-
stepHeadline: languageSupport.stepHeadline,
|
|
1713
|
-
stepDescription: languageSupport.stepDescription,
|
|
1714
|
-
shortNameInStepper: languageSupport.shortNameInStepper,
|
|
1715
|
-
shortNameInPreview: languageSupport.shortNameInPreview,
|
|
1716
|
-
pageTitle: languageSupport.pageTitle
|
|
1717
|
-
};
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
);
|
|
1721
|
-
const selectQuestionFromLanguageSupport = createSelector2(
|
|
1722
|
-
[
|
|
1723
|
-
(state) => selectSlice(state).questions,
|
|
1724
|
-
(_, activatedLanguage) => activatedLanguage
|
|
1725
|
-
],
|
|
1726
|
-
(questions, activatedLanguage) => {
|
|
1727
|
-
return questions.map((qObject) => {
|
|
1728
|
-
let languageSupport = qObject.languageSupport.find(
|
|
1729
|
-
(lang) => lang.language === activatedLanguage
|
|
1730
|
-
);
|
|
1731
|
-
if (!languageSupport) {
|
|
1732
|
-
languageSupport = {};
|
|
1733
|
-
}
|
|
1734
|
-
return {
|
|
1735
|
-
...qObject,
|
|
1736
|
-
categoryLabel: languageSupport.categoryLabel,
|
|
1737
|
-
categoryDescription: languageSupport.categoryDescription,
|
|
1738
|
-
questionLabel: languageSupport.questionLabel,
|
|
1739
|
-
previewLabel: languageSupport.previewLabel,
|
|
1740
|
-
aboutText: languageSupport.aboutText,
|
|
1741
|
-
options: languageSupport.options,
|
|
1742
|
-
validationDefaultMessesege: languageSupport.validationDefaultMessesege,
|
|
1743
|
-
validationSummaryLabel: languageSupport.validationSummaryLabel
|
|
1744
|
-
};
|
|
1745
|
-
});
|
|
1746
|
-
}
|
|
1747
|
-
);
|
|
1748
|
-
return {
|
|
1749
|
-
selectStateQuestion,
|
|
1750
|
-
selectIsQuestionLoaded,
|
|
1751
|
-
selectApplicationContentFromLanguageSupport,
|
|
1752
|
-
selectStepFromLanguageSupport,
|
|
1753
|
-
selectQuestionFromLanguageSupport
|
|
1754
|
-
};
|
|
1755
|
-
};
|
|
1756
|
-
|
|
1757
|
-
// src/NewHelpMethodsStandard/CookieHandler/cookieHandler.ts
|
|
1758
|
-
var getCookie = (name) => {
|
|
1759
|
-
const match = document.cookie.match(new RegExp("(^| )" + name + "=([^;]+)"));
|
|
1760
|
-
return match ? match[2] : null;
|
|
1761
|
-
};
|
|
1762
|
-
var setCookie = (name, value, expirationDate) => {
|
|
1763
|
-
let cookieString = `${name}=${value}; path=/; SameSite=Strict`;
|
|
1764
|
-
if (expirationDate) {
|
|
1765
|
-
cookieString += `; expires=${expirationDate.toUTCString()}`;
|
|
1766
|
-
}
|
|
1767
|
-
if (window.location.protocol === "https:") {
|
|
1768
|
-
cookieString += "; Secure";
|
|
1769
|
-
}
|
|
1770
|
-
document.cookie = cookieString;
|
|
1771
|
-
};
|
|
1772
|
-
var removeCookie = (name) => {
|
|
1773
|
-
const pastDate = /* @__PURE__ */ new Date(0);
|
|
1774
|
-
setCookie(name, "", pastDate);
|
|
1775
|
-
};
|
|
1776
|
-
var createCookieConsent = (config) => {
|
|
1777
|
-
const { cookieName, choiceKey, expiryYears = 1 } = config;
|
|
1778
|
-
const acceptCookies = () => {
|
|
1779
|
-
const expires = /* @__PURE__ */ new Date();
|
|
1780
|
-
expires.setFullYear(expires.getFullYear() + expiryYears);
|
|
1781
|
-
setCookie(cookieName, "true", expires);
|
|
1782
|
-
localStorage.setItem(cookieName, "true");
|
|
1783
|
-
};
|
|
1784
|
-
const rejectCookies = () => {
|
|
1785
|
-
removeCookie(cookieName);
|
|
1786
|
-
localStorage.removeItem(cookieName);
|
|
1787
|
-
sessionStorage.setItem(choiceKey, "true");
|
|
1788
|
-
};
|
|
1789
|
-
const areCookiesAccepted = () => getCookie(cookieName) === "true";
|
|
1790
|
-
const hasChoiceBeenMade = () => sessionStorage.getItem(choiceKey) === "true";
|
|
1791
|
-
const clearChoiceFromSession = () => sessionStorage.removeItem(choiceKey);
|
|
1792
|
-
return {
|
|
1793
|
-
acceptCookies,
|
|
1794
|
-
rejectCookies,
|
|
1795
|
-
areCookiesAccepted,
|
|
1796
|
-
hasChoiceBeenMade,
|
|
1797
|
-
clearChoiceFromSession
|
|
1798
|
-
};
|
|
1799
|
-
};
|
|
1800
|
-
|
|
1801
|
-
// src/NewHelpMethodsStandard/ScriptHandler/scriptHandler.ts
|
|
1802
|
-
var toggleScriptByConsent = (consent, options) => {
|
|
1803
|
-
if (typeof document === "undefined") return;
|
|
1804
|
-
const existingScript = document.getElementById(options.id);
|
|
1805
|
-
if (consent) {
|
|
1806
|
-
if (!existingScript) {
|
|
1807
|
-
const script = document.createElement("script");
|
|
1808
|
-
script.id = options.id;
|
|
1809
|
-
script.async = true;
|
|
1810
|
-
script.src = options.src;
|
|
1811
|
-
if (options.attributes) {
|
|
1812
|
-
Object.entries(options.attributes).forEach(
|
|
1813
|
-
([key, value]) => script.setAttribute(key, value)
|
|
1814
|
-
);
|
|
1815
|
-
}
|
|
1816
|
-
document.body.appendChild(script);
|
|
1817
|
-
}
|
|
1818
|
-
} else {
|
|
1819
|
-
if (existingScript) {
|
|
1820
|
-
existingScript.remove();
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
};
|
|
1824
|
-
var isScriptLoaded = (id) => {
|
|
1825
|
-
if (typeof document === "undefined") return false;
|
|
1826
|
-
return !!document.getElementById(id);
|
|
1827
|
-
};
|
|
1828
|
-
var removeScriptById = (id) => {
|
|
1829
|
-
if (typeof document === "undefined") return;
|
|
1830
|
-
const el = document.getElementById(id);
|
|
1831
|
-
if (el) el.remove();
|
|
1832
|
-
};
|
|
1833
|
-
|
|
1834
|
-
// src/NewHelpMethodsStandard/FocusElement/focusElement.ts
|
|
1835
|
-
var focusElement = (target) => {
|
|
1836
|
-
const element = typeof target === "string" ? document.getElementById(target) : target;
|
|
1837
|
-
if (!element) return;
|
|
1838
|
-
if (!element.hasAttribute("tabindex")) {
|
|
1839
|
-
element.setAttribute("tabindex", "-1");
|
|
1840
|
-
}
|
|
1841
|
-
element.focus();
|
|
1842
|
-
element.scrollIntoView({ behavior: "smooth" });
|
|
1843
|
-
};
|
|
1844
|
-
|
|
1845
|
-
// src/NewHelpMethodsStandard/GetIdsGroupCheckValidationTypes/getIdsGroupCheckValidationTypes.ts
|
|
1846
|
-
var getIdsGroupCheckValidationTypes = (validationType) => {
|
|
1847
|
-
if (!(validationType == null ? void 0 : validationType.length)) return [];
|
|
1848
|
-
const ids = validationType.filter((t) => t.startsWith("groupCheck-")).flatMap((t) => t.split("-").slice(1)).map((s) => Number(s)).filter((n) => Number.isFinite(n));
|
|
1849
|
-
return Array.from(new Set(ids));
|
|
1850
|
-
};
|
|
1851
|
-
|
|
1852
|
-
// src/NewHelpMethodsStandard/useFormStatusModal/useFormStatusModal.ts
|
|
1853
|
-
import * as React7 from "react";
|
|
1854
|
-
var useFormStatusModal = (formStatus, handleModalOpen, handleModalClose, mainSelector = "#main-content") => {
|
|
1855
|
-
React7.useEffect(() => {
|
|
1856
|
-
if (formStatus === "loading") {
|
|
1857
|
-
handleModalOpen();
|
|
1858
|
-
}
|
|
1859
|
-
if (formStatus === "success" || formStatus === "failed") {
|
|
1860
|
-
setTimeout(() => {
|
|
1861
|
-
handleModalClose();
|
|
1862
|
-
}, 1050);
|
|
1863
|
-
const main = document.querySelector(mainSelector);
|
|
1864
|
-
if (main) main.focus();
|
|
1865
|
-
}
|
|
1866
|
-
}, [formStatus, handleModalOpen, handleModalClose, mainSelector]);
|
|
1867
|
-
};
|
|
1868
|
-
|
|
1869
|
-
// src/NewHelpMethodsStandard/usePTSPageTitle/usePTSPageTitle.ts
|
|
1870
|
-
import { useMemo, useEffect as useEffect7 } from "react";
|
|
1871
|
-
var usePTSPageTitle = ({
|
|
1872
|
-
formStatus,
|
|
1873
|
-
activeStep,
|
|
1874
|
-
applicationContent,
|
|
1875
|
-
thankYouBlock,
|
|
1876
|
-
steps,
|
|
1877
|
-
fallbackTitle = "PTS e-tj\xE4nst"
|
|
1878
|
-
}) => {
|
|
1879
|
-
const computedTitle = useMemo(() => {
|
|
1880
|
-
var _a, _b, _c, _d;
|
|
1881
|
-
const baseTitle = (_a = applicationContent == null ? void 0 : applicationContent.pageTitle) != null ? _a : "";
|
|
1882
|
-
const thankYouPageTitle = (_b = thankYouBlock == null ? void 0 : thankYouBlock.pageTitle) != null ? _b : "";
|
|
1883
|
-
const stepTitle = (_d = (_c = steps == null ? void 0 : steps[Math.max(0, activeStep - 1)]) == null ? void 0 : _c.pageTitle) != null ? _d : "";
|
|
1884
|
-
if (formStatus === "success" && thankYouPageTitle) return thankYouPageTitle;
|
|
1885
|
-
if (activeStep === 0 && baseTitle) return baseTitle;
|
|
1886
|
-
return stepTitle || baseTitle || fallbackTitle;
|
|
1887
|
-
}, [formStatus, activeStep, applicationContent, thankYouBlock, steps, fallbackTitle]);
|
|
1888
|
-
useEffect7(() => {
|
|
1889
|
-
document.title = computedTitle;
|
|
1890
|
-
}, [computedTitle]);
|
|
1891
|
-
return computedTitle;
|
|
1892
|
-
};
|
|
1893
|
-
|
|
1894
|
-
// src/NewHelpMethodsStandard/useInputMethodDetection/useInputMethodDetection.ts
|
|
1895
|
-
import { useEffect as useEffect8 } from "react";
|
|
1896
|
-
var useInputMethodDetection = ({
|
|
1897
|
-
mouseClassName = "using-mouse",
|
|
1898
|
-
keyboardToggleKey = "Tab"
|
|
1899
|
-
} = {}) => {
|
|
1900
|
-
useEffect8(() => {
|
|
1901
|
-
const handleMouseDown = () => {
|
|
1902
|
-
document.body.classList.add(mouseClassName);
|
|
1903
|
-
};
|
|
1904
|
-
const handleKeyDown = (event) => {
|
|
1905
|
-
if (event.key === keyboardToggleKey) {
|
|
1906
|
-
document.body.classList.remove(mouseClassName);
|
|
1907
|
-
}
|
|
1908
|
-
};
|
|
1909
|
-
document.addEventListener("mousedown", handleMouseDown);
|
|
1910
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
1911
|
-
return () => {
|
|
1912
|
-
document.removeEventListener("mousedown", handleMouseDown);
|
|
1913
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
1914
|
-
};
|
|
1915
|
-
}, [mouseClassName, keyboardToggleKey]);
|
|
1916
|
-
};
|
|
1917
|
-
|
|
1918
|
-
// src/NewHelpMethodsStandard/useCookieConsent/useCookieConsent.ts
|
|
1919
|
-
import { useCallback as useCallback2, useEffect as useEffect9, useMemo as useMemo2, useState as useState6 } from "react";
|
|
1920
|
-
var useCookieConsent = ({
|
|
1921
|
-
cookieName,
|
|
1922
|
-
choiceKey,
|
|
1923
|
-
expiryYears = 1,
|
|
1924
|
-
onConsentChange
|
|
1925
|
-
}) => {
|
|
1926
|
-
const {
|
|
1927
|
-
acceptCookies,
|
|
1928
|
-
rejectCookies,
|
|
1929
|
-
areCookiesAccepted,
|
|
1930
|
-
hasChoiceBeenMade,
|
|
1931
|
-
clearChoiceFromSession
|
|
1932
|
-
} = useMemo2(
|
|
1933
|
-
() => createCookieConsent({
|
|
1934
|
-
cookieName,
|
|
1935
|
-
choiceKey,
|
|
1936
|
-
expiryYears
|
|
1937
|
-
}),
|
|
1938
|
-
[cookieName, choiceKey, expiryYears]
|
|
1939
|
-
);
|
|
1940
|
-
const [showBanner, setShowBanner] = useState6(false);
|
|
1941
|
-
const handleCookieStateChange = useCallback2(() => {
|
|
1942
|
-
const cookiesNowAccepted = areCookiesAccepted();
|
|
1943
|
-
if (onConsentChange) {
|
|
1944
|
-
onConsentChange(cookiesNowAccepted);
|
|
1945
|
-
}
|
|
1946
|
-
setShowBanner(false);
|
|
1947
|
-
}, [areCookiesAccepted, onConsentChange]);
|
|
1948
|
-
useEffect9(() => {
|
|
1949
|
-
const cookiesAccepted = areCookiesAccepted();
|
|
1950
|
-
const choiceMade = hasChoiceBeenMade();
|
|
1951
|
-
setShowBanner(!cookiesAccepted && !choiceMade);
|
|
1952
|
-
if (cookiesAccepted && onConsentChange) {
|
|
1953
|
-
onConsentChange(true);
|
|
1954
|
-
}
|
|
1955
|
-
const handleShowBannerEvent = () => {
|
|
1956
|
-
clearChoiceFromSession();
|
|
1957
|
-
setShowBanner(true);
|
|
1958
|
-
};
|
|
1959
|
-
window.addEventListener("showCookieBanner", handleShowBannerEvent);
|
|
1960
|
-
return () => {
|
|
1961
|
-
window.removeEventListener("showCookieBanner", handleShowBannerEvent);
|
|
1962
|
-
};
|
|
1963
|
-
}, [areCookiesAccepted, hasChoiceBeenMade, clearChoiceFromSession, onConsentChange]);
|
|
1964
|
-
return {
|
|
1965
|
-
showBanner,
|
|
1966
|
-
handleCookieStateChange,
|
|
1967
|
-
acceptCookies,
|
|
1968
|
-
rejectCookies
|
|
1969
|
-
};
|
|
1970
|
-
};
|
|
1971
|
-
|
|
1972
1581
|
// src/NewRenderFormComponentStandard/RenderQuestion/RenderQuestion.tsx
|
|
1973
|
-
import { Fragment as Fragment12, jsx as jsx12, jsxs as
|
|
1582
|
+
import { Fragment as Fragment12, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1974
1583
|
var RenderQuestion = ({
|
|
1975
1584
|
question,
|
|
1976
1585
|
isTouched,
|
|
@@ -1978,7 +1587,7 @@ var RenderQuestion = ({
|
|
|
1978
1587
|
showPreview = false,
|
|
1979
1588
|
hideValidationMessage
|
|
1980
1589
|
}) => {
|
|
1981
|
-
return /* @__PURE__ */
|
|
1590
|
+
return /* @__PURE__ */ jsxs11(Fragment12, { children: [
|
|
1982
1591
|
question.questionType === "Radio" && /* @__PURE__ */ jsx12(
|
|
1983
1592
|
RadioMultipleStandard_default,
|
|
1984
1593
|
{
|
|
@@ -2021,8 +1630,8 @@ var RenderQuestion = ({
|
|
|
2021
1630
|
var RenderQuestion_default = RenderQuestion;
|
|
2022
1631
|
|
|
2023
1632
|
// src/NewRenderFormComponentStandard/RenderQuestionGroup/RenderQuestionGroup.tsx
|
|
2024
|
-
import
|
|
2025
|
-
import { Fragment as Fragment13, jsx as jsx13, jsxs as
|
|
1633
|
+
import React7 from "react";
|
|
1634
|
+
import { Fragment as Fragment13, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2026
1635
|
var RenderQuestionGroup = ({
|
|
2027
1636
|
questionArray,
|
|
2028
1637
|
wrapper,
|
|
@@ -2033,7 +1642,7 @@ var RenderQuestionGroup = ({
|
|
|
2033
1642
|
AddQuestionDisplayed,
|
|
2034
1643
|
hideValidationMessage
|
|
2035
1644
|
}) => {
|
|
2036
|
-
|
|
1645
|
+
React7.useEffect(() => {
|
|
2037
1646
|
questionArray.forEach((question) => {
|
|
2038
1647
|
if (question.visible && !question.isDisplayed) {
|
|
2039
1648
|
AddQuestionDisplayed(question);
|
|
@@ -2041,7 +1650,7 @@ var RenderQuestionGroup = ({
|
|
|
2041
1650
|
});
|
|
2042
1651
|
}, [questionArray]);
|
|
2043
1652
|
const questions = /* @__PURE__ */ jsx13(Fragment13, { children: questionArray.map((question, index) => {
|
|
2044
|
-
return /* @__PURE__ */ jsx13(
|
|
1653
|
+
return /* @__PURE__ */ jsx13(React7.Fragment, { children: /* @__PURE__ */ jsx13(
|
|
2045
1654
|
RenderQuestion_default,
|
|
2046
1655
|
{
|
|
2047
1656
|
question,
|
|
@@ -2054,7 +1663,7 @@ var RenderQuestionGroup = ({
|
|
|
2054
1663
|
}) });
|
|
2055
1664
|
switch (wrapper) {
|
|
2056
1665
|
case "fieldset":
|
|
2057
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ jsxs12(
|
|
2058
1667
|
"fieldset",
|
|
2059
1668
|
{
|
|
2060
1669
|
className: "pts-root-question-group-fieldset",
|
|
@@ -2063,14 +1672,14 @@ var RenderQuestionGroup = ({
|
|
|
2063
1672
|
"aria-errormessage": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
|
|
2064
1673
|
"aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
|
|
2065
1674
|
children: [
|
|
2066
|
-
legend && /* @__PURE__ */
|
|
1675
|
+
legend && /* @__PURE__ */ jsxs12("legend", { children: [
|
|
2067
1676
|
/* @__PURE__ */ jsx13("span", { children: legend }),
|
|
2068
|
-
questionArray[0].hasValidationError && /* @__PURE__ */
|
|
1677
|
+
questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("span", { className: "sr-only", children: [
|
|
2069
1678
|
"Valideringsfel. ",
|
|
2070
1679
|
questionArray[0].validationDefaultMessesege
|
|
2071
1680
|
] })
|
|
2072
1681
|
] }),
|
|
2073
|
-
questionArray[0].hasValidationError && /* @__PURE__ */
|
|
1682
|
+
questionArray[0].hasValidationError && /* @__PURE__ */ jsxs12("div", { className: "pts-root-error", id: questionArray[0].id + "-error", children: [
|
|
2074
1683
|
/* @__PURE__ */ jsx13("span", { "aria-label": "Valideringsfel", className: "errorDot", children: "!" }),
|
|
2075
1684
|
/* @__PURE__ */ jsx13("span", { className: "errorText", children: questionArray[0].validationDefaultMessesege })
|
|
2076
1685
|
] }),
|
|
@@ -2084,7 +1693,7 @@ var RenderQuestionGroup = ({
|
|
|
2084
1693
|
return /* @__PURE__ */ jsx13("div", { className: "pts-root-question-group-div", children: questions });
|
|
2085
1694
|
case "none":
|
|
2086
1695
|
default:
|
|
2087
|
-
return /* @__PURE__ */ jsx13(
|
|
1696
|
+
return /* @__PURE__ */ jsx13(React7.Fragment, { children: questions });
|
|
2088
1697
|
}
|
|
2089
1698
|
};
|
|
2090
1699
|
var RenderQuestionGroup_default = RenderQuestionGroup;
|
|
@@ -2172,19 +1781,19 @@ var ILanguageSupportinitialState = {
|
|
|
2172
1781
|
};
|
|
2173
1782
|
|
|
2174
1783
|
// src/NewTextComponentStandard/EditPreviewLinkStandard/EditPreviewLinkStandard.tsx
|
|
2175
|
-
import { jsx as jsx14, jsxs as
|
|
1784
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2176
1785
|
var EditPreviewLink = ({
|
|
2177
1786
|
step,
|
|
2178
1787
|
changeStepHandler,
|
|
2179
1788
|
activatedLanguage = "sv"
|
|
2180
1789
|
}) => {
|
|
2181
|
-
return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ jsx14("div", { className: "pts-editPreviewLink-container", children: /* @__PURE__ */ jsxs13(
|
|
2182
1791
|
"a",
|
|
2183
1792
|
{
|
|
2184
1793
|
href: "#",
|
|
2185
1794
|
onClick: (e) => {
|
|
2186
1795
|
e.preventDefault();
|
|
2187
|
-
changeStepHandler(step
|
|
1796
|
+
changeStepHandler(step);
|
|
2188
1797
|
},
|
|
2189
1798
|
children: [
|
|
2190
1799
|
/* @__PURE__ */ jsx14(
|
|
@@ -2216,12 +1825,13 @@ var EditPreviewLink = ({
|
|
|
2216
1825
|
var EditPreviewLinkStandard_default = EditPreviewLink;
|
|
2217
1826
|
|
|
2218
1827
|
// src/NewTextComponentStandard/FooterStandard/FooterStandard.tsx
|
|
2219
|
-
import { jsx as jsx15, jsxs as
|
|
1828
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2220
1829
|
var Footer = ({ activatedLanguage = "sv" }) => {
|
|
2221
|
-
return /* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
1830
|
+
return /* @__PURE__ */ jsxs14("footer", { className: "pts-footer-container", children: [
|
|
1831
|
+
/* @__PURE__ */ jsxs14(
|
|
2223
1832
|
"svg",
|
|
2224
1833
|
{
|
|
1834
|
+
role: "img",
|
|
2225
1835
|
"aria-label": activatedLanguage === "en" ? "PTS logotype" : "PTS logotyp",
|
|
2226
1836
|
className: "pts-footer-logo",
|
|
2227
1837
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2247,62 +1857,69 @@ var Footer = ({ activatedLanguage = "sv" }) => {
|
|
|
2247
1857
|
]
|
|
2248
1858
|
}
|
|
2249
1859
|
),
|
|
2250
|
-
/* @__PURE__ */ jsx15(
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
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
|
+
)
|
|
2300
1917
|
] });
|
|
2301
1918
|
};
|
|
2302
1919
|
var FooterStandard_default = Footer;
|
|
2303
1920
|
|
|
2304
1921
|
// src/NewTextComponentStandard/HeaderStandard/Icons.tsx
|
|
2305
|
-
import { jsx as jsx16, jsxs as
|
|
1922
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2306
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(
|
|
2307
1924
|
"path",
|
|
2308
1925
|
{
|
|
@@ -2310,7 +1927,7 @@ var LanguageIcon = () => /* @__PURE__ */ jsx16("svg", { width: "15", height: "15
|
|
|
2310
1927
|
fill: "#6E3282"
|
|
2311
1928
|
}
|
|
2312
1929
|
) });
|
|
2313
|
-
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: [
|
|
2314
1931
|
/* @__PURE__ */ jsx16(
|
|
2315
1932
|
"path",
|
|
2316
1933
|
{
|
|
@@ -2456,7 +2073,7 @@ var Logo_sv = () => /* @__PURE__ */ jsxs14("svg", { width: "168.8", height: "46.
|
|
|
2456
2073
|
),
|
|
2457
2074
|
/* @__PURE__ */ jsx16("path", { d: "M82.2223 18.3335V37.2224", stroke: "black", strokeWidth: "0.8", strokeMiterlimit: "10" })
|
|
2458
2075
|
] });
|
|
2459
|
-
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: [
|
|
2460
2077
|
/* @__PURE__ */ jsx16(
|
|
2461
2078
|
"path",
|
|
2462
2079
|
{
|
|
@@ -2679,7 +2296,7 @@ var Logo_en = () => /* @__PURE__ */ jsxs14("svg", { width: "189.0", height: "46.
|
|
|
2679
2296
|
] });
|
|
2680
2297
|
|
|
2681
2298
|
// src/NewTextComponentStandard/HeaderStandard/HeaderStandard.tsx
|
|
2682
|
-
import { jsx as jsx17, jsxs as
|
|
2299
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2683
2300
|
var Header = ({
|
|
2684
2301
|
activatedLanguage = "sv",
|
|
2685
2302
|
useLanguage = true,
|
|
@@ -2698,7 +2315,7 @@ var Header = ({
|
|
|
2698
2315
|
if (activatedLanguage === "sv") return "English";
|
|
2699
2316
|
else return "Svenska";
|
|
2700
2317
|
};
|
|
2701
|
-
return /* @__PURE__ */
|
|
2318
|
+
return /* @__PURE__ */ jsxs16("header", { className: "pts-header-container", children: [
|
|
2702
2319
|
/* @__PURE__ */ jsx17(
|
|
2703
2320
|
"a",
|
|
2704
2321
|
{
|
|
@@ -2709,17 +2326,15 @@ var Header = ({
|
|
|
2709
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, {}) })
|
|
2710
2327
|
}
|
|
2711
2328
|
),
|
|
2712
|
-
useLanguage && /* @__PURE__ */
|
|
2329
|
+
useLanguage && /* @__PURE__ */ jsxs16(
|
|
2713
2330
|
"button",
|
|
2714
2331
|
{
|
|
2715
|
-
|
|
2332
|
+
"aria-label": activatedLanguage === "en" ? "Change language to Svenska" : "\xC4ndra spr\xE5k till English",
|
|
2716
2333
|
className: "pts-languageButton",
|
|
2717
2334
|
onClick: handleLanguageClick,
|
|
2718
2335
|
children: [
|
|
2719
2336
|
/* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsx17(LanguageIcon, {}) }),
|
|
2720
|
-
/* @__PURE__ */ jsx17("span", {
|
|
2721
|
-
activatedLanguage === "en" && /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "\xC4ndra spr\xE5k till svenska" }),
|
|
2722
|
-
activatedLanguage === "sv" && /* @__PURE__ */ jsx17("span", { className: "sr-only", children: "Change language to English" })
|
|
2337
|
+
/* @__PURE__ */ jsx17("span", { className: "pts-languageButton", children: getLanguageLabel() })
|
|
2723
2338
|
]
|
|
2724
2339
|
}
|
|
2725
2340
|
)
|
|
@@ -2728,9 +2343,9 @@ var Header = ({
|
|
|
2728
2343
|
var HeaderStandard_default = Header;
|
|
2729
2344
|
|
|
2730
2345
|
// src/NewTextComponentStandard/InfoOnlyStandard/InfoOnlyStandard.tsx
|
|
2731
|
-
import { useEffect as
|
|
2346
|
+
import { useEffect as useEffect6 } from "react";
|
|
2732
2347
|
import DOMPurify4 from "dompurify";
|
|
2733
|
-
import { Fragment as Fragment14, jsx as jsx18, jsxs as
|
|
2348
|
+
import { Fragment as Fragment14, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2734
2349
|
var cleanText = (text) => DOMPurify4.sanitize(text, { ADD_ATTR: ["target", "class"] });
|
|
2735
2350
|
var InfoOnly = ({
|
|
2736
2351
|
questionObject,
|
|
@@ -2742,7 +2357,7 @@ var InfoOnly = ({
|
|
|
2742
2357
|
tabIndex = -1,
|
|
2743
2358
|
activatedLanguage = "sv"
|
|
2744
2359
|
}) => {
|
|
2745
|
-
|
|
2360
|
+
useEffect6(() => {
|
|
2746
2361
|
handleSeenText(questionObject);
|
|
2747
2362
|
}, []);
|
|
2748
2363
|
const handleSeenText = (questionObject2) => {
|
|
@@ -2750,7 +2365,7 @@ var InfoOnly = ({
|
|
|
2750
2365
|
const e = { target: { value: questionObject2.questionLabel + avoidBugInRedux } };
|
|
2751
2366
|
isTouched(e, questionObject2);
|
|
2752
2367
|
};
|
|
2753
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsxs17(Fragment14, { children: [
|
|
2754
2369
|
showConfigure && visible && /* @__PURE__ */ jsx18("div", { className: "pts-infoOnly-container", children: /* @__PURE__ */ jsx18("div", { className: "InfoOnlyText", tabIndex, children: questionObject.questionLabel && /* @__PURE__ */ jsx18(
|
|
2755
2370
|
"p",
|
|
2756
2371
|
{
|
|
@@ -2775,7 +2390,7 @@ var PreviewInfoOnly = ({ questionObject }) => {
|
|
|
2775
2390
|
};
|
|
2776
2391
|
|
|
2777
2392
|
// src/NewTextComponentStandard/ModalStandard/ModalStandard.tsx
|
|
2778
|
-
import { jsx as jsx19, jsxs as
|
|
2393
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2779
2394
|
var CONTENT = {
|
|
2780
2395
|
en: {
|
|
2781
2396
|
heading: "Please wait",
|
|
@@ -2789,8 +2404,8 @@ var CONTENT = {
|
|
|
2789
2404
|
var Modal = ({ showModal: isOpen, activatedLanguage = "" }) => {
|
|
2790
2405
|
const currentContent = activatedLanguage === "en" ? CONTENT.en : CONTENT.sv;
|
|
2791
2406
|
if (!isOpen) return null;
|
|
2792
|
-
return /* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsxs18("div", { className: "pts-modal-overlay", children: [
|
|
2408
|
+
/* @__PURE__ */ jsxs18("div", { "aria-hidden": true, className: "pts-modal-content", children: [
|
|
2794
2409
|
/* @__PURE__ */ jsx19("h1", { children: currentContent.heading }),
|
|
2795
2410
|
/* @__PURE__ */ jsx19("p", { children: currentContent.message }),
|
|
2796
2411
|
/* @__PURE__ */ jsx19("div", { className: "pts-spinner-border" })
|
|
@@ -2803,21 +2418,23 @@ var ModalStandard_default = Modal;
|
|
|
2803
2418
|
// src/NewTextComponentStandard/TextHeadlineAndBodyStandard/TextHeadlineAndBodyStandard.tsx
|
|
2804
2419
|
import { createElement } from "react";
|
|
2805
2420
|
import DOMPurify5 from "dompurify";
|
|
2806
|
-
import { jsx as jsx20, jsxs as
|
|
2421
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2807
2422
|
var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
2808
|
-
return /* @__PURE__ */
|
|
2423
|
+
return /* @__PURE__ */ jsxs19(
|
|
2809
2424
|
"section",
|
|
2810
2425
|
{
|
|
2811
2426
|
className: "pts-textHeadlineAndBody-container",
|
|
2427
|
+
"aria-labelledby": "textHeadlineAndBody-headline",
|
|
2812
2428
|
children: [
|
|
2813
2429
|
data.headline && createElement(headlineType, { id: "textHeadlineAndBody-headline" }, data.headline),
|
|
2814
2430
|
data.body && /* @__PURE__ */ jsx20("div", { dangerouslySetInnerHTML: { __html: DOMPurify5.sanitize(data.body) } }),
|
|
2815
|
-
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(
|
|
2816
2432
|
"a",
|
|
2817
2433
|
{
|
|
2818
2434
|
href: link.url,
|
|
2819
2435
|
target: "_blank",
|
|
2820
2436
|
rel: "noopener noreferrer",
|
|
2437
|
+
"aria-label": link.ariaLabel,
|
|
2821
2438
|
children: [
|
|
2822
2439
|
/* @__PURE__ */ jsx20("span", { className: "MoreInfoIcon", children: /* @__PURE__ */ jsx20(
|
|
2823
2440
|
"svg",
|
|
@@ -2841,7 +2458,7 @@ var TextHeadlineAndBody = ({ data, headlineType = "h2" }) => {
|
|
|
2841
2458
|
]
|
|
2842
2459
|
}
|
|
2843
2460
|
) }, `more-info-${index}`)) }),
|
|
2844
|
-
data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */
|
|
2461
|
+
data.linksForMoreInfo && data.linksForMoreInfo.length === 1 && /* @__PURE__ */ jsxs19(
|
|
2845
2462
|
"a",
|
|
2846
2463
|
{
|
|
2847
2464
|
href: data.linksForMoreInfo[0].url,
|
|
@@ -2933,12 +2550,12 @@ var PrincipleOfPublicityStandard_default = PrincipleOfPublicity;
|
|
|
2933
2550
|
|
|
2934
2551
|
// src/NewTextComponentStandard/ServiceHeadlineAndBodyStandard/ServiceHeadlineAndBodyStandard.tsx
|
|
2935
2552
|
import DOMPurify6 from "dompurify";
|
|
2936
|
-
import { jsx as jsx22, jsxs as
|
|
2553
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2937
2554
|
var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
2938
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ jsxs20("div", { className: "pts-serviceHeadlineAndBody-container", children: [
|
|
2939
2556
|
data.mainHeadline && /* @__PURE__ */ jsx22("h1", { id: "pts-main-service-headline", children: data.mainHeadline }),
|
|
2940
2557
|
activeStep === 1 && data.ingressBody && /* @__PURE__ */ jsx22("div", { dangerouslySetInnerHTML: { __html: DOMPurify6.sanitize(data.ingressBody) } }),
|
|
2941
|
-
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: [
|
|
2942
2559
|
/* @__PURE__ */ jsx22(
|
|
2943
2560
|
"svg",
|
|
2944
2561
|
{
|
|
@@ -2959,7 +2576,7 @@ var ServiceHeadlineAndBody = ({ data, activeStep = 1 }) => {
|
|
|
2959
2576
|
),
|
|
2960
2577
|
/* @__PURE__ */ jsx22("span", { className: "pts-moreinfo-link-text", children: moreInfo.title })
|
|
2961
2578
|
] }) }, moreInfo.title + index)) }),
|
|
2962
|
-
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: [
|
|
2963
2580
|
/* @__PURE__ */ jsx22(
|
|
2964
2581
|
"svg",
|
|
2965
2582
|
{
|
|
@@ -2987,29 +2604,12 @@ var ServiceHeadlineAndBodyStandard_default = ServiceHeadlineAndBody;
|
|
|
2987
2604
|
// src/NewTextComponentStandard/SkipLinkStandard/SkipLinkStandard.tsx
|
|
2988
2605
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2989
2606
|
var SkipLink = () => {
|
|
2990
|
-
|
|
2991
|
-
const container = document.getElementById(`main-content`);
|
|
2992
|
-
if (container) {
|
|
2993
|
-
container.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
2994
|
-
container.focus();
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2997
|
-
return /* @__PURE__ */ jsx23("div", { className: "pts-skipLink-container", children: /* @__PURE__ */ jsx23(
|
|
2998
|
-
"a",
|
|
2999
|
-
{
|
|
3000
|
-
href: "#",
|
|
3001
|
-
onClick: (e) => {
|
|
3002
|
-
e.preventDefault();
|
|
3003
|
-
scrollToMainContent();
|
|
3004
|
-
},
|
|
3005
|
-
children: "Till huvudinneh\xE5ll"
|
|
3006
|
-
}
|
|
3007
|
-
) });
|
|
2607
|
+
return /* @__PURE__ */ jsx23("div", { className: "pts-skipLink-container", children: /* @__PURE__ */ jsx23("a", { href: "#main-content", children: "Till huvudinneh\xE5ll" }) });
|
|
3008
2608
|
};
|
|
3009
2609
|
var SkipLinkStandard_default = SkipLink;
|
|
3010
2610
|
|
|
3011
2611
|
// src/NewTextComponentStandard/StepperButtonsStandard/StepperButtonsStandard.tsx
|
|
3012
|
-
import { jsx as jsx24, jsxs as
|
|
2612
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3013
2613
|
var StepperButtons = ({
|
|
3014
2614
|
languageSupported,
|
|
3015
2615
|
handleActiveStep,
|
|
@@ -3019,7 +2619,7 @@ var StepperButtons = ({
|
|
|
3019
2619
|
activeStep
|
|
3020
2620
|
}) => {
|
|
3021
2621
|
const totalSteps = arraySteps ? arraySteps.length : "";
|
|
3022
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ jsxs21("div", { className: "pts-stepperButtons-container", children: [
|
|
3023
2623
|
activeStep !== 0 && /* @__PURE__ */ jsx24(
|
|
3024
2624
|
"button",
|
|
3025
2625
|
{
|
|
@@ -3029,7 +2629,7 @@ var StepperButtons = ({
|
|
|
3029
2629
|
children: languageSupported ? languageSupported.backButton : "<<"
|
|
3030
2630
|
}
|
|
3031
2631
|
),
|
|
3032
|
-
/* @__PURE__ */
|
|
2632
|
+
/* @__PURE__ */ jsxs21(
|
|
3033
2633
|
"button",
|
|
3034
2634
|
{
|
|
3035
2635
|
type: activeStep === totalSteps ? "submit" : "button",
|
|
@@ -3046,15 +2646,15 @@ var StepperButtons = ({
|
|
|
3046
2646
|
var StepperButtonsStandard_default = StepperButtons;
|
|
3047
2647
|
|
|
3048
2648
|
// src/NewTextComponentStandard/StepperStandard/StepperStandard.tsx
|
|
3049
|
-
import
|
|
3050
|
-
import { jsx as jsx25, jsxs as
|
|
2649
|
+
import React10 from "react";
|
|
2650
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3051
2651
|
var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
3052
2652
|
return /* @__PURE__ */ jsx25("div", { className: "pts-stepper-container", "aria-hidden": "true", children: arraySteps.map((step, index) => {
|
|
3053
2653
|
const isActive = step.step === activeStep;
|
|
3054
2654
|
const lastElement = arraySteps.length;
|
|
3055
2655
|
const isDone = step.step < activeStep;
|
|
3056
|
-
return /* @__PURE__ */
|
|
3057
|
-
/* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ jsxs22(React10.Fragment, { children: [
|
|
2657
|
+
/* @__PURE__ */ jsxs22("div", { className: "pts-stepper-step", children: [
|
|
3058
2658
|
/* @__PURE__ */ jsx25(
|
|
3059
2659
|
"div",
|
|
3060
2660
|
{
|
|
@@ -3089,12 +2689,12 @@ var Stepper = ({ arraySteps = [], activeStep = 1 }) => {
|
|
|
3089
2689
|
var StepperStandard_default = Stepper;
|
|
3090
2690
|
|
|
3091
2691
|
// src/NewTextComponentStandard/ValidationErrorSummaryList/ValidationErrorSummaryList.tsx
|
|
3092
|
-
import { Fragment as Fragment15, jsx as jsx26, jsxs as
|
|
2692
|
+
import { Fragment as Fragment15, jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3093
2693
|
var ValidationErrorSummaryList = ({
|
|
3094
2694
|
validationErrorsList,
|
|
3095
2695
|
formQuestions,
|
|
3096
2696
|
activatedLanguage,
|
|
3097
|
-
summaryText =
|
|
2697
|
+
summaryText = "Du beh\xF6ver \xE5tg\xE4rda {count} {plural}"
|
|
3098
2698
|
}) => {
|
|
3099
2699
|
console.log(formQuestions);
|
|
3100
2700
|
console.log(validationErrorsList);
|
|
@@ -3131,20 +2731,20 @@ var ValidationErrorSummaryList = ({
|
|
|
3131
2731
|
if (!validationErrorsList.length) return /* @__PURE__ */ jsx26(Fragment15, {});
|
|
3132
2732
|
const filteredIds = filterIdsByGroupCheck(validationErrorsList, formQuestions);
|
|
3133
2733
|
const count = filteredIds.length;
|
|
3134
|
-
const title = summaryText.replace("{count}", count.toString()).replace("{plural}",
|
|
2734
|
+
const title = summaryText.replace("{count}", count.toString()).replace("{plural}", count === 1 ? "sak" : "saker");
|
|
3135
2735
|
function getQuestionLabelById(id) {
|
|
3136
2736
|
var _a;
|
|
3137
2737
|
const found = formQuestions.find((item) => item.id === id);
|
|
3138
2738
|
return (_a = found == null ? void 0 : found.validationSummaryLabel) != null ? _a : found == null ? void 0 : found.questionLabel;
|
|
3139
2739
|
}
|
|
3140
|
-
return /* @__PURE__ */
|
|
2740
|
+
return /* @__PURE__ */ jsxs23("div", { className: "pts-errorSummary-container pts-root-error", children: [
|
|
3141
2741
|
/* @__PURE__ */ jsx26("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
3142
|
-
/* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ jsxs23("div", { className: "errorSummary-content", id: "pts-errorSummary-content", children: [
|
|
3143
2743
|
/* @__PURE__ */ jsx26("h2", { id: "errorSummary-headline", children: title }),
|
|
3144
2744
|
/* @__PURE__ */ jsx26("ul", { id: "errorSummary-ul", children: filteredIds.map((questionId, i) => /* @__PURE__ */ jsx26("li", { children: /* @__PURE__ */ jsx26(
|
|
3145
2745
|
"a",
|
|
3146
2746
|
{
|
|
3147
|
-
href:
|
|
2747
|
+
href: `#question-${questionId}`,
|
|
3148
2748
|
onClick: (e) => {
|
|
3149
2749
|
e.preventDefault();
|
|
3150
2750
|
scrollToQuestion(questionId);
|
|
@@ -3159,7 +2759,7 @@ var ValidationErrorSummaryList = ({
|
|
|
3159
2759
|
var ValidationErrorSummaryList_default = ValidationErrorSummaryList;
|
|
3160
2760
|
|
|
3161
2761
|
// src/NewTextComponentStandard/CookieBanner/CookieBanner.tsx
|
|
3162
|
-
import { jsx as jsx27, jsxs as
|
|
2762
|
+
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3163
2763
|
var CookieBanner = ({
|
|
3164
2764
|
visible = false,
|
|
3165
2765
|
onCookieStateChange,
|
|
@@ -3191,11 +2791,11 @@ var CookieBanner = ({
|
|
|
3191
2791
|
"aria-modal": "true",
|
|
3192
2792
|
id: "cookie-banner",
|
|
3193
2793
|
tabIndex: -1,
|
|
3194
|
-
children: /* @__PURE__ */
|
|
2794
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "content", children: [
|
|
3195
2795
|
/* @__PURE__ */ jsx27("h3", { id: "cookie-banner-title", children: "Kakor (cookies)" }),
|
|
3196
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." }),
|
|
3197
|
-
/* @__PURE__ */
|
|
3198
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Links", children: [
|
|
2798
|
+
/* @__PURE__ */ jsxs24(
|
|
3199
2799
|
"svg",
|
|
3200
2800
|
{
|
|
3201
2801
|
width: "27",
|
|
@@ -3218,7 +2818,7 @@ var CookieBanner = ({
|
|
|
3218
2818
|
),
|
|
3219
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)" })
|
|
3220
2820
|
] }),
|
|
3221
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ jsxs24("div", { className: "pts-cookieBanner-Buttons", children: [
|
|
3222
2822
|
/* @__PURE__ */ jsx27("button", { onClick: () => handleCookieChoice(true), children: "Ja, jag samtycker" }),
|
|
3223
2823
|
/* @__PURE__ */ jsx27("button", { onClick: () => handleCookieChoice(false), children: "Nej, jag samtycker inte" })
|
|
3224
2824
|
] })
|
|
@@ -3257,20 +2857,5 @@ export {
|
|
|
3257
2857
|
TextFieldStandard_default as TextFieldStandard,
|
|
3258
2858
|
TextHeadlineAndBodyStandard_default as TextHeadlineAndBodyStandard,
|
|
3259
2859
|
ValidationCheckAllVisibleQuestion_default as ValidationCheckAllVisibleQuestion,
|
|
3260
|
-
ValidationErrorSummaryList_default as ValidationErrorSummaryList
|
|
3261
|
-
createCookieConsent,
|
|
3262
|
-
createLanguageSlice,
|
|
3263
|
-
createQuestionsSlice,
|
|
3264
|
-
focusElement,
|
|
3265
|
-
getIdsGroupCheckValidationTypes,
|
|
3266
|
-
isScriptLoaded,
|
|
3267
|
-
makeLanguageSelectors,
|
|
3268
|
-
makeQuestionsSelectors,
|
|
3269
|
-
removeScriptById,
|
|
3270
|
-
toggleScriptByConsent,
|
|
3271
|
-
useCookieConsent,
|
|
3272
|
-
useFormStatusModal,
|
|
3273
|
-
useInputMethodDetection,
|
|
3274
|
-
usePTSPageTitle
|
|
2860
|
+
ValidationErrorSummaryList_default as ValidationErrorSummaryList
|
|
3275
2861
|
};
|
|
3276
|
-
//# sourceMappingURL=index.mjs.map
|