@cleavelandprice/ngx-lib 3.0.7 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/active-directory/public_api.d.ts +3 -0
  2. package/authentication/public_api.d.ts +1 -0
  3. package/esm2020/active-directory/public_api.mjs +4 -1
  4. package/esm2020/authentication/public_api.mjs +2 -2
  5. package/esm2020/sharepoint/public_api.mjs +2 -2
  6. package/esm2020/upload/components/upload/upload.component.mjs +3 -2
  7. package/esm2020/upload/components/upload-dialog/upload-dialog.component.mjs +6 -5
  8. package/esm2020/upload/public_api.mjs +2 -2
  9. package/esm2020/upload/upload.module.mjs +5 -1
  10. package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs +4 -4
  11. package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
  12. package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs +4 -4
  13. package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
  14. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs +4 -4
  15. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
  16. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs +24 -19
  17. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
  18. package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs +4 -4
  19. package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
  20. package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs +4 -4
  21. package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
  22. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs +4 -4
  23. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
  24. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs +24 -19
  25. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
  26. package/package.json +1 -1
  27. package/sharepoint/public_api.d.ts +1 -0
  28. package/upload/public_api.d.ts +1 -1
  29. package/upload/upload.module.d.ts +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi',\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","//#region Imports\nimport { Injectable, Optional } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, of } from 'rxjs';\n\nimport { defaultConfig } from '../model/default-config';\n\nimport { CacheObject } from '../model/cache-object';\nimport { ListItem } from '../model/list-item';\nimport { ListItemsRequest } from '../model/list-items-request';\nimport { PhotoItem } from '../model/photo-item';\nimport { ServiceConfig } from '../model/service-config';\nimport { UserRequest } from '../model/user-request';\nimport { User } from '../model/user';\n\nimport moment from 'moment';\n//#endregion\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SharepointService {\n private cache: {\n users: CacheObject<User> | null,\n photos: CacheObject<PhotoItem> | null\n } | null = null;\n\n private defaultCacheLifeMinutes = 720;\n\n //#region Utilities\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\n if (!cache) {\n return true;\n }\n\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n const expiration = moment(cache.lastUpdate)\n .add(lifeMinutes, 'minutes');\n\n return moment().isAfter(expiration);\n }\n //#endregion\n\n //#region Initialization\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\n constructor(@Optional() private config: ServiceConfig,\n private http: HttpClient) {\n\n this.config = {\n ...defaultConfig,\n ...this.config\n };\n\n this.configureCaching();\n this.configureLogging();\n }\n\n private configureCaching(): void {\n // If caching config is missing entirely, give it a default\n this.config.caching = this.config.caching ?? {\n enabled: false,\n lifeMinutes: this.defaultCacheLifeMinutes\n };\n\n this.cache = {\n photos: null,\n users: null\n };\n }\n\n private configureLogging(): void {\n // If logging config is missing entirely, give it a default\n this.config.logging = this.config.logging ?? {\n dataCached: false,\n cachedDataReturned: false,\n freshDataReturned: false,\n cacheCleared: false\n }\n }\n //#endregion\n\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\n\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\n }\n\n getPhotos(): Observable<PhotoItem[]> {\n const request: ListItemsRequest = {\n username: this.config?.username ?? defaultConfig.username,\n password: this.config?.password ?? defaultConfig.password,\n site: this.config?.photos.site ?? defaultConfig.photos.site,\n list: this.config?.photos.list ?? defaultConfig.photos.list,\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\n };\n\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\n\n if (this.config.caching?.enabled) {\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\n // Get the data and cache it\n observable$.subscribe(data => {\n this.cache!.photos = {\n data,\n lastUpdate: moment()\n };\n\n if (this.config.logging?.dataCached) {\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n console.log(`Photos cached for ${lifeMinutes} minutes`);\n }\n });\n } else {\n // Cache exists and hasn't expired yet\n if (this.config.logging?.cachedDataReturned) {\n console.log('Returning cached photos');\n }\n\n return of(this.cache!.photos!.data);\n }\n }\n\n // Cache is either disabled or expired, return data from API\n if (this.config.logging?.freshDataReturned) {\n console.log('Returning fresh photos');\n }\n\n return observable$;\n }\n\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\n \n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\n\n //#region Single user\n if (id) {\n return observable$;\n }\n //#endregion\n\n //#region Multiple users\n if (this.config.caching?.enabled) {\n if (this.cacheExpired<User>(this.cache!.users!)) {\n // Get the data and cache it\n observable$.subscribe(data => {\n this.cache!.users = {\n data: data as User[],\n lastUpdate: moment()\n };\n\n if (this.config.logging?.dataCached) {\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n console.log(`Users cached for ${lifeMinutes} minutes`);\n }\n });\n } else {\n // Cache exists and hasn't expired yet\n if (this.config.logging?.cachedDataReturned) {\n console.log('Returning cached users');\n }\n\n return of(this.cache!.users!.data);\n }\n }\n\n // Cache is either disabled or expired, return data from API\n if (this.config.logging?.freshDataReturned) {\n console.log('Returning fresh users');\n }\n\n return observable$;\n //#endregion\n }\n\n clearCache(): void {\n this.cache = null;\n\n if (this.config.logging?.cacheCleared) {\n console.log('Cache cleared');\n }\n }\n}","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ServiceConfig } from './model/service-config';\nimport { SharepointService } from './services/sharepoint.service';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule\n ]\n})\nexport class SharepointModule {\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharepointModule> {\n return {\n ngModule: SharepointModule,\n providers: [\n SharepointService,\n { provide: ServiceConfig, useValue: config }\n ]\n };\n }\n\n constructor( @Optional() @SkipSelf() parentModule: SharepointModule) {\n if (parentModule) {\n throw new Error(\n 'SharepointModule is already loaded. Import it in the AppModule only');\n }\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.ServiceConfig"],"mappings":";;;;;;;MAGa,aAAa,CAAA;AAazB;;ACbM,MAAM,aAAa,GAAkB;AACxC,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,iBAAiB,EAAE,uBAAuB;AAC1C,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE;AACJ,QAAA,IAAI,EAAE,uDAAuD;AAC7D,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,8BAA8B,EAAE;YAC5B,eAAe;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,WAAW,EAAE,GAAG;AACnB,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,kBAAkB,EAAE,IAAI;AACxB,QAAA,iB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AAA,EAAA,IAAA,EAAA,gBAAgB,kBAWwB,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAXxD,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHzB,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAGH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;0DAYoD,gBAAgB,EAAA,UAAA,EAAA,CAAA;0BAArD,QAAQ;;0BAAI,QAAQ;;;ACtBpC;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi',\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","//#region Imports\nimport { Injectable, Optional } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, of } from 'rxjs';\n\nimport { defaultConfig } from '../model/default-config';\n\nimport { CacheObject } from '../model/cache-object';\nimport { ListItem } from '../model/list-item';\nimport { ListItemsRequest } from '../model/list-items-request';\nimport { PhotoItem } from '../model/photo-item';\nimport { ServiceConfig } from '../model/service-config';\nimport { UserRequest } from '../model/user-request';\nimport { User } from '../model/user';\n\nimport moment from 'moment';\n//#endregion\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SharepointService {\n private cache: {\n users: CacheObject<User> | null,\n photos: CacheObject<PhotoItem> | null\n } | null = null;\n\n private defaultCacheLifeMinutes = 720;\n\n //#region Utilities\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\n if (!cache) {\n return true;\n }\n\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n const expiration = moment(cache.lastUpdate)\n .add(lifeMinutes, 'minutes');\n\n return moment().isAfter(expiration);\n }\n //#endregion\n\n //#region Initialization\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\n constructor(@Optional() private config: ServiceConfig,\n private http: HttpClient) {\n\n this.config = {\n ...defaultConfig,\n ...this.config\n };\n\n this.configureCaching();\n this.configureLogging();\n }\n\n private configureCaching(): void {\n // If caching config is missing entirely, give it a default\n this.config.caching = this.config.caching ?? {\n enabled: false,\n lifeMinutes: this.defaultCacheLifeMinutes\n };\n\n this.cache = {\n photos: null,\n users: null\n };\n }\n\n private configureLogging(): void {\n // If logging config is missing entirely, give it a default\n this.config.logging = this.config.logging ?? {\n dataCached: false,\n cachedDataReturned: false,\n freshDataReturned: false,\n cacheCleared: false\n }\n }\n //#endregion\n\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\n\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\n }\n\n getPhotos(): Observable<PhotoItem[]> {\n const request: ListItemsRequest = {\n username: this.config?.username ?? defaultConfig.username,\n password: this.config?.password ?? defaultConfig.password,\n site: this.config?.photos.site ?? defaultConfig.photos.site,\n list: this.config?.photos.list ?? defaultConfig.photos.list,\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\n };\n\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\n\n if (this.config.caching?.enabled) {\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\n // Get the data and cache it\n observable$.subscribe(data => {\n this.cache!.photos = {\n data,\n lastUpdate: moment()\n };\n\n if (this.config.logging?.dataCached) {\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n console.log(`Photos cached for ${lifeMinutes} minutes`);\n }\n });\n } else {\n // Cache exists and hasn't expired yet\n if (this.config.logging?.cachedDataReturned) {\n console.log('Returning cached photos');\n }\n\n return of(this.cache!.photos!.data);\n }\n }\n\n // Cache is either disabled or expired, return data from API\n if (this.config.logging?.freshDataReturned) {\n console.log('Returning fresh photos');\n }\n\n return observable$;\n }\n\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\n \n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\n\n //#region Single user\n if (id) {\n return observable$;\n }\n //#endregion\n\n //#region Multiple users\n if (this.config.caching?.enabled) {\n if (this.cacheExpired<User>(this.cache!.users!)) {\n // Get the data and cache it\n observable$.subscribe(data => {\n this.cache!.users = {\n data: data as User[],\n lastUpdate: moment()\n };\n\n if (this.config.logging?.dataCached) {\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n console.log(`Users cached for ${lifeMinutes} minutes`);\n }\n });\n } else {\n // Cache exists and hasn't expired yet\n if (this.config.logging?.cachedDataReturned) {\n console.log('Returning cached users');\n }\n\n return of(this.cache!.users!.data);\n }\n }\n\n // Cache is either disabled or expired, return data from API\n if (this.config.logging?.freshDataReturned) {\n console.log('Returning fresh users');\n }\n\n return observable$;\n //#endregion\n }\n\n clearCache(): void {\n this.cache = null;\n\n if (this.config.logging?.cacheCleared) {\n console.log('Cache cleared');\n }\n }\n}","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ServiceConfig } from './model/service-config';\nimport { SharepointService } from './services/sharepoint.service';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule\n ]\n})\nexport class SharepointModule {\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharepointModule> {\n return {\n ngModule: SharepointModule,\n providers: [\n SharepointService,\n { provide: ServiceConfig, useValue: config }\n ]\n };\n }\n\n constructor( @Optional() @SkipSelf() parentModule: SharepointModule) {\n if (parentModule) {\n throw new Error(\n 'SharepointModule is already loaded. Import it in the AppModule only');\n }\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.ServiceConfig"],"mappings":";;;;;;;AAGa,MAAA,aAAa,GAAkB;AACxC,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,iBAAiB,EAAE,uBAAuB;AAC1C,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE;AACJ,QAAA,IAAI,EAAE,uDAAuD;AAC7D,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,8BAA8B,EAAE;YAC5B,eAAe;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,WAAW,EAAE,GAAG;AACnB,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,kBAAkB,EAAE,IAAI;AACxB,QAAA,iBAAiB,EAAE,IAAI;AACvB,QAAA,YAAY,EAAE,IAAI;AACrB,KAAA;;;MCtBQ,aAAa,CAAA;AAazB;;AChBD;AAgBA;MAKa,iBAAiB,CAAA;;;;IAwB5B,WAAgC,CAAA,MAAqB,EACjC,IAAgB,EAAA;QADJ,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;QACjC,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QAxB5B,IAAK,CAAA,KAAA,GAGF,IAAI,CAAC;QAER,IAAuB,CAAA,uBAAA,GAAG,GAAG,CAAC;QAqBxB,IAAI,CAAC,MAAM,GAAG;AACZ,YAAA,GAAG,aAAa;YAChB,GAAG,IAAI,CAAC,MAAM;SACf,CAAC;QAEF,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,gBAAgB,EAAE,CA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AAA,IAAA,EAAA,gBAAgB,YAHzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAGH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;0DAYoD,gBAAgB,EAAA,UAAA,EAAA,CAAA;0BAArD,QAAQ;;0BAAI,QAAQ;;;ACtBpC;;AAEG;;;;"}
