mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2024-11-27 08:39:59 +08:00
135 lines
3.3 KiB
JSON
135 lines
3.3 KiB
JSON
{
|
|
"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"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|