UNPKG

toloframework

Version:

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

2 lines 3.15 kB
require("tfw.view.textbox",function(e,t,n){function o(e){var t=this,n=this.list;if(Array.isArray(n)&&0!==n.length){var o=this.$elements.completion;i.clear(o);var s=e.trim().toLowerCase(),r=0;n.forEach(function(e){var n=e.toLowerCase().indexOf(s);0===n&&(++r>8||a.call(t,o,e,n,s.length))}),r<8&&n.forEach(function(e){var n=e.toLowerCase().indexOf(s);n<1||++r>8||a.call(t,o,e,n,s.length)})}}function a(e,t,n,o){var a=this,s=i.div();n>0&&i.add(s,i.tag("span",[t.substr(0,n)])),i.add(s,i.tag("b",[t.substr(n,o)])),n+o<t.length&&i.add(s,i.tag("span",[t.substr(n+o)])),i.on(s,function(e){a.value=t}),i.add(e,s)}var s=function(){function t(){return o(n,arguments)}var n={en:{},fr:{}},o=e("$").intl;return t.all=n,t}(),i=e("dom"),r={onValueChanged:o};try{t.exports=function(){function t(e,t,n){return void 0===e[t]?n:e[t]}function n(e,t,n){n?a.addClass(e,t):a.removeClass(e,t)}function o(e,t,n){n?a.removeClass(e,t):a.addClass(e,t)}var a=e("dom"),s=e("tfw.binding.property-manager"),i=e("tfw.view").Tag,l=e("tfw.binding.link"),c=e("tfw.view"),u=e("tfw.binding.converters");c.ensureCodeBehind(r,"onValueChanged");var f=u.get("string"),d=u.get("boolean"),h=u.get("unit"),v=u.get("strings");return function(e){try{void 0===e&&(e={}),this.$elements={};var c=this,u=s(this);u.create("value",{cast:f}),u.create("label",{cast:f}),u.create("focus",{cast:d}),u.create("visible",{cast:d}),u.create("width",{cast:h}),u.create("list",{cast:v});var w=new i("DIV",["class"]),b=new i("DIV",["class"]);this.$elements.head=b;var m=new i("DIV",["class"]),g=new i("INPUT",["value","focus"]);this.$elements.input=g,a.add(m,g),this.$elements.body=m;var x=new i("DIV",["class"]);this.$elements.foot=x;var p=new i("DIV",["class"]);this.$elements.bottom=p;var C=new i("FOOTER"),j=new i("DIV",["class"]);this.$elements.completion=j,a.add(C,j),a.add(w,b,m,x,p,C),Object.defineProperty(this,"$",{value:w.$,writable:!1,enumerable:!1,configurable:!1}),new l({A:{obj:c,name:"focus"},B:{action:function(e){n(w,"focus",e)}}}),new l({A:{obj:c,name:"visible"},B:{action:function(e){o(w,"hide",e)}}}),new l({A:{obj:c,name:"focus",open:!1},B:{action:function(e){n(w,"thm-bg3",e)}}}),new l({A:{obj:c,name:"value"},B:{obj:g,name:"value"}}),new l({A:{obj:c,name:"focus"},B:{obj:g,name:"focus"}}),u.on("value",function(e){try{r.onValueChanged.call(c,e)}catch(e){console.error('Exception in function behind "onValueChanged" of module "mod/tfw.view.textbox.js" for attribute "value"! '),console.error(e)}}),u.on("label",function(e){a.clear(b,e)}),u.on("width",function(e){g.$.style.width=e}),w.class="tfw-view-textbox",b.class="head",m.class="body",x.class="foot",p.class="bottom thm-bgS",j.class="completion thm-bg3 thm-ele4",this.value=t(e,"value",""),this.label=t(e,"label",""),this.focus=t(e,"focus",!1),this.visible=t(e,"visible",!0),this.width=t(e,"width","8rem"),this.list=e.list,a.addClass(this,"view","custom")}catch(e){throw console.error("mod/tfw.view.textbox.js",e),Error('Instantiation error in XJS of "mod/tfw.view.textbox.js":\n'+e)}}}()}catch(e){throw Error('Definition error in XJS of "mod/tfw.view.textbox.js"\n'+e)}t.exports._=s}); //# sourceMappingURL=tfw.view.textbox.js.map