This commit is contained in:
yumoqing 2024-03-14 21:32:31 +08:00
parent 6b1a844abc
commit a7b57c5f03
38 changed files with 1300 additions and 0 deletions

33
dist/examples/accordion.ui vendored Normal file
View File

@ -0,0 +1,33 @@
{
"widgettype":"Accordion",
"options":{
"item_size":'28px',
"items":[
{
"name":"test1",
"icon":"/imgs/t.png",
"text":"accordion 1 test",
"content":{
"widgettype":"Text",
"options":{
"text":"text content 1",
"i81n":true
}
}
},
{
"name":"test2",
"icon":"/imgs/t.png",
"text":"accordion 2 test",
"content":{
"widgettype":"Text",
"options":{
"text":"text content 2",
"i81n":true
}
}
}
]
}
}

67
dist/examples/add_widget.ui vendored Normal file
View File

@ -0,0 +1,67 @@
{
"widgettype":"VBox",
"options":{
"width":"100%",
"height":"100%"
},
"subwidgets":[
{
"widgettype":"HBox",
"options":{
"height":"40px"
},
"subwidgets":[
{
"id":"insert",
"widgettype":"Button",
"options":{
"width":"80px",
"i18n":true,
"label":"insert"
}
},
{
"id":"append",
"widgettype":"Button",
"options":{
"width":"80px",
"i18n":true,
"label":"append"
}
}
]
},
{
"id":"main",
"widgettype":"Filler"
}
],
"binds":[
{
"wid":"insert",
"event":"click",
"actiontype":"urlwidget",
"target":"main",
"options":{
"url":"{{entire_url('subtext.ui')}}",
"params":{
"text":"Insert before"
}
},
"mode":"insert"
},
{
"wid":"append",
"event":"click",
"actiontype":"urlwidget",
"target":"main",
"options":{
"url":"{{entire_url('subtext.ui')}}",
"params":{
"text":"Append After"
}
},
"mode":"append"
}
]
}

9
dist/examples/audio.ui vendored Normal file
View File

@ -0,0 +1,9 @@
{
"id":"audioplayer",
"widgettype":"AudioPlayer",
"options":{
"autoplay":true,
"url":"http://kimird.com/songs/sample-mp3-file.mp3"
}
}

40
dist/examples/button.ui vendored Normal file
View File

@ -0,0 +1,40 @@
{
"widgettype":"HBox",
"options":{
"height":"auto",
"width":"100%"
},
"subwidgets":[
{
"widgettype":"Button",
"options":{
"name":"test",
"icon":"/bricks/imgs/submit.png",
"label":"test once",
"tooltip":"This is a joke too",
"nonepack":true,
"orientation":"horizontal"
}
},
{
"widgettype":"Button",
"options":{
"name":"test",
"icon":"/bricks/imgs/reset.png",
"tooltip":"This is a joke",
"label":"test twice",
"nonepack":true,
"orientation":"horizontal"
}
}
],
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"script":"alert('HBox clicked');"
}
]
}

64
dist/examples/channels.ui vendored Normal file
View File

@ -0,0 +1,64 @@
{
"widgettype":"DynamicAccordion",
"options":{
"data_url":"{{entire_url('./channels.dspy')}}",
"content_url":"{{entire_url('play_channel.dspy')}}",
"content_view":{
"widgettype":"VBox",
"options":{
"overflow":"auto",
"width":"90%",
"height":"500px"
},
"subwidgets":[
{
"id":"toolbar",
"widgettype":"Toolbar",
"options":{
"orientation":"horizontal",
"tool_margin":"15px",
"tools":[
{
"name":"blocked",
"label":"Blocked it"
}
]
}
},
{
"id":"videoplayer",
"widgettype":"Video",
"options":{
"type":"application/x-mpegURL",
"url":"${url}"
}
}
]
},
"record_view":{
"widgettype":"HBox",
"options":{
"height":"100%",
"width":"100%"
},
"subwidgets":[
{
"widgettype":"Icon",
"options":{
"rate":2,
"url":"${logo_url}"
}
},
{
"widgettype":"Text",
"options":{
"text":"${title}"
}
}
]
},
"page_rows":800,
"cache_limit":5
}
}

