chore: Removes Select duplication (#13477)
This commit is contained in:
parent
11dd2493b3
commit
8ddcba82e0
|
|
@ -24,9 +24,8 @@ import fetchMock from 'fetch-mock';
|
|||
import { act } from 'react-dom/test-utils';
|
||||
import AlertReportModal from 'src/views/CRUD/alert/AlertReportModal';
|
||||
import Modal from 'src/common/components/Modal';
|
||||
import { AsyncSelect } from 'src/components/Select';
|
||||
import { AsyncSelect, NativeGraySelect as Select } from 'src/components/Select';
|
||||
import { Radio } from 'src/common/components/Radio';
|
||||
import { GraySelect as Select } from 'src/common/components/Select';
|
||||
import { Switch } from 'src/common/components/Switch';
|
||||
import TextAreaControl from 'src/explore/components/controls/TextAreaControl';
|
||||
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
|
||||
|
|
|
|||
|
|
@ -18,18 +18,15 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { styled } from '@superset-ui/core';
|
||||
import { Select as BaseSelect, SelectProps } from 'src/common/components';
|
||||
import Select, { SelectProps } from 'antd/lib/select';
|
||||
|
||||
const StyledSelect = styled((props: SelectProps<any>) => (
|
||||
<BaseSelect
|
||||
getPopupContainer={(trigger: any) => trigger.parentNode}
|
||||
{...props}
|
||||
/>
|
||||
const StyledNativeSelect = styled((props: SelectProps<any>) => (
|
||||
<Select getPopupContainer={(trigger: any) => trigger.parentNode} {...props} />
|
||||
))`
|
||||
display: block;
|
||||
`;
|
||||
|
||||
const StyledGraySelect = styled(StyledSelect)`
|
||||
const StyledNativeGraySelect = styled(Select)`
|
||||
&.ant-select-single {
|
||||
.ant-select-selector {
|
||||
height: 36px;
|
||||
|
|
@ -49,12 +46,11 @@ const StyledGraySelect = styled(StyledSelect)`
|
|||
}
|
||||
}
|
||||
`;
|
||||
const StyledOption = BaseSelect.Option;
|
||||
|
||||
export const Select = Object.assign(StyledSelect, {
|
||||
Option: StyledOption,
|
||||
export const NativeSelect = Object.assign(StyledNativeSelect, {
|
||||
Option: Select.Option,
|
||||
});
|
||||
|
||||
export const GraySelect = Object.assign(StyledGraySelect, {
|
||||
Option: StyledOption,
|
||||
export const NativeGraySelect = Object.assign(StyledNativeGraySelect, {
|
||||
Option: Select.Option,
|
||||
});
|
||||
|
|
@ -20,3 +20,4 @@ export * from './Select';
|
|||
export * from './styles';
|
||||
export { default } from './Select';
|
||||
export { default as OnPasteSelect } from './OnPasteSelect';
|
||||
export { NativeSelect, NativeGraySelect } from './NativeSelect';
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { FormGroup } from 'react-bootstrap';
|
||||
import { Select } from 'src/common/components/Select';
|
||||
import { NativeSelect as Select } from 'src/components/Select';
|
||||
import { Input } from 'src/common/components';
|
||||
import { t, SupersetClient, styled } from '@superset-ui/core';
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { FormGroup } from 'react-bootstrap';
|
||||
import { Select } from 'src/common/components/Select';
|
||||
import { NativeSelect as Select } from 'src/components/Select';
|
||||
import { t } from '@superset-ui/core';
|
||||
import { SQLEditor } from 'src/components/AsyncAceEditor';
|
||||
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import PropTypes from 'prop-types';
|
|||
import { FormGroup } from 'react-bootstrap';
|
||||
import Tabs from 'src/common/components/Tabs';
|
||||
import Button from 'src/components/Button';
|
||||
import { Select } from 'src/common/components/Select';
|
||||
import { NativeSelect as Select } from 'src/components/Select';
|
||||
import { styled, t } from '@superset-ui/core';
|
||||
import { ColumnOption, MetricOption } from '@superset-ui/chart-controls';
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,8 @@ import { useSingleViewResource } from 'src/views/CRUD/hooks';
|
|||
import Icon from 'src/components/Icon';
|
||||
import Modal from 'src/common/components/Modal';
|
||||
import { Switch } from 'src/common/components/Switch';
|
||||
import { GraySelect as Select } from 'src/common/components/Select';
|
||||
import { Radio } from 'src/common/components/Radio';
|
||||
import { AsyncSelect } from 'src/components/Select';
|
||||
import { AsyncSelect, NativeGraySelect as Select } from 'src/components/Select';
|
||||
import withToasts from 'src/messageToasts/enhancers/withToasts';
|
||||
import Owner from 'src/types/Owner';
|
||||
import TextAreaControl from 'src/explore/components/controls/TextAreaControl';
|
||||
|
|
|
|||
Loading…
Reference in New Issue