Export SelectProperties type.
This commit is contained in:
parent
9edbc97d61
commit
f196f98317
1 changed files with 63 additions and 58 deletions
|
@ -5,22 +5,9 @@ import {classes, Modify, normalizeString} from "../../Utils";
|
|||
import {CaretDown, Check, X} from "@phosphor-icons/react";
|
||||
|
||||
/**
|
||||
* Generic select component.
|
||||
* Generic select component properties.
|
||||
*/
|
||||
export function Select<OptionKey extends keyof any, Option>(
|
||||
{
|
||||
className,
|
||||
value, onChange,
|
||||
options, renderOption, match,
|
||||
selectibleMaxCount, multiple,
|
||||
blurOnSelect, blurWhenMaxCountSelected,
|
||||
// Properties to pass down.
|
||||
onKeyDown,
|
||||
// Already set properties.
|
||||
type, role,
|
||||
children,
|
||||
...props
|
||||
}: React.PropsWithChildren<Modify<React.InputHTMLAttributes<HTMLInputElement>, {
|
||||
export type SelectProperties<OptionKey extends keyof any, Option> = React.PropsWithChildren<Modify<React.InputHTMLAttributes<HTMLInputElement>, {
|
||||
/**
|
||||
* The currently selected option(s).
|
||||
*/
|
||||
|
@ -77,7 +64,25 @@ export function Select<OptionKey extends keyof any, Option>(
|
|||
// Already set properties.
|
||||
type?: never;
|
||||
role?: never;
|
||||
}>>): React.ReactElement
|
||||
}>>;
|
||||
|
||||
/**
|
||||
* Generic select component.
|
||||
*/
|
||||
export function Select<OptionKey extends keyof any, Option>(
|
||||
{
|
||||
className,
|
||||
value, onChange,
|
||||
options, renderOption, match,
|
||||
selectibleMaxCount, multiple,
|
||||
blurOnSelect, blurWhenMaxCountSelected,
|
||||
// Properties to pass down.
|
||||
onKeyDown,
|
||||
// Already set properties.
|
||||
type, role,
|
||||
children,
|
||||
...props
|
||||
}: SelectProperties<OptionKey, Option>): React.ReactElement
|
||||
{
|
||||
const [search, setSearch] = React.useState("");
|
||||
|
||||
|
|
Loading…
Reference in a new issue