@entur/dropdown 5.1.3 → 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.
- package/dist/Dropdown.d.ts +6 -7
- package/dist/MultiSelect.d.ts +7 -8
- package/dist/NativeDropdown.d.ts +6 -7
- package/dist/SearchableDropdown.d.ts +7 -8
- package/dist/components/DropdownList.d.ts +7 -7
- package/dist/components/FieldComponents.d.ts +10 -8
- package/dist/deprecated/BaseDropdown.d.ts +2 -2
- package/dist/deprecated/DownshiftProvider.d.ts +4 -4
- package/dist/deprecated/Dropdown.d.ts +4 -5
- package/dist/deprecated/DropdownList.d.ts +2 -2
- package/dist/deprecated/MultiSelect.d.ts +5 -6
- package/dist/deprecated/RegularDropdown.d.ts +2 -2
- package/dist/deprecated/SearchableDropdown.d.ts +3 -3
- package/dist/deprecated/types.d.ts +15 -0
- package/dist/dropdown.cjs.development.js +9 -4
- package/dist/dropdown.cjs.development.js.map +1 -1
- package/dist/dropdown.cjs.production.min.js +1 -1
- package/dist/dropdown.cjs.production.min.js.map +1 -1
- package/dist/dropdown.esm.js +9 -4
- package/dist/dropdown.esm.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +105 -105
- package/dist/types.d.ts +14 -0
- package/dist/useNormalizedItems.d.ts +2 -12
- package/dist/useResolvedItems.d.ts +3 -8
- package/dist/utils.d.ts +23 -23
- package/package.json +2 -2
package/dist/dropdown.esm.js
CHANGED
|
@@ -789,12 +789,14 @@ var useNormalizedItems = function useNormalizedItems(items) {
|
|
|
789
789
|
label: item
|
|
790
790
|
};
|
|
791
791
|
}
|
|
792
|
-
if (
|
|
792
|
+
if ((item == null ? void 0 : item.value) === undefined) {
|
|
793
793
|
return _extends({}, item, {
|
|
794
794
|
value: item.label
|
|
795
795
|
});
|
|
796
796
|
}
|
|
797
|
-
return item
|
|
797
|
+
return _extends({}, item, {
|
|
798
|
+
value: item.value
|
|
799
|
+
});
|
|
798
800
|
});
|
|
799
801
|
}, [items]);
|
|
800
802
|
};
|
|
@@ -991,7 +993,7 @@ var useMultiSelectOldContext = function useMultiSelectOldContext() {
|
|
|
991
993
|
return context;
|
|
992
994
|
};
|
|
993
995
|
function stateReducer(state,
|
|
994
|
-
//StateChangeOptions<
|
|
996
|
+
//StateChangeOptions<NormalizedDropdownItemDeprecatedType>,
|
|
995
997
|
actionAndChanges) {
|
|
996
998
|
var changes = actionAndChanges.changes,
|
|
997
999
|
type = actionAndChanges.type;
|
|
@@ -1334,6 +1336,9 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
1334
1336
|
})
|
|
1335
1337
|
}, getItemProps({
|
|
1336
1338
|
key: (item == null ? void 0 : item.label) + (item == null ? void 0 : item.value),
|
|
1339
|
+
// @ts-expect-error Since getItemProps expects the same item type
|
|
1340
|
+
// here as items, it throws error when selectAllItem is a string.
|
|
1341
|
+
// This does, however, not cause any functional issues.
|
|
1337
1342
|
item: item,
|
|
1338
1343
|
index: index
|
|
1339
1344
|
})), itemIsSelectAll ? selectAllListItemContent() : listItemContent(item));
|
|
@@ -2209,7 +2214,7 @@ var MultiSelect = function MultiSelect(_ref) {
|
|
|
2209
2214
|
disabled: disabled,
|
|
2210
2215
|
getSelectedItemProps: getSelectedItemProps,
|
|
2211
2216
|
index: index,
|
|
2212
|
-
key: selectedItem == null ? void 0 : selectedItem.value,
|
|
2217
|
+
key: (selectedItem == null ? void 0 : selectedItem.label) + (typeof (selectedItem == null ? void 0 : selectedItem.value) === 'string' ? selectedItem.value : ''),
|
|
2213
2218
|
readOnly: readOnly,
|
|
2214
2219
|
removeSelectedItem: function removeSelectedItem() {
|
|
2215
2220
|
var _inputRef$current6;
|