import { uuid, createFormItemSchema } from '../utils'; // 直接从designable copy过来,如果有setter不支持那就自己加 export const propsSchema = { type: 'object', properties: { addonBefore: { title: '前缀标签', type: 'string', 'x-decorator': 'FormItem', 'x-component': 'Input', }, addonAfter: { title: '后缀标签', type: 'string', 'x-decorator': 'FormItem', 'x-component': 'Input', }, prefix: { title: '后缀标签', type: 'string', 'x-decorator': 'FormItem', 'x-component': 'Input', }, suffix: { title: '后缀', type: 'string', 'x-decorator': 'FormItem', 'x-component': 'Input', }, allowClear: { title: '允许清除内容', type: 'boolean', 'x-decorator': 'FormItem', 'x-component': 'Switch', }, bordered: { title: '是否有边框', type: 'boolean', 'x-decorator': 'FormItem', 'x-component': 'Switch', 'x-component-props': { defaultChecked: true, }, }, maxLength: { title: '最大长度', type: 'number', 'x-decorator': 'FormItem', 'x-component': 'NumberPicker', }, placeholder: { type: 'string', title: '占位提示', 'x-decorator': 'FormItem', 'x-component': 'Input', }, size: { title: '尺寸', type: 'string', enum: ['large', 'small', 'middle'], 'x-decorator': 'FormItem', 'x-component': 'Select', 'x-component-props': { defaultValue: 'middle', }, }, }, }; export default createFormItemSchema(propsSchema, { field: () => ({ name: uuid(), title: 'Input', }), });