sp-dev-fx-webparts/samples/angular-ngofficeuifabric-fi.../lib/webparts/angularFileUpload/app/controllers/fileUploadCtrl.js.map

1 line
4.2 KiB
Plaintext
Raw Normal View History

{"version":3,"sources":["webparts/angularFileUpload/app/controllers/fileUploadCtrl.ts"],"names":[],"mappings":";AAKA;IASE,wBAAoB,iBAAoC,EAAU,UAAgC;QAAlG,iBAUC;QAVmB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAAU,eAAU,GAAV,UAAU,CAAsB;QAH3F,gBAAW,GAAY,KAAK,CAAC;QAC7B,eAAU,GAAY,KAAK,CAAC;QAGjC,IAAM,EAAE,GAAmB,IAAI,CAAC;QAChC,UAAU,CAAC,GAAG,CAAC,sBAAsB,EACnC,UAAC,KAAuB,EAAE,IAAS;YACjC,KAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACxC,EAAE,CAAA,CAAC,KAAI,CAAC,YAAY,CAAC,CAAA,CAAC;gBACpB,KAAI,CAAC,IAAI,EAAE,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACP,CAAC;IACO,6BAAI,GAAZ;QAAA,iBAOC;QANC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC;aAC9D,IAAI,CAAC,UAAC,QAA0B;YAC/B,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC,EAAE,UAAC,KAAa;YACf,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,+BAAM,GAAb;QAAA,iBAcC;QAbC,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAC;YACb,MAAM,CAAC;QACT,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC;aAC5D,IAAI,CAAC,UAAC,QAAmB;YACxB,KAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAChC,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,KAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3B,CAAC,EAAE,UAAC,KAAa;YACf,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACrB,KAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,mCAAU,GAAjB,UAAkB,QAAmB;QAArC,iBAYC;QAXC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,iBAAiB;aACnB,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;aAC1C,IAAI,CAAC,UAAC,QAAa;YAClB,IAAI,aAAa,GAAW,KAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC5D,KAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;YACvC,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC,EAAE,UAAC,KAAa;YACf,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACrB,KAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;IACH,qBAAC;AAAD,CA1DA,AA0DC;AAzDe,sBAAO,GAAa,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;AAD3D,wCAAc","file":"webparts/angularFileUpload/app/controllers/fileUploadCtrl.js","sourcesContent":["import { FileUploadService } from '../services/fileUploadSvc';\r\nimport { IFileItem } from \"../../interfaces/IFileItem\";\r\nimport { IFile } from \"../../interfaces/IFile\";\r\nimport { IError } from \"../../interfaces/IError\";\r\n\r\nexport class FileUploadCtrl {\r\n public static $inject: string[] = ['fileUploadService', '$rootScope'];\r\n public allFiles: Array<IFileItem>;\r\n public file: IFile;\r\n public libraryTitle: string;\r\n public rowLimit: number;\r\n public isUploading: boolean = false;\r\n public isRemoving: boolean = false;\r\n\r\n constructor(private fileUploadService: FileUploadService, private $rootScope: ng.IRootScopeService) {\r\n const vm: FileUploadCtrl = this;\r\n $rootScope.$on('configurationChanged',\r\n (event: ng.IAngularEvent, args: any): void => {\r\n this.libraryTitle = args.libraryTitle;\r\n this.rowLimit = parseInt(args.rowLimit);\r\n if(this.libraryTitle){\r\n this.init();\r\n }\r\n });\r\n }\r\n private init(): void {\r\n this.fileUploadService.getFiles(this.libraryTitle, this.rowLimit)\r\n .then((response: Array<IFileItem>): void => {\r\n this.allFiles = response;\r\n }, (error: IError): void => {\r\n alert(error.message);\r\n });\r\n }\r\n\r\n public upload(): void {\r\n if(!this.file){\r\n return;\r\n }\r\n this.isUploading = true;\r\n this.fileUploadService.uploadFile(this.libraryTitle, this.file)\r\n .then((response: IFileItem): void => {\r\n this.allFiles.unshift(response);\r\n this.file = null;\r\n this.isUploading = false;\r\n }, (error: IError): void => {\r\n alert(error.message);\r\n this.isUploading = false;\r\n });\r\n }\r\n\r\n public deleteFile(fileItem: IFileItem): void {\r\n this.isRemoving = true;\r\n this.fileUploadService\r\n .deleteFile(this.libraryTitle, fileItem.Id)\r\n .then((response: any): void => {\r\n var fileItemIndex: number = this.allFiles.indexOf(fileItem);\r\n this.allFiles.splice(f