mirror of
https://github.com/apache/superset.git
synced 2026-06-05 23:59:25 +00:00
* make fieldset conditions more clear * make label required * use render* pattern * use slugify util for turning labels into ids * use field rather than html * don't need panel-title class here
30 lines
851 B
JavaScript
30 lines
851 B
JavaScript
import React, { PropTypes } from 'react';
|
|
import { FormGroup, FormControl } from 'react-bootstrap';
|
|
import ControlLabelWithTooltip from './ControlLabelWithTooltip';
|
|
import { slugify } from '../../modules/utils';
|
|
|
|
const propTypes = {
|
|
label: PropTypes.string,
|
|
description: PropTypes.string,
|
|
};
|
|
|
|
const defaultProps = {
|
|
label: null,
|
|
description: null,
|
|
};
|
|
|
|
export default function SelectField({ label, description }) {
|
|
return (
|
|
<FormGroup controlId={`formControlsSelect-${slugify(label)}`}>
|
|
<ControlLabelWithTooltip label={label} description={description} />
|
|
<FormControl componentClass="select" placeholder="select">
|
|
<option value="select">select</option>
|
|
<option value="other">...</option>
|
|
</FormControl>
|
|
</FormGroup>
|
|
);
|
|
}
|
|
|
|
SelectField.propTypes = propTypes;
|
|
SelectField.defaultProps = defaultProps;
|