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