import { GenericObject } from "@mongez/reinforcements"; import { AxiosResponse } from "axios"; import React, { ComponentType } from "react"; import { Column } from "../Column"; import type { FormatterProps } from "../TableProps"; export declare function defaultOnChangeInputColumn({ value, superTable, row, column, }: InputComponentChangeData): void; export type InputColumnValidateCallback = (valudateOptions: Pick) => boolean | Promise; export declare class InputColumn extends Column { /** * Component props */ componentProps: GenericObject; /** * Not permitted formatter */ protected _notPermittedFormatter?: React.ComponentType; /** * This on change callback will be called when the input value changes if the _onChange is not provided */ protected _defaultOnChange: ColumnInputOnChange; /** * Validate callback */ protected _validate: InputColumnValidateCallback; /** * Component */ protected _component: ComponentType; /** * On input value change */ protected _onChange?: ColumnInputOnChange; /** * Deboucne delay */ protected _debounceDelay: number; /** * Default value prop */ protected _valueProp: string; /** * Permission key */ protected _permissionKey: string; /** * Input placeholder */ placeholder(placeholder: string): this; /** * Input name * * @default to the column name */ inputName(name: string): this; /** * Input props */ inputProps(props: GenericObject): this; /** * Not permitted formatter */ notPermittedFormatter(formatter: React.ComponentType): this; /** * Default value prop */ valueProp(prop: string): this; /** * Permission key */ permission(key: string): this; /** * On input value change */ onChange(onChange: ColumnInputOnChange): this; /** * Set Component */ component(Component: ComponentType): this; /** * Input width */ width(width: string | number): this; /** * Add input style */ style(style: React.CSSProperties): this; style(key: string, value: string | number): this; /** * Set debounce delay */ debounce(delay: number): this; /** * Validate input value * This will be called when the input value changes and before calling the onChange method * If not returned true, the onChange method will not be called */ validateInput(validate: InputColumnValidateCallback): this; /** * {@inheritDoc} */ getFormatter(): any; } export type InputColumnFormatterProps = Omit & { column: InputColumn; }; export declare function InputColumnFormatter({ row, rowIndex, column, superTable, value, ...others }: InputColumnFormatterProps): any; export declare class NumberInputColumn extends InputColumn { /** * Whether to hide controls */ hideControls(hide?: boolean): this; } export type ColumnInputOptions = { heading?: React.ReactNode; placeholder?: string; inputProps?: GenericObject; valueProp?: string; inputName?: string; notPermittedFormatter?: React.ComponentType; }; export type InputComponentChangeData = { value: any; } & InputColumnFormatterProps & ColumnInputOptions; export type ColumnInputOnChange = (data: InputComponentChangeData) => void; export declare const inputColumn: (name: string, heading: string, component: ComponentType) => InputColumn; export declare function textInputColumn(name: string, heading?: string): InputColumn; export declare const emailInputColumn: (name: string, heading?: string) => InputColumn; export declare function booleanInputColumn(name: string, heading?: string): InputColumn; export declare function activeInputColumn(): InputColumn; export declare function chooseInputColumn(name: string, data: any[], heading?: string): InputColumn; export declare function numberInputColumn(name: string, heading?: string): NumberInputColumn; export declare function selectInputColumn(name: string, heading?: string): SelectInputColumn; export declare class SelectInputColumn extends InputColumn { /** * Add initial request */ request(request: () => Promise>): this; /** * Placeholder */ placeholder(placeholder: string): this; /** * Add lazy request */ lazyRequest(request: () => Promise>): this; /** * Set data list */ dataList(data: any[]): this; /** * Add search request */ searchRequest(request: (keywords: string) => Promise>): this; } //# sourceMappingURL=inputColumn.d.ts.map