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) • 9.52 kB
JavaScript
require('../../jqwidgets/jqxcore');
require('../../jqwidgets/jqxformattedinput');
!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/jqxformattedinput",["exports","@angular/core","@angular/forms"],e):e((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxformattedinput={}),t.ng.core,t.ng.forms)}(this,function(t,e,n){"use strict";function i(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(o=i.next()).done;)s.push(o.value)}catch(p){r={error:p}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return s}var o=function(){},r={provide:n.NG_VALUE_ACCESSOR,useExisting:e.forwardRef(function(){return s}),multi:!0},s=function(){function t(t){this.autoCreate=!0,this.properties=["disabled","decimalNotation","dropDown","dropDownWidth","height","min","max","placeHolder","popupZIndex","roundedCorners","rtl","radix","spinButtons","spinButtonsStep","template","theme","upperCase","value","width"],this.onTouchedCallback=o,this.onChangeCallback=o,this.onChange=new e.EventEmitter,this.onClose=new e.EventEmitter,this.onOpen=new e.EventEmitter,this.onRadixChange=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 n="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1),o=!1;if(this[n]!==undefined){if("object"==typeof this[n]){if(this[n]instanceof Array&&(o=this.arraysEqual(this[n],this.host.jqxFormattedInput(this.properties[e]))),o)return!1;this.host.jqxFormattedInput(this.properties[e],this[n]);continue}this[n]!==this.host.jqxFormattedInput(this.properties[e])&&this.host.jqxFormattedInput(this.properties[e],this[n])}}},t.prototype.arraysEqual=function(t,e){if(t&&!e||!t&&e)return!1;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0},t.prototype.manageAttributes=function(){for(var t={},e=0;e<this.properties.length;e++){var n="attr"+this.properties[e].substring(0,1).toUpperCase()+this.properties[e].substring(1);this[n]!==undefined&&(t[this.properties[e]]=this[n])}return t},t.prototype.moveClasses=function(t,e){var n,o=t.classList;0<o.length&&(n=e.classList).add.apply(n,function r(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}(o)),t.className=""},t.prototype.moveStyles=function(t,e){var n=t.style.cssText;e.style.cssText=n,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]),!0!==this.attrRtl?(!1===this.attrSpinButtons&&this.host.children()[1].remove(),!0!==this.attrDropDown&&this.host.children()[1].remove()):!0===this.attrRtl&&(this.host.children()[1].remove(),this.host.children()[1].remove(),!1!==this.attrSpinButtons&&this.host.prepend("<div></div>"),!0===this.attrDropDown&&this.host.prepend("<div></div>")),this.__wireEvents__(),this.widgetObject=jqwidgets.createInstance(this.host,"jqxFormattedInput",t))},t.prototype.createWidget=function(t){this.createComponent(t)},t.prototype.__updateRect__=function(){this.host&&this.host.css({width:this.attrWidth,height:this.attrHeight})},Object.defineProperty(t.prototype,"ngValue",{get:function(){return this.widgetObject?this.host.val():""},set:function(t){this.widgetObject&&this.onChangeCallback(t)},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.widgetObject&&this.host.jqxFormattedInput("val",t)},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.setOptions=function(t){this.host.jqxFormattedInput("setOptions",t)},t.prototype.disabled=function(t){if(t===undefined)return this.host.jqxFormattedInput("disabled");this.host.jqxFormattedInput("disabled",t)},t.prototype.decimalNotation=function(t){if(t===undefined)return this.host.jqxFormattedInput("decimalNotation");this.host.jqxFormattedInput("decimalNotation",t)},t.prototype.dropDown=function(t){if(t===undefined)return this.host.jqxFormattedInput("dropDown");this.host.jqxFormattedInput("dropDown",t)},t.prototype.dropDownWidth=function(t){if(t===undefined)return this.host.jqxFormattedInput("dropDownWidth");this.host.jqxFormattedInput("dropDownWidth",t)},t.prototype.height=function(t){if(t===undefined)return this.host.jqxFormattedInput("height");this.host.jqxFormattedInput("height",t)},t.prototype.min=function(t){if(t===undefined)return this.host.jqxFormattedInput("min");this.host.jqxFormattedInput("min",t)},t.prototype.max=function(t){if(t===undefined)return this.host.jqxFormattedInput("max");this.host.jqxFormattedInput("max",t)},t.prototype.placeHolder=function(t){if(t===undefined)return this.host.jqxFormattedInput("placeHolder");this.host.jqxFormattedInput("placeHolder",t)},t.prototype.popupZIndex=function(t){if(t===undefined)return this.host.jqxFormattedInput("popupZIndex");this.host.jqxFormattedInput("popupZIndex",t)},t.prototype.roundedCorners=function(t){if(t===undefined)return this.host.jqxFormattedInput("roundedCorners");this.host.jqxFormattedInput("roundedCorners",t)},t.prototype.rtl=function(t){if(t===undefined)return this.host.jqxFormattedInput("rtl");this.host.jqxFormattedInput("rtl",t)},t.prototype.radix=function(t){if(t===undefined)return this.host.jqxFormattedInput("radix");this.host.jqxFormattedInput("radix",t)},t.prototype.spinButtons=function(t){if(t===undefined)return this.host.jqxFormattedInput("spinButtons");this.host.jqxFormattedInput("spinButtons",t)},t.prototype.spinButtonsStep=function(t){if(t===undefined)return this.host.jqxFormattedInput("spinButtonsStep");this.host.jqxFormattedInput("spinButtonsStep",t)},t.prototype.template=function(t){if(t===undefined)return this.host.jqxFormattedInput("template");this.host.jqxFormattedInput("template",t)},t.prototype.theme=function(t){if(t===undefined)return this.host.jqxFormattedInput("theme");this.host.jqxFormattedInput("theme",t)},t.prototype.upperCase=function(t){if(t===undefined)return this.host.jqxFormattedInput("upperCase");this.host.jqxFormattedInput("upperCase",t)},t.prototype.value=function(t){if(t===undefined)return this.host.jqxFormattedInput("value");this.host.jqxFormattedInput("value",t)},t.prototype.width=function(t){if(t===undefined)return this.host.jqxFormattedInput("width");this.host.jqxFormattedInput("width",t)},t.prototype.close=function(){this.host.jqxFormattedInput("close")},t.prototype.destroy=function(){this.host.jqxFormattedInput("destroy")},t.prototype.focus=function(){this.host.jqxFormattedInput("focus")},t.prototype.open=function(){this.host.jqxFormattedInput("open")},t.prototype.render=function(){this.host.jqxFormattedInput("render")},t.prototype.refresh=function(){this.host.jqxFormattedInput("refresh")},t.prototype.selectAll=function(){this.host.jqxFormattedInput("selectAll")},t.prototype.selectFirst=function(){this.host.jqxFormattedInput("selectFirst")},t.prototype.selectLast=function(){this.host.jqxFormattedInput("selectLast")},t.prototype.val=function(t){return t!==undefined?this.host.jqxFormattedInput("val",t):this.host.jqxFormattedInput("val")},t.prototype.__wireEvents__=function(){var e=this;this.host.on("change",function(t){e.onChange.emit(t),t.args&&e.onChangeCallback(t.args.value)}),this.host.on("close",function(t){e.onClose.emit(t)}),this.host.on("open",function(t){e.onOpen.emit(t)}),this.host.on("radixChange",function(t){e.onRadixChange.emit(t),t.args&&e.onChangeCallback(t.args.value)})},t.decorators=[{type:e.Component,args:[{selector:"jqxFormattedInput",template:'<div><input type="text" [(ngModel)]="ngValue"><div></div><div></div></div>',providers:[r],changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={attrDisabled:[{type:e.Input,args:["disabled"]}],attrDecimalNotation:[{type:e.Input,args:["decimalNotation"]}],attrDropDown:[{type:e.Input,args:["dropDown"]}],attrDropDownWidth:[{type:e.Input,args:["dropDownWidth"]}],attrMin:[{type:e.Input,args:["min"]}],attrMax:[{type:e.Input,args:["max"]}],attrPlaceHolder:[{type:e.Input,args:["placeHolder"]}],attrPopupZIndex:[{type:e.Input,args:["popupZIndex"]}],attrRoundedCorners:[{type:e.Input,args:["roundedCorners"]}],attrRtl:[{type:e.Input,args:["rtl"]}],attrRadix:[{type:e.Input,args:["radix"]}],attrSpinButtons:[{type:e.Input,args:["spinButtons"]}],attrSpinButtonsStep:[{type:e.Input,args:["spinButtonsStep"]}],attrTemplate:[{type:e.Input,args:["template"]}],attrTheme:[{type:e.Input,args:["theme"]}],attrUpperCase:[{type:e.Input,args:["upperCase"]}],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}],onClose:[{type:e.Output}],onOpen:[{type:e.Output}],onRadixChange:[{type:e.Output}]},t}(),p=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.FormsModule],declarations:[s],exports:[s]}]}],t}();t.jqxFormattedInputComponent=s,t.jqxFormattedInputModule=p,Object.defineProperty(t,"__esModule",{value:!0})});