@linzjs/step-ag-grid 2.4.9 → 2.4.11

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,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import { KeyboardEvent } from "react";
2
2
  import "../../styles/GridFormSubComponentTextInput.scss";
3
3
  export interface GridFormSubComponentTextInput {
4
4
  setValue: (value: string) => void;
5
- keyDown: (key: string) => void;
5
+ keyDown: (key: string, event: KeyboardEvent<HTMLInputElement>) => void;
6
6
  placeholder?: string;
7
7
  className?: string;
8
8
  customHelpText?: string;
@@ -3087,15 +3087,20 @@ var GridFormDropDown = function (_props) {
3087
3087
  }
3088
3088
  setSubComponentValues(localSubComponentValues);
3089
3089
  },
3090
- keyDown: function (key) {
3090
+ keyDown: function (key, event) {
3091
3091
  var subComponentItem = subComponentValues.find(function (_a) {
3092
3092
  var optionValue = _a.optionValue;
3093
3093
  return optionValue === item.value;
3094
3094
  });
3095
3095
  if ((key === "Enter" || key === "Tab") && subComponentItem) {
3096
- selectItemHandler(item.value, subComponentItem.subComponentValue);
3097
- ref.closeMenu();
3096
+ event.preventDefault();
3097
+ event.stopPropagation();
3098
+ return selectItemHandler(item.value, subComponentItem.subComponentValue).then(function () {
3099
+ ref.closeMenu();
3100
+ return true;
3101
+ });
3098
3102
  }
3103
+ return false;
3099
3104
  },
3100
3105
  key: "".concat(props.field, "-").concat(index, "_subcomponent_inner")
3101
3106
  }, ref);
@@ -3740,13 +3745,17 @@ var GridFormSubComponentTextInput = function (_a) {
3740
3745
  var _b = useState(""), inputValue = _b[0], setInputValue = _b[1];
3741
3746
  return (jsxs("div", __assign({ style: {
3742
3747
  display: "flex",
3743
- flexDirection: "column"
3748
+ flexDirection: "column",
3749
+ width: "100%",
3750
+ padding: 0
3744
3751
  } }, { children: [jsx(TextInputFormatted, { className: inputClass, value: inputValue, onChange: function (e) {
3745
3752
  var value = e.target.value;
3746
3753
  setValue(value);
3747
3754
  setInputValue(value);
3748
3755
  }, inputProps: {
3749
- onKeyDown: function (k) { return keyDown(k.key); },
3756
+ onKeyDown: function (e) {
3757
+ return keyDown(e.key, e);
3758
+ },
3750
3759
  placeholder: placeholderText,
3751
3760
  onMouseEnter: function (e) {
3752
3761
  if (document.activeElement != e.currentTarget) {
@@ -3757,7 +3766,7 @@ var GridFormSubComponentTextInput = function (_a) {
3757
3766
  width: "100%"
3758
3767
  }
3759
3768
  } }), jsx("span", __assign({ style: {
3760
- fontSize: "0.75rem"
3769
+ fontSize: "0.7rem"
3761
3770
  } }, { children: helpText }))] })));
3762
3771
  };
3763
3772