dynamic-modal
Version:
The dynamic-modal is a solution of creation different modals into project using a json configuration file
29 lines (28 loc) • 1.06 kB
TypeScript
import { CSSProperties, JSX, TableHTMLAttributes } from 'react';
import { IField, IFieldProps } from './field';
import { IModalLiveDataCondition } from './modal';
export interface ITableColumn extends Pick<IField, 'style'> {
title: string;
key?: string;
isButton?: boolean;
isDeleteAction?: boolean;
Icon?: (props: any) => JSX.Element;
action?: (row: any) => void;
}
type ITableHtmlProps = Omit<TableHTMLAttributes<HTMLTableElement>, 'style'>;
export interface IMakeTable extends Omit<IField, 'label' | 'defaultValue' | 'validation' | 'disabled' | 'enableIf' | 'id'>, ITableHtmlProps {
elementType: 'table';
selectValueName: string;
selectTitleName: string;
selectPlaceholder?: string;
selectActionName: string;
buttonStyle?: CSSProperties;
columns: Array<ITableColumn>;
defaultSelected?: Array<string>;
data: Array<any>;
liveData?: IModalLiveDataCondition;
}
export interface IMakeTableProps extends Omit<IFieldProps, 'unregister'> {
element: Omit<IMakeTable, 'elementType'>;
}
export {};