react-auth-code-input
Advanced tools
Comparing version 3.1.1 to 3.2.0
import React from 'react'; | ||
declare const allowedCharactersValues: readonly ["alpha", "numeric", "alphanumeric"]; | ||
declare type Props = { | ||
export declare type AuthCodeProps = { | ||
allowedCharacters?: typeof allowedCharactersValues[number]; | ||
ariaLabel?: string; | ||
autoFocus?: boolean; | ||
containerClassName?: string; | ||
disabled?: boolean; | ||
length?: number; | ||
containerClassName?: string; | ||
inputClassName?: string; | ||
isPassword?: boolean; | ||
length?: number; | ||
placeholder?: string; | ||
onChange: (res: string) => void; | ||
@@ -18,3 +19,3 @@ }; | ||
}; | ||
declare const AuthCode: React.ForwardRefExoticComponent<Props & React.RefAttributes<AuthCodeRef>>; | ||
declare const AuthCode: React.ForwardRefExoticComponent<AuthCodeProps & React.RefAttributes<AuthCodeRef>>; | ||
export default AuthCode; |
@@ -32,9 +32,10 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus, | ||
containerClassName = _ref.containerClassName, | ||
disabled = _ref.disabled, | ||
_ref$length = _ref.length, | ||
length = _ref$length === void 0 ? 6 : _ref$length, | ||
containerClassName = _ref.containerClassName, | ||
inputClassName = _ref.inputClassName, | ||
_ref$isPassword = _ref.isPassword, | ||
isPassword = _ref$isPassword === void 0 ? false : _ref$isPassword, | ||
_ref$length = _ref.length, | ||
length = _ref$length === void 0 ? 6 : _ref$length, | ||
placeholder = _ref.placeholder, | ||
onChange = _ref.onChange; | ||
@@ -177,3 +178,4 @@ | ||
"aria-label": ariaLabel ? ariaLabel + ". Character " + (i + 1) + "." : "Character " + (i + 1) + ".", | ||
disabled: disabled | ||
disabled: disabled, | ||
placeholder: placeholder | ||
}))); | ||
@@ -180,0 +182,0 @@ }; |
@@ -27,7 +27,8 @@ import React, { forwardRef, useRef, useImperativeHandle, useEffect } from 'react'; | ||
autoFocus: _autoFocus = true, | ||
containerClassName, | ||
disabled, | ||
length: _length = 6, | ||
containerClassName, | ||
inputClassName, | ||
isPassword: _isPassword = false, | ||
length: _length = 6, | ||
placeholder, | ||
onChange | ||
@@ -169,3 +170,4 @@ }, ref) => { | ||
"aria-label": ariaLabel ? `${ariaLabel}. Character ${i + 1}.` : `Character ${i + 1}.`, | ||
disabled: disabled | ||
disabled: disabled, | ||
placeholder: placeholder | ||
}))); | ||
@@ -172,0 +174,0 @@ } |
{ | ||
"name": "react-auth-code-input", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "One-time password (OTP) React input component, uncontrolled, zero dependencies, fully tested.", | ||
@@ -5,0 +5,0 @@ "author": "drac94", |
@@ -134,5 +134,11 @@ ![image](https://user-images.githubusercontent.com/1719915/159784302-4bb83708-e993-4800-9bcf-091ecb709ef7.png) | ||
| `disabled` | Boolean | Makes all the inputs disabled if true. | false | Since version 3.1.1 | | ||
| `placeholder` | String | Displays a placeholder in all the inputs. | | Since version 3.2.0 | | ||
## Changelog | ||
### 3.2.0 | ||
- Add `placeholder` prop. | ||
- Export component props. | ||
### 3.1.0 | ||
@@ -139,0 +145,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42934
352
168