UNPKG

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) 7.38 kB
require('../../jqwidgets/jqxcore'); require('../../jqwidgets/jqxbuttons'); require('../../jqwidgets/jqxfileupload'); !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("jqwidgets-ng/jqxfileupload",["exports","@angular/core"],e):e((t["jqwidgets-ng"]=t["jqwidgets-ng"]||{},t["jqwidgets-ng"].jqxfileupload={}),t.ng.core)}(this,function(t,e){"use strict";function l(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var i,n,l=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(i=l.next()).done;)s.push(i.value)}catch(p){n={error:p}}finally{try{i&&!i.done&&(o=l["return"])&&o.call(l)}finally{if(n)throw n.error}}return s}var o=function(){function t(t){this.autoCreate=!0,this.properties=["autoUpload","accept","browseTemplate","cancelTemplate","disabled","fileInputName","height","localization","multipleFilesUpload","renderFiles","rtl","theme","uploadUrl","uploadTemplate","width"],this.onRemove=new e.EventEmitter,this.onSelect=new e.EventEmitter,this.onUploadStart=new e.EventEmitter,this.onUploadEnd=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),i=!1;if(this[o]!==undefined){if("object"==typeof this[o]){if(this[o]instanceof Array&&(i=this.arraysEqual(this[o],this.host.jqxFileUpload(this.properties[e]))),i)return!1;this.host.jqxFileUpload(this.properties[e],this[o]);continue}this[o]!==this.host.jqxFileUpload(this.properties[e])&&this.host.jqxFileUpload(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,i=t.classList;0<i.length&&(o=e.classList).add.apply(o,function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(l(arguments[e]));return t}(i)),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,"jqxFileUpload",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.jqxFileUpload("setOptions",t)},t.prototype.autoUpload=function(t){if(t===undefined)return this.host.jqxFileUpload("autoUpload");this.host.jqxFileUpload("autoUpload",t)},t.prototype.accept=function(t){if(t===undefined)return this.host.jqxFileUpload("accept");this.host.jqxFileUpload("accept",t)},t.prototype.browseTemplate=function(t){if(t===undefined)return this.host.jqxFileUpload("browseTemplate");this.host.jqxFileUpload("browseTemplate",t)},t.prototype.cancelTemplate=function(t){if(t===undefined)return this.host.jqxFileUpload("cancelTemplate");this.host.jqxFileUpload("cancelTemplate",t)},t.prototype.disabled=function(t){if(t===undefined)return this.host.jqxFileUpload("disabled");this.host.jqxFileUpload("disabled",t)},t.prototype.fileInputName=function(t){if(t===undefined)return this.host.jqxFileUpload("fileInputName");this.host.jqxFileUpload("fileInputName",t)},t.prototype.height=function(t){if(t===undefined)return this.host.jqxFileUpload("height");this.host.jqxFileUpload("height",t)},t.prototype.localization=function(t){if(t===undefined)return this.host.jqxFileUpload("localization");this.host.jqxFileUpload("localization",t)},t.prototype.multipleFilesUpload=function(t){if(t===undefined)return this.host.jqxFileUpload("multipleFilesUpload");this.host.jqxFileUpload("multipleFilesUpload",t)},t.prototype.renderFiles=function(t){if(t===undefined)return this.host.jqxFileUpload("renderFiles");this.host.jqxFileUpload("renderFiles",t)},t.prototype.rtl=function(t){if(t===undefined)return this.host.jqxFileUpload("rtl");this.host.jqxFileUpload("rtl",t)},t.prototype.theme=function(t){if(t===undefined)return this.host.jqxFileUpload("theme");this.host.jqxFileUpload("theme",t)},t.prototype.uploadUrl=function(t){if(t===undefined)return this.host.jqxFileUpload("uploadUrl");this.host.jqxFileUpload("uploadUrl",t)},t.prototype.uploadTemplate=function(t){if(t===undefined)return this.host.jqxFileUpload("uploadTemplate");this.host.jqxFileUpload("uploadTemplate",t)},t.prototype.width=function(t){if(t===undefined)return this.host.jqxFileUpload("width");this.host.jqxFileUpload("width",t)},t.prototype.browse=function(){this.host.jqxFileUpload("browse")},t.prototype.cancelFile=function(t){this.host.jqxFileUpload("cancelFile",t)},t.prototype.cancelAll=function(){this.host.jqxFileUpload("cancelAll")},t.prototype.destroy=function(){this.host.jqxFileUpload("destroy")},t.prototype.render=function(){this.host.jqxFileUpload("render")},t.prototype.refresh=function(){this.host.jqxFileUpload("refresh")},t.prototype.uploadFile=function(t){this.host.jqxFileUpload("uploadFile",t)},t.prototype.uploadAll=function(){this.host.jqxFileUpload("uploadAll")},t.prototype.__wireEvents__=function(){var e=this;this.host.on("remove",function(t){e.onRemove.emit(t)}),this.host.on("select",function(t){e.onSelect.emit(t)}),this.host.on("uploadStart",function(t){e.onUploadStart.emit(t)}),this.host.on("uploadEnd",function(t){e.onUploadEnd.emit(t)})},t.decorators=[{type:e.Component,args:[{selector:"jqxFileUpload",template:"<div><ng-content></ng-content></div>"}]}],t.ctorParameters=function(){return[{type:e.ElementRef}]},t.propDecorators={attrAutoUpload:[{type:e.Input,args:["autoUpload"]}],attrAccept:[{type:e.Input,args:["accept"]}],attrBrowseTemplate:[{type:e.Input,args:["browseTemplate"]}],attrCancelTemplate:[{type:e.Input,args:["cancelTemplate"]}],attrDisabled:[{type:e.Input,args:["disabled"]}],attrFileInputName:[{type:e.Input,args:["fileInputName"]}],attrLocalization:[{type:e.Input,args:["localization"]}],attrMultipleFilesUpload:[{type:e.Input,args:["multipleFilesUpload"]}],attrRenderFiles:[{type:e.Input,args:["renderFiles"]}],attrRtl:[{type:e.Input,args:["rtl"]}],attrTheme:[{type:e.Input,args:["theme"]}],attrUploadUrl:[{type:e.Input,args:["uploadUrl"]}],attrUploadTemplate:[{type:e.Input,args:["uploadTemplate"]}],attrWidth:[{type:e.Input,args:["width"]}],attrHeight:[{type:e.Input,args:["height"]}],autoCreate:[{type:e.Input,args:["auto-create"]}],onRemove:[{type:e.Output}],onSelect:[{type:e.Output}],onUploadStart:[{type:e.Output}],onUploadEnd:[{type:e.Output}]},t}(),i=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[],declarations:[o],exports:[o]}]}],t}();t.jqxFileUploadComponent=o,t.jqxFileUploadModule=i,Object.defineProperty(t,"__esModule",{value:!0})});