mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 13:38:56 +08:00
类型调整
This commit is contained in:
parent
79009c27e9
commit
26d1aecff9
@ -9,6 +9,7 @@ import {BaseSchema} from '../Schema';
|
||||
export interface DividerSchema extends BaseSchema {
|
||||
type: 'divider';
|
||||
lineStyle?: 'dashed' | 'solid';
|
||||
[propName: string]: any;
|
||||
}
|
||||
|
||||
export interface DividerProps extends RendererProps, DividerSchema {}
|
||||
|
@ -9,7 +9,46 @@ import Editor from '../../components/Editor';
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/editor
|
||||
*/
|
||||
export interface EditorControlSchema extends Omit<FormBaseControl, 'size'> {
|
||||
type: 'editor';
|
||||
type:
|
||||
| 'editor'
|
||||
| 'bat-editor'
|
||||
| 'c-editor'
|
||||
| 'coffeescript-editor'
|
||||
| 'cpp-editor'
|
||||
| 'csharp-editor'
|
||||
| 'css-editor'
|
||||
| 'dockerfile-editor'
|
||||
| 'fsharp-editor'
|
||||
| 'go-editor'
|
||||
| 'handlebars-editor'
|
||||
| 'html-editor'
|
||||
| 'ini-editor'
|
||||
| 'java-editor'
|
||||
| 'javascript-editor'
|
||||
| 'json-editor'
|
||||
| 'less-editor'
|
||||
| 'lua-editor'
|
||||
| 'markdown-editor'
|
||||
| 'msdax-editor'
|
||||
| 'objective-c-editor'
|
||||
| 'php-editor'
|
||||
| 'plaintext-editor'
|
||||
| 'postiats-editor'
|
||||
| 'powershell-editor'
|
||||
| 'pug-editor'
|
||||
| 'python-editor'
|
||||
| 'r-editor'
|
||||
| 'razor-editor'
|
||||
| 'ruby-editor'
|
||||
| 'sb-editor'
|
||||
| 'scss-editor'
|
||||
| 'sol-editor'
|
||||
| 'sql-editor'
|
||||
| 'swift-editor'
|
||||
| 'typescript-editor'
|
||||
| 'vb-editor'
|
||||
| 'xml-editor'
|
||||
| 'yaml-editor';
|
||||
|
||||
/**
|
||||
* 语言类型
|
||||
|
@ -63,7 +63,7 @@ import {RatingControlSchema} from './Rating';
|
||||
import {RepeatControlSchema} from './Repeat';
|
||||
import {RichTextControlSchema} from './RichText';
|
||||
import {ServiceControlSchema} from './Service';
|
||||
import {StaticControlSchema} from './Static';
|
||||
import {StaticControlRestSchema, StaticControlSchema} from './Static';
|
||||
import {SubFormControlSchema} from './SubForm';
|
||||
import {SwitchControlSchema} from './Switch';
|
||||
import {TableControlSchema} from './Table';
|
||||
@ -73,6 +73,9 @@ import {TagControlSchema} from './Tag';
|
||||
import {TransferControlSchema} from './Transfer';
|
||||
import {TreeControlSchema} from './Tree';
|
||||
import {TreeSelectControlSchema} from './TreeSelect';
|
||||
import {PlainSchema} from '../Plain';
|
||||
import {TplSchema} from '../Tpl';
|
||||
import {DividerSchema} from '../Divider';
|
||||
|
||||
export type FormControlType =
|
||||
| 'array'
|
||||
@ -94,7 +97,49 @@ export type FormControlType =
|
||||
| 'time'
|
||||
| 'date-range'
|
||||
| 'diff'
|
||||
|
||||
// editor 系列
|
||||
| 'editor'
|
||||
| 'bat-editor'
|
||||
| 'c-editor'
|
||||
| 'coffeescript-editor'
|
||||
| 'cpp-editor'
|
||||
| 'csharp-editor'
|
||||
| 'css-editor'
|
||||
| 'dockerfile-editor'
|
||||
| 'fsharp-editor'
|
||||
| 'go-editor'
|
||||
| 'handlebars-editor'
|
||||
| 'html-editor'
|
||||
| 'ini-editor'
|
||||
| 'java-editor'
|
||||
| 'javascript-editor'
|
||||
| 'json-editor'
|
||||
| 'less-editor'
|
||||
| 'lua-editor'
|
||||
| 'markdown-editor'
|
||||
| 'msdax-editor'
|
||||
| 'objective-c-editor'
|
||||
| 'php-editor'
|
||||
| 'plaintext-editor'
|
||||
| 'postiats-editor'
|
||||
| 'powershell-editor'
|
||||
| 'pug-editor'
|
||||
| 'python-editor'
|
||||
| 'r-editor'
|
||||
| 'razor-editor'
|
||||
| 'ruby-editor'
|
||||
| 'sb-editor'
|
||||
| 'scss-editor'
|
||||
| 'sol-editor'
|
||||
| 'sql-editor'
|
||||
| 'swift-editor'
|
||||
| 'typescript-editor'
|
||||
| 'vb-editor'
|
||||
| 'xml-editor'
|
||||
| 'yaml-editor'
|
||||
|
||||
//
|
||||
| 'fieldset'
|
||||
| 'file'
|
||||
| 'formula'
|
||||
@ -134,7 +179,13 @@ export type FormControlType =
|
||||
| 'textarea'
|
||||
| 'transfer'
|
||||
| 'tree'
|
||||
| 'tree-select';
|
||||
| 'tree-select'
|
||||
|
||||
// 非表单项但是也可以放进来
|
||||
| 'divider'
|
||||
| 'html'
|
||||
| 'plain'
|
||||
| 'tpl';
|
||||
|
||||
export type FormControlSchema =
|
||||
| ArrayControlSchema
|
||||
@ -182,6 +233,7 @@ export type FormControlSchema =
|
||||
| SubFormControlSchema
|
||||
| SwitchControlSchema
|
||||
| StaticControlSchema
|
||||
| StaticControlRestSchema
|
||||
| TableControlSchema
|
||||
| TabsControlSchema
|
||||
| TabsTransferControlSchema
|
||||
@ -190,7 +242,10 @@ export type FormControlSchema =
|
||||
| TextareaControlSchema
|
||||
| TransferControlSchema
|
||||
| TreeControlSchema
|
||||
| TreeSelectControlSchema;
|
||||
| TreeSelectControlSchema
|
||||
|
||||
// 非表单项,但是也可以放进来。
|
||||
| DividerSchema;
|
||||
|
||||
export type FormControlSchemaAlias = FormControlSchema;
|
||||
|
||||
@ -208,7 +263,7 @@ export interface FormBaseControl extends Omit<BaseSchema, 'type'> {
|
||||
/**
|
||||
* 描述标题
|
||||
*/
|
||||
label?: string;
|
||||
label?: string | false;
|
||||
|
||||
/**
|
||||
* 配置 label className
|
||||
@ -256,6 +311,11 @@ export interface FormBaseControl extends Omit<BaseSchema, 'type'> {
|
||||
*/
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* @deprecated 用 description 代替
|
||||
*/
|
||||
desc?: string;
|
||||
|
||||
/**
|
||||
* 配置描述上的 className
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ export interface ListControlSchema extends FormOptionsControl {
|
||||
/**
|
||||
* 图片div类名
|
||||
*/
|
||||
imageClassName: string;
|
||||
imageClassName?: string;
|
||||
|
||||
/**
|
||||
* 可以自定义展示模板。
|
||||
|
@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from './Item';
|
||||
import {TableCell} from '../Table';
|
||||
import PopOver from '../PopOver';
|
||||
import QuickEdit from '../QuickEdit';
|
||||
import PopOver, {SchemaPopOver} from '../PopOver';
|
||||
import QuickEdit, {SchemaQuickEdit} from '../QuickEdit';
|
||||
import {Renderer} from '../../factory';
|
||||
import Copyable from '../Copyable';
|
||||
import Copyable, {SchemaCopyable} from '../Copyable';
|
||||
import {extendObject} from '../../utils/helper';
|
||||
import {SchemaTpl} from '../../Schema';
|
||||
import {SchemaTpl, SchemaType} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Static
|
||||
@ -24,6 +24,28 @@ export interface StaticControlSchema extends FormBaseControl {
|
||||
* 内容模板,不支持 HTML
|
||||
*/
|
||||
text?: SchemaTpl;
|
||||
|
||||
/**
|
||||
* 配置查看详情功能
|
||||
*/
|
||||
popOver?: SchemaPopOver;
|
||||
|
||||
/**
|
||||
* 配置快速编辑功能
|
||||
*/
|
||||
quickEdit?: SchemaQuickEdit;
|
||||
|
||||
/**
|
||||
* 配置点击复制功能
|
||||
*/
|
||||
copyable?: SchemaCopyable;
|
||||
}
|
||||
|
||||
export interface StaticControlRestSchema
|
||||
extends Omit<StaticControlSchema, 'type'> {
|
||||
type: SchemaType;
|
||||
|
||||
[propName: string]: any;
|
||||
}
|
||||
|
||||
export interface StaticProps extends FormControlProps {
|
||||
|
@ -25,7 +25,7 @@ export interface TagControlSchema extends FormOptionsControl {
|
||||
/**
|
||||
* 选项提示信息
|
||||
*/
|
||||
optionsTip: string;
|
||||
optionsTip?: string;
|
||||
|
||||
/**
|
||||
* 是否为下拉模式
|
||||
|
@ -51,7 +51,7 @@ import {ActionSchema} from '../Action';
|
||||
export interface FormSchemaHorizontal {
|
||||
left?: number;
|
||||
right?: number;
|
||||
leftField?: boolean | number | 'xs' | 'sm' | 'md' | 'lg';
|
||||
leftFixed?: boolean | number | 'xs' | 'sm' | 'md' | 'lg';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,7 +177,14 @@ export interface FormSchema extends BaseSchema {
|
||||
*/
|
||||
resetAfterSubmit?: boolean;
|
||||
|
||||
/**
|
||||
* 配置表单项默认的展示方式。
|
||||
*/
|
||||
mode?: 'normal' | 'inline' | 'horizontal';
|
||||
|
||||
/**
|
||||
* 如果是水平排版,这个属性可以细化水平排版的左右宽度占比。
|
||||
*/
|
||||
horizontal?: FormSchemaHorizontal;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user