mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-26 07:59:48 +03:00
more
This commit is contained in:
parent
41f82fe7f8
commit
1bb2b39423
|
@ -4,13 +4,22 @@ import Select from '../Select';
|
|||
import Slider from '../Slider';
|
||||
|
||||
/* eslint-disable react/prop-types */
|
||||
const SelectWidget: Widget = ({ options, onChange, value, ...rest }) => (
|
||||
<Select
|
||||
options={options.enumOptions}
|
||||
onChange={(option: { value: string }) => {
|
||||
onChange(option.value);
|
||||
const SelectWidget: Widget = ({
|
||||
options,
|
||||
onChange,
|
||||
value,
|
||||
onBlur,
|
||||
defaultValue,
|
||||
tabIndex,
|
||||
onFocus,
|
||||
...rest
|
||||
}) => (
|
||||
<Select<{ label: string; value: string }>
|
||||
options={options.enumOptions as { label: string; value: string }[]}
|
||||
onChange={(option) => {
|
||||
onChange(option?.value);
|
||||
}}
|
||||
value={(options.enumOptions as { value: string }[]).find(
|
||||
value={(options.enumOptions as { label: string; value: string }[]).find(
|
||||
(option) => option.value === value
|
||||
)}
|
||||
{...rest}
|
||||
|
|
|
@ -81,11 +81,18 @@ export class Select<
|
|||
};
|
||||
}
|
||||
|
||||
interface ExternalSelectProps<
|
||||
Option extends OptionTypeBase = OptionTypeBase,
|
||||
IsMulti extends boolean = false
|
||||
> extends Omit<ReactSelectProps<Option, IsMulti>, 'theme'> {
|
||||
theme?: Theme;
|
||||
}
|
||||
|
||||
type SelectComponent = <
|
||||
Option extends OptionTypeBase = OptionTypeBase,
|
||||
IsMulti extends boolean = false
|
||||
>(
|
||||
props: SelectProps<Option, IsMulti>
|
||||
props: ExternalSelectProps<Option, IsMulti>
|
||||
) => ReactElement;
|
||||
|
||||
export default createThemedComponent(Select) as SelectComponent & {
|
||||
|
|
Loading…
Reference in New Issue
Block a user