jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
5 lines (4 loc) • 8.31 kB
JavaScript
require('../../jqwidgets/jqxcore');
require('../../jqwidgets/jqxdata');
require('../../jqwidgets/jqxinput');
!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/jqxinput",["exports","@angular/core","@angular/forms"],e):e((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxinput={}),t.ng.core,t.ng.forms)}(this,function(t,e,n){"use strict";function r(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(o=r.next()).done;)s.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(n=r["return"])&&n.call(r)}finally{if(i)throw i.error}}return s}var o=function(){},i={provide:n.NG_VALUE_ACCESSOR,useExisting:e.forwardRef(function(){return s}),multi:!0},s=function(){function t(t){this.autoCreate=!0,this.properties=["disabled","dropDownWidth","displayMember","height","items","minLength","maxLength","opened","placeHolder","popupZIndex","query","renderer","rtl","searchMode","source","theme","valueMember","width","value"],this.initialLoad=!0,this.onTouchedCallback=o,this.onChangeCallback=o,this.onChange=new e.EventEmitter,this.onClose=new e.EventEmitter,this.onOpen=new e.EventEmitter,this.onSelect=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.jqxInput(this.properties[e]))),o)return!1;this.host.jqxInput(this.properties[e],this[n]);continue}this[n]!==this.host.jqxInput(this.properties[e])&&this.host.jqxInput(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 i(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(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]),this.__wireEvents__(),this.widgetObject=jqwidgets.createInstance(this.host,"jqxInput",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(){if(this.widgetObject){var t=this.host.val();return"object"==typeof t?t.label:t}return""},set:function(t){this.widgetObject&&this.onChangeCallback(t)},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(e){var n=this;this.widgetObject&&e&&(this.initialLoad&&(setTimeout(function(t){return n.host.jqxInput("val",e)}),this.initialLoad=!1),this.host.jqxInput("val",e))},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.setOptions=function(t){this.host.jqxInput("setOptions",t)},t.prototype.disabled=function(t){if(t===undefined)return this.host.jqxInput("disabled");this.host.jqxInput("disabled",t)},t.prototype.dropDownWidth=function(t){if(t===undefined)return this.host.jqxInput("dropDownWidth");this.host.jqxInput("dropDownWidth",t)},t.prototype.displayMember=function(t){if(t===undefined)return this.host.jqxInput("displayMember");this.host.jqxInput("displayMember",t)},t.prototype.height=function(t){if(t===undefined)return this.host.jqxInput("height");this.host.jqxInput("height",t)},t.prototype.items=function(t){if(t===undefined)return this.host.jqxInput("items");this.host.jqxInput("items",t)},t.prototype.minLength=function(t){if(t===undefined)return this.host.jqxInput("minLength");this.host.jqxInput("minLength",t)},t.prototype.maxLength=function(t){if(t===undefined)return this.host.jqxInput("maxLength");this.host.jqxInput("maxLength",t)},t.prototype.opened=function(t){if(t===undefined)return this.host.jqxInput("opened");this.host.jqxInput("opened",t)},t.prototype.placeHolder=function(t){if(t===undefined)return this.host.jqxInput("placeHolder");this.host.jqxInput("placeHolder",t)},t.prototype.popupZIndex=function(t){if(t===undefined)return this.host.jqxInput("popupZIndex");this.host.jqxInput("popupZIndex",t)},t.prototype.query=function(t){if(t===undefined)return this.host.jqxInput("query");this.host.jqxInput("query",t)},t.prototype.renderer=function(t){if(t===undefined)return this.host.jqxInput("renderer");this.host.jqxInput("renderer",t)},t.prototype.rtl=function(t){if(t===undefined)return this.host.jqxInput("rtl");this.host.jqxInput("rtl",t)},t.prototype.searchMode=function(t){if(t===undefined)return this.host.jqxInput("searchMode");this.host.jqxInput("searchMode",t)},t.prototype.source=function(t){if(t===undefined)return this.host.jqxInput("source");this.host.jqxInput("source",t)},t.prototype.theme=function(t){if(t===undefined)return this.host.jqxInput("theme");this.host.jqxInput("theme",t)},t.prototype.valueMember=function(t){if(t===undefined)return this.host.jqxInput("valueMember");this.host.jqxInput("valueMember",t)},t.prototype.width=function(t){if(t===undefined)return this.host.jqxInput("width");this.host.jqxInput("width",t)},t.prototype.value=function(t){if(t===undefined)return this.host.jqxInput("value");this.host.jqxInput("value",t)},t.prototype.destroy=function(){this.host.jqxInput("destroy")},t.prototype.focus=function(){this.host.jqxInput("focus")},t.prototype.selectAll=function(){this.host.jqxInput("selectAll")},t.prototype.val=function(t){return t!==undefined?this.host.jqxInput("val",t):this.host.jqxInput("val")},t.prototype.__wireEvents__=function(){var e=this;this.host.on("change",function(t){e.onChange.emit(t)}),this.host.on("close",function(t){e.onClose.emit(t)}),this.host.on("open",function(t){e.onOpen.emit(t)}),this.host.on("select",function(t){e.onSelect.emit(t),t.args&&e.onChangeCallback(t.args.value)})},t.decorators=[{type:e.Component,args:[{selector:"jqxInput",template:'<input type="text" [(ngModel)]="ngValue">',providers:[i],changeDetection:e.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={attrDisabled:[{type:e.Input,args:["disabled"]}],attrDropDownWidth:[{type:e.Input,args:["dropDownWidth"]}],attrDisplayMember:[{type:e.Input,args:["displayMember"]}],attrItems:[{type:e.Input,args:["items"]}],attrMinLength:[{type:e.Input,args:["minLength"]}],attrMaxLength:[{type:e.Input,args:["maxLength"]}],attrOpened:[{type:e.Input,args:["opened"]}],attrPlaceHolder:[{type:e.Input,args:["placeHolder"]}],attrPopupZIndex:[{type:e.Input,args:["popupZIndex"]}],attrQuery:[{type:e.Input,args:["query"]}],attrRenderer:[{type:e.Input,args:["renderer"]}],attrRtl:[{type:e.Input,args:["rtl"]}],attrSearchMode:[{type:e.Input,args:["searchMode"]}],attrSource:[{type:e.Input,args:["source"]}],attrTheme:[{type:e.Input,args:["theme"]}],attrValueMember:[{type:e.Input,args:["valueMember"]}],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}],onSelect:[{type:e.Output}]},t}(),p=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.FormsModule],declarations:[s],exports:[s]}]}],t}();t.jqxInputComponent=s,t.jqxInputModule=p,Object.defineProperty(t,"__esModule",{value:!0})});