7
dist/examples/datagrid.ui vendored Normal file
View File

@ -0,0 +1,7 @@
{
"widgettype":"urlwidget",
"options":{
"url":"users.bcrud"
}
}

10
dist/examples/docs.ui vendored Normal file
View File

@ -0,0 +1,10 @@
{
"widgettype":"MarkdownViewer",
"options":{
"width":"100%",
"height":"100%",
"navigator":true,
"md_url":"../docs/README.md"
}
}

40
dist/examples/dynamicaccordion.ui vendored Normal file
View File

@ -0,0 +1,40 @@
{
"widgettype":"DynamicAccordion",
"options":{
"data_url":"{{entire_url('./channels.dspy')}}",
"content_url":"{{entire_url('play_channel.dspy')}}",
"content_view":{
"id":"videoplayer",
"widgettype":"Iframe",
"options":{
"width":"100%",
"url":"${url}"
}
},
"record_view":{
"widgettype":"HBox",
"options":{
"height":"100%",
"width":"100%"
},
"subwidgets":[
{
"widgettype":"Icon",
"options":{
"rate":2,
"url":"${logo_url}"
}
},
{
"widgettype":"Text",
"options":{
"text":"${title}"
}
}
]
},
"page_rows":800,
"cache_limit":5
}
}

7
dist/examples/editabletree.ui vendored Normal file
View File

@ -0,0 +1,7 @@
{
"widgettype":"urlwidget",
"options":{
"url":"editabletree.json"
}
}

83
dist/examples/error.ui vendored Normal file
View File

@ -0,0 +1,83 @@
{
"widgettype":"Tree",
"options":{
"idField":"id",
"textField":"text",
"data":[
{
"id":1,
"text":"node1",
"is_leaf":false,
"children":[
{
"id":11,
"text":"node11",
"is_leaf":false,
"children":[
{
"id":112,
"text":"node.12",
"is_leaf":false,
"children":[
{
"id":1112,
"text":"node1112",
"is_leaf":true
},
{
"id":1113,
"text":"node113",
"is_leaf":true
}
]
},
{
"id":113,
"text":"node113",
"is_leaf":true
}
]
},
{
"id":12,
"text":"node12",
"is_leaf":true
},
{
"id":13,
"text":"node13",
"is_leaf":true
}
]
},
{
"id":2,
"text":"node2",
"is_leaf":false,
"children":[
{
"id":21,
"text":"node21",
"is_leaf":true
},
{
"id":22,
"text":"node22",
"is_leaf":true
},
{
"id":23,
"text":"node23",
"is_leaf":true
}
]
},
{
"id":3,
"text":"node3",
"is_leaf":true
}
]
}
}

32
dist/examples/fileupload.ui vendored Normal file
View File

@ -0,0 +1,32 @@
{
"widgettype":"VBox",
"options":{
},
"subwidgets":[
{
"id":"file1",
"widgettype":"UtFile",
"options":{
"name":"file1",
"label":"File 1"
}
},
{
"widgettype":"Text",
"options":{
"text":"upload"
},
}
],
"binds":[
{
"wid":"self",
"event":"clcik",
"action":{
"rfname":"do_upload"
}
}
]
}

18
dist/examples/floaticonbar.ui vendored Normal file
View File

@ -0,0 +1,18 @@
{
"widgettype":"FloatIconBar",
"options":{
"tools":[
{
"icon":"{{entire_url('../imgs/add.png')}}",
"name":"add",
"rate":1.5,
"tip":"add a record"
},
{
"icon":"{{entire_url('../imgs/delete.png')}}",
"name":"delete",
"tip":"delete a record"
}],
}
}

19
dist/examples/floaticontextbar.ui vendored Normal file
View File

@ -0,0 +1,19 @@
{
"widgettype":"FloatIconTextBar",
"options":{
"tools":[
{
"name":"add",
"icon":"{{entire_url('../imgs/add.png')}}",
"label":"add",
"tip":"add a record"
},
{
"icon":"{{entire_url('../imgs/delete.png')}}",
"name":"delete",
"label":"delete",
"tip":"delete a record"
}],
}
}

