UNPKG

jqwidgets-scripts-custom

Version:

jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.

4 lines (3 loc) 6.86 kB
require('../../jqwidgets/jqxcore'); require('../../jqwidgets/jqxbuttons'); !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("jqwidgets-ng/jqxtogglebutton",["exports","@angular/core"],e):e((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxtogglebutton={}),t.ng.core)}(this,function(t,e){"use strict";function s(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,i,s=o.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)r.push(n.value)}catch(g){i={error:g}}finally{try{n&&!n.done&&(o=s["return"])&&o.call(s)}finally{if(i)throw i.error}}return r}var o=function(){function t(t){this.autoCreate=!0,this.properties=["disabled","height","imgSrc","imgWidth","imgHeight","imgPosition","roundedCorners","rtl","textPosition","textImageRelation","theme","template","toggled","width","value"],this.onClick=new e.EventEmitter,this.elementRef=t}return t.prototype.ngOnInit=function(){this.autoCreate&&this.createComponent()},t.prototype.ngOnChanges=function(t){if(this.host)for(var e=0;e<this.properties.length;e++){var o="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1),n=!1;if(this[o]!==undefined){if("object"==typeof this[o]){if(this[o]instanceof Array&&(n=this.arraysEqual(this[o],this.host.jqxToggleButton(this.properties[e]))),n)return!1;this.host.jqxToggleButton(this.properties[e],this[o]);continue}this[o]!==this.host.jqxToggleButton(this.properties[e])&&this.host.jqxToggleButton(this.properties[e],this[o])}}},t.prototype.arraysEqual=function(t,e){if(t&&!e||!t&&e)return!1;if(t.length!=e.length)return!1;for(var o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0},t.prototype.manageAttributes=function(){for(var t={},e=0;e<this.properties.length;e++){var o="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1);this[o]!==undefined&&(t[this.properties[e]]=this[o])}return t},t.prototype.moveClasses=function(t,e){var o,n=t.classList;0<n.length&&(o=e.classList).add.apply(o,function i(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}(n)),t.className=""},t.prototype.moveStyles=function(t,e){var o=t.style.cssText;e.style.cssText=o,t.style.cssText=""},t.prototype.createComponent=function(t){this.host||(t?JQXLite.extend(t,this.manageAttributes()):t=this.manageAttributes(),this.host=JQXLite(this.elementRef.nativeElement.firstChild),this.moveClasses(this.elementRef.nativeElement,this.host[0]),this.moveStyles(this.elementRef.nativeElement,this.host[0]),this.__wireEvents__(),this.widgetObject=jqwidgets.createInstance(this.host,"jqxToggleButton",t))},t.prototype.createWidget=function(t){this.createComponent(t)},t.prototype.__updateRect__=function(){this.host&&this.host.css({width:this.attrWidth,height:this.attrHeight})},t.prototype.setOptions=function(t){this.host.jqxToggleButton("setOptions",t)},t.prototype.disabled=function(t){if(t===undefined)return this.host.jqxToggleButton("disabled");this.host.jqxToggleButton("disabled",t)},t.prototype.height=function(t){if(t===undefined)return this.host.jqxToggleButton("height");this.host.jqxToggleButton("height",t)},t.prototype.imgSrc=function(t){if(t===undefined)return this.host.jqxToggleButton("imgSrc");this.host.jqxToggleButton("imgSrc",t)},t.prototype.imgWidth=function(t){if(t===undefined)return this.host.jqxToggleButton("imgWidth");this.host.jqxToggleButton("imgWidth",t)},t.prototype.imgHeight=function(t){if(t===undefined)return this.host.jqxToggleButton("imgHeight");this.host.jqxToggleButton("imgHeight",t)},t.prototype.imgPosition=function(t){if(t===undefined)return this.host.jqxToggleButton("imgPosition");this.host.jqxToggleButton("imgPosition",t)},t.prototype.roundedCorners=function(t){if(t===undefined)return this.host.jqxToggleButton("roundedCorners");this.host.jqxToggleButton("roundedCorners",t)},t.prototype.rtl=function(t){if(t===undefined)return this.host.jqxToggleButton("rtl");this.host.jqxToggleButton("rtl",t)},t.prototype.textPosition=function(t){if(t===undefined)return this.host.jqxToggleButton("textPosition");this.host.jqxToggleButton("textPosition",t)},t.prototype.textImageRelation=function(t){if(t===undefined)return this.host.jqxToggleButton("textImageRelation");this.host.jqxToggleButton("textImageRelation",t)},t.prototype.theme=function(t){if(t===undefined)return this.host.jqxToggleButton("theme");this.host.jqxToggleButton("theme",t)},t.prototype.template=function(t){if(t===undefined)return this.host.jqxToggleButton("template");this.host.jqxToggleButton("template",t)},t.prototype.toggled=function(t){if(t===undefined)return this.host.jqxToggleButton("toggled");this.host.jqxToggleButton("toggled",t)},t.prototype.width=function(t){if(t===undefined)return this.host.jqxToggleButton("width");this.host.jqxToggleButton("width",t)},t.prototype.value=function(t){if(t===undefined)return this.host.jqxToggleButton("value");this.host.jqxToggleButton("value",t)},t.prototype.check=function(){this.host.jqxToggleButton("check")},t.prototype.destroy=function(){this.host.jqxToggleButton("destroy")},t.prototype.focus=function(){this.host.jqxToggleButton("focus")},t.prototype.render=function(){this.host.jqxToggleButton("render")},t.prototype.toggle=function(){this.host.jqxToggleButton("toggle")},t.prototype.unCheck=function(){this.host.jqxToggleButton("unCheck")},t.prototype.val=function(t){return t!==undefined?this.host.jqxToggleButton("val",t):this.host.jqxToggleButton("val")},t.prototype.__wireEvents__=function(){var e=this;this.host.on("click",function(t){e.onClick.emit(t)})},t.decorators=[{type:e.Component,args:[{selector:"jqxToggleButton",template:"<button><ng-content></ng-content></button>"}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={attrDisabled:[{type:e.Input,args:["disabled"]}],attrImgSrc:[{type:e.Input,args:["imgSrc"]}],attrImgWidth:[{type:e.Input,args:["imgWidth"]}],attrImgHeight:[{type:e.Input,args:["imgHeight"]}],attrImgPosition:[{type:e.Input,args:["imgPosition"]}],attrRoundedCorners:[{type:e.Input,args:["roundedCorners"]}],attrRtl:[{type:e.Input,args:["rtl"]}],attrTextPosition:[{type:e.Input,args:["textPosition"]}],attrTextImageRelation:[{type:e.Input,args:["textImageRelation"]}],attrTheme:[{type:e.Input,args:["theme"]}],attrTemplate:[{type:e.Input,args:["template"]}],attrToggled:[{type:e.Input,args:["toggled"]}],attrValue:[{type:e.Input,args:["value"]}],attrWidth:[{type:e.Input,args:["width"]}],attrHeight:[{type:e.Input,args:["height"]}],autoCreate:[{type:e.Input,args:["auto-create"]}],onClick:[{type:e.Output}]},t}(),n=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[],declarations:[o],exports:[o]}]}],t}();t.jqxToggleButtonComponent=o,t.jqxToggleButtonModule=n,Object.defineProperty(t,"__esModule",{value:!0})});