126 lines
3.0 KiB
JSON
Raw Permalink Normal View History

2021-11-06 11:13:00 +08:00
{
"modules": [
{
"version": "core/v1",
"kind": "Module",
"parsedVersion": {
"category": "core/v1",
"value": "littleForm"
},
"metadata": {
"name": "littleForm"
},
"spec": {
"properties": {
"btnText": {
"type": "string"
}
},
"events": ["onSubmit"],
"stateMap": {
2022-01-13 18:14:39 +08:00
"value": "{{ $moduleId }}__input.value"
2021-11-06 11:13:00 +08:00
}
},
2021-12-17 10:17:06 +08:00
"impl": [
2021-11-06 11:13:00 +08:00
{
2022-01-13 18:14:39 +08:00
"id": "{{ $moduleId }}__hstack",
2021-11-06 11:13:00 +08:00
"type": "chakra_ui/v1/hstack",
"properties": {},
"traits": []
},
{
2022-01-13 18:14:39 +08:00
"id": "{{ $moduleId }}__input",
2021-11-06 11:13:00 +08:00
"type": "chakra_ui/v1/input",
"properties": {},
"traits": [
{
"type": "core/v1/slot",
"properties": {
"container": {
2022-01-13 18:14:39 +08:00
"id": "{{ $moduleId }}__hstack",
2021-11-06 11:13:00 +08:00
"slot": "content"
}
}
}
]
},
{
2022-01-13 18:14:39 +08:00
"id": "{{ $moduleId }}__button",
2021-11-06 11:13:00 +08:00
"type": "chakra_ui/v1/button",
"properties": {
"text": {
2022-01-13 18:14:39 +08:00
"raw": "{{{{ $moduleId }}__input.value}}",
2021-11-06 11:13:00 +08:00
"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": {
2022-01-13 18:14:39 +08:00
"id": "{{ $moduleId }}__hstack",
2021-11-06 11:13:00 +08:00
"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": []
}
]
}
}
}