mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
Optimize config form and binder
This commit is contained in:
@@ -33,15 +33,19 @@ type Props = {
|
||||
testId?: string;
|
||||
} & InputHTMLAttributes<HTMLSelectElement>;
|
||||
|
||||
/**
|
||||
* @beta
|
||||
* @since 2.44.0
|
||||
*/
|
||||
const Select = React.forwardRef<HTMLSelectElement, Props>(
|
||||
({ variant, children, className, options, testId, ...props }, ref) => (
|
||||
<div className={classNames("select", { "is-multiple": props.multiple }, createVariantClass(variant), className)}>
|
||||
<select ref={ref} {...props} {...createAttributesForTesting(testId)} className={className}>
|
||||
{options
|
||||
? options.map((option) => (
|
||||
<option {...option} key={option.value as Key}>
|
||||
{option.label}
|
||||
{option.children}
|
||||
? options.map((opt) => (
|
||||
<option {...opt} key={opt.value as Key}>
|
||||
{opt.label}
|
||||
{opt.children}
|
||||
</option>
|
||||
))
|
||||
: children}
|
||||
|
||||
@@ -39,6 +39,8 @@ type Props = {
|
||||
|
||||
/**
|
||||
* @see https://bulma.io/documentation/form/select/
|
||||
* @beta
|
||||
* @since 2.44.0
|
||||
*/
|
||||
const SelectField = React.forwardRef<HTMLSelectElement, Props>(
|
||||
({ label, helpText, error, className, id, ...props }, ref) => {
|
||||
|
||||
Reference in New Issue
Block a user