UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

79 lines (78 loc) 4.15 kB
/// <reference types="react" /> import type { ParamValues } from "airplane/api"; import { DefaultParams } from "../../client"; import { SelectTValue } from "../../state/components/select/reducer"; import { SelectComponentProps, SelectItem, SelectProps, SelectPropsWithTask } from "./Select.types"; export declare const Select: { <TParams extends ParamValues | undefined = DefaultParams, TOutput = any>(props: SelectProps<TParams, TOutput>): import("react/jsx-runtime").JSX.Element; displayName: string; }; /** * Presentational select component. */ export declare const SelectComponent: import("react").ForwardRefExoticComponent<{ id?: string | undefined; defaultValue?: string | number | undefined; value?: SelectTValue; label?: import("react").ReactNode; placeholder?: string | undefined; description?: import("react").ReactNode; nothingFound?: import("react").ReactNode; onChange?: ((value: string | null) => void) | undefined; filter?: ((value: string, item: SelectItem) => boolean) | undefined; size?: import("@mantine/core").MantineSize | undefined; defaultDisabled?: boolean | undefined; searchable?: boolean | undefined; clearable?: boolean | undefined; loading?: boolean | undefined; data: (string | number | SelectItem)[]; radius?: import("@mantine/core").MantineSize | undefined; allowDeselect?: boolean | undefined; error?: import("react").ReactNode; initiallyOpened?: boolean | undefined; ItemComponent?: import("react").FunctionComponent<any> | undefined; itemComponent?: import("react").FunctionComponent<any> | undefined; disabled?: boolean | undefined; autoFocus?: boolean | undefined; withinPortal?: boolean | undefined; unstyled?: boolean | undefined; readOnly?: boolean | undefined; sx?: import("@mantine/core").CSSObject | undefined; classNames?: Partial<Record<import("@mantine/core").SelectStylesNames, string>> | undefined; } & import("../layout/layout.types").CommonLayoutProps & import("../styling.types").CommonStylingProps & import("react").RefAttributes<HTMLInputElement>>; export declare const SelectComponentWithoutRef: ({ loading, data, value, defaultValue, filter, withinPortal, innerRef, unstyled, disabled, ItemComponent, itemComponent, className, style, width, height, grow, ...restProps }: { id?: string | undefined; defaultValue?: string | number | undefined; value?: SelectTValue; label?: import("react").ReactNode; placeholder?: string | undefined; description?: import("react").ReactNode; nothingFound?: import("react").ReactNode; onChange?: ((value: string | null) => void) | undefined; filter?: ((value: string, item: SelectItem) => boolean) | undefined; size?: import("@mantine/core").MantineSize | undefined; defaultDisabled?: boolean | undefined; searchable?: boolean | undefined; clearable?: boolean | undefined; loading?: boolean | undefined; data: (string | number | SelectItem)[]; radius?: import("@mantine/core").MantineSize | undefined; allowDeselect?: boolean | undefined; error?: import("react").ReactNode; initiallyOpened?: boolean | undefined; ItemComponent?: import("react").FunctionComponent<any> | undefined; itemComponent?: import("react").FunctionComponent<any> | undefined; disabled?: boolean | undefined; autoFocus?: boolean | undefined; withinPortal?: boolean | undefined; unstyled?: boolean | undefined; readOnly?: boolean | undefined; sx?: import("@mantine/core").CSSObject | undefined; classNames?: Partial<Record<import("@mantine/core").SelectStylesNames, string>> | undefined; } & import("../layout/layout.types").CommonLayoutProps & import("../styling.types").CommonStylingProps & { innerRef: React.Ref<HTMLInputElement>; }) => import("react/jsx-runtime").JSX.Element; /** * outputToData converts task output to Select data. */ export declare function outputToData<TParams extends ParamValues | undefined, TOutput>(output: TOutput, dataTransform?: SelectPropsWithTask<TParams, TOutput>["outputTransform"]): SelectComponentProps["data"];