UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

156 lines (155 loc) 6.29 kB
import { AxiosInstance, AxiosPromise, AxiosRequestConfig } from 'axios'; import { ReactNode } from 'react'; import { LovConfig } from '../../pro/lib/lov/Lov'; import { ExportMode, RecordStatus } from '../../pro/lib/data-set/enum'; import { Customized, expandIconProps, Suffixes, TablePaginationConfig, TableProps, TableQueryBarHook } from '../../pro/lib/table/Table'; import { ValidationMessages } from '../../pro/lib/validator/Validator'; import { ButtonProps } from '../../pro/lib/button/Button'; import { DragColumnAlign, TableColumnTooltip, TableQueryBarType } from '../../pro/lib/table/enum'; import { TransportHookProps, TransportProps } from '../../pro/lib/data-set/Transport'; import DataSet from '../../pro/lib/data-set/DataSet'; import { FeedBack } from '../../pro/lib/data-set/FeedBack'; import Record from '../../pro/lib/data-set/Record'; import { CacheOptions } from '../../pro/lib/_util/Cache'; import { LabelLayout } from '../../pro/lib/form/enum'; import { ButtonColor, FuncType } from '../../pro/lib/button/enum'; import { Renderer } from '../../pro/lib/field/FormField'; import { FormatNumberFunc, FormatNumberFuncOptions } from '../../pro/lib/number-field/NumberField'; import { ModalProps } from '../../pro/lib/modal/interface'; import { onCellProps } from '../../pro/lib/table/Column'; import { SpinProps } from '../spin'; import { PanelProps } from '../collapse'; export declare type Status = { [RecordStatus.add]: string; [RecordStatus.update]: string; [RecordStatus.delete]: string; }; export declare type renderEmptyHandler = (componentName?: string) => ReactNode; export declare type Formatter = { jsonDate?: string | null; date?: string; dateTime?: string; time?: string; year?: string; month?: string; week?: string; }; export declare type Config = { prefixCls?: string; proPrefixCls?: string; iconfontPrefix?: string; ripple?: boolean; collapseExpandIconPosition?: string; collapseExpandIcon?: (panelProps: PanelProps) => ReactNode | 'text'; collapseTrigger?: string; lookupCache?: CacheOptions<string, AxiosPromise>; lookupUrl?: string | ((code: string) => string); lookupAxiosMethod?: string; lookupAxiosConfig?: AxiosRequestConfig | ((props: { params?: any; dataSet?: DataSet; record?: Record; lookupCode?: string; }) => AxiosRequestConfig); lookupBatchAxiosConfig?: (codes: string[]) => AxiosRequestConfig; lovDefineUrl?: string | ((code: string) => string); lovDefineAxiosConfig?: AxiosRequestConfig | ((code: string) => AxiosRequestConfig); lovQueryUrl?: string | ((code: string, lovConfig: LovConfig | undefined, props: TransportHookProps) => string); lovQueryAxiosConfig?: AxiosRequestConfig | ((code: string, lovConfig: LovConfig | undefined, props: TransportHookProps) => AxiosRequestConfig); lovTableProps?: TableProps; lovModalProps?: ModalProps; lovTableCustomizable?: boolean; lovAutoSelectSingle?: boolean; axios?: AxiosInstance; feedback?: FeedBack; dataKey?: string; totalKey?: string; statusKey?: string; tlsKey?: string; status?: Status; exportMode?: ExportMode; labelLayout?: LabelLayout; queryBar?: TableQueryBarType | TableQueryBarHook; tableBorder?: boolean; tableHighLightRow?: boolean; tableParityRow?: boolean; tableSelectedHighLightRow?: boolean; tableRowHeight?: 'auto' | number; tableColumnTooltip?: TableColumnTooltip; tableColumnResizable?: boolean; tableColumnHideable?: boolean; tableColumnTitleEditable?: boolean; tableDragColumnAlign?: DragColumnAlign; tableColumnDraggable?: boolean; tableRowDraggable?: boolean; tableExpandIcon?: (props: expandIconProps) => ReactNode; tableSpinProps?: SpinProps; tableButtonProps?: ButtonProps; tableCommandProps?: ButtonProps; tableDefaultRenderer?: Renderer; tableColumnOnCell?: (props: onCellProps) => object; tableShowSelectionTips?: boolean; tableAlwaysShowRowBox?: boolean; tableUseMouseBatchChoose?: boolean; tableEditorNextKeyEnterDown?: boolean; tableAutoFocus?: boolean; tableKeyboard?: boolean; tableFilterAdapter?: TransportProps; tableFilterSuffix?: Suffixes[]; tableFilterSearchText?: string; tableAutoHeightDiff?: number; tableCustomizable?: boolean; tableCustomizedSave?: (code: string, customized: Customized) => void; tableCustomizedLoad?: (code: string) => Promise<Customized | null>; pagination?: TablePaginationConfig | false; modalSectionBorder?: boolean; drawerSectionBorder?: boolean; drawerTransitionName?: string; modalAutoCenter?: boolean; modalOkFirst?: boolean; drawerOkFirst?: boolean; modalButtonProps?: ButtonProps; modalKeyboard?: boolean; modalMaskClosable?: string | boolean; buttonFuncType?: FuncType; buttonColor?: ButtonColor; renderEmpty?: renderEmptyHandler; defaultValidationMessages?: ValidationMessages; transport?: TransportProps; icons?: { [key: string]: string[]; } | string[]; generatePageQuery?: (pageParams: { page?: number; pageSize?: number; sortName?: string; sortOrder?: string; }) => object; formatter?: Formatter; dropdownMatchSelectWidth?: boolean; selectReverse?: boolean; selectPagingOptionContent?: string | ReactNode; selectSearchable?: boolean; useColon?: boolean; excludeUseColonTagList?: string[]; textFieldAutoComplete?: 'on' | 'off'; resultStatusRenderer?: object; numberFieldNonStrictStep?: boolean; numberFieldFormatter?: FormatNumberFunc; numberFieldFormatterOptions?: FormatNumberFuncOptions; /** * @deprecated * 同 tableColumnDraggable */ tableDragColumn?: boolean; /** * @deprecated * 同 tableRowDraggable */ tableDragRow?: boolean; }; export declare type ConfigKeys = keyof Config; export declare function getConfig(key: ConfigKeys): any; export declare function getPrefixCls(suffixCls: string, customizePrefixCls?: string): string; export declare function getProPrefixCls(suffixCls: string, customizePrefixCls?: string): string; export default function configure(config: Config): void;