@typeolymp/ui-components 1.3.0 → 1.3.3

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.
package/build/index.js CHANGED
@@ -516,13 +516,11 @@ var PasswordInput = function (props) {
516
516
  props.onChange(value_1);
517
517
  }
518
518
  };
519
- var onKeyPressEnter = function () {
520
- if (props.onKeyPressEnter)
521
- props.onKeyPressEnter();
519
+ var onKeyPress = function (e) {
520
+ if (props.onKeyPress)
521
+ props.onKeyPress(e);
522
522
  };
523
- return (jsxRuntime.jsxs(PasswordInputWrapper, __assign({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }, void 0), jsxRuntime.jsx(StyledInput, __assign({ type: isVisible ? "text" : "password" }, props, { value: value, onChange: onChange, onKeyPress: function (e) {
524
- return e.key === "Enter" ? onKeyPressEnter() : null;
525
- } }), void 0)] }), void 0));
523
+ return (jsxRuntime.jsxs(PasswordInputWrapper, __assign({ disabled: props.disabled }, { children: [jsxRuntime.jsx(Icon, { type: isVisible ? "eyeInvisible" : "eye", color: "gray", size: "small", onClick: toggle }, void 0), jsxRuntime.jsx(StyledInput, __assign({ type: isVisible ? "text" : "password" }, props, { value: value, onChange: onChange, onKeyPress: onKeyPress }), void 0)] }), void 0));
526
524
  };
527
525
 
528
526
  var Input = function (props) {
@@ -1057,15 +1055,16 @@ var PasswordInputField = function (props) {
1057
1055
  if (props.onChange)
1058
1056
  props.onChange(props.name, value);
1059
1057
  };
1060
- var onKeyPressEnter = function () {
1061
- if (props.onKeyPressEnter)
1062
- props.onKeyPressEnter();
1058
+ var onKeyPress = function (e) {
1059
+ if (e.key === "Enter" && props.onKeyPress) {
1060
+ props.onKeyPress(e);
1061
+ }
1063
1062
  };
1064
1063
  var onBlur = function () {
1065
1064
  if (props.onBlur)
1066
1065
  props.onBlur(props.name);
1067
1066
  };
1068
- return (jsxRuntime.jsxs(Container$4, { children: [jsxRuntime.jsx(Label$3, __assign({ as: "label", htmlFor: props.name }, { children: props.label }), void 0), jsxRuntime.jsx(Spacer, { vertical: 5 }, void 0), jsxRuntime.jsx(Input.Password, { initialValue: props.initialValue, autocomplete: props.autocomplete, autoFocus: props.autoFocus, disabled: props.disabled, placeholder: props.placeholder, id: props.name, onChange: onChange, onKeyPressEnter: onKeyPressEnter, onBlur: onBlur }, void 0)] }, void 0));
1067
+ return (jsxRuntime.jsxs(Container$4, { children: [jsxRuntime.jsx(Label$3, __assign({ as: "label", htmlFor: props.name }, { children: props.label }), void 0), jsxRuntime.jsx(Spacer, { vertical: 5 }, void 0), jsxRuntime.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));
1069
1068
  };
1070
1069
 
1071
1070
  var generateRandomString = function (length) {
@@ -1347,7 +1346,7 @@ var Form = function (props) {
1347
1346
  jsxRuntime.jsx(InputField, __assign({}, field, { onChange: onChangeFormField, onBlur: onBlurFormField }), void 0)));
1348
1347
  case "password":
1349
1348
  return (React.createElement(WithValidation, __assign({}, feedback[field.name], { key: "field-".concat(index) }),
1350
- jsxRuntime.jsx(PasswordInputField, __assign({}, field, { onChange: onChangeFormField, onBlur: onBlurFormField, onKeyPressEnter: field.submitOnEnter && onSubmit }), void 0)));
1349
+ jsxRuntime.jsx(PasswordInputField, __assign({}, field, { onChange: onChangeFormField, onBlur: onBlurFormField, onKeyPress: field.submitOnEnter && onSubmit }), void 0)));
1351
1350
  case "radio":
1352
1351
  return (React.createElement(WithValidation, __assign({}, feedback[field.name], { key: "field-".concat(index) }),
1353
1352
  jsxRuntime.jsx(RadioGroup, __assign({}, field, { onChange: onChangeFormField, onBlur: onBlurFormField }), void 0)));