react-mui-form-validator
Advanced tools
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
+169
| import * as React$1 from 'react'; | ||
| import React__default from 'react'; | ||
| import { FilledTextFieldProps, OutlinedTextFieldProps, StandardTextFieldProps, BoxProps } from '@mui/material'; | ||
| import { MuiTelInputInfo } from 'mui-tel-input'; | ||
| interface required { | ||
| validator: "required"; | ||
| } | ||
| interface matchRegexp { | ||
| validator: "matchRegexp"; | ||
| regexp: RegExp | string; | ||
| } | ||
| interface isEmail { | ||
| validator: "isEmail"; | ||
| } | ||
| interface isEmpty { | ||
| validator: "isEmpty"; | ||
| } | ||
| interface trim { | ||
| validator: "trim"; | ||
| } | ||
| interface isNumber { | ||
| validator: "isNumber"; | ||
| } | ||
| interface isFloat { | ||
| validator: "isFloat"; | ||
| } | ||
| interface isPositive { | ||
| validator: "isPositive"; | ||
| } | ||
| interface maxNumber { | ||
| validator: "maxNumber"; | ||
| max: number; | ||
| } | ||
| interface minNumber { | ||
| validator: "minNumber"; | ||
| min: number; | ||
| } | ||
| interface maxFloat { | ||
| validator: "maxFloat"; | ||
| max: number; | ||
| } | ||
| interface minFloat { | ||
| validator: "minFloat"; | ||
| min: number; | ||
| } | ||
| interface isString { | ||
| validator: "isString"; | ||
| } | ||
| interface minStringLength { | ||
| validator: "minStringLength"; | ||
| min: number; | ||
| } | ||
| interface maxStringLength { | ||
| validator: "maxStringLength"; | ||
| max: number; | ||
| } | ||
| interface isFile { | ||
| validator: "isFile"; | ||
| } | ||
| interface maxFileSize { | ||
| validator: "maxFileSize"; | ||
| max: number; | ||
| } | ||
| interface allowedExtensions { | ||
| validator: "allowedExtensions"; | ||
| fileTypes: string; | ||
| } | ||
| type Validator = required | matchRegexp | isEmail | isEmpty | trim | isNumber | isFloat | isPositive | maxNumber | minNumber | maxFloat | minFloat | isString | minStringLength | maxStringLength | isFile | maxFileSize | allowedExtensions; | ||
| type ComponentProps = { | ||
| errorMessages?: string | string[]; | ||
| validators?: Validator[]; | ||
| value: any; | ||
| validatorListener?: (value: boolean) => void; | ||
| withRequiredValidator?: boolean; | ||
| containerProps?: object; | ||
| onChangeTel: (value: string, info: MuiTelInputInfo) => void; | ||
| }; | ||
| type ValidatorComponentProps = (FilledTextFieldProps | OutlinedTextFieldProps | StandardTextFieldProps) & ComponentProps; | ||
| interface ValidatorComponentState { | ||
| isValid?: boolean; | ||
| value: any; | ||
| errorMessages?: string | string[]; | ||
| validators?: Validator[]; | ||
| } | ||
| interface ValidatorFormProps { | ||
| children: React.ReactNode; | ||
| onSubmit: () => void; | ||
| instantValidate?: boolean; | ||
| onError?: (errors: any) => void; | ||
| debounceTime?: number; | ||
| } | ||
| declare class ValidatorForm extends React$1.Component<ValidatorFormProps & BoxProps> { | ||
| static getValidator: (validator: Validator, value: any, includeRequired: boolean) => boolean; | ||
| getFormHelpers: () => { | ||
| form: { | ||
| attachToForm: (component: any) => void; | ||
| detachFromForm: (component: any) => void; | ||
| instantValidate: boolean; | ||
| debounceTime: number; | ||
| }; | ||
| }; | ||
| instantValidate: boolean; | ||
| childs: any[]; | ||
| errors: any[]; | ||
| debounceTime: number; | ||
| attachToForm: (component: any) => void; | ||
| detachFromForm: (component: any) => void; | ||
| submit: (event: React$1.FormEvent<HTMLFormElement>) => void; | ||
| walk: (children: any[], dryRun?: boolean) => Promise<boolean>; | ||
| checkInput: (input: any, dryRun?: boolean) => Promise<boolean>; | ||
| validate: (input: any, includeRequired: boolean, dryRun?: boolean) => Promise<boolean>; | ||
| find: (collection: any[], fn: (item: any) => boolean) => any; | ||
| resetValidations: () => void; | ||
| isFormValid: (dryRun?: boolean) => Promise<boolean>; | ||
| render(): React$1.JSX.Element; | ||
| } | ||
| declare class ValidatorComponent extends React$1.Component<ValidatorComponentProps, ValidatorComponentState> { | ||
| renderValidatorComponent(): React$1.ReactNode; | ||
| validateDebounced: any; | ||
| form: any; | ||
| debounceTime: any; | ||
| getSnapshotBeforeUpdate(nextProps: ValidatorComponentProps, prevState: ValidatorComponentState): { | ||
| value: any; | ||
| validators: Validator[]; | ||
| errorMessages: string | string[]; | ||
| } | { | ||
| value: any; | ||
| validators?: undefined; | ||
| errorMessages?: undefined; | ||
| }; | ||
| state: { | ||
| isValid: boolean; | ||
| value: any; | ||
| errorMessages: string | string[] | undefined; | ||
| validators: Validator[] | undefined; | ||
| }; | ||
| componentDidMount(): void; | ||
| shouldComponentUpdate(nextProps: ValidatorComponentProps, nextState: ValidatorComponentState): boolean; | ||
| componentDidUpdate(prevProps: ValidatorComponentProps, prevState: ValidatorComponentState): void; | ||
| componentWillUnmount(): void; | ||
| getErrorMessage: () => string | boolean | string[]; | ||
| instantValidate: boolean; | ||
| invalid: number[]; | ||
| configure: () => void; | ||
| validate: (value: any, includeRequired?: boolean, dryRun?: boolean) => Promise<boolean>; | ||
| isValid: () => boolean; | ||
| makeInvalid: () => void; | ||
| makeValid: () => void; | ||
| renderComponent: (form: ValidatorForm) => React$1.ReactNode; | ||
| render(): React$1.JSX.Element; | ||
| } | ||
| declare class MuiSelect extends ValidatorComponent { | ||
| renderValidatorComponent(): React$1.JSX.Element; | ||
| } | ||
| declare class MuiTextField extends ValidatorComponent { | ||
| renderValidatorComponent(): React__default.JSX.Element; | ||
| } | ||
| declare class MuiTelInputDefault extends ValidatorComponent { | ||
| renderValidatorComponent(): React__default.JSX.Element; | ||
| } | ||
| export { ValidatorComponent as MuiComponent, ValidatorForm as MuiForm, MuiTelInputDefault as MuiPhoneNumber, MuiSelect, MuiTextField, type Validator as MuiValidator }; |
Sorry, the diff of this file is too big to display
+3
-13
| import * as React$1 from 'react'; | ||
| import React__default from 'react'; | ||
| import { FilledTextFieldProps, OutlinedTextFieldProps, StandardTextFieldProps, BoxProps } from '@mui/material'; | ||
| import { CountryCode, NumberType } from 'libphonenumber-js'; | ||
| import { MuiTelInputInfo } from 'mui-tel-input'; | ||
@@ -71,12 +71,2 @@ interface required { | ||
| type MuiTelInputReason = 'country' | 'input'; | ||
| interface MuiTelInputInfo { | ||
| countryCode: CountryCode | null; | ||
| countryCallingCode: string | null; | ||
| nationalNumber: string | null; | ||
| numberType: Exclude<NumberType, undefined> | null; | ||
| numberValue: string | null; | ||
| reason: MuiTelInputReason; | ||
| } | ||
| type ComponentProps = { | ||
@@ -89,3 +79,3 @@ errorMessages?: string | string[]; | ||
| containerProps?: object; | ||
| onChangeTel?: (value: string, info: MuiTelInputInfo) => void; | ||
| onChangeTel: (value: string, info: MuiTelInputInfo) => void; | ||
| }; | ||
@@ -181,2 +171,2 @@ type ValidatorComponentProps = (FilledTextFieldProps | OutlinedTextFieldProps | StandardTextFieldProps) & ComponentProps; | ||
| export { ValidatorComponent as MuiComponent, ValidatorForm as MuiForm, MuiTelInputDefault as MuiPhoneNumber, MuiSelect, MuiTextField, Validator as MuiValidator }; | ||
| export { ValidatorComponent as MuiComponent, ValidatorForm as MuiForm, MuiTelInputDefault as MuiPhoneNumber, MuiSelect, MuiTextField, type Validator as MuiValidator }; |
+36
-30
| { | ||
| "name": "react-mui-form-validator", | ||
| "version": "1.6.0", | ||
| "version": "1.7.0", | ||
| "description": "Validator for forms designed with material-ui components.", | ||
| "main": "lib/index.js", | ||
| "types": "lib/index.d.ts", | ||
| "type": "module", | ||
| "main": "./lib/index.cjs", | ||
| "module": "./lib/index.js", | ||
| "types": "./lib/index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./lib/index.d.ts", | ||
| "import": "./lib/index.js", | ||
| "require": "./lib/index.cjs" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "scripts": { | ||
| "prod": "rimraf ./lib && tsup src/index.ts --dts --outDir=lib", | ||
| "start": "react-scripts start", | ||
| "build": "rimraf ./lib && tsup src/index.ts src/cli.ts --dts --format esm,cjs --outDir=lib --sourcemap", | ||
| "test": "jest", | ||
@@ -22,3 +31,2 @@ "test:watch": "jest --watch" | ||
| "mui-validator", | ||
| "form-validator", | ||
| "validator", | ||
@@ -28,3 +36,2 @@ "validations", | ||
| "react-validator", | ||
| "react-mui-form-validator", | ||
| "react-form-validator" | ||
@@ -39,31 +46,30 @@ ], | ||
| "dependencies": { | ||
| "libphonenumber-js": "^1.10.49", | ||
| "react": "^18.2.0", | ||
| "react-dom": "^18.2.0", | ||
| "libphonenumber-js": "^1.12.35", | ||
| "react": "^19.2.4", | ||
| "react-dom": "^19.2.4", | ||
| "react-lifecycles-compat": "^3.0.4" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "^16.0.0 || ^17.0.0 || ^18.2.0", | ||
| "react-dom": "^16.0.0 || ^17.0.0 || ^18.2.0" | ||
| "react": "^16.0.0 || ^17.0.0 || ^18.3.1 || ^19.2.4 || 20.0.0", | ||
| "react-dom": "^16.0.0 || ^17.0.0 || ^18.3.1 || ^19.2.4 || 20.0.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/preset-env": "^7.23.3", | ||
| "@babel/preset-flow": "^7.23.3", | ||
| "@babel/preset-react": "^7.23.3", | ||
| "@jest/globals": "^29.7.0", | ||
| "@mui/material": "^5.14.17", | ||
| "@testing-library/react": "^14.1.0", | ||
| "@types/node": "^20.9.0", | ||
| "@types/react": "^18.2.37", | ||
| "@types/react-dom": "^18.2.15", | ||
| "@babel/preset-env": "^7.28.6", | ||
| "@babel/preset-flow": "^7.27.1", | ||
| "@babel/preset-react": "^7.28.5", | ||
| "@jest/globals": "^30.2.0", | ||
| "@mui/material": "^7.3.7", | ||
| "@testing-library/react": "^16.3.2", | ||
| "@types/node": "^25.0.10", | ||
| "@types/react": "^19.2.9", | ||
| "@types/react-dom": "^19.2.3", | ||
| "@types/react-lifecycles-compat": "^3.0.4", | ||
| "@types/react-test-renderer": "^18.0.6", | ||
| "babel-jest": "^29.7.0", | ||
| "jest": "^29.7.0", | ||
| "mui-tel-input": "4.0.1", | ||
| "react-scripts": "5.0.1", | ||
| "react-test-renderer": "^18.2.0", | ||
| "rimraf": "^5.0.5", | ||
| "tsup": "^7.2.0", | ||
| "typescript": "^4.9.5" | ||
| "@types/react-test-renderer": "^19.1.0", | ||
| "babel-jest": "^30.2.0", | ||
| "jest": "^30.2.0", | ||
| "mui-tel-input": "9.0.1", | ||
| "react-test-renderer": "^19.2.4", | ||
| "rimraf": "^6.1.2", | ||
| "tsup": "^8.5.1", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
@@ -70,0 +76,0 @@ "browserslist": { |
+1
-1
@@ -1,2 +0,2 @@ | ||
| ## Validation component for material-ui forms | ||
| ## Validation component for MUI forms | ||
@@ -3,0 +3,0 @@ [](https://opensource.org/licenses/MIT) |
+1
-1
@@ -18,3 +18,3 @@ { | ||
| "declaration": true, | ||
| "moduleResolution": "node", | ||
| "moduleResolution": "bundler", | ||
| "resolveJsonModule": true, | ||
@@ -21,0 +21,0 @@ "isolatedModules": true, |
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
5017050
492.93%18
-5.26%13
44.44%47891
120.32%Yes
NaN281
69.28%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated