@xqmsg/ui-core 0.23.3 → 0.24.0

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.
@@ -1161,9 +1161,7 @@ var StackedSelect = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref
1161
1161
  }))), isFocussed && /*#__PURE__*/React__default.createElement(Dropdown, {
1162
1162
  position: position,
1163
1163
  dropdownRef: dropdownMenuRef,
1164
- onSelectItem: function onSelectItem(option) {
1165
- return handleOnSelectItem(option);
1166
- },
1164
+ onSelectItem: handleOnSelectItem,
1167
1165
  options: options,
1168
1166
  optionIndex: optionIndex
1169
1167
  }));
@@ -1894,7 +1892,7 @@ function Input(_ref) {
1894
1892
  setError = _ref.setError,
1895
1893
  clearErrors = _ref.clearErrors,
1896
1894
  separators = _ref.separators;
1897
- var selectedInputField = function selectedInputField(onChange, onBlur, ref, value) {
1895
+ function selectedInputField(onChange, onBlur, ref, value) {
1898
1896
  switch (inputType) {
1899
1897
  case 'text':
1900
1898
  return /*#__PURE__*/React__default.createElement(StackedInput, {
@@ -2038,7 +2036,7 @@ function Input(_ref) {
2038
2036
  default:
2039
2037
  return null;
2040
2038
  }
2041
- };
2039
+ }
2042
2040
  var nonLabeledInputs = ['checkbox'];
2043
2041
  return /*#__PURE__*/React__default.createElement(Controller, {
2044
2042
  control: control,
@@ -3016,7 +3014,7 @@ var _excluded$4 = ["label", "ariaLabel", "className", "placeholder", "name", "he
3016
3014
  /**
3017
3015
  * A functional React component utilized to render the `SelectNative` component.
3018
3016
  */
3019
- var SelectNative = function SelectNative(_ref) {
3017
+ function SelectNative(_ref) {
3020
3018
  var name = _ref.name,
3021
3019
  helperText = _ref.helperText,
3022
3020
  options = _ref.options,
@@ -3045,26 +3043,21 @@ var SelectNative = function SelectNative(_ref) {
3045
3043
  borderLeft: 'none',
3046
3044
  borderRight: 'none'
3047
3045
  };
3048
- var handleOnSelectItem = function handleOnSelectItem(selectedValue) {
3046
+ var handleOnSelectItem = function handleOnSelectItem(e) {
3047
+ var selectedValue = e.target.value;
3049
3048
  var selectedOption = options == null ? void 0 : options.find(function (_ref2) {
3050
3049
  var val = _ref2.value;
3051
3050
  return selectedValue === val;
3052
3051
  });
3053
3052
  if (selectedOption) {
3054
3053
  if (onChange) {
3055
- onChange(selectedOption.value);
3054
+ onChange(e);
3056
3055
  }
3057
3056
  setValue(name, selectedOption.value);
3058
3057
  } else {
3059
3058
  setValue(name, selectedValue);
3060
3059
  }
3061
3060
  };
3062
- useEffect(function () {
3063
- if (defaultValue) {
3064
- handleOnSelectItem(defaultValue);
3065
- }
3066
- // eslint-disable-next-line react-hooks/exhaustive-deps
3067
- }, [defaultValue]);
3068
3061
  return /*#__PURE__*/React__default.createElement(Controller, {
3069
3062
  control: control,
3070
3063
  name: name,
@@ -3086,9 +3079,8 @@ var SelectNative = function SelectNative(_ref) {
3086
3079
  ref: ref,
3087
3080
  value: value,
3088
3081
  disabled: disabled != null ? disabled : false,
3089
- onChange: function onChange(e) {
3090
- return handleOnSelectItem(e.target.value);
3091
- },
3082
+ onChange: handleOnSelectItem,
3083
+ defaultValue: defaultValue,
3092
3084
  style: style
3093
3085
  }), options && options.map(function (i) {
3094
3086
  return /*#__PURE__*/React__default.createElement("option", {
@@ -3098,7 +3090,7 @@ var SelectNative = function SelectNative(_ref) {
3098
3090
  })), isInvalid ? /*#__PURE__*/React__default.createElement(FormErrorMessage, null, errorText) : helperText && /*#__PURE__*/React__default.createElement(FormHelperText, null, helperText));
3099
3091
  }
3100
3092
  });
3101
- };
3093
+ }
3102
3094
 
3103
3095
  /**
3104
3096
  * A functional React component utilized to render the `BorderedBox` component