6
dist/examples/footer.ui vendored Normal file
View File

@ -0,0 +1,6 @@
{
"widgettype":"Text",
"options":{
"text":"Bricks module, make front end coding easier"
}
}

157
dist/examples/form.ui vendored Normal file
View File

@ -0,0 +1,157 @@
{
"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":"/ttt/ttt.dspy",
"title":"Test hahah Form",
"description":"test input implemented",
"fields":[
{
"uitype":"email",
"name":"email",
"label":"Email",
'required':true
},
{
"uitype":"tel",
"name":"tel",
"pattern":"{\d}3-{\d}4-{\d}4",
"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",
"name":"checkbox",
"label":"CheckBox",
"value":2,
"dataurl":"test_code.json",
'required':true
},
{
"uitype":"audio",
"name":"audio",
"label":"Audio",
'required':true
},
{
"uitype":"code",
"name":"code",
"label":"Code",
"value":2,
"dataurl":"test_code.json",
'required':true
},
{
"uitype":"text",
"name":"text",
"value":"This is a test",
"label":"Text",
'required':true
}
]
}
}
]
}
]
}

50
dist/examples/hbox.ui vendored Normal file
View File

@ -0,0 +1,50 @@
{
"widgettype":"HBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Title1",
"options":{
"text":"Pic Viewer",
"i18n":true
},
"binds":[
{
"wid":"self",
"target":"self",
"event":"click",
"actiontype":"script",
"script":"alert('hahahahahah');"
}
]
},
{
"widgettype":"urlwidget",
"options":{
"url":"/bricks/image.tmpl",
"i18n":true
}
},
{
"id":"mymodal",
"widgettype":"Modal",
"options":{
"auto_close":true,
"auto_open":false,
"width":"700px",
"height":"400px",
"archor":"cl",
},
"subwidgets":[
{
"widgettype":"Text",
"options":{
"text":"This is a test"
}
}
]
}
]
}

20
dist/examples/iconbar.ui vendored Normal file
View File

@ -0,0 +1,20 @@
{
"widgettype":"IconBar",
"options":{
"tools":[
{
"icon":"{{entire_url('../imgs/add.png')}}",
"name":"add",
"rate":1.5,
"label":"add",
"tip":"add a record"
},
{
"icon":"{{entire_url('../imgs/delete.png')}}",
"name":"delete",
"label":"delete",
"tip":"delete a record"
}],
}
}

20
dist/examples/icontextbar.ui vendored Normal file
View File

@ -0,0 +1,20 @@
{
"widgettype":"IconTextBar",
"options":{
"tools":[
{
"icon":"{{entire_url('../imgs/add.png')}}",
"name":"add",
"rate":1.5,
"label":"add",
"tip":"add a record"
},
{
"icon":"{{entire_url('../imgs/delete.png')}}",
"name":"delete",
"label":"delete",
"tip":"delete a record"
}],
}
}

8
dist/examples/iframe.ui vendored Normal file
View File

@ -0,0 +1,8 @@
{
"id":"videoplayer",
"widgettype":"Iframe",
"options":{
"width":"100%",
"url":"{{params_kw.url}}"
}
}

9
dist/examples/image.ui vendored Normal file
View File

@ -0,0 +1,9 @@
{
"widgettype":"Image",
"options":{
"url":"https://cdn.pixabay.com/photo/2018/04/26/16/31/marine-3352341_960_720.jpg",
"height":"100%",
"width":"100%"
}
}

10
dist/examples/m3u8.ui vendored Normal file
View File

@ -0,0 +1,10 @@
{
"id":"videoplayer",
"widgettype":"VideoPlayer",
"options":{
"autoplay":true,
"url":"{{params_kw.get('url')}}",
"type":"hls"
}
}

21
dist/examples/markdown.ui vendored Normal file
View File

@ -0,0 +1,21 @@
{
"widgettype":"VBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Title1",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"MarkdownViewer",
"options":{
"md_url":"test1.md"
}
}
]
}

83
dist/examples/message.ui vendored Normal file
View File

