react-multi-email
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -13,2 +13,4 @@ import * as React from 'react'; | ||
onBlur?: () => void; | ||
onKeyDown?: (evt: React.KeyboardEvent<HTMLInputElement>) => void; | ||
onKeyUp?: (evt: React.KeyboardEvent<HTMLInputElement>) => void; | ||
noClass?: boolean; | ||
@@ -15,0 +17,0 @@ validateEmail?: (email: string) => boolean | Promise<boolean>; |
@@ -92,3 +92,3 @@ "use strict"; | ||
var _this = this; | ||
var id = props.id, style = props.style, getLabel = props.getLabel, _a = props.className, className = _a === void 0 ? '' : _a, noClass = props.noClass, placeholder = props.placeholder, autoFocus = props.autoFocus, enable = props.enable, onDisabled = props.onDisabled, validateEmail = props.validateEmail, onChange = props.onChange, onChangeInput = props.onChangeInput, onFocus = props.onFocus, onBlur = props.onBlur, spinner = props.spinner; | ||
var id = props.id, style = props.style, getLabel = props.getLabel, _a = props.className, className = _a === void 0 ? '' : _a, noClass = props.noClass, placeholder = props.placeholder, autoFocus = props.autoFocus, enable = props.enable, onDisabled = props.onDisabled, validateEmail = props.validateEmail, onChange = props.onChange, onChangeInput = props.onChangeInput, onFocus = props.onFocus, onBlur = props.onBlur, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, spinner = props.spinner; | ||
var emailInputRef = React.useRef(null); | ||
@@ -228,2 +228,3 @@ var _b = __read(React.useState(false), 2), focused = _b[0], setFocused = _b[1]; | ||
var handleOnKeydown = React.useCallback(function (e) { | ||
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e); | ||
switch (e.key) { | ||
@@ -240,3 +241,3 @@ case 'Enter': | ||
} | ||
}, [emails.length, removeEmail]); | ||
}, [emails.length, onKeyDown, removeEmail]); | ||
var handleOnKeyup = React.useCallback(function (e) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -247,2 +248,3 @@ var _a; | ||
case 0: | ||
onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(e); | ||
_a = e.key; | ||
@@ -249,0 +251,0 @@ switch (_a) { |
@@ -13,2 +13,4 @@ import * as React from 'react'; | ||
onBlur?: () => void; | ||
onKeyDown?: (evt: React.KeyboardEvent<HTMLInputElement>) => void; | ||
onKeyUp?: (evt: React.KeyboardEvent<HTMLInputElement>) => void; | ||
noClass?: boolean; | ||
@@ -15,0 +17,0 @@ validateEmail?: (email: string) => boolean | Promise<boolean>; |
@@ -39,3 +39,3 @@ "use strict"; | ||
function ReactMultiEmail(props) { | ||
const { id, style, getLabel, className = '', noClass, placeholder, autoFocus, enable, onDisabled, validateEmail, onChange, onChangeInput, onFocus, onBlur, spinner, } = props; | ||
const { id, style, getLabel, className = '', noClass, placeholder, autoFocus, enable, onDisabled, validateEmail, onChange, onChangeInput, onFocus, onBlur, onKeyDown, onKeyUp, spinner, } = props; | ||
const emailInputRef = React.useRef(null); | ||
@@ -154,2 +154,3 @@ const [focused, setFocused] = React.useState(false); | ||
const handleOnKeydown = React.useCallback((e) => { | ||
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e); | ||
switch (e.key) { | ||
@@ -166,4 +167,5 @@ case 'Enter': | ||
} | ||
}, [emails.length, removeEmail]); | ||
}, [emails.length, onKeyDown, removeEmail]); | ||
const handleOnKeyup = React.useCallback((e) => __awaiter(this, void 0, void 0, function* () { | ||
onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(e); | ||
switch (e.key) { | ||
@@ -170,0 +172,0 @@ case 'Enter': |
{ | ||
"name": "react-multi-email", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"jsnext:main": "dist/es6/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/es6/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
117435
919