//
// SPDX-License-Identifier: AGPL-3.0
-import * as React from 'react';
+import React from 'react';
import { WrappedFieldProps } from 'redux-form';
-import { ArvadosTheme } from '~/common/custom-theme';
+import { ArvadosTheme } from 'common/custom-theme';
import { StyleRulesCallback, WithStyles, withStyles, FormControl, InputLabel, Select, FormHelperText } from '@material-ui/core';
type CssRules = 'formControl' | 'selectWrapper' | 'select' | 'option';
}
});
+interface NativeSelectFieldProps {
+ disabled?: boolean;
+}
+
export const NativeSelectField = withStyles(styles)
- ((props: WrappedFieldProps & WithStyles<CssRules> & { items: any[] }) =>
+ ((props: WrappedFieldProps & NativeSelectFieldProps & WithStyles<CssRules> & { items: any[] }) =>
<FormControl className={props.classes.formControl}>
<Select className={props.classes.selectWrapper}
native
value={props.input.value}
onChange={props.input.onChange}
- disabled={props.meta.submitting}
+ disabled={props.meta.submitting || props.disabled}
name={props.input.name}
inputProps={{
id: `id-${props.input.name}`,
</Select>
<FormHelperText>{props.meta.error}</FormHelperText>
</FormControl>
-);
\ No newline at end of file
+);