@ -0,0 +1,83 @@
{
"widgettype":"Tree",
"options":{
"idField":"id",
"textField":"text",
"data":[
{
"id":1,
"text":"node1",
"is_leaf":false,
"children":[
{
"id":11,
"text":"node11",
"is_leaf":false,
"children":[
{
"id":112,
"text":"node.12",
"is_leaf":false,
"children":[
{
"id":1112,
"text":"node1112",
"is_leaf":true
},
{
"id":1113,
"text":"node113",
"is_leaf":true
}
]
},
{
"id":113,
"text":"node113",
"is_leaf":true
}
]
},
{
"id":12,
"text":"node12",
"is_leaf":true
},
{
"id":13,
"text":"node13",
"is_leaf":true
}
]
},
{
"id":2,
"text":"node2",
"is_leaf":false,
"children":[
{
"id":21,
"text":"node21",
"is_leaf":true
},
{
"id":22,
"text":"node22",
"is_leaf":true
},
{
"id":23,
"text":"node23",
"is_leaf":true
}
]
},
{
"id":3,
"text":"node3",
"is_leaf":true
}
]
}
}

7
dist/examples/miniform.ui vendored Normal file
View File

@ -0,0 +1,7 @@
{
"widgettype":"urlwidget",
"options":{
"url":"miniform.json"
}
}

7
dist/examples/model.ui vendored Normal file
View File

@ -0,0 +1,7 @@
{
"widgettype":"urlwidget",
"options":{
"url":"modal.json"
}
}

17
dist/examples/recorder.ui vendored Normal file
View File

@ -0,0 +1,17 @@
{
"id":"recorder",
"widgettype":"AudioRecorder",
"options":{
"height":"40px",
"upload_url":"{{entire_url('stt.dspy')}}",
"start_icon":"/bricks/imgs/start_recording.png"
},
"binds":[
{
"wid":"self",
"event":"uploaded",
"actiontype":"script",
"script":"alert('kwargs', kwargs, args)"
}
]
}

27
dist/examples/scroll.ui vendored Normal file
View File

@ -0,0 +1,27 @@
{
"widgettype":"VBox",
"options":{
"width":"100%",
"height":"100%"
},
"subwidgets":[
{
"widgettype":"Title3",
"options":{
"text":"Scroll Widget"
}
},
{
"widgettype":"urlwidget",
"options":{
"url":"{{entire_url('scroll.json')}}"
}
},
{
"widgettype":"urlwidget",
"options":{
"url":"{{entire_url('footer.ui')}}"
}
}
]
}

6
dist/examples/subtext.ui vendored Normal file
View File

@ -0,0 +1,6 @@
{
"widgettype":"Text",
"options":{
"text":"{{params_kw.get('text') or 'default text'}}"
}
}

33
dist/examples/t.ui vendored Normal file
View File

@ -0,0 +1,33 @@
{
"widgettype":"VBox",
"options":{
"width":"100%"
},
"subwidgets":[
{
"widgettype":"Title3",
"options":{
"height":"auto",
"text":"Header information"
}
},
{
"widgettype":"Filler",
"options":{},
"subwidgets":[
{
"widgettype":"urlwidget",
"options":{
"url":"{{entire_url('channels.ui')}}"
}
}
]
},
{
"widgettype":"Text",
"options":{
"text":"Footer information"
}
}
]
}

59
dist/examples/tab.ui vendored Normal file
View File

@ -0,0 +1,59 @@
{
"widgettype":"TabPanel",
"options":{
"tab_wide":"auto",
"height":"100%",
"width":"100%",
"tab_long":"70%",
"tab_pos":"top",
"items":[
{
"name":"c",
"label":"C",
"content":{
"widgettype":"Text",
"options":{
"text":"This is a C language documents"
}
},
"icon":null
},
{
"name":"javascript",
"removable":true,
"label":"JavaScript",
"content":{
"widgettype":"Text",
"options":{
"text":"This is JavaScript language documents"
}
},
"icon":null
},
{
"name":"php",
"label":"PHP",
"content":{
"widgettype":"Text",
"options":{
"text":"This is PHP language documents"
}
},
"icon":null
},
{
"name":"python",
"label":"Python",
"content":{
"widgettype":"Text",
"options":{
"text":"This is Python language documents"
}
},
"icon":null
},
]
}
}

