UNPKG

react-otp-input

Version:

A fully customizable, one-time password input component for the web built with React

1 lines 16.9 kB
{"version":3,"file":"index.cjs","sources":["../../src/index.tsx"],"sourcesContent":["import React from 'react';\n\ntype AllowedInputTypes = 'password' | 'text' | 'number' | 'tel';\n\ntype InputProps = Required<\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n | 'value'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'onKeyDown'\n | 'onPaste'\n | 'aria-label'\n | 'autoComplete'\n | 'style'\n | 'inputMode'\n | 'onInput'\n > & {\n ref: React.RefCallback<HTMLInputElement>;\n placeholder: string | undefined;\n className: string | undefined;\n type: AllowedInputTypes;\n }\n>;\n\ninterface OTPInputProps {\n /** Value of the OTP input */\n value?: string;\n /** Number of OTP inputs to be rendered */\n numInputs?: number;\n /** Callback to be called when the OTP value changes */\n onChange: (otp: string) => void;\n /** Callback to be called when pasting content into the component */\n onPaste?: (event: React.ClipboardEvent<HTMLDivElement>) => void;\n /** Function to render the input */\n renderInput: (inputProps: InputProps, index: number) => React.ReactNode;\n /** Whether the first input should be auto focused */\n shouldAutoFocus?: boolean;\n /** Placeholder for the inputs */\n placeholder?: string;\n /** Function to render the separator */\n renderSeparator?: ((index: number) => React.ReactNode) | React.ReactNode;\n /** Style for the container */\n containerStyle?: React.CSSProperties | string;\n /** Style for the input */\n inputStyle?: React.CSSProperties | string;\n /** The type that will be passed to the input being rendered */\n inputType?: AllowedInputTypes;\n /** Do not apply the default styles to the inputs, will be removed in future versions */\n skipDefaultStyles?: boolean; // TODO: Remove in next major release\n}\n\nconst isStyleObject = (obj: unknown) => typeof obj === 'object' && obj !== null;\n\nconst OTPInput = ({\n value = '',\n numInputs = 4,\n onChange,\n onPaste,\n renderInput,\n shouldAutoFocus = false,\n inputType = 'text',\n renderSeparator,\n placeholder,\n containerStyle,\n inputStyle,\n skipDefaultStyles = false,\n}: OTPInputProps) => {\n const [activeInput, setActiveInput] = React.useState(0);\n const inputRefs = React.useRef<Array<HTMLInputElement | null>>([]);\n\n const getOTPValue = () => (value ? value.toString().split('') : []);\n\n const isInputNum = inputType === 'number' || inputType === 'tel';\n\n React.useEffect(() => {\n inputRefs.current = inputRefs.current.slice(0, numInputs);\n }, [numInputs]);\n\n React.useEffect(() => {\n if (shouldAutoFocus) {\n inputRefs.current[0]?.focus();\n }\n }, [shouldAutoFocus]);\n\n const getPlaceholderValue = () => {\n if (typeof placeholder === 'string') {\n if (placeholder.length === numInputs) {\n return placeholder;\n }\n\n if (placeholder.length > 0) {\n console.error('Length of the placeholder should be equal to the number of inputs.');\n }\n }\n return undefined;\n };\n\n const isInputValueValid = (value: string) => {\n const isTypeValid = isInputNum ? !isNaN(Number(value)) : typeof value === 'string';\n return isTypeValid && value.trim().length === 1;\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = event.target;\n\n if (isInputValueValid(value)) {\n changeCodeAtFocus(value);\n focusInput(activeInput + 1);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { nativeEvent } = event;\n const value = event.target.value;\n\n if (!isInputValueValid(value)) {\n // Pasting from the native autofill suggestion on a mobile device can pass\n // the pasted string as one long input to one of the cells. This ensures\n // that we handle the full input and not just the first character.\n if (value.length === numInputs) {\n const hasInvalidInput = value.split('').some((cellInput) => !isInputValueValid(cellInput));\n if (!hasInvalidInput) {\n handleOTPChange(value.split(''));\n focusInput(numInputs - 1);\n }\n }\n\n // @ts-expect-error - This was added previously to handle and edge case\n // for dealing with keyCode \"229 Unidentified\" on Android. Check if this is\n // still needed.\n if (nativeEvent.data === null && nativeEvent.inputType === 'deleteContentBackward') {\n event.preventDefault();\n changeCodeAtFocus('');\n focusInput(activeInput - 1);\n }\n\n // Clear the input if it's not valid value because firefox allows\n // pasting non-numeric characters in a number type input\n event.target.value = '';\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => (index: number) => {\n setActiveInput(index);\n event.target.select();\n };\n\n const handleBlur = () => {\n setActiveInput(activeInput - 1);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const otp = getOTPValue();\n if ([event.code, event.key].includes('Backspace')) {\n event.preventDefault();\n changeCodeAtFocus('');\n focusInput(activeInput - 1);\n } else if (event.code === 'Delete') {\n event.preventDefault();\n changeCodeAtFocus('');\n } else if (event.code === 'ArrowLeft') {\n event.preventDefault();\n focusInput(activeInput - 1);\n } else if (event.code === 'ArrowRight') {\n event.preventDefault();\n focusInput(activeInput + 1);\n }\n // React does not trigger onChange when the same value is entered\n // again. So we need to focus the next input manually in this case.\n else if (event.key === otp[activeInput]) {\n event.preventDefault();\n focusInput(activeInput + 1);\n } else if (\n event.code === 'Spacebar' ||\n event.code === 'Space' ||\n event.code === 'ArrowUp' ||\n event.code === 'ArrowDown'\n ) {\n event.preventDefault();\n }\n };\n\n const focusInput = (index: number) => {\n const activeInput = Math.max(Math.min(numInputs - 1, index), 0);\n\n if (inputRefs.current[activeInput]) {\n inputRefs.current[activeInput]?.focus();\n inputRefs.current[activeInput]?.select();\n setActiveInput(activeInput);\n }\n };\n\n const changeCodeAtFocus = (value: string) => {\n const otp = getOTPValue();\n otp[activeInput] = value[0];\n handleOTPChange(otp);\n };\n\n const handleOTPChange = (otp: Array<string>) => {\n const otpValue = otp.join('');\n onChange(otpValue);\n };\n\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n\n const otp = getOTPValue();\n let nextActiveInput = activeInput;\n\n // Get pastedData in an array of max size (num of inputs - current position)\n const pastedData = event.clipboardData\n .getData('text/plain')\n .slice(0, numInputs - activeInput)\n .split('');\n\n // Prevent pasting if the clipboard data contains non-numeric values for number inputs\n if (isInputNum && pastedData.some((value) => isNaN(Number(value)))) {\n return;\n }\n\n // Paste data from focused input onwards\n for (let pos = 0; pos < numInputs; ++pos) {\n if (pos >= activeInput && pastedData.length > 0) {\n otp[pos] = pastedData.shift() ?? '';\n nextActiveInput++;\n }\n }\n\n focusInput(nextActiveInput);\n handleOTPChange(otp);\n };\n\n return (\n <div\n style={Object.assign({ display: 'flex', alignItems: 'center' }, isStyleObject(containerStyle) && containerStyle)}\n className={typeof containerStyle === 'string' ? containerStyle : undefined}\n onPaste={onPaste}\n >\n {Array.from({ length: numInputs }, (_, index) => index).map((index) => (\n <React.Fragment key={index}>\n {renderInput(\n {\n value: getOTPValue()[index] ?? '',\n placeholder: getPlaceholderValue()?.[index] ?? undefined,\n ref: (element) => (inputRefs.current[index] = element),\n onChange: handleChange,\n onFocus: (event) => handleFocus(event)(index),\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onPaste: handlePaste,\n autoComplete: 'off',\n 'aria-label': `Please enter OTP character ${index + 1}`,\n style: Object.assign(\n !skipDefaultStyles ? ({ width: '1em', textAlign: 'center' } as const) : {},\n isStyleObject(inputStyle) ? inputStyle : {}\n ),\n className: typeof inputStyle === 'string' ? inputStyle : undefined,\n type: inputType,\n inputMode: isInputNum ? 'numeric' : 'text',\n onInput: handleInputChange,\n },\n index\n )}\n {index < numInputs - 1 && (typeof renderSeparator === 'function' ? renderSeparator(index) : renderSeparator)}\n </React.Fragment>\n ))}\n </div>\n );\n};\n\nexport type { OTPInputProps, InputProps, AllowedInputTypes };\nexport default OTPInput;\n"],"names":["React"],"mappings":";;;;;;;;AAqDA,IAAM,aAAa,GAAG,UAAC,GAAY,EAAA,EAAK,OAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,CAAA,EAAA,CAAC;AAE1E,IAAA,QAAQ,GAAG,UAAC,EAaF,EAAA;QAZd,EAAU,GAAA,EAAA,CAAA,KAAA,EAAV,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,EAAE,GAAA,EAAA,EACV,EAAa,GAAA,EAAA,CAAA,SAAA,EAAb,SAAS,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,CAAC,GAAA,EAAA,EACb,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,O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