mirror of
https://github.com/apache/superset.git
synced 2026-05-31 21:29:19 +00:00
chore: Extract common select component code (#21094)
This commit is contained in:
@@ -20,7 +20,8 @@ import React, { useEffect, useState } from 'react';
|
||||
import { t, SupersetClient } from '@superset-ui/core';
|
||||
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||
import { Select } from 'src/components';
|
||||
import { SelectProps, OptionsType } from 'src/components/Select/Select';
|
||||
import { SelectProps } from 'src/components/Select/Select';
|
||||
import { SelectOptionsType } from 'src/components/Select/utils';
|
||||
import { SelectValue, LabeledValue } from 'antd/lib/select';
|
||||
import withToasts from 'src/components/MessageToasts/withToasts';
|
||||
import { getClientErrorObject } from 'src/utils/getClientErrorObject';
|
||||
@@ -32,7 +33,7 @@ interface SelectAsyncControlProps extends SelectAsyncProps {
|
||||
ariaLabel?: string;
|
||||
dataEndpoint: string;
|
||||
default?: SelectValue;
|
||||
mutator?: (response: Record<string, any>) => OptionsType;
|
||||
mutator?: (response: Record<string, any>) => SelectOptionsType;
|
||||
multi?: boolean;
|
||||
onChange: (val: SelectValue) => void;
|
||||
// ControlHeader related props
|
||||
@@ -57,7 +58,7 @@ const SelectAsyncControl = ({
|
||||
value,
|
||||
...props
|
||||
}: SelectAsyncControlProps) => {
|
||||
const [options, setOptions] = useState<OptionsType>([]);
|
||||
const [options, setOptions] = useState<SelectOptionsType>([]);
|
||||
|
||||
const handleOnChange = (val: SelectValue) => {
|
||||
let onChangeVal = val;
|
||||
|
||||
Reference in New Issue
Block a user