diff --git a/package-lock.json b/package-lock.json index 45d9e13..54c2333 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ilb/uniformscomponents", - "version": "1.0.49", + "version": "1.0.50", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ilb/uniformscomponents", - "version": "1.0.49", + "version": "1.0.50", "license": "ISC", "dependencies": { "@babel/eslint-parser": "^7.17.0", @@ -924,6 +924,7 @@ "jest-resolve": "^26.6.2", "jest-util": "^26.6.2", "jest-worker": "^26.6.2", + "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", @@ -3423,7 +3424,8 @@ "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1" + "optionator": "^0.8.1", + "source-map": "~0.6.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -5829,6 +5831,7 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", + "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -7356,6 +7359,10 @@ "@next/polyfill-module": "11.1.2", "@next/react-dev-overlay": "11.1.2", "@next/react-refresh-utils": "11.1.2", + "@next/swc-darwin-arm64": "11.1.2", + "@next/swc-darwin-x64": "11.1.2", + "@next/swc-linux-x64-gnu": "11.1.2", + "@next/swc-win32-x64-msvc": "11.1.2", "@node-rs/helper": "1.2.1", "assert": "2.0.0", "ast-types": "0.13.2", @@ -7475,6 +7482,7 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", diff --git a/pages/AppForm.js b/pages/AppForm.js index 19507cf..e644467 100644 --- a/pages/AppForm.js +++ b/pages/AppForm.js @@ -2,6 +2,7 @@ import React from 'react'; import { AutoForm } from 'uniforms-semantic'; import { createSchemaBridge } from '../src'; import { CustomAutoField } from '../src'; +import Validator from "../src/utils/Validator"; export default function AppForm() { function onSubmit(data) { @@ -144,7 +145,7 @@ export default function AppForm() { return ( { + const error = []; + + if (!model?.firstName) { + error.push({ + dataPath: '.firstName', + message: 'Неверный firstName' + }); + } + console.log(error); + return error; +}; +export default Validator; diff --git a/src/utils/registerAjvKeywords.js b/src/utils/registerAjvKeywords.js index 9ba83cb..3d8fae2 100644 --- a/src/utils/registerAjvKeywords.js +++ b/src/utils/registerAjvKeywords.js @@ -28,7 +28,6 @@ export default (ajv) => { params: { keyword: 'maskedNumberLength' } } ]; - const numsLength = data.replace(/\D/g, '').length; return typeof data === 'string' && (numsLength === 0 || numsLength === length);