@@ -7,12 +7,28 @@ import * as i1 from '@angular/common/http';
7
7
  import { HttpHeaders, HttpRequest, HttpEventType, HttpResponse } from '@angular/common/http';
8
8
  import * as i3 from '@angular/common';
9
9
  import { CommonModule } from '@angular/common';
10
- import * as i4 from '@angular/material/list';
10
+ import * as i4 from '@angular/material/button';
11
+ import { MatButtonModule } from '@angular/material/button';
12
+ import * as i5 from '@angular/material/list';
11
13
  import { MatListModule } from '@angular/material/list';
12
- import * as i5 from '@angular/material/core';
13
- import * as i6 from '@angular/material/progress-bar';
14
+ import * as i6 from '@angular/material/core';
15
+ import * as i7 from '@angular/material/progress-bar';
14
16
  import { MatProgressBarModule } from '@angular/material/progress-bar';
15
17
 
18
+ const defaultConfig = {
19
+ apiUrl: 'http://utilityapi/upload/database',
20
+ uploadDialogTitle: 'Upload Files',
21
+ uploadPath: null,
22
+ comment: null,
23
+ dbAppId: null,
24
+ externalReferenceId: null,
25
+ uploadButtonText: 'Upload',
26
+ uploadDialogCancelButtonText: 'Cancel',
27
+ uploadDialogFinishButtonText: 'Finish',
28
+ uploadDialogUploadButtonText: 'Upload',
29
+ uploadDialogAddFilesButtonText: 'Add Files'
30
+ };
31
+
16
32
  class ServiceConfig {
17
33
  constructor() {
18
34
  this.uploadPath = null;
@@ -29,20 +45,6 @@ class ServiceConfig {
29
45
  }
30
46
  }
31
47
 
32
- const defaultConfig = {
33
- apiUrl: 'http://utilityapi/upload/database',
34
- uploadDialogTitle: 'Upload Files',
35
- uploadPath: null,
36
- comment: null,
37
- dbAppId: null,
38
- externalReferenceId: null,
39
- uploadButtonText: 'Upload',
40
- uploadDialogCancelButtonText: 'Cancel',
41
- uploadDialogFinishButtonText: 'Finish',
42
- uploadDialogUploadButtonText: 'Upload',
43
- uploadDialogAddFilesButtonText: 'Add Files'
44
- };
45
-
46
48
  // https://malcoded.com/posts/angular-file-upload-component-with-express
47
49
  class UploadService {
48
50
  constructor(http, config) {
@@ -197,7 +199,7 @@ class UploadDialogComponent {
197
199
  }
198
200
  }
199
201
  UploadDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
200
- UploadDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: UploadDialogComponent, selector: "cp-upload-dialog", viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, static: true }], ngImport: i0, template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadService.config.uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadService.config.uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\n", styles: ["#title{display:flex;justify-content:space-between}#actions{display:flex;justify-content:flex-end}#conflict{font-size:.8em;color:red;margin-top:.5em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i4.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i5.MatLine, selector: "[mat-line], [matLine]" }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
202
+ UploadDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: UploadDialogComponent, selector: "cp-upload-dialog", viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, static: true }], ngImport: i0, template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadService.config.uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadService.config.uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\n", styles: ["#title{display:flex;justify-content:space-between}#actions{display:flex;justify-content:flex-end}#conflict{font-size:.8em;color:red;margin-top:.5em}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i5.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatLine, selector: "[mat-line], [matLine]" }, { kind: "component", type: i7.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
201
203
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadDialogComponent, decorators: [{
202
204
  type: Component,
203
205
  args: [{ selector: 'cp-upload-dialog', template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadService.config.uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadService.config.uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\n", styles: ["#title{display:flex;justify-content:space-between}#actions{display:flex;justify-content:flex-end}#conflict{font-size:.8em;color:red;margin-top:.5em}\n"] }]
@@ -223,7 +225,7 @@ class UploadComponent {
223
225
  }
224
226
  }
225
227
  UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadComponent, deps: [{ token: i1$1.MatDialog }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
226
- UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: UploadComponent, selector: "cp-upload", outputs: { dialogClosed: "dialogClosed" }, ngImport: i0, template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>', isInline: true });
228
+ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: UploadComponent, selector: "cp-upload", outputs: { dialogClosed: "dialogClosed" }, ngImport: i0, template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>', isInline: true, dependencies: [{ kind: "component", type: i4.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
227
229
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadComponent, decorators: [{
228
230
  type: Component,
229
231
  args: [{
@@ -253,11 +255,13 @@ class UploadModule {
253
255
  UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, deps: [{ token: UploadModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
254
256
  UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
255
257
  UploadDialogComponent], imports: [CommonModule,
258
+ MatButtonModule,
256
259
  MatDialogModule,
257
260
  MatListModule,
258
261
  MatProgressBarModule], exports: [UploadComponent,
259
262
  UploadDialogComponent] });
260
263
  UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, imports: [CommonModule,
264
+ MatButtonModule,
261
265
  MatDialogModule,
262
266
  MatListModule,
263
267
  MatProgressBarModule] });
@@ -270,6 +274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
270
274
  ],
271
275
  imports: [
272
276
  CommonModule,
277
+ MatButtonModule,
273
278
  MatDialogModule,
274
279
  MatListModule,
275
280
  MatProgressBarModule
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-upload.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/upload/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/services/upload.service.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload-dialog/upload-dialog.component.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload-dialog/upload-dialog.component.html","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload/upload.component.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/upload.module.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/cleavelandprice-ngx-lib-upload.ts"],"sourcesContent":["export class ServiceConfig {\r\n apiUrl!: string;\r\n uploadPath: string | null = null;\r\n dbAppId: string | null = null;\r\n externalReferenceId: string | null = null;\r\n comment: string | null = null;\r\n\r\n // UI configuration\r\n uploadButtonText: string | null = null;\r\n uploadDialogTitle: string | null = null;\r\n uploadDialogAddFilesButtonText: string | null = null;\r\n uploadDialogCancelButtonText: string | null = null;\r\n uploadDialogUploadButtonText: string | null = null;\r\n uploadDialogFinishButtonText: string | null = null;\r\n}\r\n","import { ServiceConfig } from \"./service-config\";\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi/upload/database',\r\n uploadDialogTitle: 'Upload Files',\r\n uploadPath: null,\r\n comment: null,\r\n dbAppId: null,\r\n externalReferenceId: null,\r\n \r\n uploadButtonText: 'Upload',\r\n uploadDialogCancelButtonText: 'Cancel',\r\n uploadDialogFinishButtonText: 'Finish',\r\n uploadDialogUploadButtonText: 'Upload',\r\n uploadDialogAddFilesButtonText: 'Add Files'\r\n}","import { Injectable, Optional } from '@angular/core';\nimport { HttpClient, HttpRequest, HttpEventType, HttpResponse, HttpHeaders } from '@angular/common/http';\nimport { Subject , Observable } from 'rxjs';\nimport { ServiceConfig } from '../model/service-config';\nimport { FileUploadRequest } from '../model/file-upload-request';\nimport { DatabaseFileInfo } from '../model/database-file-info';\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\nimport { defaultConfig } from '../model/default-config';\n\n// https://malcoded.com/posts/angular-file-upload-component-with-express\n\n@Injectable()\nexport class UploadService {\n constructor(private http: HttpClient,\n @Optional() public config: ServiceConfig) {\n this.config = {\n ...defaultConfig,\n ...this.config\n };\n }\n\n public upload(files: Set<File>): any { // {[key: string]: Observable<number>} {\n // this will be the our resulting map\n const status: {[key: string]: {progress: Observable<number>}} = {};\n\n files.forEach(file => {\n // create a new multipart-form for every file\n const formData: FormData = new FormData();\n formData.append('file', file, file.name);\n\n // create a http-post request and pass the form\n // tell it to report the upload progress\n\n // A 'Destination' header is used to optionally configure the file upload destination (filesystem)\n // A 'DbAppId' header is used to configure the unique identifier of database uploads\n \n const headers = new HttpHeaders();\n if (this.config.uploadPath) {\n headers.append('Destination', this.config.uploadPath);\n }\n if (this.config.dbAppId) {\n headers.append('DbAppId', this.config.dbAppId);\n }\n if (this.config.externalReferenceId) {\n headers.append('ExternalReferenceId', this.config.externalReferenceId);\n }\n if (this.config.comment) {\n headers.append('Comment', this.config.comment);\n }\n const req = new HttpRequest('POST', this.config.apiUrl, formData, {\n reportProgress: true,\n responseType: 'blob',\n headers\n });\n\n // create a new progress-subject for every file\n const progress = new Subject<number>();\n\n // send the http-request and subscribe for progress-updates\n this.http.request(req).subscribe(event => {\n if (event.type === HttpEventType.UploadProgress) {\n\n // calculate the progress percentage\n const percentDone = Math.round(100 * event.loaded / (event.total ?? 1));\n\n // pass the percentage into the progress-stream\n progress.next(percentDone);\n } else if (event instanceof HttpResponse) {\n\n // Close the progress-stream if we get an answer form the API\n // The upload is complete\n progress.complete();\n }\n });\n\n // Save every progress-observable in a map of all observables\n status[file.name] = {\n progress: progress.asObservable()\n };\n });\n\n // return the map of progress.observables\n return status;\n }\n\n public exists(fileName: string): Observable<boolean> {\n const query = this.config.apiUrl.toLowerCase().indexOf('filesystem') === -1 ?\n { name: fileName, dbAppId: this.config.dbAppId } :\n { name: fileName, destination: this.config.uploadPath };\n\n return this.http.post<boolean>(`${this.config.apiUrl}/exists`, query);\n }\n\n public download(request: FileUploadRequest): Observable<Blob> {\n return this.http.post(`${this.config.apiUrl}/stream`, request, { responseType: 'blob' });\n }\n\n public getUploadInfo(request: FileUploadRequest):\n Observable<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]> {\n return this.http.post<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]>\n (`${this.config.apiUrl}/info`, request);\n }\n}\n","import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { UploadService } from './../../services/upload.service';\nimport { forkJoin } from 'rxjs';\n\n@Component({\n selector: 'cp-upload-dialog',\n templateUrl: './upload-dialog.component.html',\n styleUrls: ['./upload-dialog.component.css']\n})\nexport class UploadDialogComponent implements OnInit {\n @ViewChild('file', { static: true }) file!: ElementRef;\n public files: Set<File> = new Set();\n existingFileConflict: string | null = null;\n\n // State\n progress: any;\n canBeClosed = true;\n primaryButtonText: string | null = null;\n showCancelButton = true;\n uploading = false;\n uploadSuccessful = false;\n \n constructor(public dialogRef: MatDialogRef<UploadDialogComponent>, public uploadService: UploadService) { }\n\n ngOnInit() {\n this.primaryButtonText = this.uploadService.config.uploadDialogUploadButtonText;\n }\n\n addFiles() {\n this.file.nativeElement.click();\n }\n\n onFilesAdded() {\n const files: { [key: string]: File } = this.file.nativeElement.files;\n for (const key in files) {\n if (!isNaN(parseInt(key))) {\n // See if the file already exists\n this.uploadService.exists(files[key].name)\n .subscribe(exists => {\n if (exists) {\n this.existingFileConflict = files[key].name;\n }\n\n if (!exists) {\n this.files.add(files[key]);\n }\n });\n }\n }\n }\n\n closeDialog() {\n // if everything was uploaded already, just close the dialog\n if (this.uploadSuccessful) {\n return this.dialogRef.close();\n }\n\n // set the component state to \"uploading\"\n this.uploading = true;\n\n // start the upload and save the progress map\n this.progress = this.uploadService.upload(this.files);\n\n // convert the progress map into an array\n const allProgressObservables = [];\n\n for (let key in this.progress) {\n allProgressObservables.push(this.progress[key].progress);\n }\n\n // Adjust the state variables\n\n // The OK-button should have the text \"Finish\" now\n this.primaryButtonText = this.uploadService.config.uploadDialogFinishButtonText;\n\n // The dialog should not be closed while uploading\n this.canBeClosed = false;\n this.dialogRef.disableClose = true;\n\n // Hide the cancel-button\n this.showCancelButton = false;\n\n // When all progress-observables are completed...\n forkJoin(allProgressObservables).subscribe(end => {\n // ... the dialog can be closed again...\n this.canBeClosed = true;\n this.dialogRef.disableClose = false;\n\n // ... the upload was successful...\n this.uploadSuccessful = true;\n\n // ... and the component is no longer uploading\n this.uploading = false;\n });\n }\n}\n","<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadService.config.uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadService.config.uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\nimport { UploadService } from './../../services/upload.service';\n\n@Component({\n selector: 'cp-upload',\n template: '<button mat-raised-button (click)=\"openUploadDialog()\">{{ uploadButtonText }}</button>'\n})\nexport class UploadComponent implements OnInit {\n @Output() dialogClosed = new EventEmitter();\n uploadButtonText!: string;\n\n constructor(public dialog: MatDialog, public uploadService: UploadService) { }\n\n ngOnInit(): void {\n this.uploadButtonText = this.uploadService.config.uploadButtonText ?\n this.uploadService.config.uploadButtonText :\n 'Upload';\n }\n\n public openUploadDialog() {\n this.dialog.open(UploadDialogComponent, { width: '50%' })\n .afterClosed().subscribe(() => this.dialogClosed.emit());\n }\n}\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatListModule } from '@angular/material/list';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { UploadComponent } from './components/upload/upload.component';\nimport { UploadDialogComponent } from './components/upload-dialog/upload-dialog.component';\nimport { ServiceConfig } from './model/service-config';\nimport { UploadService } from './services/upload.service';\n\n@NgModule({\n declarations: [\n UploadComponent,\n UploadDialogComponent\n ],\n imports: [\n CommonModule,\n MatDialogModule,\n MatListModule,\n MatProgressBarModule\n ],\n exports: [\n UploadComponent,\n UploadDialogComponent\n ]\n})\nexport class UploadModule {\n static forRoot(uploadConfig: ServiceConfig): ModuleWithProviders<UploadModule> {\n return {\n ngModule: UploadModule,\n providers: [\n UploadService,\n { provide: ServiceConfig, useValue: uploadConfig }\n ]\n };\n }\n\n constructor(@Optional() @SkipSelf() parentModule: UploadModule) {\n if (parentModule) {\n throw new Error(\n 'UploadModule is already loaded. Import it in the AppModule only');\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.ServiceConfig","i1","i2.UploadService"],"mappings":";;;;;;;;;;;;;;;MAAa,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QAEI,IAAU,CAAA,UAAA,GAAkB,IAAI,CAAC;QACjC,IAAO,CAAA,OAAA,GAAkB,IAAI,CAAC;QAC9B,IAAmB,CAAA,mBAAA,GAAkB,IAAI,CAAC;QAC1C,IAAO,CAAA,OAAA,GAAkB,IAAI,CAAC;;QAG9B,IAAgB,CAAA,gBAAA,GAAkB,IAAI,CAAC;QACvC,IAAiB,CAAA,iBAAA,GAAkB,IAAI,CAAC;QACxC,IAA8B,CAAA,8BAAA,GAAkB,IAAI,CAAC;QACrD,IAA4B,CAAA,4BAAA,GAAkB,IAAI,CAAC;QACnD,IAA4B,CAAA,4BAAA,GAAkB,IAAI,CAAC;QACnD,IAA4B,CA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tB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;wBACf,aAAa;wBACb,oBAAoB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,eAAe;wBACf,qBAAqB;AACtB,qBAAA;AACF,iBAAA,CAAA;0DAYqD,YAAY,EAAA,UAAA,EAAA,CAAA;0BAAjD,QAAQ;;0BAAI,QAAQ;;;ACvCrC;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-upload.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/upload/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/services/upload.service.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload-dialog/upload-dialog.component.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload-dialog/upload-dialog.component.html","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload/upload.component.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/upload.module.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/cleavelandprice-ngx-lib-upload.ts"],"sourcesContent":["import { ServiceConfig } from \"./service-config\";\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi/upload/database',\r\n uploadDialogTitle: 'Upload Files',\r\n uploadPath: null,\r\n comment: null,\r\n dbAppId: null,\r\n externalReferenceId: null,\r\n \r\n uploadButtonText: 'Upload',\r\n uploadDialogCancelButtonText: 'Cancel',\r\n uploadDialogFinishButtonText: 'Finish',\r\n uploadDialogUploadButtonText: 'Upload',\r\n uploadDialogAddFilesButtonText: 'Add Files'\r\n}","export class ServiceConfig {\r\n apiUrl!: string;\r\n uploadPath: string | null = null;\r\n dbAppId: string | null = null;\r\n externalReferenceId: string | null = null;\r\n comment: string | null = null;\r\n\r\n // UI configuration\r\n uploadButtonText: string | null = null;\r\n uploadDialogTitle: string | null = null;\r\n uploadDialogAddFilesButtonText: string | null = null;\r\n uploadDialogCancelButtonText: string | null = null;\r\n uploadDialogUploadButtonText: string | null = null;\r\n uploadDialogFinishButtonText: string | null = null;\r\n}\r\n","import { Injectable, Optional } from '@angular/core';\nimport { HttpClient, HttpRequest, HttpEventType, HttpResponse, HttpHeaders } from '@angular/common/http';\nimport { Subject , Observable } from 'rxjs';\nimport { ServiceConfig } from '../model/service-config';\nimport { FileUploadRequest } from '../model/file-upload-request';\nimport { DatabaseFileInfo } from '../model/database-file-info';\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\nimport { defaultConfig } from '../model/default-config';\n\n// https://malcoded.com/posts/angular-file-upload-component-with-express\n\n@Injectable()\nexport class UploadService {\n constructor(private http: HttpClient,\n @Optional() public config: ServiceConfig) {\n this.config = {\n ...defaultConfig,\n ...this.config\n };\n }\n\n public upload(files: Set<File>): any { // {[key: string]: Observable<number>} {\n // this will be the our resulting map\n const status: {[key: string]: {progress: Observable<number>}} = {};\n\n files.forEach(file => {\n // create a new multipart-form for every file\n const formData: FormData = new FormData();\n formData.append('file', file, file.name);\n\n // create a http-post request and pass the form\n // tell it to report the upload progress\n\n // A 'Destination' header is used to optionally configure the file upload destination (filesystem)\n // A 'DbAppId' header is used to configure the unique identifier of database uploads\n \n const headers = new HttpHeaders();\n if (this.config.uploadPath) {\n headers.append('Destination', this.config.uploadPath);\n }\n if (this.config.dbAppId) {\n headers.append('DbAppId', this.config.dbAppId);\n }\n if (this.config.externalReferenceId) {\n headers.append('ExternalReferenceId', this.config.externalReferenceId);\n }\n if (this.config.comment) {\n headers.append('Comment', this.config.comment);\n }\n const req = new HttpRequest('POST', this.config.apiUrl, formData, {\n reportProgress: true,\n responseType: 'blob',\n headers\n });\n\n // create a new progress-subject for every file\n const progress = new Subject<number>();\n\n // send the http-request and subscribe for progress-updates\n this.http.request(req).subscribe(event => {\n if (event.type === HttpEventType.UploadProgress) {\n\n // calculate the progress percentage\n const percentDone = Math.round(100 * event.loaded / (event.total ?? 1));\n\n // pass the percentage into the progress-stream\n progress.next(percentDone);\n } else if (event instanceof HttpResponse) {\n\n // Close the progress-stream if we get an answer form the API\n // The upload is complete\n progress.complete();\n }\n });\n\n // Save every progress-observable in a map of all observables\n status[file.name] = {\n progress: progress.asObservable()\n };\n });\n\n // return the map of progress.observables\n return status;\n }\n\n public exists(fileName: string): Observable<boolean> {\n const query = this.config.apiUrl.toLowerCase().indexOf('filesystem') === -1 ?\n { name: fileName, dbAppId: this.config.dbAppId } :\n { name: fileName, destination: this.config.uploadPath };\n\n return this.http.post<boolean>(`${this.config.apiUrl}/exists`, query);\n }\n\n public download(request: FileUploadRequest): Observable<Blob> {\n return this.http.post(`${this.config.apiUrl}/stream`, request, { responseType: 'blob' });\n }\n\n public getUploadInfo(request: FileUploadRequest):\n Observable<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]> {\n return this.http.post<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]>\n (`${this.config.apiUrl}/info`, request);\n }\n}\n","import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { UploadService } from './../../services/upload.service';\nimport { forkJoin } from 'rxjs';\n\n@Component({\n selector: 'cp-upload-dialog',\n templateUrl: './upload-dialog.component.html',\n styleUrls: ['./upload-dialog.component.css']\n})\nexport class UploadDialogComponent implements OnInit {\n @ViewChild('file', { static: true }) file!: ElementRef;\n public files: Set<File> = new Set();\n existingFileConflict: string | null = null;\n\n // State\n progress: any;\n canBeClosed = true;\n primaryButtonText: string | null = null;\n showCancelButton = true;\n uploading = false;\n uploadSuccessful = false;\n \n constructor(public dialogRef: MatDialogRef<UploadDialogComponent>, public uploadService: UploadService) { }\n\n ngOnInit() {\n this.primaryButtonText = this.uploadService.config.uploadDialogUploadButtonText;\n }\n\n addFiles() {\n this.file.nativeElement.click();\n }\n\n onFilesAdded() {\n const files: { [key: string]: File } = this.file.nativeElement.files;\n for (const key in files) {\n if (!isNaN(parseInt(key))) {\n // See if the file already exists\n this.uploadService.exists(files[key].name)\n .subscribe(exists => {\n if (exists) {\n this.existingFileConflict = files[key].name;\n }\n\n if (!exists) {\n this.files.add(files[key]);\n }\n });\n }\n }\n }\n\n closeDialog() {\n // if everything was uploaded already, just close the dialog\n if (this.uploadSuccessful) {\n return this.dialogRef.close();\n }\n\n // set the component state to \"uploading\"\n this.uploading = true;\n\n // start the upload and save the progress map\n this.progress = this.uploadService.upload(this.files);\n\n // convert the progress map into an array\n const allProgressObservables = [];\n\n for (let key in this.progress) {\n allProgressObservables.push(this.progress[key].progress);\n }\n\n // Adjust the state variables\n\n // The OK-button should have the text \"Finish\" now\n this.primaryButtonText = this.uploadService.config.uploadDialogFinishButtonText;\n\n // The dialog should not be closed while uploading\n this.canBeClosed = false;\n this.dialogRef.disableClose = true;\n\n // Hide the cancel-button\n this.showCancelButton = false;\n\n // When all progress-observables are completed...\n forkJoin(allProgressObservables).subscribe(end => {\n // ... the dialog can be closed again...\n this.canBeClosed = true;\n this.dialogRef.disableClose = false;\n\n // ... the upload was successful...\n this.uploadSuccessful = true;\n\n // ... and the component is no longer uploading\n this.uploading = false;\n });\n }\n}\n","<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadService.config.uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadService.config.uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\nimport { UploadService } from './../../services/upload.service';\n\n@Component({\n selector: 'cp-upload',\n template: '<button mat-raised-button (click)=\"openUploadDialog()\">{{ uploadButtonText }}</button>'\n})\nexport class UploadComponent implements OnInit {\n @Output() dialogClosed = new EventEmitter();\n uploadButtonText!: string;\n\n constructor(public dialog: MatDialog, public uploadService: UploadService) { }\n\n ngOnInit(): void {\n this.uploadButtonText = this.uploadService.config.uploadButtonText ?\n this.uploadService.config.uploadButtonText :\n 'Upload';\n }\n\n public openUploadDialog() {\n this.dialog.open(UploadDialogComponent, { width: '50%' })\n .afterClosed().subscribe(() => this.dialogClosed.emit());\n }\n}\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatListModule } from '@angular/material/list';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { UploadComponent } from './components/upload/upload.component';\nimport { UploadDialogComponent } from './components/upload-dialog/upload-dialog.component';\nimport { ServiceConfig } from './model/service-config';\nimport { UploadService } from './services/upload.service';\n\n@NgModule({\n declarations: [\n UploadComponent,\n UploadDialogComponent\n ],\n imports: [\n CommonModule,\n MatButtonModule,\n MatDialogModule,\n MatListModule,\n MatProgressBarModule\n ],\n exports: [\n UploadComponent,\n UploadDialogComponent\n ]\n})\nexport class UploadModule {\n static forRoot(uploadConfig: ServiceConfig): ModuleWithProviders<UploadModule> {\n return {\n ngModule: UploadModule,\n providers: [\n UploadService,\n { provide: ServiceConfig, useValue: uploadConfig }\n ]\n };\n }\n\n constructor(@Optional() @SkipSelf() parentModule: UploadModule) {\n if (parentModule) {\n throw new Error(\n 'UploadModule is already loaded. Import it in the AppModule only');\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i2.ServiceConfig","i1","i2.UploadService","i3"],"mappings":";;;;;;;;;;;;;;;;;AAEa,MAAA,aAAa,GAAkB;AACxC,IAAA,MAAM,EAAE,mCAAmC;AAC3C,IAAA,iBAAiB,EAAE,cAAc;AACjC,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,mBAAmB,EAAE,IAAI;AAEzB,IAAA,gBAAgB,EAAE,QAAQ;AAC1B,IAAA,4BAA4B,EAAE,QAAQ;AACtC,IAAA,4BAA4B,EAAE,QAAQ;AACtC,IAAA,4BAA4B,EAAE,QAAQ;AACtC,IAAA,8BAA8B,EAAE,WAAW;;;MCdlC,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QAEI,IAAU,CAAA,UAAA,GAAkB,IAAI,CAAC;QACjC,IAAO,CAAA,OAAA,GAAkB,IAAI,CAAC;QAC9B,IAAmB,CAAA,mBAAA,GAAkB,IAAI,CAAC;QAC1C,IAAO,CAAA,OAAA,GAAkB,IAAI,CAAC;;QAG9B,IAAgB,CAAA,gBAAA,GAAkB,IAAI,CAAC;QACvC,IAAiB,CAAA,iBAAA,GAAkB,IAAI,CAAC;QACxC,IAA8B,CAAA,8BAAA,GAAkB,IAAI,CAAC;QACrD,IAA4B,CAAA,4BAAA,GAAkB,IAAI,CAAC;QACnD,IAA4B,CAAA,4BAAA,GAAkB,IAAI,CAAC;QACnD,IAA4B,CAAA,4BAAA,GAAkB,IAAI,CAAC;KACtD;AAAA;;AC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;AACtB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;wBACf,eAAe;wBACf,aAAa;wBACb,oBAAoB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,eAAe;wBACf,qBAAqB;AACtB,qBAAA;AACF,iBAAA,CAAA;0DAYqD,YAAY,EAAA,UAAA,EAAA,CAAA;0BAAjD,QAAQ;;0BAAI,QAAQ;;;ACzCrC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleavelandprice/ngx-lib",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "description": "Angular 14+ library providing foundational functionality to Cleaveland-Price applications",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^14.1.0",
@@ -2,6 +2,7 @@ export * from './model/base-item';
2
2
  export * from './model/base-request';
3
3
  export * from './model/base-request-credential';
4
4
  export * from './model/caching-config';
5
+ export * from './model/default-config';
5
6
  export * from './model/file-request';
6
7
  export * from './model/folder-request';
7
8
  export * from './model/list-item';
@@ -1,8 +1,8 @@
1
1
  export * from './model/database-file-info';
2
+ export * from './model/default-config';
2
3
  export * from './model/file-upload-request';
3
4
  export * from './model/filesystem-file-info';
4
5
  export * from './model/service-config';
5
- export * from './model/default-config';
6
6
  export * from './components/upload/upload.component';
7
7
  export * from './components/upload-dialog/upload-dialog.component';
8
8
  export * from './services/upload.service';
@@ -4,13 +4,14 @@ import * as i0 from "@angular/core";
4
4
  import * as i1 from "./components/upload/upload.component";
5
5
  import * as i2 from "./components/upload-dialog/upload-dialog.component";
6
6
  import * as i3 from "@angular/common";
7
- import * as i4 from "@angular/material/dialog";
8
- import * as i5 from "@angular/material/list";
9
- import * as i6 from "@angular/material/progress-bar";
7
+ import * as i4 from "@angular/material/button";
8
+ import * as i5 from "@angular/material/dialog";
9
+ import * as i6 from "@angular/material/list";
10
+ import * as i7 from "@angular/material/progress-bar";
10
11
  export declare class UploadModule {
11
12
  static forRoot(uploadConfig: ServiceConfig): ModuleWithProviders<UploadModule>;
12
13
  constructor(parentModule: UploadModule);
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<UploadModule, [{ optional: true; skipSelf: true; }]>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<UploadModule, [typeof i1.UploadComponent, typeof i2.UploadDialogComponent], [typeof i3.CommonModule, typeof i4.MatDialogModule, typeof i5.MatListModule, typeof i6.MatProgressBarModule], [typeof i1.UploadComponent, typeof i2.UploadDialogComponent]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UploadModule, [typeof i1.UploadComponent, typeof i2.UploadDialogComponent], [typeof i3.CommonModule, typeof i4.MatButtonModule, typeof i5.MatDialogModule, typeof i6.MatListModule, typeof i7.MatProgressBarModule], [typeof i1.UploadComponent, typeof i2.UploadDialogComponent]>;
15
16
  static ɵinj: i0.ɵɵInjectorDeclaration<UploadModule>;
16
17
  }