mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-02-11 17:37:40 +08:00
126 lines
3.0 KiB
JSON
126 lines
3.0 KiB
JSON
{
|
||
"modules": [
|
||
{
|
||
"version": "core/v1",
|
||
"kind": "Module",
|
||
"parsedVersion": {
|
||
"category": "core/v1",
|
||
"value": "littleForm"
|
||
},
|
||
"metadata": {
|
||
"name": "littleForm"
|
||
},
|
||
"spec": {
|
||
"properties": {
|
||
"btnText": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"events": ["onSubmit"],
|
||
"stateMap": {
|
||
"value": "{{ $moduleId }}__input.value"
|
||
}
|
||
},
|
||
"impl": [
|
||
{
|
||
"id": "{{ $moduleId }}__hstack",
|
||
"type": "chakra_ui/v1/hstack",
|
||
"properties": {},
|
||
"traits": []
|
||
},
|
||
{
|
||
"id": "{{ $moduleId }}__input",
|
||
"type": "chakra_ui/v1/input",
|
||
"properties": {},
|
||
"traits": [
|
||
{
|
||
"type": "core/v1/slot",
|
||
"properties": {
|
||
"container": {
|
||
"id": "{{ $moduleId }}__hstack",
|
||
"slot": "content"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"id": "{{ $moduleId }}__button",
|
||
"type": "chakra_ui/v1/button",
|
||
"properties": {
|
||
"text": {
|
||
"raw": "{{{{ $moduleId }}__input.value}}",
|
||
"format": "md"
|
||
}
|
||
},
|
||
"traits": [
|
||
{
|
||
"type": "core/v1/event",
|
||
"properties": {
|
||
"handlers": [
|
||
{
|
||
"type": "onClick",
|
||
"componentId": "$module",
|
||
"method": {
|
||
"name": "onSubmit",
|
||
"parameters": {
|
||
"moduleId": "{{$moduleId}}"
|
||
}
|
||
},
|
||
"wait": {},
|
||
"disabled": false
|
||
}
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"type": "core/v1/slot",
|
||
"properties": {
|
||
"container": {
|
||
"id": "{{ $moduleId }}__hstack",
|
||
"slot": "content"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
]
|
||
}
|
||
],
|
||
"app": {
|
||
"version": "example/v1",
|
||
"metadata": {
|
||
"name": "module",
|
||
"description": "module demo"
|
||
},
|
||
"spec": {
|
||
"components": [
|
||
{
|
||
"id": "form",
|
||
"type": "core/v1/moduleContainer",
|
||
"properties": {
|
||
"id": "littleFormModule",
|
||
"type": "core/v1/littleForm",
|
||
"properties": {
|
||
"btnText": "Submit!"
|
||
},
|
||
"handlers": [
|
||
{
|
||
"type": "onSubmit",
|
||
"componentId": "$utils",
|
||
"method": {
|
||
"name": "alert",
|
||
"parameters": "Submit: {{ littleFormModule ? littleFormModule.value : 0 }}!"
|
||
},
|
||
"wait": {},
|
||
"disabled": false
|
||
}
|
||
]
|
||
},
|
||
"traits": []
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|