antosdk-apps/ShowCase/build/debug/main.js

1 line
6.2 KiB
JavaScript
Raw Normal View History

2020-05-22 17:58:13 +02:00
(function(){var t;(t=class extends this.OS.GUI.BaseApplication{constructor(t){super("ShowCase",t)}main(){var t,e,i,n,o,a,s,l,d;return this.find("bttest").set("onbtclick",t=>this.error("test error")),this.observable.on("btclick",t=>this.notify("button clicked")),this.observable.on("menuselect",t=>this.notify(t.id)),(o=this.find("list")).set("data",[{text:"some thing with avery long text"},{text:"some thing 1",closable:!0},{text:"some thing 2",iconclass:"fa fa-camera-retro fa-lg"},{text:"some thing 3"},{text:"some thing 4"},{text:"some thing 5"}]),o.unshift({text:"shifted el"}),o.set("onlistselect",t=>this.notify(t.data.items)),this.find("switch").set("onchange",t=>this.notify(t.data)),this.find("spin").set("onchange",t=>this.notify(t.data)),this.find("menu").set("items",this.menu()),o.contextmenuHandle=(t,e)=>(e.set("items",this.menu()),e.show(t)),(n=this.find("grid")).set("oncelldbclick",t=>this.notify("on dbclick",t)),n.set("onrowselect",t=>this.notify("on rowselect",t.data.items)),this.observable.on("cellselect",(function(t){return console.log("observable",t)})),n.set("header",[{text:"header1",width:80},{text:"header2"},{text:"header3"}]),n.set("rows",[[{text:"text 1"},{text:"text 2"},{text:"text 3"}],[{text:"text 4"},{text:"text 5"},{text:"text 6"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"Subgrid on columns and rows. Subgrid on columns, implicit grid rows. Subgrid on rows, defined column tracks"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}],[{text:"text 7"},{text:"text 8"},{text:"text 9"}]]),s={name:"My Tree",nodes:[{name:"hello",iconclass:"fa fa-car"},{name:"wat"},{name:"child folder",nodes:[{name:"child folder",nodes:[{name:"hello"},{name:"wat"}]},{name:"hello"},{name:"wat"},{name:"child folder",nodes:[{name:"hello"},{name:"wat"}]}]}]},(l=this.find("tree")).set("data",s),l.set("ontreeselect",t=>this.notify(t.data.item.get("treepath"))),l.set("ontreedbclick",t=>this.notify("treedbclick",t)),this.observable.on("treedbclick",t=>this.notify("observable treedbclick",t)),this.find("slider").set("onchange",t=>this.notify(t)),this.find("cal").set("ondateselect",t=>this.notify(t)),(a=this.find("cpk")).set("oncolorselect",t=>this.notify(t)),a.set("oncolorselect",t=>this.notify(t)),(i=this.find("fileview")).set("fetch",(function(t){return new Promise((function(e,i){var n;return(n=t.asFileHandle()).read().then((function(t){var o;return(o=n.parent().asFileHandle()).filename="[..]",o.type="dir",t.error?i(t.error):(t.result.unshift(o),e(t.result))}))}))})),i.set("path","home:///"),(d=this.find("viewoption")).set("data",[{text:"icon"},{text:"list"},{text:"tree"}]),d.set("onlistselect",t=>(this.notify(t.data.item.get("data").text),i.set("view",t.data.item.get("data").text))),e=this.find("dialoglist"),t=this.find("btrundia"),e.set("data",[{text:"Prompt dialog",id:"prompt"},{text:"Calendar dialog",id:"calendar"},{text:"Color picker dialog",id:"colorpicker"},{text:"Info dialog",id:"info"},{text:"YesNo dialog",id:"yesno"},{text:"Selection dialog",id:"selection"},{text:"About dialog",id:"about"},{text:"File dialog",id:"file"},{text:"Text dialog",id:"text"}]),t.set("onbtclick",t=>{var i;if(i=e.get("selectedItem"))switch(i.get("data").id){case"prompt":return this.openDialog("PromptDialog",{title:"Prompt review",value:"txt data",label:"enter value"}).then(t=>this.notify(t));case"calendar":return this.openDialog("CalendarDialog",{title:"Calendar"}).then(t=>this.notify(t));case"colorpicker":return this.openDialog("ColorPickerDialog").then(t=>this.notify(t));case"info":return this.openDialog("InfoDialog",{title:"Info application",name:"Show case",date:"10/12/2014",description:"the brown fox jumps over the lazy dog"}).then((function(t){}));case"yesno":return this.openDialog("YesNoDialog",{title:"Question ?",text:"Do you realy want to delete fi