@entur/dropdown 6.0.3-RC.1 → 6.0.3-RC.3

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.
@@ -13,7 +13,7 @@ type DropdownListProps<ValueType> = {
13
13
  listStyle: {
14
14
  [key: string]: any;
15
15
  } | undefined;
16
- listRef?: React.Ref<HTMLUListElement>;
16
+ setListRef: (node: HTMLElement | null) => void;
17
17
  loading?: boolean;
18
18
  loadingText?: string;
19
19
  noMatchesText?: string;
@@ -22,5 +22,5 @@ type DropdownListProps<ValueType> = {
22
22
  selectedItems: NormalizedDropdownItemType<ValueType>[];
23
23
  [key: string]: any;
24
24
  };
25
- export declare const DropdownList: <ValueType extends unknown>({ ariaLabelChosenSingular, ariaLabelSelectedItem, getItemProps, getMenuProps, inputValue, isOpen, highlightedIndex, listItems, listStyle, listRef, loading, loadingText, noMatchesText, selectAllCheckboxState, selectAllItem, selectedItems, showSelectAllInList, ...rest }: DropdownListProps<ValueType>) => React.JSX.Element;
25
+ export declare const DropdownList: <ValueType extends unknown>({ ariaLabelChosenSingular, ariaLabelSelectedItem, getItemProps, getMenuProps, inputValue, isOpen, highlightedIndex, listItems, listStyle, setListRef, loading, loadingText, noMatchesText, selectAllCheckboxState, selectAllItem, selectedItems, showSelectAllInList, ...rest }: DropdownListProps<ValueType>) => React.JSX.Element;
26
26
  export {};
@@ -1239,7 +1239,7 @@ function SelectedItemsLabel(items) {
1239
1239
  }).toString() : items.length + " elementer valgt";
1240
1240
  }
1241
1241
 
1242
- var _excluded$5 = ["ariaLabelChosenSingular", "ariaLabelSelectedItem", "getItemProps", "getMenuProps", "inputValue", "isOpen", "highlightedIndex", "listItems", "listStyle", "listRef", "loading", "loadingText", "noMatchesText", "selectAllCheckboxState", "selectAllItem", "selectedItems", "showSelectAllInList"];
1242
+ var _excluded$5 = ["ariaLabelChosenSingular", "ariaLabelSelectedItem", "getItemProps", "getMenuProps", "inputValue", "isOpen", "highlightedIndex", "listItems", "listStyle", "setListRef", "loading", "loadingText", "noMatchesText", "selectAllCheckboxState", "selectAllItem", "selectedItems", "showSelectAllInList"];
1243
1243
  var DropdownList = function DropdownList(_ref) {
1244
1244
  var _listItems$;
1245
1245
  var _ref$ariaLabelChosenS = _ref.ariaLabelChosenSingular,
@@ -1252,7 +1252,7 @@ var DropdownList = function DropdownList(_ref) {
1252
1252
  highlightedIndex = _ref.highlightedIndex,
1253
1253
  listItems = _ref.listItems,
1254
1254
  listStyle = _ref.listStyle,
1255
- listRef = _ref.listRef,
1255
+ setListRef = _ref.setListRef,
1256
1256
  _ref$loading = _ref.loading,
1257
1257
  loading = _ref$loading === void 0 ? false : _ref$loading,
1258
1258
  _ref$loadingText = _ref.loadingText,
@@ -1339,7 +1339,7 @@ var DropdownList = function DropdownList(_ref) {
1339
1339
  }, {
1340
1340
  suppressRefError: true
1341
1341
  }), {
1342
- ref: utils.mergeRefs(listRef, getMenuProps().ref),
1342
+ ref: setListRef,
1343
1343
  className: "eds-dropdown__list",
1344
1344
  style: _extends({
1345
1345
  display: isOpen ? 'inline-block' : 'none'
@@ -1899,7 +1899,7 @@ var SearchableDropdown = function SearchableDropdown(_ref) {
1899
1899
  isOpen: isOpen,
1900
1900
  listItems: listItems,
1901
1901
  listStyle: _extends({}, floatingStyles, listStyle),
1902
- listRef: refs.setFloating,
1902
+ setListRef: refs.setFloating,
1903
1903
  loading: loading,
1904
1904
  loadingText: loadingText,
1905
1905
  noMatchesText: noMatchesText,
@@ -2279,7 +2279,7 @@ var MultiSelect = function MultiSelect(_ref) {
2279
2279
  isOpen: isOpen,
2280
2280
  listItems: listItems,
2281
2281
  listStyle: _extends({}, floatingStyles, listStyle),
2282
- listRef: refs.setFloating,
2282
+ setListRef: refs.setFloating,
2283
2283
  loading: loading,
2284
2284
  loadingText: loadingText,
2285
2285
  noMatchesText: noMatchesText,
@@ -2419,9 +2419,12 @@ var Dropdown = function Dropdown(_ref) {
2419
2419
  onChange == null ? void 0 : onChange(highlitedItem);
2420
2420
  }
2421
2421
  }
2422
- },
2422
+ }
2423
+ }, {
2424
+ suppressRefError: true
2425
+ }), {
2423
2426
  ref: toggleButtonRef
2424
- })), (_ref3 = (_selectedItem$label = selectedItem == null ? void 0 : selectedItem.label) != null ? _selectedItem$label : React.createElement("div", {
2427
+ }), (_ref3 = (_selectedItem$label = selectedItem == null ? void 0 : selectedItem.label) != null ? _selectedItem$label : React.createElement("div", {
2425
2428
  className: classNames('eds-dropdown__selected-item__placeholder', {
2426
2429
  'eds-dropdown__selected-item__placeholder--readonly': readOnly
2427
2430
  })
@@ -2434,7 +2437,7 @@ var Dropdown = function Dropdown(_ref) {
2434
2437
  isOpen: isOpen,
2435
2438
  listItems: normalizedItems,
2436
2439
  listStyle: _extends({}, floatingStyles, listStyle),
2437
- listRef: refs.setFloating,
2440
+ setListRef: refs.setFloating,
2438
2441
  loading: loading,
2439
2442
  loadingText: loadingText,
2440
2443
  selectedItems: selectedItem !== null ? [selectedItem] : []