🏷️(react) move SelectProps to index.tsx
It makes more sense for this type to be next to the Select component.
This commit is contained in:
@@ -1,15 +1,9 @@
|
||||
import React, {
|
||||
forwardRef,
|
||||
PropsWithChildren,
|
||||
useEffect,
|
||||
useState,
|
||||
} from "react";
|
||||
import React, { forwardRef, useEffect, useState } from "react";
|
||||
import { UseSelectStateChange } from "downshift";
|
||||
import { FieldProps } from ":/components/Forms/Field";
|
||||
import { optionToValue, SubProps } from ":/components/Forms/Select/mono-common";
|
||||
import { SelectMonoSearchable } from ":/components/Forms/Select/mono-searchable";
|
||||
import { SelectMonoSimple } from ":/components/Forms/Select/mono-simple";
|
||||
import { SelectHandle } from ":/components/Forms/Select/index";
|
||||
import { SelectHandle, SelectProps } from ":/components/Forms/Select";
|
||||
|
||||
export interface Option {
|
||||
value?: string;
|
||||
@@ -17,26 +11,6 @@ export interface Option {
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export type SelectProps = PropsWithChildren &
|
||||
FieldProps & {
|
||||
label: string;
|
||||
hideLabel?: boolean;
|
||||
options: Option[];
|
||||
searchable?: boolean;
|
||||
name?: string;
|
||||
defaultValue?: string | number | string[];
|
||||
value?: string | number | string[];
|
||||
onChange?: (event: {
|
||||
target: { value: string | number | undefined | string[] };
|
||||
}) => void;
|
||||
onBlur?: (event: {
|
||||
target: { value: string | number | undefined | string[] };
|
||||
}) => void;
|
||||
disabled?: boolean;
|
||||
clearable?: boolean;
|
||||
multi?: boolean;
|
||||
};
|
||||
|
||||
export const SelectMono = forwardRef<SelectHandle, SelectProps>(
|
||||
(props, ref) => {
|
||||
const defaultSelectedItem = props.defaultValue
|
||||
|
||||
Reference in New Issue
Block a user