optimized-react-component-library-xyz123 0.1.86 → 0.1.88
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.js +74 -79
- package/dist/index.mjs +74 -79
- package/package.json +1 -1
- package/src/css/styles.css +17 -9
package/dist/index.js
CHANGED
|
@@ -758,12 +758,12 @@ var FilesUploadStandard_default = FilesUpload;
|
|
|
758
758
|
|
|
759
759
|
// src/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.tsx
|
|
760
760
|
var import_react7 = require("react");
|
|
761
|
-
var
|
|
761
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
762
762
|
|
|
763
763
|
// src/NewInputComponentStandard/AddFilesStandard/DropFilesStandard.tsx
|
|
764
764
|
var import_react_dropzone = require("react-dropzone");
|
|
765
765
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
766
|
-
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r" }) => {
|
|
766
|
+
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
|
|
767
767
|
const onDrop = FilesSelected;
|
|
768
768
|
const { getRootProps, getInputProps, isDragActive } = (0, import_react_dropzone.useDropzone)({ onDrop, noKeyboard: true });
|
|
769
769
|
const handleFileExplorer = (event) => {
|
|
@@ -784,34 +784,22 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
784
784
|
}
|
|
785
785
|
)
|
|
786
786
|
] }),
|
|
787
|
-
isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "dropFilesNowText", children: "Sl\xE4pp filerna, nu ...!" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
788
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
787
|
+
isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { className: "dropFilesNowText", children: language === "sv" ? "Sl\xE4pp filerna, nu ...!" : "Drop files here!" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
788
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
789
789
|
"svg",
|
|
790
790
|
{
|
|
791
|
-
"aria-hidden": "true",
|
|
792
791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
793
|
-
width: "
|
|
794
|
-
height: "
|
|
795
|
-
viewBox: "0 0
|
|
796
|
-
fill: "
|
|
797
|
-
children:
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
) }),
|
|
805
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("clipPath", { id: "clip0_247_596", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
806
|
-
"rect",
|
|
807
|
-
{
|
|
808
|
-
width: "72",
|
|
809
|
-
height: "47.1064",
|
|
810
|
-
fill: "white",
|
|
811
|
-
transform: "translate(0 0.446777)"
|
|
812
|
-
}
|
|
813
|
-
) }) })
|
|
814
|
-
]
|
|
792
|
+
width: "2.4rem",
|
|
793
|
+
height: "2.4rem",
|
|
794
|
+
viewBox: "0 0 7 15",
|
|
795
|
+
fill: "#fff",
|
|
796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
797
|
+
"path",
|
|
798
|
+
{
|
|
799
|
+
d: "M0 2.5C0 1.83696 0.263392 1.20107 0.732233 0.732233C1.20107 0.263392 1.83696 0 2.5 0C3.16304 0 3.79893 0.263392 4.26777 0.732233C4.73661 1.20107 5 1.83696 5 2.5V11.5C5 11.8978 4.84196 12.2794 4.56066 12.5607C4.27936 12.842 3.89782 13 3.5 13C3.10218 13 2.72064 12.842 2.43934 12.5607C2.15804 12.2794 2 11.8978 2 11.5V4.5C2 4.36739 2.05268 4.24021 2.14645 4.14645C2.24021 4.05268 2.36739 4 2.5 4C2.63261 4 2.75979 4.05268 2.85355 4.14645C2.94732 4.24021 3 4.36739 3 4.5V11.5C3 11.6326 3.05268 11.7598 3.14645 11.8536C3.24021 11.9473 3.36739 12 3.5 12C3.63261 12 3.75979 11.9473 3.85355 11.8536C3.94732 11.7598 4 11.6326 4 11.5V2.5C4 2.30302 3.9612 2.10796 3.88582 1.92597C3.81044 1.74399 3.69995 1.57863 3.56066 1.43934C3.42137 1.30005 3.25601 1.18956 3.07403 1.11418C2.89204 1.0388 2.69698 1 2.5 1C2.30302 1 2.10796 1.0388 1.92597 1.11418C1.74399 1.18956 1.57863 1.30005 1.43934 1.43934C1.30005 1.57863 1.18956 1.74399 1.11418 1.92597C1.0388 2.10796 1 2.30302 1 2.5V11.5C1 12.163 1.26339 12.7989 1.73223 13.2678C2.20107 13.7366 2.83696 14 3.5 14C4.16304 14 4.79893 13.7366 5.26777 13.2678C5.73661 12.7989 6 12.163 6 11.5V4.5C6 4.36739 6.05268 4.24021 6.14645 4.14645C6.24021 4.05268 6.36739 4 6.5 4C6.63261 4 6.75979 4.05268 6.85355 4.14645C6.94732 4.24021 7 4.36739 7 4.5V11.5C7 12.4283 6.63125 13.3185 5.97487 13.9749C5.3185 14.6313 4.42826 15 3.5 15C2.57174 15 1.6815 14.6313 1.02513 13.9749C0.368749 13.3185 0 12.4283 0 11.5V2.5Z",
|
|
800
|
+
fill: "#fff"
|
|
801
|
+
}
|
|
802
|
+
)
|
|
815
803
|
}
|
|
816
804
|
),
|
|
817
805
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dropFilesText", children: DropFilesText })
|
|
@@ -947,7 +935,6 @@ var Indicator = (filename) => {
|
|
|
947
935
|
var IndicatorStandard_default = Indicator;
|
|
948
936
|
|
|
949
937
|
// src/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.tsx
|
|
950
|
-
var import_clsx4 = __toESM(require("clsx"));
|
|
951
938
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
952
939
|
var SelectedFiles = ({
|
|
953
940
|
questionObject,
|
|
@@ -989,53 +976,58 @@ var SelectedFiles = ({
|
|
|
989
976
|
};
|
|
990
977
|
const windowWidth = useWindowWidth();
|
|
991
978
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
992
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
},
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pts-errorSummary-container", children: [
|
|
980
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
981
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
982
|
+
"ul",
|
|
983
|
+
{
|
|
984
|
+
"aria-hidden": true,
|
|
985
|
+
className: "fileListUnorderedList",
|
|
986
|
+
id: "errorSummary-ul",
|
|
987
|
+
children: [
|
|
988
|
+
" ",
|
|
989
|
+
errorMessageAddingFile.map((errorObj, index) => {
|
|
990
|
+
const errorFileName = errorObj.FileName;
|
|
991
|
+
let mobileFirstFileName = errorObj.FileName.split(".").shift();
|
|
992
|
+
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
993
|
+
const fileType = errorObj.FileName.split(".").pop();
|
|
994
|
+
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
995
|
+
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", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "fileInList", children: [
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__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 }) }) }),
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap.Row, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
998
|
+
import_react_bootstrap.Col,
|
|
999
|
+
{
|
|
1000
|
+
style: {
|
|
1001
|
+
width: "100%",
|
|
1002
|
+
color: "#8e0039"
|
|
1003
|
+
},
|
|
1004
|
+
className: "errorMessageAddingFile",
|
|
1005
|
+
...activatedLanguage === "sv" ? {
|
|
1006
|
+
"aria-label": `${errorFileName} ${errorObj.svMessage}`
|
|
1007
|
+
} : {
|
|
1008
|
+
"aria-label": `${errorFileName} ${errorObj.enMessage}`
|
|
1009
|
+
},
|
|
1010
|
+
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
1011
|
+
}
|
|
1012
|
+
) }),
|
|
1013
|
+
/* @__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" }) })
|
|
1014
|
+
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
1015
|
+
})
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
) }),
|
|
1019
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "addFile-error-close-button", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1020
|
+
"button",
|
|
1021
|
+
{
|
|
1022
|
+
className: "selectedFilesLinkButton error-close",
|
|
1023
|
+
onClick: () => {
|
|
1024
|
+
removeError();
|
|
1025
|
+
},
|
|
1026
|
+
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet` : `Close error message`,
|
|
1027
|
+
children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
|
|
1028
|
+
}
|
|
1029
|
+
) })
|
|
1030
|
+
] }) }),
|
|
1039
1031
|
questionObject.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
1040
1032
|
const indicatorfileName = file.FileName;
|
|
1041
1033
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
@@ -1257,10 +1249,13 @@ var AddFiles = ({
|
|
|
1257
1249
|
const removeFileFromNumberOfFiles = (newCount) => {
|
|
1258
1250
|
setNumberOfFiles(newCount);
|
|
1259
1251
|
};
|
|
1260
|
-
const
|
|
1252
|
+
const removeOneError = (errorIndex) => {
|
|
1261
1253
|
let newErrors = errorMessageAddingFile.filter((e, index) => index !== errorIndex);
|
|
1262
1254
|
setErrorMessageAddingFile(newErrors);
|
|
1263
1255
|
};
|
|
1256
|
+
const removeError = () => {
|
|
1257
|
+
setErrorMessageAddingFile([]);
|
|
1258
|
+
};
|
|
1264
1259
|
const handleRemoveErrors = () => {
|
|
1265
1260
|
setErrorMessageAddingFile([]);
|
|
1266
1261
|
};
|
|
@@ -1270,7 +1265,7 @@ var AddFiles = ({
|
|
|
1270
1265
|
"p",
|
|
1271
1266
|
{
|
|
1272
1267
|
id: aboutId,
|
|
1273
|
-
className: (0,
|
|
1268
|
+
className: (0, import_clsx4.default)(
|
|
1274
1269
|
"addFilesMandatory",
|
|
1275
1270
|
questionObject.hasValidationError ? " error" : ""
|
|
1276
1271
|
),
|
|
@@ -1304,7 +1299,7 @@ var AddFiles = ({
|
|
|
1304
1299
|
removeUploadErrors: handleRemoveErrors
|
|
1305
1300
|
}
|
|
1306
1301
|
),
|
|
1307
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DropFilesStandard_default, { FilesSelected: onDrop, DropFilesText: dropFilesText }),
|
|
1302
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DropFilesStandard_default, { FilesSelected: onDrop, DropFilesText: dropFilesText, language: activatedLanguage }),
|
|
1308
1303
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1309
1304
|
SelectedFilesStandard_default,
|
|
1310
1305
|
{
|
|
@@ -1649,7 +1644,7 @@ var RenderQuestionGroup = ({
|
|
|
1649
1644
|
"aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
|
|
1650
1645
|
children: [
|
|
1651
1646
|
legend && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("legend", { children: [
|
|
1652
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: legend }),
|
|
1647
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "pts-legend", children: legend }),
|
|
1653
1648
|
questionArray[0].hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "sr-only", children: [
|
|
1654
1649
|
"Valideringsfel. ",
|
|
1655
1650
|
questionArray[0].validationDefaultMessesege
|
package/dist/index.mjs
CHANGED
|
@@ -693,12 +693,12 @@ var FilesUploadStandard_default = FilesUpload;
|
|
|
693
693
|
|
|
694
694
|
// src/NewInputComponentStandard/AddFilesStandard/AddFilesStandard.tsx
|
|
695
695
|
import { useCallback, useEffect as useEffect5, useState as useState5 } from "react";
|
|
696
|
-
import
|
|
696
|
+
import clsx4 from "clsx";
|
|
697
697
|
|
|
698
698
|
// src/NewInputComponentStandard/AddFilesStandard/DropFilesStandard.tsx
|
|
699
699
|
import { useDropzone } from "react-dropzone";
|
|
700
700
|
import { Fragment as Fragment6, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
701
|
-
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r" }) => {
|
|
701
|
+
var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h\xE4r", language }) => {
|
|
702
702
|
const onDrop = FilesSelected;
|
|
703
703
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop, noKeyboard: true });
|
|
704
704
|
const handleFileExplorer = (event) => {
|
|
@@ -719,34 +719,22 @@ var DropFiles = ({ FilesSelected, DropFilesText = "Dra och sl\xE4pp dina filer h
|
|
|
719
719
|
}
|
|
720
720
|
)
|
|
721
721
|
] }),
|
|
722
|
-
isDragActive ? /* @__PURE__ */ jsx6("b", { className: "dropFilesNowText", children: "Sl\xE4pp filerna, nu ...!" }) : /* @__PURE__ */ jsxs6(Fragment6, { children: [
|
|
723
|
-
/* @__PURE__ */
|
|
722
|
+
isDragActive ? /* @__PURE__ */ jsx6("b", { className: "dropFilesNowText", children: language === "sv" ? "Sl\xE4pp filerna, nu ...!" : "Drop files here!" }) : /* @__PURE__ */ jsxs6(Fragment6, { children: [
|
|
723
|
+
/* @__PURE__ */ jsx6(
|
|
724
724
|
"svg",
|
|
725
725
|
{
|
|
726
|
-
"aria-hidden": "true",
|
|
727
726
|
xmlns: "http://www.w3.org/2000/svg",
|
|
728
|
-
width: "
|
|
729
|
-
height: "
|
|
730
|
-
viewBox: "0 0
|
|
731
|
-
fill: "
|
|
732
|
-
children:
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
) }),
|
|
740
|
-
/* @__PURE__ */ jsx6("defs", { children: /* @__PURE__ */ jsx6("clipPath", { id: "clip0_247_596", children: /* @__PURE__ */ jsx6(
|
|
741
|
-
"rect",
|
|
742
|
-
{
|
|
743
|
-
width: "72",
|
|
744
|
-
height: "47.1064",
|
|
745
|
-
fill: "white",
|
|
746
|
-
transform: "translate(0 0.446777)"
|
|
747
|
-
}
|
|
748
|
-
) }) })
|
|
749
|
-
]
|
|
727
|
+
width: "2.4rem",
|
|
728
|
+
height: "2.4rem",
|
|
729
|
+
viewBox: "0 0 7 15",
|
|
730
|
+
fill: "#fff",
|
|
731
|
+
children: /* @__PURE__ */ jsx6(
|
|
732
|
+
"path",
|
|
733
|
+
{
|
|
734
|
+
d: "M0 2.5C0 1.83696 0.263392 1.20107 0.732233 0.732233C1.20107 0.263392 1.83696 0 2.5 0C3.16304 0 3.79893 0.263392 4.26777 0.732233C4.73661 1.20107 5 1.83696 5 2.5V11.5C5 11.8978 4.84196 12.2794 4.56066 12.5607C4.27936 12.842 3.89782 13 3.5 13C3.10218 13 2.72064 12.842 2.43934 12.5607C2.15804 12.2794 2 11.8978 2 11.5V4.5C2 4.36739 2.05268 4.24021 2.14645 4.14645C2.24021 4.05268 2.36739 4 2.5 4C2.63261 4 2.75979 4.05268 2.85355 4.14645C2.94732 4.24021 3 4.36739 3 4.5V11.5C3 11.6326 3.05268 11.7598 3.14645 11.8536C3.24021 11.9473 3.36739 12 3.5 12C3.63261 12 3.75979 11.9473 3.85355 11.8536C3.94732 11.7598 4 11.6326 4 11.5V2.5C4 2.30302 3.9612 2.10796 3.88582 1.92597C3.81044 1.74399 3.69995 1.57863 3.56066 1.43934C3.42137 1.30005 3.25601 1.18956 3.07403 1.11418C2.89204 1.0388 2.69698 1 2.5 1C2.30302 1 2.10796 1.0388 1.92597 1.11418C1.74399 1.18956 1.57863 1.30005 1.43934 1.43934C1.30005 1.57863 1.18956 1.74399 1.11418 1.92597C1.0388 2.10796 1 2.30302 1 2.5V11.5C1 12.163 1.26339 12.7989 1.73223 13.2678C2.20107 13.7366 2.83696 14 3.5 14C4.16304 14 4.79893 13.7366 5.26777 13.2678C5.73661 12.7989 6 12.163 6 11.5V4.5C6 4.36739 6.05268 4.24021 6.14645 4.14645C6.24021 4.05268 6.36739 4 6.5 4C6.63261 4 6.75979 4.05268 6.85355 4.14645C6.94732 4.24021 7 4.36739 7 4.5V11.5C7 12.4283 6.63125 13.3185 5.97487 13.9749C5.3185 14.6313 4.42826 15 3.5 15C2.57174 15 1.6815 14.6313 1.02513 13.9749C0.368749 13.3185 0 12.4283 0 11.5V2.5Z",
|
|
735
|
+
fill: "#fff"
|
|
736
|
+
}
|
|
737
|
+
)
|
|
750
738
|
}
|
|
751
739
|
),
|
|
752
740
|
/* @__PURE__ */ jsx6("p", { className: "dropFilesText", children: DropFilesText })
|
|
@@ -882,7 +870,6 @@ var Indicator = (filename) => {
|
|
|
882
870
|
var IndicatorStandard_default = Indicator;
|
|
883
871
|
|
|
884
872
|
// src/NewInputComponentStandard/AddFilesStandard/SelectedFilesStandard.tsx
|
|
885
|
-
import clsx4 from "clsx";
|
|
886
873
|
import { Fragment as Fragment10, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
887
874
|
var SelectedFiles = ({
|
|
888
875
|
questionObject,
|
|
@@ -924,53 +911,58 @@ var SelectedFiles = ({
|
|
|
924
911
|
};
|
|
925
912
|
const windowWidth = useWindowWidth();
|
|
926
913
|
return /* @__PURE__ */ jsxs8(Fragment10, { children: [
|
|
927
|
-
/* @__PURE__ */ jsxs8("div", { children: [
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
},
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
914
|
+
/* @__PURE__ */ jsx10("div", { children: errorMessageAddingFile.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "pts-errorSummary-container", children: [
|
|
915
|
+
/* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "errorDot", children: "!" }),
|
|
916
|
+
/* @__PURE__ */ jsx10("div", { className: "addFile-error-list-container", children: /* @__PURE__ */ jsxs8(
|
|
917
|
+
"ul",
|
|
918
|
+
{
|
|
919
|
+
"aria-hidden": true,
|
|
920
|
+
className: "fileListUnorderedList",
|
|
921
|
+
id: "errorSummary-ul",
|
|
922
|
+
children: [
|
|
923
|
+
" ",
|
|
924
|
+
errorMessageAddingFile.map((errorObj, index) => {
|
|
925
|
+
const errorFileName = errorObj.FileName;
|
|
926
|
+
let mobileFirstFileName = errorObj.FileName.split(".").shift();
|
|
927
|
+
mobileFirstFileName = mobileFirstFileName.length > 8 ? mobileFirstFileName.substring(0, 8) + ".." : mobileFirstFileName;
|
|
928
|
+
const fileType = errorObj.FileName.split(".").pop();
|
|
929
|
+
mobileFirstFileName = mobileFirstFileName + "." + fileType;
|
|
930
|
+
return /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(React5.Fragment, { children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("div", { className: "fileInListContainer", children: /* @__PURE__ */ jsxs8("div", { className: "fileInList", children: [
|
|
931
|
+
/* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(Col, { children: windowWidth < 768 ? /* @__PURE__ */ jsx10("span", { className: "mobileFirstFileName", children: mobileFirstFileName }) : /* @__PURE__ */ jsx10("span", { className: "desktopFileName", children: errorObj.FileName }) }) }),
|
|
932
|
+
/* @__PURE__ */ jsx10(Row, { children: /* @__PURE__ */ jsx10(
|
|
933
|
+
Col,
|
|
934
|
+
{
|
|
935
|
+
style: {
|
|
936
|
+
width: "100%",
|
|
937
|
+
color: "#8e0039"
|
|
938
|
+
},
|
|
939
|
+
className: "errorMessageAddingFile",
|
|
940
|
+
...activatedLanguage === "sv" ? {
|
|
941
|
+
"aria-label": `${errorFileName} ${errorObj.svMessage}`
|
|
942
|
+
} : {
|
|
943
|
+
"aria-label": `${errorFileName} ${errorObj.enMessage}`
|
|
944
|
+
},
|
|
945
|
+
children: activatedLanguage === "sv" ? errorObj.svMessage : errorObj.enMessage
|
|
946
|
+
}
|
|
947
|
+
) }),
|
|
948
|
+
/* @__PURE__ */ jsx10(Row, { style: { marginTop: "12px", marginBottom: "12px" }, children: /* @__PURE__ */ jsx10(Col, { className: "makeSpace" }) })
|
|
949
|
+
] }, index) }) }) }, `error-${errorObj.FileName}-${index}`) });
|
|
950
|
+
})
|
|
951
|
+
]
|
|
952
|
+
}
|
|
953
|
+
) }),
|
|
954
|
+
/* @__PURE__ */ jsx10("div", { className: "addFile-error-close-button", children: /* @__PURE__ */ jsx10(
|
|
955
|
+
"button",
|
|
956
|
+
{
|
|
957
|
+
className: "selectedFilesLinkButton error-close",
|
|
958
|
+
onClick: () => {
|
|
959
|
+
removeError();
|
|
960
|
+
},
|
|
961
|
+
"aria-label": activatedLanguage === "sv" ? `St\xE4ng felmeddelandet` : `Close error message`,
|
|
962
|
+
children: activatedLanguage === "sv" ? "St\xE4ng" : "Close"
|
|
963
|
+
}
|
|
964
|
+
) })
|
|
965
|
+
] }) }),
|
|
974
966
|
questionObject.files.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "fileListUnorderedList", "aria-label": "Uppladdade filer", children: questionObject.files.map((file, index) => {
|
|
975
967
|
const indicatorfileName = file.FileName;
|
|
976
968
|
let mobileFirstFileName = file.FileName.split(".").shift();
|
|
@@ -1192,10 +1184,13 @@ var AddFiles = ({
|
|
|
1192
1184
|
const removeFileFromNumberOfFiles = (newCount) => {
|
|
1193
1185
|
setNumberOfFiles(newCount);
|
|
1194
1186
|
};
|
|
1195
|
-
const
|
|
1187
|
+
const removeOneError = (errorIndex) => {
|
|
1196
1188
|
let newErrors = errorMessageAddingFile.filter((e, index) => index !== errorIndex);
|
|
1197
1189
|
setErrorMessageAddingFile(newErrors);
|
|
1198
1190
|
};
|
|
1191
|
+
const removeError = () => {
|
|
1192
|
+
setErrorMessageAddingFile([]);
|
|
1193
|
+
};
|
|
1199
1194
|
const handleRemoveErrors = () => {
|
|
1200
1195
|
setErrorMessageAddingFile([]);
|
|
1201
1196
|
};
|
|
@@ -1205,7 +1200,7 @@ var AddFiles = ({
|
|
|
1205
1200
|
"p",
|
|
1206
1201
|
{
|
|
1207
1202
|
id: aboutId,
|
|
1208
|
-
className:
|
|
1203
|
+
className: clsx4(
|
|
1209
1204
|
"addFilesMandatory",
|
|
1210
1205
|
questionObject.hasValidationError ? " error" : ""
|
|
1211
1206
|
),
|
|
@@ -1239,7 +1234,7 @@ var AddFiles = ({
|
|
|
1239
1234
|
removeUploadErrors: handleRemoveErrors
|
|
1240
1235
|
}
|
|
1241
1236
|
),
|
|
1242
|
-
/* @__PURE__ */ jsx11(DropFilesStandard_default, { FilesSelected: onDrop, DropFilesText: dropFilesText }),
|
|
1237
|
+
/* @__PURE__ */ jsx11(DropFilesStandard_default, { FilesSelected: onDrop, DropFilesText: dropFilesText, language: activatedLanguage }),
|
|
1243
1238
|
/* @__PURE__ */ jsx11(
|
|
1244
1239
|
SelectedFilesStandard_default,
|
|
1245
1240
|
{
|
|
@@ -1584,7 +1579,7 @@ var RenderQuestionGroup = ({
|
|
|
1584
1579
|
"aria-describedby": questionArray[0].hasValidationError ? `${questionArray[0].id}-error` : void 0,
|
|
1585
1580
|
children: [
|
|
1586
1581
|
legend && /* @__PURE__ */ jsxs11("legend", { children: [
|
|
1587
|
-
/* @__PURE__ */ jsx13("span", { children: legend }),
|
|
1582
|
+
/* @__PURE__ */ jsx13("span", { className: "pts-legend", children: legend }),
|
|
1588
1583
|
questionArray[0].hasValidationError && /* @__PURE__ */ jsxs11("span", { className: "sr-only", children: [
|
|
1589
1584
|
"Valideringsfel. ",
|
|
1590
1585
|
questionArray[0].validationDefaultMessesege
|
package/package.json
CHANGED
package/src/css/styles.css
CHANGED
|
@@ -155,15 +155,6 @@ fieldset {
|
|
|
155
155
|
margin-bottom: 3.6rem;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
.pts-root-question legend {
|
|
159
|
-
font-family: Arial;
|
|
160
|
-
font-size: 1.6rem;
|
|
161
|
-
font-style: normal;
|
|
162
|
-
font-weight: 400;
|
|
163
|
-
line-height: 20px;
|
|
164
|
-
margin-bottom: 0.8rem;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
158
|
.pts-root-question legend,
|
|
168
159
|
.pts-root-question label,
|
|
169
160
|
.pts-radio-option {
|
|
@@ -172,6 +163,14 @@ fieldset {
|
|
|
172
163
|
cursor: pointer;
|
|
173
164
|
margin-bottom: 0.6rem;
|
|
174
165
|
}
|
|
166
|
+
.pts-root-question legend {
|
|
167
|
+
font-family: Arial;
|
|
168
|
+
font-size: 1.6rem;
|
|
169
|
+
font-style: normal;
|
|
170
|
+
font-weight: 400;
|
|
171
|
+
line-height: 20px;
|
|
172
|
+
margin: 0.8rem 0 0.8rem 0;
|
|
173
|
+
}
|
|
175
174
|
|
|
176
175
|
.pts-root-about {
|
|
177
176
|
font-size: 1.4rem;
|
|
@@ -1498,6 +1497,13 @@ dd {
|
|
|
1498
1497
|
opacity: 0.9;
|
|
1499
1498
|
cursor: copy;
|
|
1500
1499
|
}
|
|
1500
|
+
|
|
1501
|
+
.DropZone svg{
|
|
1502
|
+
border-radius: 50%;
|
|
1503
|
+
background: var(--purple-purple-900-primary, #6E3282);
|
|
1504
|
+
border: 2px solid #6E3282;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1501
1507
|
.ClipboardLink {
|
|
1502
1508
|
display: block;
|
|
1503
1509
|
position: relative;
|
|
@@ -1511,6 +1517,8 @@ dd {
|
|
|
1511
1517
|
cursor: pointer;
|
|
1512
1518
|
}
|
|
1513
1519
|
|
|
1520
|
+
|
|
1521
|
+
|
|
1514
1522
|
/* SelectedFiles.tsx */
|
|
1515
1523
|
|
|
1516
1524
|
.makeTopSpace {
|