react-mui-form-validator
Advanced tools
+179
| 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'; | ||
| 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 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 = { | ||
| 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, Validator as MuiValidator }; |
Sorry, the diff of this file is too big to display
+1
-1
| { | ||
| "name": "react-mui-form-validator", | ||
| "version": "1.5.6", | ||
| "version": "1.5.7", | ||
| "description": "Validator for forms designed with material-ui components.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
846056
14816.36%9
28.57%21737
74855.17%166
Infinity%