UNPKG

toloframework

Version:

Javascript/HTML/CSS compiler for Firefox OS or nodewebkit apps using modules in the nodejs style.

2 lines 2.29 kB
require("tfw.view.checkbox",function(e,n,t){var i=function(){function n(){return i(t,arguments)}var t={en:{},fr:{}},i=e("$").intl;return n.all=t,n}(),o={onKeyUp:function(e){["enter","space"].indexOf(e.code.toLowerCase())>-1&&(this.value=!this.value)}};try{n.exports=function(){function n(e,n,t){return void 0===e[n]?t:e[n]}function t(e,n,t){t?a.addClass(e,n):a.removeClass(e,n)}function i(e,n,t){t?a.removeClass(e,n):a.addClass(e,n)}var a=e("dom"),c=e("tfw.binding.property-manager"),r=e("tfw.view").Tag,s=e("tfw.binding.link"),l=e("tfw.view"),v=e("tfw.binding.converters");l.ensureCodeBehind(o,"onKeyUp");var u=v.get("boolean");return function(e){try{void 0===e&&(e={}),this.$elements={};var l=this,v=c(this);v.create("value",{cast:u}),v.create("inverted",{cast:u}),v.create("visible",{cast:u}),v.create("wide",{cast:u}),v.create("content");var w=new r("BUTTON",["class"]),d=new r("DIV",["class"]),f=new r("DIV",["class"]);this.$elements.bar=f;var b=new r("DIV",["class"]);this.$elements.btn=b,a.add(d,f,b);var h=new r("DIV",["class"]);a.add(w,d,h),Object.defineProperty(this,"$",{value:w.$,writable:!1,enumerable:!1,configurable:!1}),a.on(w,"tap",function(e){l.value=!l.value}),a.on(w,"keyup",o.onKeyUp.bind(this)),new s({A:{obj:l,name:"value"},B:{action:function(e){t(w,"ok",e)}}}),new s({A:{obj:l,name:"inverted"},B:{action:function(e){t(w,"inverted",e)}}}),new s({A:{obj:l,name:"wide"},B:{action:function(e){t(w,"wide",e)}}}),new s({A:{obj:l,name:"visible"},B:{action:function(e){i(w,"hide",e)}}}),new s({A:{obj:l,name:"value"},B:{action:function(e){t(f,"thm-bgSL",e),i(f,"thm-bg2",e)}}}),new s({A:{obj:l,name:"value"},B:{action:function(e){t(b,"thm-bgS",e),i(b,"thm-bg1",e)}}}),v.on("content",function(e){a.clear(h,e)}),w.class="tfw-view-checkbox",d.class="pin",f.class="bar thm-ele2",b.class="btn thm-ele2",h.class="txt",this.value=n(e,"value",!1),this.inverted=n(e,"inverted",!1),this.visible=n(e,"visible",!0),this.wide=n(e,"wide",!0),this.content=n(e,"content","Checkbox"),a.addClass(this,"view","custom")}catch(e){throw console.error("mod/tfw.view.checkbox.js",e),Error('Instantiation error in XJS of "mod/tfw.view.checkbox.js":\n'+e)}}}()}catch(e){throw Error('Definition error in XJS of "mod/tfw.view.checkbox.js"\n'+e)}n.exports._=i}); //# sourceMappingURL=tfw.view.checkbox.js.map