7
dist/examples/table.ui vendored Normal file
View File

@ -0,0 +1,7 @@
{
"widgettype":"urlwidget",
"options":{
"url":"tables.json"
}
}

104
dist/examples/text.ui vendored Normal file
View File

@ -0,0 +1,104 @@
{
"widgettype":"VBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Title1",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"Title2",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"Title3",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"Title4",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"Title5",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"Title6",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"Text",
"options":{
"text":"Pic Viewer",
"dynsize":true,
"i18n":true
}
},
{
"widgettype":"HBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Button",
"options":{
"label":"A",
"item_rate":1.4
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"target":"app",
"script":"bricks.app.textsize_bigger()"
}
]
},
{
"widgettype":"Button",
"options":{
"label":"A",
"item_rate":0.7,
"item_size":"20px"
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"target":"app",
"script":"bricks.app.textsize_smaller()"
}
]
}
]
}
]
}

31
dist/examples/toolbar.ui vendored Normal file
View File

@ -0,0 +1,31 @@
{
"widgettype":"Toolbar",
"options":{
"target":null,
"orientation":"horizontal",
"tool_margin":"15px",
"tools":[
{
"name":"c",
"label":"C",
"icon":null
},
{
"name":"javascript",
"label":"JavaScript",
"icon":null
},
{
"name":"php",
"label":"PHP",
"icon":null
},
{
"name":"python",
"label":"Python",
"icon":null
},
]
}
}

7
dist/examples/tree.ui vendored Normal file
View File

@ -0,0 +1,7 @@
{
"widgettype":"urlwidget",
"options":{
"url":"tree.json"
}
}

35
dist/examples/tree_t.ui vendored Normal file
View File

@ -0,0 +1,35 @@
{
"widgettype":"VBox",
"options":{
"height":"100%",
"width":"100%"
},
"subwidgets":[
{
"widgettype":"Title3",
"options":{
"height":"auto",
"text":"This is a tree"
}
},
{
"widgettype":"Filler",
"options":{},
"subwidgets":[
{
"widgettype":"urlwidget",
"options":{
"url":"{{entire_url('tree.ui')}}"
}
}
]
},
{
"widgettype":"Text",
"options":{
"height":"auto",
"text":"This is footer message"
}
}
]
}

97
dist/examples/vbox.ui vendored Normal file
View File

@ -0,0 +1,97 @@
{
"widgettype":"VBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Title1",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"Title2",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"Title3",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"Title4",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"Title5",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"Title6",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"Text",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"HBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Button",
"options":{
"label":"A",
"item_rate":1.4
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"target":"app",
"script":"bricks_app.textsize_bigger()"
}
]
},
{
"widgettype":"Button",
"options":{
"label":"A",
"item_rate":0.7,
"item_size":"20px"
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"script",
"target":"app",
"script":"bricks_app.textsize_smaller()"
}
]
}
]
}
]
}

40
dist/examples/vbox1.ui vendored Normal file
View File

@ -0,0 +1,40 @@
{
"widgettype":"VBox",
"options":{
},
"subwidgets":[
{
"widgettype":"Title1",
"options":{
"text":"Pic Viewer",
"i18n":true
}
},
{
"widgettype":"urlwidget",
"options":{
"url":"/bricks/image.tmpl"
}
},
{
"id":"mymodal",
"widgettype":"Modal",
"options":{
"auto_close":true,
"auto_open":false,
"width":"700px",
"height":"400px",
"archor":"cl",
},
"subwidgets":[
{
"widgettype":"Text",
"options":{
"text":"This is a test"
}
}
]
}
]
}

10
dist/examples/video.ui vendored Normal file
View File

@ -0,0 +1,10 @@
{
"id":"videoplayer",
"widgettype":"Video",
"options":{
"autoplay":true,
"url":"http://kimird.com/video/sample-mp4-file.mp4",
"type":"video/mp4"
}
}