@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
18 lines • 869 B
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { warnOnce } from '@awsui/component-toolkit/internal';
import { isDevelopment } from '../../internal/is-development';
export function checkOptionValueField(componentName, propertyName, propertyValue) {
if (isDevelopment) {
if (!propertyValue) {
return;
}
const valuePropertyMissing = !propertyValue.every(element => {
return 'options' in element || 'value' in element;
});
if (valuePropertyMissing) {
warnOnce(componentName, `You provided an \`${propertyName}\` prop where at least one non-group array element is missing the \`value\` field. This field is required for all options without sub-items.`);
}
}
}
//# sourceMappingURL=check-option-value-field.js.map