bricks/examples/form.ui
2024-06-20 17:35:25 +08:00

176 lines
3.2 KiB
XML

{
"widgettype":"VBox",
"options":{"height":"100%", "width":"100%"},
"subwidgets":[
{
"widgettype":"HBox",
"options":{"height":"auto"},
"subwidgets":[
{
"widgettype":"Text",
"options":{
"otext":"Please change Font size",
"i18n":true
}
},
{
"widgettype":"Button",
"options":{
"label":"A",
"width":"auto",
"item_rate":1.4
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"target":"app",
"script":"bricks.app.textsize_bigger()"
}
]
},
{
"widgettype":"Button",
"options":{
"label":"A",
"width":"auto",
"item_rate":0.8
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"target":"app",
"script":"bricks.app.textsize_smaller()"
}
]
}
]
},
{
"widgettype":"Filler",
"options":{"overflow":"auto"},
"subwidgets":[
{
"widgettype":"Form",
"options":{
"submit_url":"{{entire_url('ttt.dspy')}}",
"title":"Test hahah Form",
"description":"test input implemented",
"fields":[
{
"uitype":"email",
"name":"email",
"label":"Email",
"required":true
},
{
"uitype":"tel",
"name":"tel",
"label":"Tel",
"required":true
},
{
"uitype":"file",
"name":"file",
"label":"File",
"required":true
},
{
"uitype":"str",
"minlength":3,
"length":30,
"value":"tlegre",
"name":"name",
"label":"Name",
"required":true
},
{
"uitype":"int",
"minlength":3,
"length":30,
"value":12432,
"name":"integer",
"label":"Integer",
"required":true
},
{
"uitype":"float",
"dec_length":3,
"length":25,
"name":"float",
"label":"Float"
},
{
"uitype":"date",
"name":"date",
"label":"Date",
"required":true
},
{
"uitype":"password",
"minlength":3,
"length":30,
"name":"password",
"label":"Password",
"required":true
},
{
"uitype":"checkbox",
"multicheck":true,
"name":"checkbox",
"label":"CheckBox",
"value":2,
"dataurl":"test_code.json",
"required":true
},
{
"uitype":"code",
"name":"code",
"label":"Code",
"value":2,
"dataurl":"test_code.json",
"required":true
},
{
"uitype":"image",
"name":"Image",
"height":"100px",
"width":"100px",
"label":"Image",
"required":true
},
{
"uitype":"text",
"name":"text",
"value":"This is a test",
"label":"Text",
"required":true
},
{
"uitype":"audiotext",
"upload_url":"https://sage.opencomputing.cn/stt/generate",
"name":"atext",
"value":"This is a test",
"label":"Text",
"required":true
}
]
},
"binds":[
{
"wid":"self",
"event":"submited",
"actiontype":"script",
"target":"self",
"script":"await bricks.show_resp_message_or_error(event.params)"
}
]
}
]
}
]
}