@rhc-shared-components/form-select-component 0.2.4 → 0.2.6

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,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import './styles.scss';
3
2
  export interface ISelectItem {
4
3
  value: string;
5
4
  key?: string;
package/dist/index.js CHANGED
@@ -9629,10 +9629,6 @@ var FormSelect = function FormSelect(_ref) {
9629
9629
  isOpen = _React$useState[0],
9630
9630
  setIsOpen = _React$useState[1];
9631
9631
 
9632
- var _React$useState2 = React__namespace.useState(''),
9633
- selected = _React$useState2[0],
9634
- setSelected = _React$useState2[1];
9635
-
9636
9632
  var onToggle = function onToggle() {
9637
9633
  setIsOpen(!isOpen);
9638
9634
  };
@@ -9652,13 +9648,10 @@ var FormSelect = function FormSelect(_ref) {
9652
9648
  isFullWidth: isFullWidth,
9653
9649
  isFullHeight: isFullHeight,
9654
9650
  isDisabled: isSubmitting
9655
- }, selected || placeholder);
9651
+ }, value || placeholder);
9656
9652
  };
9657
9653
 
9658
- React__namespace.useEffect(function () {
9659
- setSelected(value);
9660
- }, [value]);
9661
- return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(formGroupContainer.FormGroupContainer, {
9654
+ return React__namespace.createElement(formGroupContainer.FormGroupContainer, {
9662
9655
  validated: meta.touched && meta.error ? reactCore.ValidatedOptions.error : reactCore.ValidatedOptions["default"],
9663
9656
  helperTextInvalid: meta.error,
9664
9657
  className: 'from-group-custom',
@@ -9678,7 +9671,7 @@ var FormSelect = function FormSelect(_ref) {
9678
9671
  "aria-labelledby": rest.name,
9679
9672
  toggle: toggle,
9680
9673
  onSelect: onSelect,
9681
- selected: selected,
9674
+ selected: value,
9682
9675
  isOpen: isOpen,
9683
9676
  popperProps: {
9684
9677
  enableFlip: false
@@ -9699,7 +9692,7 @@ var FormSelect = function FormSelect(_ref) {
9699
9692
  }, option.isDisabled && {
9700
9693
  isDisabled: option.isDisabled
9701
9694
  }, selectOptionExtraProps && _extends({}, selectOptionExtraProps)), option.value);
9702
- })))));
9695
+ }))));
9703
9696
  };
9704
9697
 
9705
9698
  exports.FormSelect = FormSelect;
@@ -9605,7 +9605,6 @@ const FormSelect = _ref => {
9605
9605
  validateField
9606
9606
  } = useFormikContext();
9607
9607
  const [isOpen, setIsOpen] = React.useState(false);
9608
- const [selected, setSelected] = React.useState('');
9609
9608
 
9610
9609
  const onToggle = () => {
9611
9610
  setIsOpen(!isOpen);
@@ -9625,12 +9624,9 @@ const FormSelect = _ref => {
9625
9624
  isFullWidth: isFullWidth,
9626
9625
  isFullHeight: isFullHeight,
9627
9626
  isDisabled: isSubmitting
9628
- }, selected || placeholder);
9627
+ }, value || placeholder);
9629
9628
 
9630
- React.useEffect(() => {
9631
- setSelected(value);
9632
- }, [value]);
9633
- return React.createElement(React.Fragment, null, React.createElement(FormGroupContainer, {
9629
+ return React.createElement(FormGroupContainer, {
9634
9630
  validated: meta.touched && meta.error ? ValidatedOptions.error : ValidatedOptions.default,
9635
9631
  helperTextInvalid: meta.error,
9636
9632
  className: 'from-group-custom',
@@ -9650,7 +9646,7 @@ const FormSelect = _ref => {
9650
9646
  "aria-labelledby": rest.name,
9651
9647
  toggle: toggle,
9652
9648
  onSelect: onSelect,
9653
- selected: selected,
9649
+ selected: value,
9654
9650
  isOpen: isOpen,
9655
9651
  popperProps: {
9656
9652
  enableFlip: false
@@ -9667,7 +9663,7 @@ const FormSelect = _ref => {
9667
9663
  isPlaceholder: option.isPlaceholder
9668
9664
  }, option.isDisabled && {
9669
9665
  isDisabled: option.isDisabled
9670
- }, selectOptionExtraProps && _extends({}, selectOptionExtraProps)), option.value))))));
9666
+ }, selectOptionExtraProps && _extends({}, selectOptionExtraProps)), option.value)))));
9671
9667
  };
9672
9668
 
9673
9669
  export { FormSelect };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhc-shared-components/form-select-component",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "project description",
5
5
  "author": "redhatofficial",
6
6
  "license": "MIT",
@@ -72,6 +72,5 @@
72
72
  ],
73
73
  "publishConfig": {
74
74
  "access": "public"
75
- },
76
- "gitHead": "e3ffbb8f2793c6be4ea9d3d4ec916fc0d9faba5d"
75
+ }
77
76
  }
@@ -1 +0,0 @@
1
- export {};