@typeolymp/ui-components 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { PropsType as InputPropsType } from ".";
|
|
3
3
|
export declare type PropsType = InputPropsType & {
|
|
4
|
-
|
|
4
|
+
onKeyPress?(e: KeyboardEvent): void;
|
|
5
5
|
};
|
|
6
6
|
declare const PasswordInput: FC<PropsType>;
|
|
7
7
|
export default PasswordInput;
|
package/build/index.es.js
CHANGED
|
@@ -506,13 +506,11 @@ var PasswordInput = function (props) {
|
|
|
506
506
|
props.onChange(value_1);
|
|
507
507
|
}
|
|
508
508
|
};
|
|
509
|
-
var
|
|
510
|
-
if (props.
|
|
511
|
-
props.
|
|
509
|
+
var onKeyPress = function (e) {
|
|
510
|
+
if (props.onKeyPress)
|
|
511
|
+
props.onKeyPress(e);
|
|
512
512
|
};
|
|
513
|
-
return (jsxs(PasswordInputWrapper, __assign({ disabled: props.disabled }, { children: [jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }, void 0), jsx(StyledInput, __assign({ type: isVisible ? "text" : "password" }, props, { value: value, onChange: onChange, onKeyPress:
|
|
514
|
-
return e.key === "Enter" ? onKeyPressEnter() : null;
|
|
515
|
-
} }), void 0)] }), void 0));
|
|
513
|
+
return (jsxs(PasswordInputWrapper, __assign({ disabled: props.disabled }, { children: [jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }, void 0), jsx(StyledInput, __assign({ type: isVisible ? "text" : "password" }, props, { value: value, onChange: onChange, onKeyPress: onKeyPress }), void 0)] }), void 0));
|
|
516
514
|
};
|
|
517
515
|
|
|
518
516
|
var Input = function (props) {
|
|
@@ -1047,15 +1045,16 @@ var PasswordInputField = function (props) {
|
|
|
1047
1045
|
if (props.onChange)
|
|
1048
1046
|
props.onChange(props.name, value);
|
|
1049
1047
|
};
|
|
1050
|
-
var
|
|
1051
|
-
if (props.onKeyPressEnter)
|
|
1048
|
+
var onKeyPress = function (e) {
|
|
1049
|
+
if (e.key === "Enter" && props.onKeyPressEnter) {
|
|
1052
1050
|
props.onKeyPressEnter();
|
|
1051
|
+
}
|
|
1053
1052
|
};
|
|
1054
1053
|
var onBlur = function () {
|
|
1055
1054
|
if (props.onBlur)
|
|
1056
1055
|
props.onBlur(props.name);
|
|
1057
1056
|
};
|
|
1058
|
-
return (jsxs(Container$4, { children: [jsx(Label$3, __assign({ as: "label", htmlFor: props.name }, { children: props.label }), void 0), jsx(Spacer, { vertical: 5 }, void 0), jsx(Input.Password, { initialValue: props.initialValue, autocomplete: props.autocomplete, autoFocus: props.autoFocus, disabled: props.disabled, placeholder: props.placeholder, id: props.name, onChange: onChange,
|
|
1057
|
+
return (jsxs(Container$4, { children: [jsx(Label$3, __assign({ as: "label", htmlFor: props.name }, { children: props.label }), void 0), jsx(Spacer, { vertical: 5 }, void 0), jsx(Input.Password, { initialValue: props.initialValue, autocomplete: props.autocomplete, autoFocus: props.autoFocus, disabled: props.disabled, placeholder: props.placeholder, id: props.name, onChange: onChange, onKeyPress: onKeyPress, onBlur: onBlur }, void 0)] }, void 0));
|
|
1059
1058
|
};
|
|
1060
1059
|
|
|
1061
1060
|
var generateRandomString = function (length) {
|