@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
21 lines • 744 B
JavaScript
export const connectOptionsByValue = (options, selectedOptions) => {
return (selectedOptions || []).map(selectedOption => {
for (const dropdownOption of options) {
if (dropdownOption.type !== 'parent' &&
dropdownOption.option.value === selectedOption.value) {
return dropdownOption;
}
}
return { option: selectedOption };
});
};
export const findOptionIndex = (options, option) => {
for (let index = 0; index < options.length; index++) {
const __option = options[index];
if (__option === option || __option.value === option.value) {
return index;
}
}
return -1;
};
//# sourceMappingURL=connect-options.js.map