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.08 kB
require('../../jqwidgets/jqxcore'); require('../../jqwidgets/jqxvalidator'); !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("jqwidgets-ng/jqxvalidator",["exports","@angular/core"],i):i((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxvalidator={}),t.ng.core)}(this,function(t,i){"use strict";function n(t,i){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var e,r,n=o.call(t),s=[];try{for(;(void 0===i||0<i--)&&!(e=n.next()).done;)s.push(e.value)}catch(a){r={error:a}}finally{try{e&&!e.done&&(o=n["return"])&&o.call(n)}finally{if(r)throw r.error}}return s}var o=function(){function t(t){this.autoCreate=!0,this.properties=["arrow","animation","animationDuration","closeOnClick","focus","hintType","onError","onSuccess","position","rules","rtl"],this.onValidationError=new i.EventEmitter,this.onValidationSuccess=new i.EventEmitter,this.elementRef=t}return t.prototype.ngOnInit=function(){this.autoCreate&&this.createComponent()},t.prototype.ngOnChanges=function(t){if(this.host)for(var i=0;i<this.properties.length;i++){var o="attr"+this.properties[i].substring(0,1).toUpperCase()+this.properties[i].substring(1),e=!1;if(this[o]!==undefined){if("object"==typeof this[o]){if(this[o]instanceof Array&&(e=this.arraysEqual(this[o],this.host.jqxValidator(this.properties[i]))),e)return!1;this.host.jqxValidator(this.properties[i],this[o]);continue}this[o]!==this.host.jqxValidator(this.properties[i])&&this.host.jqxValidator(this.properties[i],this[o])}}},t.prototype.arraysEqual=function(t,i){if(t&&!i||!t&&i)return!1;if(t.length!=i.length)return!1;for(var o=0;o<t.length;o++)if(t[o]!==i[o])return!1;return!0},t.prototype.manageAttributes=function(){for(var t={},i=0;i<this.properties.length;i++){var o="attr"+this.properties[i].substring(0,1).toUpperCase()+this.properties[i].substring(1);this[o]!==undefined&&(t[this.properties[i]]=this[o])}return t},t.prototype.moveClasses=function(t,i){var o,e=t.classList;0<e.length&&(o=i.classList).add.apply(o,function r(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t}(e)),t.className=""},t.prototype.moveStyles=function(t,i){var o=t.style.cssText;i.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,"jqxValidator",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.jqxValidator("setOptions",t)},t.prototype.arrow=function(t){if(t===undefined)return this.host.jqxValidator("arrow");this.host.jqxValidator("arrow",t)},t.prototype.animation=function(t){if(t===undefined)return this.host.jqxValidator("animation");this.host.jqxValidator("animation",t)},t.prototype.animationDuration=function(t){if(t===undefined)return this.host.jqxValidator("animationDuration");this.host.jqxValidator("animationDuration",t)},t.prototype.closeOnClick=function(t){if(t===undefined)return this.host.jqxValidator("closeOnClick");this.host.jqxValidator("closeOnClick",t)},t.prototype.focus=function(t){if(t===undefined)return this.host.jqxValidator("focus");this.host.jqxValidator("focus",t)},t.prototype.hintType=function(t){if(t===undefined)return this.host.jqxValidator("hintType");this.host.jqxValidator("hintType",t)},t.prototype.onError=function(t){if(t===undefined)return this.host.jqxValidator("onError");this.host.jqxValidator("onError",t)},t.prototype.onSuccess=function(t){if(t===undefined)return this.host.jqxValidator("onSuccess");this.host.jqxValidator("onSuccess",t)},t.prototype.position=function(t){if(t===undefined)return this.host.jqxValidator("position");this.host.jqxValidator("position",t)},t.prototype.rules=function(t){if(t===undefined)return this.host.jqxValidator("rules");this.host.jqxValidator("rules",t)},t.prototype.rtl=function(t){if(t===undefined)return this.host.jqxValidator("rtl");this.host.jqxValidator("rtl",t)},t.prototype.hideHint=function(t){this.host.jqxValidator("hideHint",t)},t.prototype.hide=function(){this.host.jqxValidator("hide")},t.prototype.updatePosition=function(){this.host.jqxValidator("updatePosition")},t.prototype.validate=function(t){this.host.jqxValidator("validate",t)},t.prototype.validateInput=function(t){this.host.jqxValidator("validateInput",t)},t.prototype.__wireEvents__=function(){var i=this;this.host.on("validationError",function(t){i.onValidationError.emit(t)}),this.host.on("validationSuccess",function(t){i.onValidationSuccess.emit(t)})},t.decorators=[{type:i.Component,args:[{selector:"jqxValidator",template:"<div><ng-content></ng-content></div>"}]}],t.ctorParameters=function(){return[{type:i.ElementRef}]},t.propDecorators={attrArrow:[{type:i.Input,args:["arrow"]}],attrAnimation:[{type:i.Input,args:["animation"]}],attrAnimationDuration:[{type:i.Input,args:["animationDuration"]}],attrCloseOnClick:[{type:i.Input,args:["closeOnClick"]}],attrFocus:[{type:i.Input,args:["focus"]}],attrHintType:[{type:i.Input,args:["hintType"]}],attrOnError:[{type:i.Input,args:["onError"]}],attrOnSuccess:[{type:i.Input,args:["onSuccess"]}],attrPosition:[{type:i.Input,args:["position"]}],attrRules:[{type:i.Input,args:["rules"]}],attrRtl:[{type:i.Input,args:["rtl"]}],attrWidth:[{type:i.Input,args:["width"]}],attrHeight:[{type:i.Input,args:["height"]}],autoCreate:[{type:i.Input,args:["auto-create"]}],onValidationError:[{type:i.Output}],onValidationSuccess:[{type:i.Output}]},t}(),e=function(){function t(){}return t.decorators=[{type:i.NgModule,args:[{imports:[],declarations:[o],exports:[o]}]}],t}();t.jqxValidatorComponent=o,t.jqxValidatorModule=e,Object.defineProperty(t,"__esModule",{value:!0})});