sp-dev-fx-webparts/samples/angular-ngofficeuifabric-fi.../lib/webparts/angularFileUpload/AngularFileUploadWebPart.js...

1 line
7.0 KiB
Plaintext

{"version":3,"sources":["webparts/angularFileUpload/AngularFileUploadWebPart.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAqD;AACrD,8DAKoC;AAIpC,kDAAyD;AACzD,iCAAmC;AACnC,kCAAgC;AAChC,iFAAqD;AACrD,kDAAoD;AAGpD;IAAsD,4CAAqD;IAGzG,kCAAmB,OAAwB;QAA3C,YACE,iBAAO,SAGR;QAFC,6BAAiB,CAAC,OAAO,CAAC,iEAAiE,CAAC,CAAC;QAC7F,6BAAiB,CAAC,OAAO,CAAC,4EAA4E,CAAC,CAAC;;IAC1G,CAAC;IAEM,yCAAM,GAAb;QACE,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC;YAChC,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,0BACd,uCAAM,CAAC,iBAAiB,kCACtB,uCAAM,CAAC,SAAS,2GACa,uCAAM,CAAC,GAAG,SAAI,uCAAM,CAAC,gBAAgB,0LAG1B,uCAAM,CAAC,eAAe,8HAG9C,uCAAM,CAAC,eAAe,SAAI,uCAAM,CAAC,GAAG,wqBAQZ,uCAAM,CAAC,eAAe,2IAI9C,uCAAM,CAAC,eAAe,SAAI,uCAAM,CAAC,GAAG,iQAMpC,uCAAM,CAAC,eAAe,SAAI,uCAAM,CAAC,GAAG,o5BAcQ,uCAAM,CAAC,aAAa,4SAQzF,CAAC;YAER,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,UAAU,CAAC,sBAAsB,EAAE;YAClE,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY;YAC1C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ;SACnC,CAAC,CAAC;IACL,CAAC;IAED,sBAAc,iDAAW;aAAzB;YACE,MAAM,CAAC,yBAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;;;OAAA;IAES,+DAA4B,GAAtC;QACE,MAAM,CAAC;YACL,KAAK,EAAE;gBACL;oBACE,MAAM,EAAE;wBACN,WAAW,EAAE,OAAO,CAAC,uBAAuB;qBAC7C;oBACD,MAAM,EAAE;wBACN;4BACE,SAAS,EAAE,OAAO,CAAC,cAAc;4BACjC,WAAW,EAAE;gCACX,uCAAqB,CAAC,cAAc,EAAE;oCACpC,KAAK,EAAE,OAAO,CAAC,iBAAiB;iCACjC,CAAC;gCACF,uCAAqB,CAAC,UAAU,EAAE;oCAChC,KAAK,EAAE,OAAO,CAAC,aAAa;iCAC7B,CAAC;6BACH;yBACF;qBACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED,sBAAc,oEAA8B;aAA5C;YACE,MAAM,CAAC,IAAI,CAAC;QACd,CAAC;;;OAAA;IACH,+BAAC;AAAD,CAtGA,AAsGC,CAtGqD,uCAAqB,GAsG1E","file":"webparts/angularFileUpload/AngularFileUploadWebPart.js","sourcesContent":["import { Version } from '@microsoft/sp-core-library';\r\nimport {\r\n BaseClientSideWebPart,\r\n IPropertyPaneConfiguration,\r\n PropertyPaneTextField,\r\n IWebPartContext\r\n} from '@microsoft/sp-webpart-base';\r\n\r\nimport { escape } from '@microsoft/sp-lodash-subset';\r\n\r\nimport { SPComponentLoader } from '@microsoft/sp-loader';\r\nimport * as angular from 'angular';\r\nimport './app/FileUploadModule';\r\nimport styles from './AngularFileUpload.module.scss';\r\nimport * as strings from 'angularFileUploadStrings';\r\nimport { IAngularFileUploadWebPartProps } from './IAngularFileUploadWebPartProps';\r\n\r\nexport default class AngularFileUploadWebPart extends BaseClientSideWebPart<IAngularFileUploadWebPartProps> {\r\n\r\n private $injector: ng.auto.IInjectorService;\r\n public constructor(context: IWebPartContext) {\r\n super();\r\n SPComponentLoader.loadCss('https://appsforoffice.microsoft.com/fabric/2.6.1/fabric.min.css');\r\n SPComponentLoader.loadCss('https://appsforoffice.microsoft.com/fabric/2.6.1/fabric.components.min.css');\r\n }\r\n\r\n public render(): void {\r\n if (this.renderedOnce === false) {\r\n this.domElement.innerHTML = `\r\n <div class=\"${styles.angularFileUpload}\">\r\n <div class=\"${styles.container}\" data-ng-controller=\"fileUploadCtrl as vm\">\r\n <div class=\"ms-Grid ms-fontColor-white ${styles.row} ${styles.headerBackground}\">\r\n <div class=\"ms-Grid-row\">\r\n <div class=\"ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg12\">\r\n <h1 class=\"ms-fontSize-su ms-fontColor-white ${styles.textAlignCenter}\">Welcome to Angular File Upload!</h1>\r\n </div>\r\n </div>\r\n <div class=\"ms-Grid-row ${styles.whiteBackground} ${styles.row}\">\r\n <div class=\"ms-Grid-col ms-u-sm5 ms-u-md7 ms-u-lg7 ms-fontColor-black\"><input type=\"file\" value=\"vm.file.fileName\" data-custom-file-change=\"vm.file\" /></div>\r\n <div class=\"ms-Grid-col ms-u-sm2 ms-u-md2 ms-u-lg2\"><uif-spinner data-ng-if=\"vm.isUploading\"></uif-spinner></div>\r\n <div class=\"ms-Grid-col ms-u-sm5 ms-u-md3 ms-u-lg3\"><uif-button uif-type=\"primary\" data-ng-click=\"vm.upload()\">Upload</uif-button></div>\r\n </div>\r\n\r\n <div class=\"ms-Grid-row\">\r\n <div class=\"ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg12\">\r\n <h1 class=\"ms-fontSize-su ms-fontColor-white ${styles.textAlignCenter}\">{{vm.libraryTitle}}: Files uploaded by You</h1>\r\n </div>\r\n </div>\r\n\r\n <div class=\"ms-Grid-row ${styles.whiteBackground} ${styles.row}\">\r\n <div class=\"ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg12\">\r\n <uif-spinner data-ng-if=\"vm.isRemoving\">Removing .....</uif-spinner>\r\n </div>\r\n </div>\r\n\r\n <div class=\"ms-Grid-row ${styles.whiteBackground} ${styles.row}\">\r\n <div class=\"ms-Grid-col ms-u-sm12 ms-u-md12 ms-u-lg12\">\r\n <uif-table>\r\n <uif-table-head>\r\n <uif-table-row>\r\n <uif-table-header>File Name</uif-table-header>\r\n <uif-table-header>Modified</uif-table-header>\r\n <uif-table-header>Action</uif-table-header>\r\n </uif-table-row>\r\n </uif-table-head>\r\n <uif-table-body>\r\n <uif-table-row data-ng-repeat=\"fileItem in vm.allFiles\">\r\n <uif-table-cell>{{fileItem.FileLeafRef}}</uif-table-cell>\r\n <uif-table-cell>{{fileItem.Modified | isoToDateString}}</uif-table-cell>\r\n <uif-table-cell><i class=\"ms-Icon ms-Icon--Delete ${styles.cursorPointer}\" aria-hidden=\"true\" data-ng-click=\"vm.deleteFile(fileItem)\"></i></uif-table-cell>\r\n </uif-table-row>\r\n </uif-table-body>\r\n </uif-table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>`;\r\n\r\n this.$injector = angular.bootstrap(this.domElement, ['fileUploadApp']);\r\n }\r\n this.$injector.get('$rootScope').$broadcast('configurationChanged', {\r\n libraryTitle: this.properties.libraryTitle,\r\n rowLimit: this.properties.rowLimit\r\n });\r\n }\r\n\r\n protected get dataVersion(): Version {\r\n return Version.parse('1.0');\r\n }\r\n\r\n protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {\r\n return {\r\n pages: [\r\n {\r\n header: {\r\n description: strings.PropertyPaneDescription\r\n },\r\n groups: [\r\n {\r\n groupName: strings.BasicGroupName,\r\n groupFields: [\r\n PropertyPaneTextField('libraryTitle', {\r\n label: strings.LibraryTitleLabel\r\n }),\r\n PropertyPaneTextField('rowLimit', {\r\n label: strings.RowLimitLabel\r\n })\r\n ]\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n }\r\n\r\n protected get disableReactivePropertyChanges(): boolean {\r\n return true;\r\n }\r\n}\r\n"],"sourceRoot":"..\\..\\..\\src"}