UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

55 lines (54 loc) 1.44 kB
import type { FormBaseControlSchema, FormControlProps } from '../types'; export * from './components/types'; /** * JSON Schema Editor * */ export interface JSONSchemaEditorControlSchema extends FormBaseControlSchema { /** * 指定为 JSON Schema Editor */ type: 'json-schema-editor'; /** * 可以理解为类型模板,方便快速定义复杂类型 */ definitions?: { [propName: string]: { title: string; type: 'string' | 'number' | 'integer' | 'object' | 'array' | 'boolean' | 'null'; [propName: string]: any; }; }; /** * 顶层是否允许修改类型 */ rootTypeMutable?: boolean; /** * 顶层类型信息是否隐藏 */ showRootInfo?: boolean; /** * 禁用类型,默认禁用了 null 类型 */ disabledTypes?: Array<string>; /** * 开启详情配置 */ enableAdvancedSetting?: boolean; /** * 自定义详情配置面板如: * * { * boolean: [ * {type: "input-text", name: "aa", label: "AA" } * ] * } * * 当配置布尔字段详情时,就会出现以上配置 */ advancedSettings?: { [propName: string]: any; }; } export interface JSONSchemaEditorProps extends FormControlProps, Omit<JSONSchemaEditorControlSchema, 'type' | 'className' | 'descriptionClassName' | 'inputClassName'> { }