amis/schemas/dropdown-button.json

157 lines
4.8 KiB
JSON
Raw Normal View History

2020-05-27 14:57:40 +08:00
{
2020-09-03 11:45:31 +08:00
"$id": "/schemas/dropdown-button.json#",
2020-08-21 15:28:22 +08:00
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/dropdown-button.json#/definitions/common"
2020-08-21 15:28:22 +08:00
},
{
"additionalProperties": false,
"patternProperties": {
"^(\\$ref|label|closeOnOutside|closeOnClick|block|btnClassName|level|size|primary|tooltip|buttons|className|disabled|disabledOn|hiddenOn|hidden|visible|visbileOn)$": {}
},
"properties": {
"$schema": {
"description": "绑定 JSON 格式说明,可忽略!",
"format": "uri",
"type": "string"
},
"type": {
"const": "dropdown-button",
"description": "指定为 DropDown Button 类型"
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
},
"required": ["type"],
"type": "object"
}
],
"definitions": {
"common": {
"description": "amis Dropdown Button 渲染器格式说明。https://baidu.github.io/amis/docs/renderers#dropdown-button",
"properties": {
"$ref": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/$ref",
2020-08-21 15:28:22 +08:00
"description": "引用页面中的定义"
},
"block": {
"default": false,
"description": "是否独占一行 `display: block`",
"type": "boolean"
},
"btnClassName": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/className",
2020-08-21 15:28:22 +08:00
"description": "给 Button 配置 className。"
},
"buttons": {
"description": "按钮集合",
"items": {
"allOf": [
{
"oneOf": [
{
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/action.json#/definitions/baseAction"
2020-08-21 15:28:22 +08:00
},
2020-05-27 14:57:40 +08:00
2020-08-21 15:28:22 +08:00
{
"type": "object",
"properties": {
"type": {
"const": "divider"
}
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"additionalProperties": false,
"description": "分割符号"
}
]
},
{
"properties": {
"className": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/className",
2020-05-27 14:57:40 +08:00
"description": "配置容器 className"
2020-08-21 15:28:22 +08:00
},
"icon": {
"description": "按钮图标,请查看 fontAwesome http://fontawesome.io/icons/",
2020-05-27 14:57:40 +08:00
"type": "string"
2020-08-21 15:28:22 +08:00
},
"label": {
"description": "按钮名字",
2020-05-27 14:57:40 +08:00
"type": "string"
2020-08-21 15:28:22 +08:00
}
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"type": "object"
}
]
},
"type": "array"
},
"className": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/className",
2020-08-21 15:28:22 +08:00
"description": "配置容器 className"
},
"disabled": {
"description": "是否为禁用状态。",
"type": "boolean"
},
"disabledOn": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/expression",
2020-08-21 15:28:22 +08:00
"description": "通过 JS 表达式来配置当前表单项的禁用状态。"
},
"hiddenOn": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/expression",
2020-08-21 15:28:22 +08:00
"description": "通过 JS 表达式来配置当前表单项是否隐藏。"
},
"label": {
"description": "按钮文字",
"type": "string"
},
"level": {
"description": "按钮级别",
"enum": ["info", "success", "warning", "danger", "link", "primary"],
"type": "string"
},
"primary": {
"default": false,
"description": "按钮是否为主按钮,影响样式。",
"type": "boolean"
},
"size": {
"description": "按钮大小",
"enum": ["xs", "sm", "md", "lg", "", "base"],
"type": "string"
},
"tooltip": {
"description": "按钮提示文字hover 时显示",
"type": "string"
},
"type": {
"enum": ["dropdown-button"],
"type": "string"
},
"visibleOn": {
2020-09-03 11:45:31 +08:00
"$ref": "/schemas/page.json#/definitions/expression",
2020-08-21 15:28:22 +08:00
"description": "通过 JS 表达式来配置当前表单项是否显示"
},
"closeOnOutside": {
"type": "boolean",
"description": "点击外部是否关闭"
},
"closeOnClick": {
"type": "boolean",
"description": "点击内容是否关闭"
2020-05-27 14:57:40 +08:00
}
2020-08-21 15:28:22 +08:00
},
"type": "object"
2020-05-27 14:57:40 +08:00
},
2020-08-21 15:28:22 +08:00
"test": {
"properties": {
"type": {
"const": "dropdown-button"
}
}
}
},
"dependencies": {},
"description": "amis Dropdown Button 渲染器格式说明。https://baidu.github.io/amis/docs/renderers#dropdown-button"
}