@acusti/input-text
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -9,2 +9,3 @@ import * as React from 'react'; | ||
minLength?: number; | ||
name?: string; | ||
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => unknown; | ||
@@ -11,0 +12,0 @@ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => unknown; |
import * as React from 'react'; | ||
const { useCallback, useEffect, useImperativeHandle, useRef } = React; | ||
const InputText = React.forwardRef(({ autoComplete, className, disabled, initialValue, maxLength, minLength, onBlur, onChange, onFocus, onKeyDown, onKeyUp, pattern, placeholder, readOnly, selectTextOnFocus, tabIndex, title, type = 'text', }, ref) => { | ||
const InputText = React.forwardRef(({ autoComplete, className, disabled, initialValue, maxLength, minLength, name, onBlur, onChange, onFocus, onKeyDown, onKeyUp, pattern, placeholder, readOnly, selectTextOnFocus, tabIndex, title, type = 'text', }, ref) => { | ||
const inputRef = useRef(null); | ||
@@ -41,5 +41,5 @@ useImperativeHandle(ref, () => inputRef.current); | ||
}, []); | ||
return (React.createElement("input", { autoComplete: autoComplete, className: className, defaultValue: initialValue || '', disabled: disabled, maxLength: maxLength, minLength: minLength, onBlur: selectTextOnFocus ? handleBlur : onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onSelect: selectTextOnFocus ? handleSelect : undefined, pattern: pattern, placeholder: placeholder, readOnly: readOnly, ref: inputRef, tabIndex: tabIndex, title: title, type: type })); | ||
return (React.createElement("input", { autoComplete: autoComplete, className: className, defaultValue: initialValue || '', disabled: disabled, maxLength: maxLength, minLength: minLength, name: name, onBlur: selectTextOnFocus ? handleBlur : onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onSelect: selectTextOnFocus ? handleSelect : undefined, pattern: pattern, placeholder: placeholder, readOnly: readOnly, ref: inputRef, tabIndex: tabIndex, title: title, type: type })); | ||
}); | ||
export default InputText; | ||
//# sourceMappingURL=InputText.js.map |
{ | ||
"name": "@acusti/input-text", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
8540
68