UNPKG

amis-model-design

Version:

amis模型设计器

61 lines (60 loc) 1.71 kB
/** * @file 组件选项组件的可视化编辑控件 */ import React from 'react'; import { Api, FormControlProps, OptionValue } from 'amis-core'; import type { valueType, OptionControlItem } from './OptionsCustom'; export interface PopoverForm { optionLabel: string; optionValue: any; optionValueType: valueType; } export interface OptionControlProps extends FormControlProps { className?: string; } export interface OptionControlState { options: Array<OptionControlItem>; api: Api; labelField: string; valueField: string; source: string; valueType: valueType; } export default class OptionControl extends React.Component<OptionControlProps, OptionControlState> { $comp: string; internalProps: string[]; constructor(props: OptionControlProps); /** * 获取当前选项值的类型 */ getOptionValueType(value: any): valueType; /** * 将当前选项值转换为选择的类型 */ /** * 处理填入输入框的值 */ transformOptionValue(value: any): string; transformOptions(props: OptionControlProps): { label: string | undefined; value: any; checked: boolean; }[]; /** * 处理当前组件的默认值 */ normalizeValue(): OptionValue | OptionValue[]; /** * 更新options字段的统一出口 */ onChange(): void; /** * 切换选项类型 */ handleSourceChange(source: string): void; renderHeader(): React.JSX.Element; handleChange(options: any, triggerChange?: boolean, valueType?: valueType): void; render(): React.JSX.Element; } export declare class OptionControlRenderer extends OptionControl { }