@entur/dropdown 5.2.0-beta.0 → 5.2.0-beta.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.
@@ -784,14 +784,6 @@ var DropdownInputGroupDeprecated = function DropdownInputGroupDeprecated(_ref) {
784
784
  }, feedback)));
785
785
  };
786
786
 
787
- // export type DropdownItemType<ValueType> =
788
- // | { value?: ValueType; label: string; icons?: React.ComponentType<any>[] }
789
- // | string;
790
- // export type NormalizedDropdownItemType = {
791
- // value: string | number | Record<any, any>;
792
- // label: string;
793
- // icons?: React.ComponentType<any>[];
794
- // };
795
787
  var useNormalizedItems = function useNormalizedItems(items) {
796
788
  return React.useMemo(function () {
797
789
  return items.map(function (item) {
@@ -801,12 +793,14 @@ var useNormalizedItems = function useNormalizedItems(items) {
801
793
  label: item
802
794
  };
803
795
  }
804
- if (!('value' in item)) {
796
+ if ((item == null ? void 0 : item.value) === undefined) {
805
797
  return _extends({}, item, {
806
798
  value: item.label
807
799
  });
808
800
  }
809
- return item;
801
+ return _extends({}, item, {
802
+ value: item.value
803
+ });
810
804
  });
811
805
  }, [items]);
812
806
  };