optimized-react-component-library-xyz123 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +20 -1713
- package/dist/index.d.ts +20 -1713
- package/dist/index.js +74 -86
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -14
- package/src/css/mobileView.css +1 -0
- package/src/css/styles.css +10 -8
package/dist/index.mjs
CHANGED
|
@@ -516,7 +516,7 @@ var PreviewTextField = ({
|
|
|
516
516
|
};
|
|
517
517
|
|
|
518
518
|
// src/components/input-components/AddFilesStandard/AddFilesStandard.tsx
|
|
519
|
-
import { useCallback, useEffect as
|
|
519
|
+
import { useCallback, useEffect as useEffect6, useState as useState7 } from "react";
|
|
520
520
|
import clsx3 from "clsx";
|
|
521
521
|
|
|
522
522
|
// src/components/input-components/AddFilesStandard/DropFilesStandard.tsx
|
|
@@ -622,7 +622,7 @@ var ExploreFiles = ({
|
|
|
622
622
|
var _a;
|
|
623
623
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
624
624
|
};
|
|
625
|
-
|
|
625
|
+
let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
|
|
626
626
|
const ariaLabelText = `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`;
|
|
627
627
|
return /* @__PURE__ */ jsx9(Fragment8, { children: /* @__PURE__ */ jsxs8("div", { className: "inputContainer", children: [
|
|
628
628
|
/* @__PURE__ */ jsxs8(
|
|
@@ -680,7 +680,7 @@ var ExploreFiles = ({
|
|
|
680
680
|
var ExploreFilesStandard_default = ExploreFiles;
|
|
681
681
|
|
|
682
682
|
// src/components/input-components/AddFilesStandard/SelectedFilesStandard.tsx
|
|
683
|
-
import { useEffect as
|
|
683
|
+
import React6, { useEffect as useEffect5, useState as useState6, useRef as useRef3 } from "react";
|
|
684
684
|
import { Col, Row } from "react-bootstrap";
|
|
685
685
|
|
|
686
686
|
// src/components/input-components/AddFilesStandard/IndicatorStandard.tsx
|
|
@@ -710,7 +710,7 @@ var SelectedFiles = ({
|
|
|
710
710
|
}) => {
|
|
711
711
|
const theDiv = useRef3(null);
|
|
712
712
|
const remove = (file) => {
|
|
713
|
-
|
|
713
|
+
let newFiles = questionObject.files.filter((f) => f !== file);
|
|
714
714
|
const newCountOfFiles = newFiles.length;
|
|
715
715
|
setNumberOfFiles(newCountOfFiles);
|
|
716
716
|
let e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
|
|
@@ -721,7 +721,7 @@ var SelectedFiles = ({
|
|
|
721
721
|
};
|
|
722
722
|
const useWindowWidth = () => {
|
|
723
723
|
const [windowWidth2, setWindowWidth] = useState6(window.innerWidth);
|
|
724
|
-
|
|
724
|
+
useEffect5(() => {
|
|
725
725
|
const handleResize = () => {
|
|
726
726
|
setWindowWidth(window.innerWidth);
|
|
727
727
|
};
|
|
@@ -744,7 +744,7 @@ var SelectedFiles = ({
|
|
|
744
744
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
745
745
|
const fileType = errorObj.FileName.split(".").pop();
|
|
746
746
|
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
747
|
-
return /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(
|
|
747
|
+
return /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(React6.Fragment, { children: /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
|
|
748
748
|
/* @__PURE__ */ jsx11(Row, { children: /* @__PURE__ */ jsx11(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx11("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx11("span", { className: "desktopFileName", children: errorObj.FileName }) }) }),
|
|
749
749
|
/* @__PURE__ */ jsx11(Row, { children: /* @__PURE__ */ jsx11(
|
|
750
750
|
Col,
|
|
@@ -758,7 +758,7 @@ var SelectedFiles = ({
|
|
|
758
758
|
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
759
759
|
}
|
|
760
760
|
) })
|
|
761
|
-
] }
|
|
761
|
+
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
762
762
|
})
|
|
763
763
|
] }) }),
|
|
764
764
|
/* @__PURE__ */ jsx11("div", { className: "addFile-error-close-button", children: /* @__PURE__ */ jsx11(
|
|
@@ -791,67 +791,60 @@ var SelectedFiles = ({
|
|
|
791
791
|
}
|
|
792
792
|
) })
|
|
793
793
|
] }) }),
|
|
794
|
-
questionObject.files.length > 0 && /* @__PURE__ */ jsx11(
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
height: "8",
|
|
813
|
-
viewBox: "0 0 8 8",
|
|
814
|
-
fill: "none",
|
|
815
|
-
children: /* @__PURE__ */ jsx11(
|
|
816
|
-
"path",
|
|
817
|
-
{
|
|
818
|
-
d: "M1 4.65913L2.8 6.45913L7 1.35913",
|
|
819
|
-
stroke: "white",
|
|
820
|
-
strokeWidth: "1.5",
|
|
821
|
-
strokeLinecap: "round"
|
|
822
|
-
}
|
|
823
|
-
)
|
|
824
|
-
}
|
|
825
|
-
) }) }),
|
|
826
|
-
/* @__PURE__ */ jsx11(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsxs9("span", { className: "mobileFirstFileName", children: [
|
|
827
|
-
mobileFirstFileName,
|
|
828
|
-
" (",
|
|
829
|
-
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
830
|
-
" ",
|
|
831
|
-
"MB)"
|
|
832
|
-
] }) : /* @__PURE__ */ jsxs9("span", { className: "desktopFileName", children: [
|
|
833
|
-
file.FileName,
|
|
834
|
-
" (",
|
|
835
|
-
/* @__PURE__ */ jsx11("span", { className: "fileSizeText", children: file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB` }),
|
|
836
|
-
" ",
|
|
837
|
-
")"
|
|
838
|
-
] }) }),
|
|
839
|
-
/* @__PURE__ */ jsx11(Col, { className: "lastCol", children: /* @__PURE__ */ jsx11(
|
|
840
|
-
"button",
|
|
794
|
+
questionObject.files.length > 0 && /* @__PURE__ */ jsx11("ul", { className: "fileListUnorderedList", "aria-label": activatedLanguage === "en" ? "Uploaded files" : "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
795
|
+
const indicatorfileName = file.FileName;
|
|
796
|
+
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
797
|
+
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
798
|
+
const fileType = file.FileName.split(".").pop();
|
|
799
|
+
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
800
|
+
return /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(React6.Fragment, { children: /* @__PURE__ */ jsx11("div", { children: /* @__PURE__ */ jsx11("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs9("div", { className: "fileInList", children: [
|
|
801
|
+
/* @__PURE__ */ jsxs9("div", { className: "fileItem", children: [
|
|
802
|
+
/* @__PURE__ */ jsx11(Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", className: "uploadedDot", children: /* @__PURE__ */ jsx11(
|
|
803
|
+
"svg",
|
|
804
|
+
{
|
|
805
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
806
|
+
width: "8",
|
|
807
|
+
height: "8",
|
|
808
|
+
viewBox: "0 0 8 8",
|
|
809
|
+
fill: "none",
|
|
810
|
+
children: /* @__PURE__ */ jsx11(
|
|
811
|
+
"path",
|
|
841
812
|
{
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
813
|
+
d: "M1 4.65913L2.8 6.45913L7 1.35913",
|
|
814
|
+
stroke: "white",
|
|
815
|
+
strokeWidth: "1.5",
|
|
816
|
+
strokeLinecap: "round"
|
|
846
817
|
}
|
|
847
|
-
)
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
818
|
+
)
|
|
819
|
+
}
|
|
820
|
+
) }) }),
|
|
821
|
+
/* @__PURE__ */ jsx11(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsxs9("span", { className: "mobileFirstFileName", children: [
|
|
822
|
+
mobileFirstFileName,
|
|
823
|
+
" (",
|
|
824
|
+
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
825
|
+
" ",
|
|
826
|
+
"MB)"
|
|
827
|
+
] }) : /* @__PURE__ */ jsxs9("span", { className: "desktopFileName", children: [
|
|
828
|
+
file.FileName,
|
|
829
|
+
" (",
|
|
830
|
+
/* @__PURE__ */ jsx11("span", { className: "fileSizeText", children: file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(1)} MB` }),
|
|
831
|
+
" ",
|
|
832
|
+
")"
|
|
833
|
+
] }) }),
|
|
834
|
+
/* @__PURE__ */ jsx11(Col, { className: "lastCol", children: /* @__PURE__ */ jsx11(
|
|
835
|
+
"button",
|
|
836
|
+
{
|
|
837
|
+
className: "selectedFilesLinkButton",
|
|
838
|
+
onClick: () => remove(file),
|
|
839
|
+
"aria-label": activatedLanguage === "sv" ? `Radera ${indicatorfileName}` : `Delete ${indicatorfileName}`,
|
|
840
|
+
children: activatedLanguage === "sv" ? "Radera" : "Delete"
|
|
841
|
+
}
|
|
842
|
+
) })
|
|
843
|
+
] }),
|
|
844
|
+
showIndicator && /* @__PURE__ */ jsx11(Row, { children: /* @__PURE__ */ jsx11(Col, { style: { width: "100%", padding: 0 }, children: /* @__PURE__ */ jsx11(IndicatorStandard_default, { filename: indicatorfileName }) }) }),
|
|
845
|
+
/* @__PURE__ */ jsx11(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx11(Col, { className: "makeSpace" }) })
|
|
846
|
+
] }, index) }) }) }, `file-${file.FileName}-${index}`) });
|
|
847
|
+
}) }),
|
|
855
848
|
/* @__PURE__ */ jsx11("div", { ref: theDiv, className: "pts-clipboard-container" })
|
|
856
849
|
] });
|
|
857
850
|
};
|
|
@@ -902,14 +895,14 @@ var AddFiles = ({
|
|
|
902
895
|
const [errorMessageAddingFile, setErrorMessageAddingFile] = useState7([]);
|
|
903
896
|
const [newFiles, setNewFiles] = useState7([]);
|
|
904
897
|
const [dropFilesText, setDropFilesText] = useState7("Dra och sl\xE4pp dina filer h\xE4r");
|
|
905
|
-
|
|
898
|
+
useEffect6(() => {
|
|
906
899
|
if (activatedLanguage === "sv") {
|
|
907
900
|
setDropFilesText("Dra och sl\xE4pp dina filer h\xE4r");
|
|
908
901
|
} else {
|
|
909
902
|
setDropFilesText("Drag and drop your files here");
|
|
910
903
|
}
|
|
911
904
|
}, [activatedLanguage]);
|
|
912
|
-
|
|
905
|
+
useEffect6(() => {
|
|
913
906
|
if (questionObject.files && questionObject.files.length > 0) {
|
|
914
907
|
setNumberOfFiles(questionObject.files.length);
|
|
915
908
|
}
|
|
@@ -1004,7 +997,7 @@ var AddFiles = ({
|
|
|
1004
997
|
reader.readAsDataURL(file);
|
|
1005
998
|
});
|
|
1006
999
|
};
|
|
1007
|
-
|
|
1000
|
+
useEffect6(() => {
|
|
1008
1001
|
if (newFiles.length > 0) {
|
|
1009
1002
|
const currentFiles = questionObject.files ? questionObject.files : [];
|
|
1010
1003
|
const e = {
|
|
@@ -1022,7 +1015,7 @@ var AddFiles = ({
|
|
|
1022
1015
|
setNumberOfFiles(newCount);
|
|
1023
1016
|
};
|
|
1024
1017
|
const removeOneError = (errorIndex) => {
|
|
1025
|
-
|
|
1018
|
+
let newErrors = errorMessageAddingFile.filter((e, index) => index !== errorIndex);
|
|
1026
1019
|
setErrorMessageAddingFile(newErrors);
|
|
1027
1020
|
};
|
|
1028
1021
|
const removeError = () => {
|
|
@@ -1124,7 +1117,7 @@ var PreviewAddFiles = ({
|
|
|
1124
1117
|
};
|
|
1125
1118
|
|
|
1126
1119
|
// src/components/input-components/SingleCheckboxStandard/SingleCheckboxStandard.tsx
|
|
1127
|
-
import { useEffect as
|
|
1120
|
+
import { useEffect as useEffect7, useState as useState8 } from "react";
|
|
1128
1121
|
import DOMPurify3 from "dompurify";
|
|
1129
1122
|
import { Fragment as Fragment12, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1130
1123
|
var SingleCheckbox = ({
|
|
@@ -1139,7 +1132,7 @@ var SingleCheckbox = ({
|
|
|
1139
1132
|
const aboutId = `about-${question.id}`;
|
|
1140
1133
|
const errorId = `error-${question.id}`;
|
|
1141
1134
|
const [checked, setChecked] = useState8(false);
|
|
1142
|
-
|
|
1135
|
+
useEffect7(() => {
|
|
1143
1136
|
if (question.answer && question.answer === "true") {
|
|
1144
1137
|
setChecked(true);
|
|
1145
1138
|
} else {
|
|
@@ -1148,7 +1141,7 @@ var SingleCheckbox = ({
|
|
|
1148
1141
|
}, [question.answer]);
|
|
1149
1142
|
const handleInputChange = (event) => {
|
|
1150
1143
|
setChecked(event.target.checked);
|
|
1151
|
-
|
|
1144
|
+
let answer = event.target.checked ? "true" : "false";
|
|
1152
1145
|
const e = { target: { value: answer } };
|
|
1153
1146
|
handleQuestionInputChange(e, question);
|
|
1154
1147
|
};
|
|
@@ -2070,7 +2063,7 @@ var InfoOnlyStandard_default = InputInfoOnly;
|
|
|
2070
2063
|
import React9 from "react";
|
|
2071
2064
|
|
|
2072
2065
|
// src/components/input-components/RadioMultipleWithInfoStandard/RadioCollapseItem.tsx
|
|
2073
|
-
import { useEffect as
|
|
2066
|
+
import { useEffect as useEffect8, useState as useState9 } from "react";
|
|
2074
2067
|
import DOMPurify7 from "dompurify";
|
|
2075
2068
|
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2076
2069
|
var RadioCollapseItem = ({
|
|
@@ -2092,7 +2085,7 @@ var RadioCollapseItem = ({
|
|
|
2092
2085
|
const openLabel = activatedLanguage === "sv" ? "Visa mer information om" : "Show more information about";
|
|
2093
2086
|
const closeLabel = activatedLanguage === "sv" ? "D\xF6lj mer information om" : "Hide more information about";
|
|
2094
2087
|
const buttonLabel = `${isOpen ? closeLabel : openLabel} "${label}"`;
|
|
2095
|
-
|
|
2088
|
+
useEffect8(() => {
|
|
2096
2089
|
if (questionAnswer === value) {
|
|
2097
2090
|
setIsOpen(true);
|
|
2098
2091
|
} else {
|
|
@@ -2201,7 +2194,7 @@ var RadioWithInfo = ({
|
|
|
2201
2194
|
children: [
|
|
2202
2195
|
groupedOptionArray.map((group, g_index) => {
|
|
2203
2196
|
var _a2;
|
|
2204
|
-
|
|
2197
|
+
let subId = "subheading-" + g_index;
|
|
2205
2198
|
return /* @__PURE__ */ jsxs17(React9.Fragment, { children: [
|
|
2206
2199
|
/* @__PURE__ */ jsx21("legend", { className: "pts-radioWithInfo-sub-headline", id: subId, children: group.category }),
|
|
2207
2200
|
/* @__PURE__ */ jsx21("div", { role: "group", "aria-labelledby": subId, children: (_a2 = group.items) == null ? void 0 : _a2.map((option, o_index) => {
|
|
@@ -2221,8 +2214,7 @@ var RadioWithInfo = ({
|
|
|
2221
2214
|
questionIsMandatory: (_c2 = question.isQuestionMandatory) != null ? _c2 : false,
|
|
2222
2215
|
optionText: (_e = (_d = group.items.find((optionInfo) => optionInfo.value === option.value)) == null ? void 0 : _d.info) != null ? _e : "",
|
|
2223
2216
|
activatedLanguage
|
|
2224
|
-
}
|
|
2225
|
-
questionId + groupId + index
|
|
2217
|
+
}
|
|
2226
2218
|
);
|
|
2227
2219
|
}) })
|
|
2228
2220
|
] }, subId);
|
|
@@ -3046,7 +3038,7 @@ var useFormStatusModal = (formStatus, handleModalOpen, handleModalClose, mainSel
|
|
|
3046
3038
|
};
|
|
3047
3039
|
|
|
3048
3040
|
// src/hooks/usePTSPageTitle/usePTSPageTitle.ts
|
|
3049
|
-
import { useMemo, useEffect as
|
|
3041
|
+
import { useMemo, useEffect as useEffect10 } from "react";
|
|
3050
3042
|
var usePTSPageTitle = ({
|
|
3051
3043
|
formStatus,
|
|
3052
3044
|
activeStep,
|
|
@@ -3064,19 +3056,19 @@ var usePTSPageTitle = ({
|
|
|
3064
3056
|
if (activeStep === 0 && baseTitle) return baseTitle;
|
|
3065
3057
|
return stepTitle || baseTitle || fallbackTitle;
|
|
3066
3058
|
}, [formStatus, activeStep, applicationContent, thankYouBlock, steps, fallbackTitle]);
|
|
3067
|
-
|
|
3059
|
+
useEffect10(() => {
|
|
3068
3060
|
document.title = computedTitle;
|
|
3069
3061
|
}, [computedTitle]);
|
|
3070
3062
|
return computedTitle;
|
|
3071
3063
|
};
|
|
3072
3064
|
|
|
3073
3065
|
// src/hooks/useInputMethodDetection/useInputMethodDetection.ts
|
|
3074
|
-
import { useEffect as
|
|
3066
|
+
import { useEffect as useEffect11 } from "react";
|
|
3075
3067
|
var useInputMethodDetection = ({
|
|
3076
3068
|
mouseClassName = "using-mouse",
|
|
3077
3069
|
keyboardToggleKey = "Tab"
|
|
3078
3070
|
} = {}) => {
|
|
3079
|
-
|
|
3071
|
+
useEffect11(() => {
|
|
3080
3072
|
const handleMouseDown = () => {
|
|
3081
3073
|
document.body.classList.add(mouseClassName);
|
|
3082
3074
|
};
|
|
@@ -3095,7 +3087,7 @@ var useInputMethodDetection = ({
|
|
|
3095
3087
|
};
|
|
3096
3088
|
|
|
3097
3089
|
// src/hooks/useCookieConsent/useCookieConsent.ts
|
|
3098
|
-
import { useCallback as useCallback2, useEffect as
|
|
3090
|
+
import { useCallback as useCallback2, useEffect as useEffect12, useMemo as useMemo2, useState as useState10 } from "react";
|
|
3099
3091
|
var useCookieConsent = ({
|
|
3100
3092
|
cookieName,
|
|
3101
3093
|
choiceKey,
|
|
@@ -3124,7 +3116,7 @@ var useCookieConsent = ({
|
|
|
3124
3116
|
}
|
|
3125
3117
|
setShowBanner(false);
|
|
3126
3118
|
}, [areCookiesAccepted, onConsentChange]);
|
|
3127
|
-
|
|
3119
|
+
useEffect12(() => {
|
|
3128
3120
|
const cookiesAccepted = areCookiesAccepted();
|
|
3129
3121
|
const choiceMade = hasChoiceBeenMade();
|
|
3130
3122
|
setShowBanner(!cookiesAccepted && !choiceMade);
|
|
@@ -3253,7 +3245,7 @@ var QuestionRenderer = ({
|
|
|
3253
3245
|
var QuestionRenderer_default = QuestionRenderer;
|
|
3254
3246
|
|
|
3255
3247
|
// src/components/question-rendering/QuestionGroup/QuestionGroup.tsx
|
|
3256
|
-
import { useEffect as
|
|
3248
|
+
import { useEffect as useEffect13, Fragment as Fragment18 } from "react";
|
|
3257
3249
|
import { Fragment as Fragment19, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3258
3250
|
var QuestionGroup = ({
|
|
3259
3251
|
questions,
|
|
@@ -3265,13 +3257,6 @@ var QuestionGroup = ({
|
|
|
3265
3257
|
markQuestionAsDisplayed
|
|
3266
3258
|
}) => {
|
|
3267
3259
|
var _a, _b, _c;
|
|
3268
|
-
useEffect12(() => {
|
|
3269
|
-
questions.forEach((question) => {
|
|
3270
|
-
if (question.visible && !question.isDisplayed) {
|
|
3271
|
-
markQuestionAsDisplayed(question);
|
|
3272
|
-
}
|
|
3273
|
-
});
|
|
3274
|
-
}, [questions]);
|
|
3275
3260
|
if (!questions || questions.length === 0) {
|
|
3276
3261
|
return null;
|
|
3277
3262
|
}
|
|
@@ -3280,6 +3265,13 @@ var QuestionGroup = ({
|
|
|
3280
3265
|
const groupMandatory = (_a = firstQuestion.validationType) == null ? void 0 : _a.find(
|
|
3281
3266
|
(e) => e.startsWith("groupCheck-")
|
|
3282
3267
|
);
|
|
3268
|
+
useEffect13(() => {
|
|
3269
|
+
questions.forEach((question) => {
|
|
3270
|
+
if (question.visible && !question.isDisplayed) {
|
|
3271
|
+
markQuestionAsDisplayed(question);
|
|
3272
|
+
}
|
|
3273
|
+
});
|
|
3274
|
+
}, [questions]);
|
|
3283
3275
|
const groupQuestions = /* @__PURE__ */ jsx25(Fragment19, { children: questions.map((question, index) => {
|
|
3284
3276
|
var _a2;
|
|
3285
3277
|
return /* @__PURE__ */ jsx25(Fragment18, { children: /* @__PURE__ */ jsx25(
|
|
@@ -3956,7 +3948,7 @@ var HeaderStandard_default = Header;
|
|
|
3956
3948
|
import { useRef as useRef5, useState as useState13 } from "react";
|
|
3957
3949
|
|
|
3958
3950
|
// src/components/layout/NavigationStandard/NavigationStandard.tsx
|
|
3959
|
-
import { useEffect as
|
|
3951
|
+
import { useEffect as useEffect14, useState as useState11, useRef as useRef4 } from "react";
|
|
3960
3952
|
import { Fragment as Fragment20, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3961
3953
|
var Navigation = ({
|
|
3962
3954
|
setIsMenyOpen,
|
|
@@ -3964,7 +3956,7 @@ var Navigation = ({
|
|
|
3964
3956
|
activatedLanguage = "sv",
|
|
3965
3957
|
menuLinks = [],
|
|
3966
3958
|
openButtonRef = null,
|
|
3967
|
-
linkComponent: LinkComponent = "a",
|
|
3959
|
+
linkComponent: LinkComponent = (props) => /* @__PURE__ */ jsx30("a", { ...props }),
|
|
3968
3960
|
navigationCloseFocusId,
|
|
3969
3961
|
activePath = null
|
|
3970
3962
|
}) => {
|
|
@@ -3978,13 +3970,9 @@ var Navigation = ({
|
|
|
3978
3970
|
const handleMenuClick = (typeOfInteraction) => {
|
|
3979
3971
|
var _a, _b;
|
|
3980
3972
|
setIsMenyOpen == null ? void 0 : setIsMenyOpen(false);
|
|
3981
|
-
|
|
3982
|
-
(_a = openButtonRef == null ? void 0 : openButtonRef.current) == null ? void 0 : _a.focus();
|
|
3983
|
-
} else if (navigationCloseFocusId) {
|
|
3984
|
-
(_b = document.getElementById(navigationCloseFocusId)) == null ? void 0 : _b.focus();
|
|
3985
|
-
}
|
|
3973
|
+
typeOfInteraction === "close" ? (_a = openButtonRef == null ? void 0 : openButtonRef.current) == null ? void 0 : _a.focus() : navigationCloseFocusId && ((_b = document.getElementById(navigationCloseFocusId)) == null ? void 0 : _b.focus());
|
|
3986
3974
|
};
|
|
3987
|
-
|
|
3975
|
+
useEffect14(() => {
|
|
3988
3976
|
var _a, _b;
|
|
3989
3977
|
if (!isOpen) {
|
|
3990
3978
|
setOpenSubMenu(null);
|
|
@@ -3996,7 +3984,7 @@ var Navigation = ({
|
|
|
3996
3984
|
})) == null ? void 0 : _a.label[activatedLanguage]) != null ? _b : null;
|
|
3997
3985
|
setOpenSubMenu(defaultOpenSubMenu);
|
|
3998
3986
|
}, [isOpen, activePath, menuLinks, activatedLanguage]);
|
|
3999
|
-
|
|
3987
|
+
useEffect14(() => {
|
|
4000
3988
|
if (!isOpen || !navRef.current) {
|
|
4001
3989
|
return;
|
|
4002
3990
|
}
|
|
@@ -4047,7 +4035,7 @@ var Navigation = ({
|
|
|
4047
4035
|
return "\xD6ppna undermeny f\xF6r " + label["sv"];
|
|
4048
4036
|
};
|
|
4049
4037
|
const [instruction, setInstruction] = useState11("");
|
|
4050
|
-
|
|
4038
|
+
useEffect14(() => {
|
|
4051
4039
|
if (firstVisitRef.current) {
|
|
4052
4040
|
firstVisitRef.current = false;
|
|
4053
4041
|
return;
|
|
@@ -4196,7 +4184,7 @@ var NavigationHeader = ({
|
|
|
4196
4184
|
menuLinks = void 0,
|
|
4197
4185
|
SetActivatedLanguage = () => {
|
|
4198
4186
|
},
|
|
4199
|
-
linkComponent: LinkComponent = "a",
|
|
4187
|
+
linkComponent: LinkComponent = (props) => /* @__PURE__ */ jsx33("a", { ...props }),
|
|
4200
4188
|
noLogoLink = false,
|
|
4201
4189
|
navigationCloseFocusId,
|
|
4202
4190
|
activePath = null
|
|
@@ -4401,6 +4389,7 @@ var LinkStandard = ({
|
|
|
4401
4389
|
}) => {
|
|
4402
4390
|
let iconClass = "";
|
|
4403
4391
|
const excelExtensions = ["xls", "xlsx", "xlsm", "xlsb", "xltx", "xltm", "xlam", "csv"];
|
|
4392
|
+
let linkTitle = title;
|
|
4404
4393
|
const getFileExtension = (url2) => {
|
|
4405
4394
|
const match = url2.match(/\.([a-zA-Z0-9]+)(?=$|\?|#)/);
|
|
4406
4395
|
return match ? match[1] : null;
|
|
@@ -4422,7 +4411,7 @@ var LinkStandard = ({
|
|
|
4422
4411
|
}
|
|
4423
4412
|
}
|
|
4424
4413
|
}
|
|
4425
|
-
|
|
4414
|
+
linkTitle = fileExtension !== null ? `${title} (${fileExtension})` : title;
|
|
4426
4415
|
return /* @__PURE__ */ jsx36("div", { className: "pts-standard-link", children: /* @__PURE__ */ jsxs31(
|
|
4427
4416
|
LinkComponent,
|
|
4428
4417
|
{
|
|
@@ -4480,8 +4469,7 @@ var Collapse = ({
|
|
|
4480
4469
|
customClass = ""
|
|
4481
4470
|
}) => {
|
|
4482
4471
|
const [isOpen, setIsOpen] = useState14(defaultOpen);
|
|
4483
|
-
const
|
|
4484
|
-
const uniqueId = id != null ? id : generatedId;
|
|
4472
|
+
const uniqueId = id != null ? id : useId2();
|
|
4485
4473
|
const contentId = `${uniqueId}-content`;
|
|
4486
4474
|
const openLabel = activatedLanguage === "sv" ? "Visa" : "Show";
|
|
4487
4475
|
const closeLabel = activatedLanguage === "sv" ? "D\xF6lj" : "Hide";
|