sunmao-ui/examples/dialog/index.json

135 lines
3.3 KiB
JSON
Raw Normal View History

2021-11-06 11:13:00 +08:00
{
"app": {
"version": "example/v1",
"metadata": {
"name": "dialog_component",
"description": "dialog component example"
},
"spec": {
"components": [
{
"id": "root",
"type": "chakra_ui/v1/root",
"properties": {},
"traits": []
},
{
"id": "btn",
"type": "plain/v1/button",
"properties": {
"text": {
"raw": "**Open Dialog**",
"format": "md"
},
"colorScheme": "red"
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "root",
"slot": "root"
}
}
},
{
"type": "core/v1/event",
"properties": {
"handlers": [
{
"type": "onClick",
"componentId": "dialog",
"method": {
"name": "openDialog",
"parameters": {
"title": "hi"
}
},
"wait": {}
}
]
}
}
]
},
{
"id": "dialog",
"type": "chakra_ui/v1/dialog",
"properties": {
"title": "This is a dialog",
"confirmButton": {
"text": "hello",
"colorScheme": "pink"
},
"cancelButton": {
"text": "thanks"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "root",
"slot": "root"
}
}
},
{
"type": "core/v1/event",
"parsedType": {
"version": "core/v1",
"name": "event"
},
"properties": {
"handlers": [
{
"type": "confirmDialog",
"componentId": "dialog",
"method": {
"name": "confirmDialog"
},
"wait": {},
"disabled": "false"
},
{
"type": "cancelDialog",
"componentId": "dialog",
"method": {
"name": "cancelDialog"
},
"wait": {},
"disabled": "false"
}
]
}
}
]
},
{
"id": "dialogContent",
"type": "core/v1/text",
"properties": {
"value": {
"raw": "**This is a dialog**",
"format": "md"
}
},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
"id": "dialog",
"slot": "content"
}
}
}
]
}
]
}
}
}