refactor: Bootstrap to AntD - Form - iteration 2 (#14379)

This commit is contained in:
Michael S. Molina
2021-05-06 02:00:37 -03:00
committed by GitHub
parent fa510df624
commit 331310db9b
24 changed files with 245 additions and 179 deletions

View File

@@ -28,6 +28,7 @@ import './ColorSchemeControl.less';
const propTypes = {
description: PropTypes.string,
label: PropTypes.string.isRequired,
labelMargin: PropTypes.number,
name: PropTypes.string.isRequired,
onChange: PropTypes.func,
value: PropTypes.string,
@@ -92,7 +93,7 @@ export default class ColorSchemeControl extends React.PureComponent {
}
render() {
const { schemes, choices } = this.props;
const { schemes, choices, labelMargin = 0 } = this.props;
// save parsed schemes for later
this.schemes = isFunction(schemes) ? schemes() : schemes;
const options = (isFunction(choices) ? choices() : choices).map(
@@ -118,7 +119,7 @@ export default class ColorSchemeControl extends React.PureComponent {
return (
<div>
<ControlHeader {...this.props} />
<Select {...selectProps} />
<Select {...selectProps} css={{ marginTop: labelMargin }} />
</div>
);
}

View File

@@ -25,7 +25,7 @@ import Button from 'src/components/Button';
import { NativeSelect as Select } from 'src/components/Select';
import { t, styled } from '@superset-ui/core';
import FormLabel from 'src/components/FormLabel';
import { FormLabel } from 'src/components/Form';
import { SQLEditor } from 'src/components/AsyncAceEditor';
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
import { noOp } from 'src/utils/common';

View File

@@ -22,7 +22,7 @@ import Popover from 'src/components/Popover';
import { decimal2sexagesimal } from 'geolib';
import Label from 'src/components/Label';
import FormLabel from 'src/components/FormLabel';
import { FormLabel } from 'src/components/Form';
import TextControl from './TextControl';
import ControlHeader from '../ControlHeader';