optimized-react-component-library-xyz123 0.1.65 → 0.1.66
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 +330 -0
- package/dist/index.js +170 -78
- package/dist/index.mjs +237 -145
- package/package.json +1 -1
- package/src/css/styles.css +75 -3
package/dist/index.js
CHANGED
|
@@ -200,10 +200,10 @@ var PrevieMultipleCheckboxes = ({
|
|
|
200
200
|
const previewId = `preview-${question.id}`;
|
|
201
201
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
202
202
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dt", { id: `question-${previewId}`, children: (_a = question.previewLabel) != null ? _a : question.questionLabel }),
|
|
203
|
-
question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
203
|
+
question.answer ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: question.options && question.options.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { children: question.options[0].label }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "preview-answer-list", children: (_b = question.options) == null ? void 0 : _b.filter((option) => {
|
|
204
204
|
var _a2;
|
|
205
205
|
return (_a2 = question.answer) == null ? void 0 : _a2.includes(option.label);
|
|
206
|
-
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("
|
|
206
|
+
}).map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: option.label }, index)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("dd", { className: "no-answer-preview-page", children: activatedLanguage === "en" ? "No Answer" : "Inget svar" }),
|
|
207
207
|
" "
|
|
208
208
|
] });
|
|
209
209
|
};
|
|
@@ -821,7 +821,7 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
821
821
|
var DropFilesStandard_default = DropFiles;
|
|
822
822
|
|
|
823
823
|
// src/NewInputComponentStandard/AddFilesStandard/ExploreFilesStandard.tsx
|
|
824
|
-
var import_react4 = require("react");
|
|
824
|
+
var import_react4 = __toESM(require("react"));
|
|
825
825
|
var import_clsx2 = __toESM(require("clsx"));
|
|
826
826
|
|
|
827
827
|
// src/NewInputComponentStandard/AddFilesStandard/ScreenReaderErrors.tsx
|
|
@@ -829,7 +829,11 @@ var import_react3 = __toESM(require("react"));
|
|
|
829
829
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
830
830
|
var ScreenReaderErrors = ({
|
|
831
831
|
errorMessageAddingFile,
|
|
832
|
-
activatedLanguage
|
|
832
|
+
activatedLanguage,
|
|
833
|
+
removeUploadErrors,
|
|
834
|
+
putFocusOnButton = () => {
|
|
835
|
+
alert("no function");
|
|
836
|
+
}
|
|
833
837
|
}) => {
|
|
834
838
|
const [activateErrorMessagesForScreenReader, setActivateErrorMessagesForScreenReader] = import_react3.default.useState(false);
|
|
835
839
|
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react3.default.useState("");
|
|
@@ -845,7 +849,49 @@ var ScreenReaderErrors = ({
|
|
|
845
849
|
setActivateErrorMessagesForScreenReader(true);
|
|
846
850
|
}
|
|
847
851
|
}, [errorMessageAddingFile]);
|
|
848
|
-
|
|
852
|
+
const handleRemoveErrors = () => {
|
|
853
|
+
const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
|
|
854
|
+
setErrorMessagesForScreenReader(errorMessages);
|
|
855
|
+
removeUploadErrors();
|
|
856
|
+
putFocusOnButton();
|
|
857
|
+
setTimeout(() => {
|
|
858
|
+
setActivateErrorMessagesForScreenReader(false);
|
|
859
|
+
}, 1e3);
|
|
860
|
+
};
|
|
861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
862
|
+
errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
863
|
+
"button",
|
|
864
|
+
{
|
|
865
|
+
onClick: handleRemoveErrors,
|
|
866
|
+
style: {
|
|
867
|
+
marginRight: "8px",
|
|
868
|
+
backgroundColor: "transparent",
|
|
869
|
+
border: "none",
|
|
870
|
+
textDecoration: "underline",
|
|
871
|
+
cursor: "pointer"
|
|
872
|
+
},
|
|
873
|
+
className: "errorMessageAddingFile",
|
|
874
|
+
"aria-label": activatedLanguage === "sv" ? "Ta bort felmeddelande f\xF6r uppladdning av filer" : "Remove error message for file uploads",
|
|
875
|
+
children: "Ta bort fel! / Remove errors!"
|
|
876
|
+
}
|
|
877
|
+
),
|
|
878
|
+
activateErrorMessagesForScreenReader && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
879
|
+
"p",
|
|
880
|
+
{
|
|
881
|
+
role: "alert",
|
|
882
|
+
style: {
|
|
883
|
+
position: "absolute",
|
|
884
|
+
left: "-9999px",
|
|
885
|
+
top: "auto",
|
|
886
|
+
width: "1px",
|
|
887
|
+
height: "1px",
|
|
888
|
+
overflow: "hidden"
|
|
889
|
+
},
|
|
890
|
+
"aria-atomic": "true",
|
|
891
|
+
children: errorMessagesForScreenReader
|
|
892
|
+
}
|
|
893
|
+
)
|
|
894
|
+
] });
|
|
849
895
|
};
|
|
850
896
|
var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
851
897
|
|
|
@@ -853,6 +899,7 @@ var ScreenReaderErrors_default = ScreenReaderErrors;
|
|
|
853
899
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
854
900
|
var ExploreFiles = ({
|
|
855
901
|
FilesSelected,
|
|
902
|
+
//UploadButtonText = 'upload files',
|
|
856
903
|
numberOfFiles,
|
|
857
904
|
allowedNumberOfFiles,
|
|
858
905
|
activatedLanguage,
|
|
@@ -862,10 +909,28 @@ var ExploreFiles = ({
|
|
|
862
909
|
errorId,
|
|
863
910
|
questionObject,
|
|
864
911
|
showErrors,
|
|
865
|
-
errorMessageAddingFile
|
|
912
|
+
errorMessageAddingFile,
|
|
913
|
+
removeUploadErrors = () => {
|
|
914
|
+
alert("finns ingen funktion");
|
|
915
|
+
}
|
|
866
916
|
}) => {
|
|
867
917
|
const fileInputRef = (0, import_react4.useRef)(null);
|
|
868
918
|
const buttonInputRef = (0, import_react4.useRef)(null);
|
|
919
|
+
const [showErrorMessagesForScreenReader, setShowErrorMessagesForScreenReader] = import_react4.default.useState(false);
|
|
920
|
+
const [errorMessagesForScreenReader, setErrorMessagesForScreenReader] = import_react4.default.useState("");
|
|
921
|
+
(0, import_react4.useEffect)(() => {
|
|
922
|
+
const button = buttonInputRef.current;
|
|
923
|
+
if (!button) return;
|
|
924
|
+
const handleFocus = () => {
|
|
925
|
+
setShowErrorMessagesForScreenReader(!showErrorMessagesForScreenReader);
|
|
926
|
+
console.log("FOCUS!!");
|
|
927
|
+
console.log("Error messages for screen reader: " + errorMessageAddingFile);
|
|
928
|
+
};
|
|
929
|
+
button.addEventListener("focus", handleFocus);
|
|
930
|
+
return () => {
|
|
931
|
+
button.removeEventListener("focus", handleFocus);
|
|
932
|
+
};
|
|
933
|
+
}, []);
|
|
869
934
|
const handleFiles = (event) => {
|
|
870
935
|
const files = Array.from(event.target.files || []);
|
|
871
936
|
FilesSelected(files);
|
|
@@ -875,17 +940,32 @@ var ExploreFiles = ({
|
|
|
875
940
|
var _a;
|
|
876
941
|
(_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
877
942
|
};
|
|
943
|
+
const handleRemoveErrors = () => {
|
|
944
|
+
const errorMessages = activatedLanguage === "sv" ? `Felmeddelande raderat.` : `Error message deleted.`;
|
|
945
|
+
setErrorMessagesForScreenReader(errorMessages);
|
|
946
|
+
removeUploadErrors();
|
|
947
|
+
putFocusOnButton();
|
|
948
|
+
setTimeout(() => {
|
|
949
|
+
setShowErrorMessagesForScreenReader(false);
|
|
950
|
+
}, 1e3);
|
|
951
|
+
};
|
|
952
|
+
const putFocusOnButton = () => {
|
|
953
|
+
var _a;
|
|
954
|
+
(_a = buttonInputRef.current) == null ? void 0 : _a.focus();
|
|
955
|
+
};
|
|
878
956
|
let addFilesInfoText = numberOfFiles > 0 ? activatedLanguage === "sv" ? `${numberOfFiles} filer valda (max ${allowedNumberOfFiles})` : `${numberOfFiles} files chosed (max ${allowedNumberOfFiles})` : activatedLanguage === "sv" ? "Ingen fil vald" : "No file chosen";
|
|
879
957
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "inputContainer", children: [
|
|
880
958
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
881
|
-
"
|
|
959
|
+
"label",
|
|
882
960
|
{
|
|
961
|
+
tabIndex: -1,
|
|
883
962
|
className: (0, import_clsx2.default)(
|
|
884
963
|
["form-control"],
|
|
885
964
|
"filePickLabel",
|
|
886
965
|
showErrors && questionObject.error ? ["form-control error"] : ""
|
|
887
966
|
),
|
|
888
967
|
id: labelId,
|
|
968
|
+
htmlFor: inputId,
|
|
889
969
|
children: [
|
|
890
970
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
891
971
|
"button",
|
|
@@ -896,32 +976,34 @@ var ExploreFiles = ({
|
|
|
896
976
|
"filePickButton",
|
|
897
977
|
showErrors && questionObject.error ? "filePickButton error" : ""
|
|
898
978
|
),
|
|
899
|
-
"aria-describedby": `${aboutId} ${questionObject.
|
|
900
|
-
"aria-label": `${activatedLanguage === "sv" ? "
|
|
979
|
+
"aria-describedby": `${aboutId} ${showErrors && questionObject.error ? errorId : ""}`.trim(),
|
|
980
|
+
"aria-label": `${activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"} ${addFilesInfoText}`,
|
|
901
981
|
children: activatedLanguage === "sv" ? "V\xE4lj fil" : "Choose file"
|
|
902
982
|
}
|
|
903
983
|
),
|
|
904
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
985
|
+
"input",
|
|
986
|
+
{
|
|
987
|
+
ref: fileInputRef,
|
|
988
|
+
type: "file",
|
|
989
|
+
className: "invisible",
|
|
990
|
+
multiple: true,
|
|
991
|
+
onChange: handleFiles,
|
|
992
|
+
tabIndex: -1,
|
|
993
|
+
id: inputId
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "filePickText", children: addFilesInfoText })
|
|
905
997
|
]
|
|
906
998
|
}
|
|
907
999
|
),
|
|
908
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
909
|
-
"input",
|
|
910
|
-
{
|
|
911
|
-
ref: fileInputRef,
|
|
912
|
-
type: "file",
|
|
913
|
-
className: "invisible",
|
|
914
|
-
multiple: true,
|
|
915
|
-
onChange: handleFiles,
|
|
916
|
-
tabIndex: -1,
|
|
917
|
-
id: inputId
|
|
918
|
-
}
|
|
919
|
-
),
|
|
920
1000
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
921
1001
|
ScreenReaderErrors_default,
|
|
922
1002
|
{
|
|
923
1003
|
errorMessageAddingFile,
|
|
924
|
-
|
|
1004
|
+
removeUploadErrors,
|
|
1005
|
+
activatedLanguage,
|
|
1006
|
+
putFocusOnButton
|
|
925
1007
|
}
|
|
926
1008
|
)
|
|
927
1009
|
] }) });
|
|
@@ -955,12 +1037,11 @@ var SelectedFiles = ({
|
|
|
955
1037
|
errorMessageAddingFile,
|
|
956
1038
|
activatedLanguage,
|
|
957
1039
|
numberOfFiles,
|
|
958
|
-
setNumberOfFiles
|
|
959
|
-
removeUploadErrors
|
|
1040
|
+
setNumberOfFiles
|
|
960
1041
|
}) => {
|
|
961
1042
|
const theDiv = (0, import_react6.useRef)(null);
|
|
962
1043
|
const remove = (file) => {
|
|
963
|
-
let newFiles = questionObject.
|
|
1044
|
+
let newFiles = questionObject.Files.filter((f) => f !== file);
|
|
964
1045
|
const newCountOfFiles = newFiles.length;
|
|
965
1046
|
setNumberOfFiles(newCountOfFiles);
|
|
966
1047
|
const e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
|
|
@@ -986,54 +1067,58 @@ var SelectedFiles = ({
|
|
|
986
1067
|
};
|
|
987
1068
|
const windowWidth = useWindowWidth();
|
|
988
1069
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
989
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
1000
|
-
|
|
1001
|
-
"span",
|
|
1002
|
-
{
|
|
1003
|
-
"aria-hidden": "true",
|
|
1004
|
-
className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
|
|
1005
|
-
children: "!"
|
|
1006
|
-
}
|
|
1007
|
-
) }),
|
|
1008
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { children: windowWidth < 768 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "desktopFileName", children: errorObj.FileName }) }),
|
|
1009
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol" })
|
|
1010
|
-
] }),
|
|
1011
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1012
|
-
import_react_bootstrap.Col,
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { className: "fileListUnorderedList", "aria-label": "Valideringsfelmeddelanden f\xF6r uppladdade filer", children: [
|
|
1071
|
+
" ",
|
|
1072
|
+
errorMessageAddingFile.map((errorObj, index) => {
|
|
1073
|
+
const errorFileName = errorObj.FileName;
|
|
1074
|
+
let mobileFirstFileName = errorObj.FileName.split(".").shift();
|
|
1075
|
+
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
1076
|
+
const fileType = errorObj.FileName.split(".").pop();
|
|
1077
|
+
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
1078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react6.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "fileInListContainer", role: "alert", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "fileInList", children: [
|
|
1079
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap.Row, { children: [
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { style: { maxWidth: "30px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1081
|
+
"span",
|
|
1013
1082
|
{
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
},
|
|
1018
|
-
className: "errorMessageAddingFile",
|
|
1019
|
-
...activatedLanguage === "sv" ? {
|
|
1020
|
-
"aria-label": `${errorFileName} ${errorObj.svMessage}`
|
|
1021
|
-
} : {
|
|
1022
|
-
"aria-label": `${errorFileName} ${errorObj.enMessage}`
|
|
1023
|
-
},
|
|
1024
|
-
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
1083
|
+
"aria-hidden": "true",
|
|
1084
|
+
className: (0, import_clsx4.default)("uploadedDot", "uploadFailed"),
|
|
1085
|
+
children: "!"
|
|
1025
1086
|
}
|
|
1026
1087
|
) }),
|
|
1027
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1088
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { children: windowWidth < 768 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "desktopFileName", children: errorObj.FileName }) }),
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1090
|
+
"button",
|
|
1091
|
+
{
|
|
1092
|
+
className: "selectedFilesLinkButton",
|
|
1093
|
+
onClick: () => {
|
|
1094
|
+
removeError(index);
|
|
1095
|
+
},
|
|
1096
|
+
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet f\xF6r ${errorFileName}` : `Close error message for ${errorFileName}`,
|
|
1097
|
+
children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
|
|
1098
|
+
}
|
|
1099
|
+
) })
|
|
1100
|
+
] }),
|
|
1101
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1102
|
+
import_react_bootstrap.Col,
|
|
1103
|
+
{
|
|
1104
|
+
style: {
|
|
1105
|
+
width: "100%",
|
|
1106
|
+
color: "#8e0039"
|
|
1107
|
+
},
|
|
1108
|
+
className: "errorMessageAddingFile",
|
|
1109
|
+
...activatedLanguage === "sv" ? {
|
|
1110
|
+
"aria-label": `${errorFileName} ${errorObj.svMessage}`
|
|
1111
|
+
} : {
|
|
1112
|
+
"aria-label": `${errorFileName} ${errorObj.enMessage}`
|
|
1113
|
+
},
|
|
1114
|
+
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
1115
|
+
}
|
|
1116
|
+
) }),
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "makeSpace" }) })
|
|
1118
|
+
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
1119
|
+
})
|
|
1120
|
+
] }) }),
|
|
1121
|
+
questionObject.Files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.Files.map((file, index) => {
|
|
1037
1122
|
const indicatorfileName = file.FileName;
|
|
1038
1123
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
1039
1124
|
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
@@ -1064,12 +1149,13 @@ var SelectedFiles = ({
|
|
|
1064
1149
|
mobileFirstFileName,
|
|
1065
1150
|
" (",
|
|
1066
1151
|
Math.ceil(file.FileSize / (1024 * 1024)),
|
|
1067
|
-
" "
|
|
1068
|
-
"MB)"
|
|
1152
|
+
" MB)"
|
|
1069
1153
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "desktopFileName", children: [
|
|
1070
1154
|
file.FileName,
|
|
1071
1155
|
" (",
|
|
1072
|
-
file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
|
|
1156
|
+
file.FileSize < 1024 * 1024 ? `${Math.round(file.FileSize / 1024)} kB` : `${(file.FileSize / (1024 * 1024)).toFixed(
|
|
1157
|
+
1
|
|
1158
|
+
)} MB`,
|
|
1073
1159
|
")"
|
|
1074
1160
|
] }) }),
|
|
1075
1161
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Col, { className: "lastCol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1263,6 +1349,7 @@ var AddFiles = ({
|
|
|
1263
1349
|
};
|
|
1264
1350
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1265
1351
|
!showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { role: "group", children: [
|
|
1352
|
+
!questionObject.hideQuestion && questionObject.questionLabel,
|
|
1266
1353
|
questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1267
1354
|
"p",
|
|
1268
1355
|
{
|
|
@@ -1282,8 +1369,14 @@ var AddFiles = ({
|
|
|
1282
1369
|
),
|
|
1283
1370
|
questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "error addfileserror", id: errorId, children: [
|
|
1284
1371
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1285
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1286
|
-
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1373
|
+
"span",
|
|
1374
|
+
{
|
|
1375
|
+
"aria-label": `Felmeddelande. ${questionObject.validationDefaultMessesege}`,
|
|
1376
|
+
className: "errorText",
|
|
1377
|
+
children: questionObject.validationDefaultMessesege
|
|
1378
|
+
}
|
|
1379
|
+
)
|
|
1287
1380
|
] }),
|
|
1288
1381
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1289
1382
|
ExploreFilesStandard_default,
|
|
@@ -1312,8 +1405,7 @@ var AddFiles = ({
|
|
|
1312
1405
|
errorMessageAddingFile,
|
|
1313
1406
|
activatedLanguage,
|
|
1314
1407
|
numberOfFiles,
|
|
1315
|
-
setNumberOfFiles
|
|
1316
|
-
removeUploadErrors: handleRemoveErrors
|
|
1408
|
+
setNumberOfFiles
|
|
1317
1409
|
}
|
|
1318
1410
|
)
|
|
1319
1411
|
] }) }),
|