jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
35 lines (34 loc) • 1.52 kB
TypeScript
import React from 'react';
import type { LocaleProps, SchemaClassName, ThemeProps } from 'jamis-core';
import type { ConditionBuilderConfig, ConditionBuilderFields, ConditionBuilderFuncs, ConditionRule, FormulaPickerProps, OperatorType } from '../../types';
export interface ConditionItemProps extends ThemeProps, LocaleProps {
config: ConditionBuilderConfig;
fields: ConditionBuilderFields;
funcs?: ConditionBuilderFuncs;
index?: number;
value: ConditionRule;
data?: any;
disabled?: boolean;
searchable?: boolean;
fieldClassName?: string;
formula?: FormulaPickerProps;
popOverContainer?: any;
renderEtrValue?: any;
valueClassName?: SchemaClassName;
onChange: (value: ConditionRule, index?: number) => void;
}
export declare class ConditionItem extends React.Component<ConditionItemProps> {
operatorRef: React.RefObject<HTMLInputElement>;
handleLeftFieldSelect(field: any): void;
handleLeftInputTypeChange(type: 'func' | 'field'): void;
handleLeftChange(leftValue: any): void;
handleOperatorChange(op: OperatorType): void;
handleRightChange(rightValue: any): void;
handleRightSubChange(isCustom: boolean, index: number | string, rightValue: any): void;
renderLeft(): JSX.Element;
renderOperator(): JSX.Element | null;
renderRight(): JSX.Element | JSX.Element[] | null;
renderRightWidgets(type: string, op: OperatorType): JSX.Element | JSX.Element[] | null;
render(): JSX.Element;
}
export default ConditionItem;