optimized-react-component-library-xyz123 0.21.1 → 0.22.1
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 +72 -63
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -63
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -705,7 +705,9 @@ var SelectedFiles = ({
|
|
|
705
705
|
let newFiles = questionObject.files.filter((f) => f !== file);
|
|
706
706
|
const newCountOfFiles = newFiles.length;
|
|
707
707
|
setNumberOfFiles(newCountOfFiles);
|
|
708
|
-
|
|
708
|
+
let e = { target: { value: `${newCountOfFiles} files`, files: newFiles } };
|
|
709
|
+
const targetValue = e.target.value === "0 files" ? "" : e.target.value;
|
|
710
|
+
e = { ...e, target: { ...e.target, value: targetValue } };
|
|
709
711
|
isTouched(e, questionObject);
|
|
710
712
|
removeFile(newCountOfFiles);
|
|
711
713
|
};
|
|
@@ -991,7 +993,7 @@ var AddFiles = ({
|
|
|
991
993
|
const currentFiles = questionObject.files ? questionObject.files : [];
|
|
992
994
|
const e = {
|
|
993
995
|
target: {
|
|
994
|
-
value: `${currentFiles.length + newFiles.length} files
|
|
996
|
+
value: currentFiles.length + newFiles.length > 0 ? `${currentFiles.length + newFiles.length} files` : "",
|
|
995
997
|
files: [...currentFiles, ...newFiles]
|
|
996
998
|
}
|
|
997
999
|
};
|
|
@@ -1014,68 +1016,75 @@ var AddFiles = ({
|
|
|
1014
1016
|
setErrorMessageAddingFile([]);
|
|
1015
1017
|
};
|
|
1016
1018
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1017
|
-
!showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1019
|
+
!showPreview && visible && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1020
|
+
"div",
|
|
1021
|
+
{
|
|
1022
|
+
className: "root-question addFile-question-container",
|
|
1023
|
+
id: `question-${questionObject.id}`,
|
|
1024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { role: "group", children: [
|
|
1025
|
+
questionObject.aboutText && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1026
|
+
"p",
|
|
1027
|
+
{
|
|
1028
|
+
id: aboutId,
|
|
1029
|
+
className: (0, import_clsx3.default)(
|
|
1030
|
+
"addFilesMandatory",
|
|
1031
|
+
questionObject.hasValidationError ? " error" : ""
|
|
1032
|
+
),
|
|
1033
|
+
children: [
|
|
1034
|
+
questionObject.aboutText,
|
|
1035
|
+
questionObject.isQuestionMandatory && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "pts-root-mandatoryAsterisk", "aria-label": "Obligatorisk fr\xE5ga", children: [
|
|
1036
|
+
" ",
|
|
1037
|
+
"*"
|
|
1038
|
+
] })
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1025
1041
|
),
|
|
1026
|
-
children: [
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
activatedLanguage,
|
|
1073
|
-
numberOfFiles,
|
|
1074
|
-
setNumberOfFiles,
|
|
1075
|
-
removeUploadErrors: handleRemoveErrors
|
|
1076
|
-
}
|
|
1077
|
-
)
|
|
1078
|
-
] }) }),
|
|
1042
|
+
questionObject.hasValidationError && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "pts-root-error error addfileserror", id: errorId, children: [
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": true, className: "errorDot", children: "!" }),
|
|
1044
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Valideringsfel" }),
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "errorText", children: questionObject.validationDefaultMessesege })
|
|
1046
|
+
] }),
|
|
1047
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1048
|
+
ExploreFilesStandard_default,
|
|
1049
|
+
{
|
|
1050
|
+
FilesSelected: onDrop,
|
|
1051
|
+
numberOfFiles,
|
|
1052
|
+
allowedNumberOfFiles,
|
|
1053
|
+
activatedLanguage,
|
|
1054
|
+
inputId,
|
|
1055
|
+
labelId,
|
|
1056
|
+
aboutId,
|
|
1057
|
+
errorId,
|
|
1058
|
+
questionObject,
|
|
1059
|
+
errorMessageAddingFile,
|
|
1060
|
+
removeUploadErrors: handleRemoveErrors
|
|
1061
|
+
}
|
|
1062
|
+
),
|
|
1063
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1064
|
+
DropFilesStandard_default,
|
|
1065
|
+
{
|
|
1066
|
+
FilesSelected: onDrop,
|
|
1067
|
+
DropFilesText: dropFilesText,
|
|
1068
|
+
language: activatedLanguage
|
|
1069
|
+
}
|
|
1070
|
+
),
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1072
|
+
SelectedFilesStandard_default,
|
|
1073
|
+
{
|
|
1074
|
+
questionObject,
|
|
1075
|
+
isTouched: handleQuestionInputChange,
|
|
1076
|
+
removeFile: removeFileFromNumberOfFiles,
|
|
1077
|
+
removeError,
|
|
1078
|
+
errorMessageAddingFile,
|
|
1079
|
+
activatedLanguage,
|
|
1080
|
+
numberOfFiles,
|
|
1081
|
+
setNumberOfFiles,
|
|
1082
|
+
removeUploadErrors: handleRemoveErrors
|
|
1083
|
+
}
|
|
1084
|
+
)
|
|
1085
|
+
] })
|
|
1086
|
+
}
|
|
1087
|
+
),
|
|
1079
1088
|
showPreview && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PreviewAddFiles, { activatedLanguage, questionObject })
|
|
1080
1089
|
] });
|
|
1081
1090
|
};
|