@dmitryvim/form-builder 0.2.2 → 0.2.3
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/browser/formbuilder.min.js +21 -21
- package/dist/browser/{formbuilder.v0.2.2.min.js → formbuilder.v0.2.3.min.js} +21 -21
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/form-builder.js +21 -21
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2064,6 +2064,7 @@ function renderMultipleFileElement(element, ctx, wrapper, pathKey) {
|
|
|
2064
2064
|
function validateFileElement(element, key, context) {
|
|
2065
2065
|
const errors = [];
|
|
2066
2066
|
const { scopeRoot, skipValidation, path } = context;
|
|
2067
|
+
const isMultipleField = element.type === "files" || "multiple" in element && Boolean(element.multiple);
|
|
2067
2068
|
const validateFileCount = (key2, resourceIds, element2) => {
|
|
2068
2069
|
if (skipValidation) return;
|
|
2069
2070
|
const minFiles = "minCount" in element2 ? element2.minCount ?? 0 : 0;
|
|
@@ -2078,7 +2079,7 @@ function validateFileElement(element, key, context) {
|
|
|
2078
2079
|
errors.push(`${key2}: maximum ${maxFiles} files allowed`);
|
|
2079
2080
|
}
|
|
2080
2081
|
};
|
|
2081
|
-
if (
|
|
2082
|
+
if (isMultipleField) {
|
|
2082
2083
|
const fullKey = pathJoin(path, key);
|
|
2083
2084
|
const pickerInput = scopeRoot.querySelector(
|
|
2084
2085
|
`input[type="file"][name="${fullKey}"]`
|