phx-react
Version:
PHX REACT
48 lines (47 loc) • 1.47 kB
TypeScript
import React, { ReactNode } from 'react';
import { BadgeProps } from '../Badge';
export type IconItemType = 'edit' | 'delete';
export interface ActionItem {
type: IconItemType;
onClick(val: string): void;
}
export interface SelectOption {
value: string;
label: string;
helpText?: string | SelectHelpText | Array<SelectHelpText>;
badge?: BadgeProps;
action?: ActionItem;
isHelpTextArray?: boolean;
}
export interface Search {
value: string;
handleFilter(value: string): void;
}
export interface SelectHelpText {
title: string;
description: string;
}
export interface PHXSelectWithActionProps {
label: string;
suffix?: ReactNode;
placeholder?: string;
options: Array<SelectOption>;
value?: string;
search?: Search;
enableSearch?: boolean;
onChange?(value: string): void;
searchPlaceholder?: string;
className?: string;
maxHeight?: string;
error?: string;
helpText?: string | SelectHelpText;
emptyState?: ReactNode;
disabled?: boolean;
emptySearchState?: ReactNode;
loading?: boolean;
addNew?: {
title: string;
onClick(): void;
};
}
export declare function PHXSelectWithAction({ addNew, className, emptySearchState, emptyState, error, helpText, label, loading, enableSearch, maxHeight, onChange, options, placeholder, search, searchPlaceholder, suffix, value: defaultValue, disabled, }: PHXSelectWithActionProps): React.JSX.Element;