UNPKG

choerodon-ui

Version:

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

124 lines (123 loc) 4.16 kB
import { ReactElement, ReactNode } from 'react'; import { ColProps } from '../../../lib/col'; import { RowProps } from '../../../lib/row'; import DataSetComponent, { DataSetComponentProps } from '../data-set/DataSetComponent'; import DataSet from '../data-set/DataSet'; import Field from '../data-set/Field'; import Record from '../data-set/Record'; import { FieldType } from '../data-set/enum'; import { FormContextValue } from '../form/FormContext'; export declare function getItemKey(record: Record, text: ReactNode, value: any): string; export declare type RenderProps = { options?: DataSet; name?: string; dataSet?: DataSet; onConfirm?: (confirm: Confirm) => void; record?: Record; }; export declare type Renderer = (props: RenderProps) => ReactNode; export interface Confirm { value: string; fieldName: string | undefined; } export interface ScreeningItemProps extends DataSetComponentProps { multiple?: boolean; dataSet?: DataSet; name: string; primitiveValue?: boolean; onChange?: (value: any, oldValue: any, formNode: any) => void; renderer?: Renderer; onConfirm: (confirm: Confirm) => void; onRef?: (ref: any) => void; colProps?: ColProps; rowProps?: RowProps; optionRenderer?: ({ text, value, record }: { text: string; value: any; record: Record; }) => ReactElement<any>; } export default class Screening extends DataSetComponent<ScreeningItemProps, FormContextValue> { static displayName: string; iconExpanded: boolean; screeningMultiple: boolean; emptyValue?: any; text?: any; constructor(props: any, context: any); static defaultProps: { suffixCls: string; multiple: boolean; colProps: { span: number; }; }; componentDidMount(): void; /** * return the record: dataIndex record, current, undefined */ get record(): Record | undefined; get value(): any | undefined; set value(value: any | undefined); get editable(): boolean; /** * 判断是否展示更多按钮 */ get needExpandButton(): boolean; get name(): string | undefined; get primitive(): boolean; /** * get field message: recordField,dsField,undefined */ get field(): Field | undefined; getProp(propName: string): any; handleChange(e: any): void; get options(): DataSet; get multiple(): boolean; get textField(): string; get valueField(): string; getFieldType(): FieldType; getDateFormat(): string; handleExpanedClick: () => void; choose(record?: Record | null): void; unChoose(record?: Record | null): void; handleOptionSelect(record: Record): void; handleOptionUnSelect(record: Record): void; getDataSetValue(): any; getValue(): any; getValues(): any[]; getOldValue(): any; addValue(...values: any[]): void; getValueKey(v: any): any; removeValues(values: any[], index?: number): void; afterRemoveValue(_value: any, _repeat: number): void; removeValue(value: any, index?: number): void; isReadOnly(): boolean; setValue(value: any): void; /** * 提交值,触发dataSet修改和提交方法。 */ handleConfirm: () => void; prepareSetValue(...value: any[]): void; handleSelect: (info: any) => void; handleDeselect: (info: any) => void; handleClick: (_info: any) => void; findByValue(value: any): Record | undefined; processObjectValue(value: any, textField: any): any; processValueNormal(value: any): string; processLookupValue(value: any): string; processValue(value: any): string; processRecordToObject(record: Record): any; getTextNode(): ReactNode; getText(value: any): string; processText(value: string): string; processRenderer(value?: any): ReactNode; getScreeningOption: () => JSX.Element[] | null; getObservableProps(props: any, context: any): any; getOmitPropsKeys(): string[]; getOtherProps(): any; getLabel(): any; handleMultiple: () => void; handleClear: () => void; handleCancel: () => void; render(): JSX.Element; }