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) • 5.86 kB
JavaScript
require('../../jqwidgets/jqxcore');
require('../../jqwidgets/jqxrating');
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("jqwidgets-ng/jqxrating",["exports","@angular/core","@angular/forms"],e):e((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxrating={}),t.ng.core,t.ng.forms)}(this,function(t,e,i){"use strict";function s(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),r=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(i=s["return"])&&i.call(s)}finally{if(o)throw o.error}}return r}var n=function(){},o={provide:i.NG_VALUE_ACCESSOR,useExisting:e.forwardRef(function(){return r}),multi:!0},r=function(){function t(t){this.autoCreate=!0,this.properties=["count","disabled","height","itemHeight","itemWidth","precision","singleVote","value","width"],this.onTouchedCallback=n,this.onChangeCallback=n,this.onChange=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 i="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1),n=!1;if(this[i]!==undefined){if("object"==typeof this[i]){if(this[i]instanceof Array&&(n=this.arraysEqual(this[i],this.host.jqxRating(this.properties[e]))),n)return!1;this.host.jqxRating(this.properties[e],this[i]);continue}this[i]!==this.host.jqxRating(this.properties[e])&&this.host.jqxRating(this.properties[e],this[i])}}},t.prototype.arraysEqual=function(t,e){if(t&&!e||!t&&e)return!1;if(t.length!=e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},t.prototype.manageAttributes=function(){for(var t={},e=0;e<this.properties.length;e++){var i="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1);this[i]!==undefined&&(t[this.properties[e]]=this[i])}return t},t.prototype.moveClasses=function(t,e){var i,n=t.classList;0<n.length&&(i=e.classList).add.apply(i,function o(){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 i=t.style.cssText;e.style.cssText=i,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,"jqxRating",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.writeValue=function(t){this.widgetObject&&this.onChangeCallback(this.host.val())},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.setOptions=function(t){this.host.jqxRating("setOptions",t)},t.prototype.count=function(t){if(t===undefined)return this.host.jqxRating("count");this.host.jqxRating("count",t)},t.prototype.disabled=function(t){if(t===undefined)return this.host.jqxRating("disabled");this.host.jqxRating("disabled",t)},t.prototype.height=function(t){if(t===undefined)return this.host.jqxRating("height");this.host.jqxRating("height",t)},t.prototype.itemHeight=function(t){if(t===undefined)return this.host.jqxRating("itemHeight");this.host.jqxRating("itemHeight",t)},t.prototype.itemWidth=function(t){if(t===undefined)return this.host.jqxRating("itemWidth");this.host.jqxRating("itemWidth",t)},t.prototype.precision=function(t){if(t===undefined)return this.host.jqxRating("precision");this.host.jqxRating("precision",t)},t.prototype.singleVote=function(t){if(t===undefined)return this.host.jqxRating("singleVote");this.host.jqxRating("singleVote",t)},t.prototype.value=function(t){if(t===undefined)return this.host.jqxRating("value");this.host.jqxRating("value",t)},t.prototype.width=function(t){if(t===undefined)return this.host.jqxRating("width");this.host.jqxRating("width",t)},t.prototype.disable=function(){this.host.jqxRating("disable")},t.prototype.enable=function(){this.host.jqxRating("enable")},t.prototype.getValue=function(){return this.host.jqxRating("getValue")},t.prototype.setValue=function(t){this.host.jqxRating("setValue",t)},t.prototype.val=function(t){return t!==undefined?this.host.jqxRating("val",t):this.host.jqxRating("val")},t.prototype.__wireEvents__=function(){var e=this;this.host.on("change",function(t){e.onChange.emit(t),e.onChangeCallback(e.host.val())})},t.decorators=[{type:e.Component,args:[{selector:"jqxRating",template:"<div><ng-content></ng-content></div>",providers:[o],changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={attrCount:[{type:e.Input,args:["count"]}],attrDisabled:[{type:e.Input,args:["disabled"]}],attrItemHeight:[{type:e.Input,args:["itemHeight"]}],attrItemWidth:[{type:e.Input,args:["itemWidth"]}],attrPrecision:[{type:e.Input,args:["precision"]}],attrSingleVote:[{type:e.Input,args:["singleVote"]}],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"]}],onChange:[{type:e.Output}]},t}(),a=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.FormsModule],declarations:[r],exports:[r]}]}],t}();t.jqxRatingComponent=r,t.jqxRatingModule=a,Object.defineProperty(t,"__esModule",{value:!0})});