UNPKG

@linzjs/step-ag-grid

Version:

[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) > Reusable [ag-grid](https://www.ag-grid.com/) component for LINZ / Toitū te whenua.

41 lines (40 loc) 2.15 kB
import { ReactElement } from 'react'; import { GridBaseRow } from '../Grid'; import { CellEditorCommon } from '../GridCell'; export interface GridPopoutEditDropDownSelectedItem<TData extends GridBaseRow, TOption> { selectedRows: TData[]; selectedRowIds: TData['id'][]; value: TOption; subComponentValue?: any; } interface FinalSelectOption<TOptionValue> { value: TOptionValue; label?: ReactElement | string; disabled?: boolean | string; subComponent?: (props: any, ref: any) => any; } export declare const primitiveToSelectOption: <T>(value: T) => SelectOption<T>; export declare const MenuSeparatorString = "_____MENU_SEPARATOR_____"; export declare const MenuSeparator: Readonly<{ value: "_____MENU_SEPARATOR_____"; }>; export declare const MenuHeaderString = "_____MENU_HEADER_____"; export declare const MenuHeaderItem: (title: string) => { label: string; value: string; }; export type SelectOption<TOptionValue = any> = FinalSelectOption<TOptionValue>; export type MaybePromise<T> = T | Promise<T>; export interface GridFormDropDownProps<TData extends GridBaseRow, TOptionValue> extends CellEditorCommon { className?: 'GridPopoverEditDropDown-containerSmall' | 'GridPopoverEditDropDown-containerMedium' | 'GridPopoverEditDropDown-containerLarge' | 'GridPopoverEditDropDown-containerUnlimited' | 'GridPopoverEditDropDown-containerAutoWidth' | string | undefined; filtered?: 'local' | 'reload'; filterDefaultValue?: string; filterPlaceholder?: string; filterHelpText?: string; noOptionsMessage?: string; onSelectedItem?: (props: GridPopoutEditDropDownSelectedItem<TData, TOptionValue>) => Promise<void> | void; onSelectFilter?: (props: GridPopoutEditDropDownSelectedItem<TData, TOptionValue>) => Promise<void> | void; options: FinalSelectOption<TOptionValue>[] | ((selectedRows: TData[], filter?: string) => MaybePromise<FinalSelectOption<TOptionValue>[] | undefined>) | undefined; } export declare const GridFormDropDown: <TData extends GridBaseRow, TOptionValue>(props: GridFormDropDownProps<TData, TOptionValue>) => import("react/jsx-runtime").JSX.Element; export {};