editorShape
描述
可选。一个对象数组,用于定义控制看板编辑器外观和行为的设置。
用法
editorShape?: [
{
// 所有类型的通用参数
type: string,
key: string,
label?: string,
// 仅适用于 "dateRange" 类型
key: {
start: string,
end: string
},
config?: {
align?: "start" | "center" | "end",
editable?: boolean | function,
buttons?: boolean,
css?: string,
disabled?: boolean,
done?: boolean,
error?: boolean,
format?: string,
months?: number,
placeholder?: string,
title?: string,
width?: string
},
// 仅适用于 "date" 类型
config?: {
align?: "start" | "center" | "end",
editable?: boolean | function,
buttons?: boolean,
css?: string,
disabled?: boolean,
error?: boolean,
format?: string,
placeholder?: string,
title?: string,
width?: string
},
// 仅适用于 "color" 类型
values?: array,
config?: {
clear?: boolean,
disabled?: boolean,
error?: boolean,
placeholder?: string,
title?: string
},
// 仅适用于 "combo"、"select" 和 "multiselect" 类型
values?: [
{
id: string | number,
label: string,
avatar?: string // 仅适用于 "multiselect" 类型
},
{...} // 其他选项
],
config?: {
clearButton?: boolean, // 仅适用于 "combo" 类型
label?: string, // 仅适用于 "select" 类型
checkboxes?: boolean, // 仅适用于 "multiselect" 类型
// 通用参数
disabled?: boolean,
error?: boolean,
placeholder?: string,
textField?: string,
title?: string
},
// 仅适用于 "text" 类型
config?: {
css?: string,
disabled?: boolean,
error?: boolean,
focus?: boolean,
icon?: string,
inputStyle?: string,
placeholder?: string,
readonly?: boolean,
select?: boolean,
title?: string,
type?: string
},
// 仅适用于 "textarea" 类型
config? {
disabled?: boolean,
error?: boolean,
placeholder?: string,
title?: string,
readonly?: boolean
},
// 仅适用于 "progress" 类型
config?: {
disabled?: boolean,
label?: string,
max?: number,
min?: number,
step?: number,
title?: string,
width?: number
},
// 仅适用于 "files" 类型
uploadURL?: string | function,
config?: {
accept?: string,
disabled?: boolean,
multiple?: boolean,
folder?: boolean,
},
// 仅适用于 "comments" 类型
config?: {
format?: string,
placement?: "page" | "editor",
html?: boolean,
confirmDeletion?: boolean
},
// 仅适用于 "links" 类型
config?: {
confirmDeletion?: boolean
},
}, { /* 其他控件设置 */ }
];
参数
编辑器的外观和功能可通过设置以下参数(字段)进行自定义:
- 所有类型的通用参数
type
- (必需)指定编辑器字段的类型。
important
看板编辑器支持的字段类型有:dateRange、date、combo、select、multiselect、color、text、textarea、progress、files、comments 和 links。
key
- (必需)编辑器字段的键。此键应与cardShape
属性中设置的值相匹配。示例:
// 卡片外观设置
const cardShape = {
...kanban.defaultCardShape,
headerFields: [
{ // 自定义字段
label: "Custom field",
css: "custom_style",
key: "custom_key"
}
]
};
// 编辑器外观设置
const editorShape = [
{
label: "Custom field",
type: "text",
key: "custom_key"
}
];
label
- (可选)编辑器字段的标签。