-
Notifications
You must be signed in to change notification settings - Fork 2
/
excel.min.js
1 lines (1 loc) · 3.57 KB
/
excel.min.js
1
var aps;(function(n){var e=require("edge"),o=function(){function n(){}return n.prototype.load=function(n){var i=t({fn:"excel-load",path:n},!0);return new f(i)},n}(),f,r,i,u,t;n.Excel=o,f=function(){function n(n){this.workbook=n}return n.prototype.save=function(n){t({fn:"workbook-save",path:n},!0)},n.prototype.getSheetAt=function(n){var i=t({fn:"workbook-getSheetAt",index:n,workbook:this.workbook},!0);return new r(i)},n.prototype.getSheet=function(n){var i=t({fn:"workbook-getSheet",name:n,workbook:this.workbook},!0);return new r(i)},n}(),n.Workbook=f,r=function(){function n(n){this.sheet=n}return n.prototype.getRow=function(n){if(n===0)throw new Error("row 0 is not valid");var r=t({fn:"sheet-getRow",sheet:this.sheet,row:n-1},!0);return r==null?null:new i(this.sheet,r,n)},n.prototype.getRowExists=function(n){if(n===0)throw new Error("row 0 is not valid");return t({fn:"sheet-getRowExists",sheet:this.sheet,row:n-1},!0)},n.prototype.getRowCount=function(){return t({fn:"sheet-getRowCount",sheet:this.sheet},!0)},n.prototype.cloneRow=function(n,r){if(n===0)throw new Error("row 0 is not valid");if(r===0)throw new Error("row 0 is not valid");var u=t({fn:"sheet-cloneRow",sheet:this.sheet,sourceRow:n-1,destRow:r-1},!0);return new i(this.sheet,u,r)},n.prototype.protect=function(n){t({fn:"sheet-protect",sheet:this.sheet,password:n},!0)},n.prototype.unprotect=function(){t({fn:"sheet-unprotect",sheet:this.sheet},!0)},n.prototype.createRow=function(n){if(n===0)throw new Error("row 0 is not valid");var r=t({fn:"sheet-createRow",sheet:this.sheet,row:n-1},!0);return new i(this.sheet,r,n)},n.prototype.getCellValue=function(n,t){var i,r;if(n===0)throw new Error("row 0 is not valid");if(t===0)throw new Error("column 0 is not valid");return(i=this.getRow(n),!i.isExists())?null:(r=i.getCell(t),!r.isExists())?null:r.getValue()},n.prototype.setCellValue=function(n,t,i){var r,u;if(n===0)throw new Error("row 0 is not valid");if(t===0)throw new Error("column 0 is not valid");r=this.getRow(n),r.isExists()||r.create(),u=r.getCell(t),u.isExists()||u.create(),u.setValue(i)},n}(),n.Sheet=r,i=function(){function n(n,t,i){this.sheet=n,this.row=t,this.index=i}return n.prototype.getCell=function(n){if(n===0)throw new Error("cell 0 is not valid");var i=t({fn:"row-getCell",row:this.row,cell:n-1},!0);return i==null?null:new u(this.row,i,n)},n.prototype.getCellExists=function(n){if(n===0)throw new Error("cell 0 is not valid");return t({fn:"row-getCellExists",row:this.row,cell:n-1},!0)},n.prototype.isExists=function(){return!!this.row},n.prototype.create=function(){this.isExists()||(this.row=t({fn:"sheet-createRow",row:this.index,sheet:this.sheet},!0))},n.prototype.createCell=function(n){if(n===0)throw new Error("cell 0 is not valid");var i=t({fn:"row-createCell",row:this.row,cell:n-1},!0);return new u(this.row,i,n)},n}(),n.Row=i,u=function(){function n(n,t,i){this.row=n,this.cell=t,this.index=i}return n.prototype.isExists=function(){return!!this.cell},n.prototype.create=function(){this.isExists()||(this.cell=t({fn:"row-createCell",row:this.row,cell:this.index-1},!0))},n.prototype.getValue=function(){return t({fn:"cell-getValue",cell:this.cell},!0)},n.prototype.setValue=function(n){t({fn:"cell-setValue",cell:this.cell,value:n},!0)},n.prototype.setLock=function(n){typeof n=="undefined"&&(n=!0),t({fn:"cell-setLock",cell:this.cell,lock:n},!0)},n.prototype.getLock=function(){return t({fn:"cell-getLock",cell:this.cell},!0)},n}(),n.Cell=u,t=e.func({source:__dirname+"/.cs/Excel.cs",typeName:"aps_excel_cs.Excel",methodName:"Invoke",references:["System.Data.dll",__dirname+"/.lib/NPOI.dll"]})})(aps||(aps={})),exports.Excel=new aps.Excel