@cleavelandprice/ngx-lib 3.11.2 → 3.11.4
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.
- package/active-directory/gui/components/user-chooser/user-chooser.component.d.ts +5 -5
- package/active-directory/gui/components/user-form-field/user-form-field.component.d.ts +3 -3
- package/active-directory/gui/model/user-chooser-data.d.ts +2 -2
- package/active-directory/services/active-directory.service.d.ts +1 -1
- package/authentication/model/abstract-authentication-service.d.ts +1 -1
- package/authentication/model/service-config.d.ts +2 -2
- package/authentication/object/model/service-config.d.ts +1 -1
- package/authentication/object/services/authentication.service.d.ts +1 -1
- package/authentication/token/gui/components/login-form/login-form.component.d.ts +1 -1
- package/authentication/token/gui/model/service-config.d.ts +1 -1
- package/authentication/token/model/service-config.d.ts +1 -1
- package/authentication/token/services/authentication.service.d.ts +1 -1
- package/dialog/components/base/base.component.d.ts +1 -1
- package/esm2022/active-directory/gui/components/user-chooser/user-chooser.component.mjs +4 -4
- package/esm2022/active-directory/gui/components/user-form-field/user-form-field.component.mjs +3 -6
- package/esm2022/active-directory/gui/model/user-chooser-data.mjs +1 -1
- package/esm2022/active-directory/services/active-directory.service.mjs +1 -1
- package/esm2022/authentication/model/abstract-authentication-service.mjs +1 -1
- package/esm2022/authentication/model/service-config.mjs +1 -1
- package/esm2022/authentication/object/model/service-config.mjs +2 -2
- package/esm2022/authentication/object/services/authentication.service.mjs +1 -1
- package/esm2022/authentication/token/gui/components/login-form/login-form.component.mjs +4 -4
- package/esm2022/authentication/token/gui/model/service-config.mjs +2 -2
- package/esm2022/authentication/token/model/service-config.mjs +2 -2
- package/esm2022/authentication/token/services/authentication.service.mjs +1 -1
- package/esm2022/dialog/components/base/base.component.mjs +2 -2
- package/esm2022/lib/model/service-config.mjs +1 -1
- package/esm2022/quill/components/editor/editor.component.mjs +3 -3
- package/esm2022/quill/mention/components/editor/editor.component.mjs +3 -3
- package/esm2022/quill/mention/model/dialog-data.mjs +1 -1
- package/esm2022/quill/model/dialog-data.mjs +1 -1
- package/esm2022/sharepoint/components/employee-photo/employee-photo.component.mjs +1 -1
- package/esm2022/sharepoint/model/service-config.mjs +1 -1
- package/esm2022/sharepoint/services/sharepoint.service.mjs +1 -1
- package/esm2022/upload/components/upload-dialog/upload-dialog.component.mjs +3 -3
- package/esm2022/upload/model/service-config.mjs +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-gui.mjs +4 -7
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-gui.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token-gui.mjs +3 -3
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token-gui.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs +2 -2
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs +2 -2
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs +2 -2
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib.mjs.map +1 -1
- package/lib/model/service-config.d.ts +1 -1
- package/package.json +1 -1
- package/quill/components/editor/editor.component.d.ts +12 -12
- package/quill/mention/components/editor/editor.component.d.ts +1 -1
- package/quill/mention/model/dialog-data.d.ts +1 -1
- package/quill/model/dialog-data.d.ts +2 -2
- package/sharepoint/components/employee-photo/employee-photo.component.d.ts +2 -2
- package/sharepoint/model/service-config.d.ts +2 -2
- package/upload/components/upload-dialog/upload-dialog.component.d.ts +2 -2
- package/upload/model/service-config.d.ts +4 -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/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/employee-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { ServiceConfig as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';\r\n\r\nexport class ServiceConfig extends NgxLibServiceConfig {\r\n usersEndpoint = '/sharepoint/users';\r\n listItemsEndpoint = '/sharepoint/listitems';\r\n username: string | undefined;\r\n password: string | undefined;\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 // See the comment in the library's main service-config.ts file for an explanation\r\n constructor(useSsl_or_customApiUrl: boolean | string = false) {\r\n super(useSsl_or_customApiUrl);\r\n }\r\n}","import { HttpClient } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { DateTime } from 'luxon';\r\nimport { Observable, of } from 'rxjs';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { User } from '../model/user';\r\nimport { UserRequest } from '../model/user-request';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n //#region Services\r\n private config = inject(ServiceConfig, { optional: true }) ?? new ServiceConfig();\r\n private http = inject(HttpClient);\r\n //#endregion\r\n\r\n private cache: {\r\n users: CacheObject<User> | undefined,\r\n photos: CacheObject<PhotoItem> | undefined\r\n } | undefined;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config?.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = cache.lastUpdate.plus({ minutes: lifeMinutes});\r\n\r\n return DateTime.now() > expiration;\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n constructor() {\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n if (this.config) {\r\n this.config.caching = this.config?.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n }\r\n\r\n this.cache = {\r\n photos: undefined,\r\n users: undefined\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n if (this.config) {\r\n this.config.logging = this.config.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n }\r\n }\r\n //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username,\r\n password: this.config?.password,\r\n site: this.config?.photos.site,\r\n list: this.config?.photos.list,\r\n additionalPropertiesToRetrieve: this.config?.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config?.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.config?.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config?.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl;\r\n const endpoint = this.config?.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config?.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.config?.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config?.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = undefined;\r\n\r\n if (this.config?.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { map, of } from 'rxjs';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'employeePhotoUrl'\n})\nexport class EmployeePhotoUrlPipe implements PipeTransform {\n private sharePointService = inject(SharePointService);\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { Component, inject, Input, OnInit } from '@angular/core';\nimport { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../../model/photo-item';\n\n@Component({\n selector: 'employee-photo',\n templateUrl: './employee-photo.component.html',\n styleUrls: ['./employee-photo.component.css']\n})\nexport class EmployeePhotoComponent implements OnInit {\n private activeDirectoryService = inject(ActiveDirectoryService);\n\n @Input() employee: CleavelandPriceUser | undefined;\n // Or...\n @Input() accountName: string | undefined;\n\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n\n ngOnInit(): void {\n if (this.accountName && !this.employee) {\n // Developer passed in an account name instead of a user object\n // We need to do the work of getting the user object ourselves\n this.activeDirectoryService.getUser(this.accountName)\n .subscribe(user => this.employee = user);\n }\n }\n}","@if (employee) {\n @if ((employee | employeePhotoUrl:employeePhotos | async)) {\n <img\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n }\n}","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { SharePointService } from './services/sharepoint.service';\r\nimport { EmployeePhotoUrlPipe } from './pipes/employee-photo-url.pipe';\r\nimport { EmployeePhotoComponent } from './components/employee-photo/employee-photo.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibServiceConfig","i2.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;;AAEM,MAAO,aAAc,SAAQA,eAAmB,CAAA;;AAwBlD,IAAA,WAAA,CAAY,yBAA2C,KAAK,EAAA;QACxD,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAxBlC,IAAa,CAAA,aAAA,GAAG,mBAAmB,CAAC;QACpC,IAAiB,CAAA,iBAAA,GAAG,uBAAuB,CAAC;AAG5C,QAAA,IAAA,CAAA,MAAM,GAAG;AACL,YAAA,IAAI,EAAE,uDAAuD;AAC7D,YAAA,IAAI,EAAE,2BAA2B;AACjC,YAAA,8BAA8B,EAAE;gBAC5B,eAAe;AAClB,aAAA;SACJ,CAAC;AACF,QAAA,IAAA,CAAA,OAAO,GAAG;AACN,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,WAAW,EAAE,GAAG;SACnB,CAAC;AACF,QAAA,IAAA,CAAA,OAAO,GAAG;AACN,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,kBAAkB,EAAE,IAAI;AACxB,YAAA,iBAAiB,EAAE,IAAI;AACvB,YAAA,YAAY,EAAE,IAAI;SACrB,CAAC;KAKD;AACJ;;MCbY,iBAAiB,CAAA;;AAcpB,IAAA,YAAY,CAAI,KAAqB,EAAA;QAC3C,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,IAAI,CAAC;SACb;AAED,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,uBAAuB,C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,EAAE;wBACZ,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACF,iBAAA,CAAA;;0BAYc,QAAQ;;0BAAI,QAAQ;;;AChCnC;;AAEG;;;;"}
|
|
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/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/employee-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { ServiceConfig as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';\r\n\r\nexport class ServiceConfig extends NgxLibServiceConfig {\r\n usersEndpoint = '/sharepoint/users';\r\n listItemsEndpoint = '/sharepoint/listitems';\r\n username?: string;\r\n password?: string;\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 // See the comment in the library's main service-config.ts file for an explanation\r\n constructor(useSsl_or_customApiUrl: boolean | string = false) {\r\n super(useSsl_or_customApiUrl);\r\n }\r\n}","import { HttpClient } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { DateTime } from 'luxon';\r\nimport { Observable, of } from 'rxjs';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { User } from '../model/user';\r\nimport { UserRequest } from '../model/user-request';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n //#region Services\r\n private config = inject(ServiceConfig, { optional: true }) ?? new ServiceConfig();\r\n private http = inject(HttpClient);\r\n //#endregion\r\n\r\n private cache: {\r\n users?: CacheObject<User>,\r\n photos?: CacheObject<PhotoItem>\r\n } | undefined;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config?.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = cache.lastUpdate.plus({ minutes: lifeMinutes});\r\n\r\n return DateTime.now() > expiration;\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n constructor() {\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n if (this.config) {\r\n this.config.caching = this.config?.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n }\r\n\r\n this.cache = {\r\n photos: undefined,\r\n users: undefined\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n if (this.config) {\r\n this.config.logging = this.config.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n }\r\n }\r\n //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username,\r\n password: this.config?.password,\r\n site: this.config?.photos.site,\r\n list: this.config?.photos.list,\r\n additionalPropertiesToRetrieve: this.config?.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config?.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.config?.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config?.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl;\r\n const endpoint = this.config?.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config?.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.config?.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config?.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = undefined;\r\n\r\n if (this.config?.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { map, of } from 'rxjs';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'employeePhotoUrl'\n})\nexport class EmployeePhotoUrlPipe implements PipeTransform {\n private sharePointService = inject(SharePointService);\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { Component, inject, Input, OnInit } from '@angular/core';\nimport { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../../model/photo-item';\n\n@Component({\n selector: 'employee-photo',\n templateUrl: './employee-photo.component.html',\n styleUrls: ['./employee-photo.component.css']\n})\nexport class EmployeePhotoComponent implements OnInit {\n private activeDirectoryService = inject(ActiveDirectoryService);\n\n @Input() employee?: CleavelandPriceUser;\n // Or...\n @Input() accountName?: string;\n\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n\n ngOnInit(): void {\n if (this.accountName && !this.employee) {\n // Developer passed in an account name instead of a user object\n // We need to do the work of getting the user object ourselves\n this.activeDirectoryService.getUser(this.accountName)\n .subscribe(user => this.employee = user);\n }\n }\n}","@if (employee) {\n @if ((employee | employeePhotoUrl:employeePhotos | async)) {\n <img\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n }\n}","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { SharePointService } from './services/sharepoint.service';\r\nimport { EmployeePhotoUrlPipe } from './pipes/employee-photo-url.pipe';\r\nimport { EmployeePhotoComponent } from './components/employee-photo/employee-photo.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibServiceConfig","i2.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;;AAEM,MAAO,aAAc,SAAQA,eAAmB,CAAA;;AAwBlD,IAAA,WAAA,CAAY,yBAA2C,KAAK,EAAA;QACxD,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAxBlC,IAAa,CAAA,aAAA,GAAG,mBAAmB,CAAC;QACpC,IAAiB,CAAA,iBAAA,GAAG,uBAAuB,CAAC;AAG5C,QAAA,IAAA,CAAA,MAAM,GAAG;AACL,YAAA,IAAI,EAAE,uDAAuD;AAC7D,YAAA,IAAI,EAAE,2BAA2B;AACjC,YAAA,8BAA8B,EAAE;gBAC5B,eAAe;AAClB,aAAA;SACJ,CAAC;AACF,QAAA,IAAA,CAAA,OAAO,GAAG;AACN,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,WAAW,EAAE,GAAG;SACnB,CAAC;AACF,QAAA,IAAA,CAAA,OAAO,GAAG;AACN,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,kBAAkB,EAAE,IAAI;AACxB,YAAA,iBAAiB,EAAE,IAAI;AACvB,YAAA,YAAY,EAAE,IAAI;SACrB,CAAC;KAKD;AACJ;;MCbY,iBAAiB,CAAA;;AAcpB,IAAA,YAAY,CAAI,KAAqB,EAAA;QAC3C,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,IAAI,CAAC;SACb;AAED,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,uBAAuB,CAAC;AACtF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ACZ,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACF,iBAAA,CAAA;;0BAYc,QAAQ;;0BAAI,QAAQ;;;AChCnC;;AAEG;;;;"}
|
|
@@ -180,11 +180,11 @@ class UploadDialogComponent {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: UploadDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
183
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.2", type: UploadDialogComponent, selector: "ng-component", 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@if (existingFileConflict) {\n <div id=\"conflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n </div>\n}\n\n<mat-dialog-content>\n <mat-list>\n @for (file of files; track file) {\n <mat-list-item>\n <h4 mat-line>{{file.name}}</h4>\n @if (progress) {\n <mat-progress-bar mode=\"determinate\" [value]=\"progress[file.name].progress | async\"
|
|
183
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.1.2", type: UploadDialogComponent, selector: "ng-component", 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@if (existingFileConflict) {\n <div id=\"conflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n </div>\n}\n\n<mat-dialog-content>\n <mat-list>\n @for (file of files; track file) {\n <mat-list-item>\n <h4 mat-line>{{file.name}}</h4>\n @if (progress) {\n <mat-progress-bar mode=\"determinate\" [value]=\"progress[file.name].progress | async\"/>\n }\n </mat-list-item>\n }\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n @if (showCancelButton) {\n <button mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n }\n @if (files.size > 0) {\n <button mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n }\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: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i3.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i3.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "component", type: i4.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }] }); }
|
|
184
184
|
}
|
|
185
185
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: UploadDialogComponent, decorators: [{
|
|
186
186
|
type: Component,
|
|
187
|
-
args: [{ 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@if (existingFileConflict) {\n <div id=\"conflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n </div>\n}\n\n<mat-dialog-content>\n <mat-list>\n @for (file of files; track file) {\n <mat-list-item>\n <h4 mat-line>{{file.name}}</h4>\n @if (progress) {\n <mat-progress-bar mode=\"determinate\" [value]=\"progress[file.name].progress | async\"
|
|
187
|
+
args: [{ 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@if (existingFileConflict) {\n <div id=\"conflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n </div>\n}\n\n<mat-dialog-content>\n <mat-list>\n @for (file of files; track file) {\n <mat-list-item>\n <h4 mat-line>{{file.name}}</h4>\n @if (progress) {\n <mat-progress-bar mode=\"determinate\" [value]=\"progress[file.name].progress | async\"/>\n }\n </mat-list-item>\n }\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n @if (showCancelButton) {\n <button mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n }\n @if (files.size > 0) {\n <button mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n }\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"] }]
|
|
188
188
|
}], propDecorators: { file: [{
|
|
189
189
|
type: ViewChild,
|
|
190
190
|
args: ['file', { static: true }]
|
|
@@ -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/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 as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';\r\n\r\nexport class ServiceConfig extends NgxLibServiceConfig {\r\n databaseEndpoint = '/upload/database';\r\n uploadDialogTitle = 'Upload Files';\r\n uploadPath: string | undefined;\r\n comment: string | undefined;\r\n dbAppId: string | undefined;\r\n externalReferenceId: string | undefined;\r\n \r\n // UI configuration\r\n uploadButtonText = 'Upload';\r\n uploadDialogCancelButtonText = 'Cancel';\r\n uploadDialogFinishButtonText = 'Finish';\r\n uploadDialogUploadButtonText = 'Upload';\r\n uploadDialogAddFilesButtonText = 'Add Files';\r\n\r\n // See the comment in the library's main service-config.ts file for an explanation\r\n constructor(useSsl_or_customApiUrl: boolean | string = false) {\r\n super(useSsl_or_customApiUrl);\r\n }\r\n}","import { HttpClient, HttpEventType, HttpHeaders, HttpRequest, HttpResponse } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\nimport { DatabaseFileInfo } from '../model/database-file-info';\r\nimport { FileUploadRequest } from '../model/file-upload-request';\r\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\r\nimport { ServiceConfig } from '../model/service-config';\r\n\r\n// https://malcoded.com/posts/angular-file-upload-component-with-express\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class UploadService {\r\n //#region Services\r\n private http = inject(HttpClient);\r\n public config = inject(ServiceConfig, { optional: true }) ?? new ServiceConfig();\r\n //#endregion\r\n\r\n\r\n public upload(files: Set<File>): any { // {[key: string]: Observable<number>} {\r\n // this will be the our resulting map\r\n const status: {[key: string]: {progress: Observable<number>}} = {};\r\n\r\n files.forEach(file => {\r\n // create a new multipart-form for every file\r\n const formData: FormData = new FormData();\r\n formData.append('file', file, file.name);\r\n\r\n // create a http-post request and pass the form\r\n // tell it to report the upload progress\r\n\r\n // A 'Destination' header is used to optionally configure the file upload destination (filesystem)\r\n // A 'DbAppId' header is used to configure the unique identifier of database uploads\r\n \r\n let headers = new HttpHeaders();\r\n if (this.config.uploadPath) {\r\n headers = headers.set('Destination', this.config.uploadPath);\r\n }\r\n if (this.config.dbAppId) {\r\n headers = headers.set('DbAppId', this.config.dbAppId);\r\n }\r\n if (this.config.externalReferenceId) {\r\n headers = headers.set('ExternalReferenceId', this.config.externalReferenceId);\r\n }\r\n if (this.config.comment) {\r\n headers = headers.set('Comment', this.config.comment);\r\n }\r\n\r\n const req = new HttpRequest('POST', `${this.config.apiUrl}${this.config.databaseEndpoint}`, formData, {\r\n reportProgress: true,\r\n responseType: 'blob',\r\n headers\r\n });\r\n\r\n // create a new progress-subject for every file\r\n const progress = new Subject<number>();\r\n\r\n // send the http-request and subscribe for progress-updates\r\n this.http.request(req).subscribe(event => {\r\n if (event.type === HttpEventType.UploadProgress) {\r\n\r\n // calculate the progress percentage\r\n const percentDone = Math.round(100 * event.loaded / (event.total ?? 1));\r\n\r\n // pass the percentage into the progress-stream\r\n progress.next(percentDone);\r\n } else if (event instanceof HttpResponse) {\r\n\r\n // Close the progress-stream if we get an answer form the API\r\n // The upload is complete\r\n progress.complete();\r\n }\r\n });\r\n\r\n // Save every progress-observable in a map of all observables\r\n status[file.name] = {\r\n progress: progress.asObservable()\r\n };\r\n });\r\n\r\n // return the map of progress.observables\r\n return status;\r\n }\r\n\r\n public exists(fileName: string): Observable<boolean> {\r\n const query = `${this.config.apiUrl}${this.config.databaseEndpoint}`.toLowerCase().indexOf('filesystem') === -1 ?\r\n { name: fileName, dbAppId: this.config.dbAppId } :\r\n { name: fileName, destination: this.config.uploadPath };\r\n\r\n return this.http.post<boolean>(`${this.config.apiUrl}${this.config.databaseEndpoint}/exists`, query);\r\n }\r\n\r\n public download(request: FileUploadRequest): Observable<Blob> {\r\n return this.http.post(`${this.config.apiUrl}${this.config.databaseEndpoint}/stream`, request, { responseType: 'blob' });\r\n }\r\n\r\n public getUploadInfo(request: FileUploadRequest):\r\n Observable<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]> {\r\n return this.http.post<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]>\r\n (`${this.config.apiUrl}${this.config.databaseEndpoint}/info`, request);\r\n }\r\n}\r\n","import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';\r\nimport { MatDialogRef } from '@angular/material/dialog';\r\nimport { forkJoin } from 'rxjs';\r\n\r\nimport { UploadService } from './../../services/upload.service';\r\n\r\n@Component({\r\n templateUrl: './upload-dialog.component.html',\r\n styleUrls: ['./upload-dialog.component.css']\r\n})\r\nexport class UploadDialogComponent implements OnInit {\r\n //#region Services\r\n public dialogRef = inject(MatDialogRef<UploadDialogComponent>);\r\n public uploadService = inject(UploadService);\r\n //#endregion\r\n\r\n @ViewChild('file', { static: true }) file!: ElementRef;\r\n public files: Set<File> = new Set();\r\n existingFileConflict: string | undefined;\r\n\r\n // State\r\n progress: any;\r\n canBeClosed = true;\r\n primaryButtonText: string | undefined;\r\n showCancelButton = true;\r\n uploading = false;\r\n uploadSuccessful = false;\r\n\r\n ngOnInit() {\r\n this.primaryButtonText = this.uploadService.config.uploadDialogUploadButtonText;\r\n }\r\n\r\n addFiles() {\r\n this.file.nativeElement.click();\r\n }\r\n\r\n onFilesAdded() {\r\n const files: { [key: string]: File } = this.file.nativeElement.files;\r\n for (const key in files) {\r\n if (!isNaN(parseInt(key))) {\r\n // See if the file already exists\r\n this.uploadService.exists(files[key].name)\r\n .subscribe(exists => {\r\n if (exists) {\r\n this.existingFileConflict = files[key].name;\r\n }\r\n\r\n if (!exists) {\r\n this.files.add(files[key]);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n closeDialog() {\r\n // if everything was uploaded already, just close the dialog\r\n if (this.uploadSuccessful) {\r\n return this.dialogRef.close();\r\n }\r\n\r\n // set the component state to \"uploading\"\r\n this.uploading = true;\r\n\r\n // start the upload and save the progress map\r\n this.progress = this.uploadService.upload(this.files);\r\n\r\n // convert the progress map into an array\r\n const allProgressObservables: any[] = [];\r\n\r\n for (let key in this.progress) {\r\n allProgressObservables.push(this.progress[key].progress);\r\n }\r\n\r\n // Adjust the state variables\r\n\r\n // The OK-button should have the text \"Finish\" now\r\n this.primaryButtonText = this.uploadService.config.uploadDialogFinishButtonText;\r\n\r\n // The dialog should not be closed while uploading\r\n this.canBeClosed = false;\r\n this.dialogRef.disableClose = true;\r\n\r\n // Hide the cancel-button\r\n this.showCancelButton = false;\r\n\r\n // When all progress-observables are completed...\r\n forkJoin(allProgressObservables).subscribe(end => {\r\n // ... the dialog can be closed again...\r\n this.canBeClosed = true;\r\n this.dialogRef.disableClose = false;\r\n\r\n // ... the upload was successful...\r\n this.uploadSuccessful = true;\r\n\r\n // ... and the component is no longer uploading\r\n this.uploading = false;\r\n });\r\n }\r\n}\r\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@if (existingFileConflict) {\n <div id=\"conflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n </div>\n}\n\n<mat-dialog-content>\n <mat-list>\n @for (file of files; track file) {\n <mat-list-item>\n <h4 mat-line>{{file.name}}</h4>\n @if (progress) {\n <mat-progress-bar mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n }\n </mat-list-item>\n }\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n @if (showCancelButton) {\n <button mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n }\n @if (files.size > 0) {\n <button mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n }\n</mat-dialog-actions>\n","import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\n\r\nimport { UploadService } from './../../services/upload.service';\r\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\r\n\r\n@Component({\r\n selector: 'cp-upload',\r\n template: '<button mat-raised-button (click)=\"openUploadDialog()\">{{ uploadButtonText }}</button>'\r\n})\r\nexport class UploadComponent implements OnInit {\r\n //#region Services\r\n public dialog = inject(MatDialog);\r\n public uploadService = inject(UploadService);\r\n //#endregion\r\n\r\n @Output() dialogClosed = new EventEmitter();\r\n uploadButtonText!: string;\r\n\r\n ngOnInit(): void {\r\n this.uploadButtonText = this.uploadService.config.uploadButtonText ?\r\n this.uploadService.config.uploadButtonText :\r\n 'Upload';\r\n }\r\n\r\n public openUploadDialog() {\r\n this.dialog.open(UploadDialogComponent, { width: '50%' })\r\n .afterClosed().subscribe(() => this.dialogClosed.emit());\r\n }\r\n}\r\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\n\r\nimport { UploadService } from './services/upload.service';\r\n\r\nimport { UploadComponent } from './components/upload/upload.component';\r\nimport { UploadDialogComponent } from './components/upload-dialog/upload-dialog.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n UploadComponent,\r\n UploadDialogComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n MatButtonModule,\r\n MatDialogModule,\r\n MatListModule,\r\n MatProgressBarModule\r\n ],\r\n exports: [\r\n UploadComponent,\r\n UploadDialogComponent\r\n ]\r\n})\r\nexport class UploadModule {\r\n static forRoot(uploadConfig: ServiceConfig): ModuleWithProviders<UploadModule> {\r\n return {\r\n ngModule: UploadModule,\r\n providers: [\r\n UploadService,\r\n { provide: ServiceConfig, useValue: uploadConfig }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: UploadModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'UploadModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibService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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;;0BAYgB,QAAQ;;0BAAI,QAAQ;;;AC3CrC;;AAEG;;;;"}
|
|
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/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 as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';\r\n\r\nexport class ServiceConfig extends NgxLibServiceConfig {\r\n databaseEndpoint = '/upload/database';\r\n uploadDialogTitle = 'Upload Files';\r\n uploadPath?: string;\r\n comment?: string;\r\n dbAppId?: string;\r\n externalReferenceId?: string;\r\n \r\n // UI configuration\r\n uploadButtonText = 'Upload';\r\n uploadDialogCancelButtonText = 'Cancel';\r\n uploadDialogFinishButtonText = 'Finish';\r\n uploadDialogUploadButtonText = 'Upload';\r\n uploadDialogAddFilesButtonText = 'Add Files';\r\n\r\n // See the comment in the library's main service-config.ts file for an explanation\r\n constructor(useSsl_or_customApiUrl: boolean | string = false) {\r\n super(useSsl_or_customApiUrl);\r\n }\r\n}","import { HttpClient, HttpEventType, HttpHeaders, HttpRequest, HttpResponse } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\nimport { DatabaseFileInfo } from '../model/database-file-info';\r\nimport { FileUploadRequest } from '../model/file-upload-request';\r\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\r\nimport { ServiceConfig } from '../model/service-config';\r\n\r\n// https://malcoded.com/posts/angular-file-upload-component-with-express\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class UploadService {\r\n //#region Services\r\n private http = inject(HttpClient);\r\n public config = inject(ServiceConfig, { optional: true }) ?? new ServiceConfig();\r\n //#endregion\r\n\r\n\r\n public upload(files: Set<File>): any { // {[key: string]: Observable<number>} {\r\n // this will be the our resulting map\r\n const status: {[key: string]: {progress: Observable<number>}} = {};\r\n\r\n files.forEach(file => {\r\n // create a new multipart-form for every file\r\n const formData: FormData = new FormData();\r\n formData.append('file', file, file.name);\r\n\r\n // create a http-post request and pass the form\r\n // tell it to report the upload progress\r\n\r\n // A 'Destination' header is used to optionally configure the file upload destination (filesystem)\r\n // A 'DbAppId' header is used to configure the unique identifier of database uploads\r\n \r\n let headers = new HttpHeaders();\r\n if (this.config.uploadPath) {\r\n headers = headers.set('Destination', this.config.uploadPath);\r\n }\r\n if (this.config.dbAppId) {\r\n headers = headers.set('DbAppId', this.config.dbAppId);\r\n }\r\n if (this.config.externalReferenceId) {\r\n headers = headers.set('ExternalReferenceId', this.config.externalReferenceId);\r\n }\r\n if (this.config.comment) {\r\n headers = headers.set('Comment', this.config.comment);\r\n }\r\n\r\n const req = new HttpRequest('POST', `${this.config.apiUrl}${this.config.databaseEndpoint}`, formData, {\r\n reportProgress: true,\r\n responseType: 'blob',\r\n headers\r\n });\r\n\r\n // create a new progress-subject for every file\r\n const progress = new Subject<number>();\r\n\r\n // send the http-request and subscribe for progress-updates\r\n this.http.request(req).subscribe(event => {\r\n if (event.type === HttpEventType.UploadProgress) {\r\n\r\n // calculate the progress percentage\r\n const percentDone = Math.round(100 * event.loaded / (event.total ?? 1));\r\n\r\n // pass the percentage into the progress-stream\r\n progress.next(percentDone);\r\n } else if (event instanceof HttpResponse) {\r\n\r\n // Close the progress-stream if we get an answer form the API\r\n // The upload is complete\r\n progress.complete();\r\n }\r\n });\r\n\r\n // Save every progress-observable in a map of all observables\r\n status[file.name] = {\r\n progress: progress.asObservable()\r\n };\r\n });\r\n\r\n // return the map of progress.observables\r\n return status;\r\n }\r\n\r\n public exists(fileName: string): Observable<boolean> {\r\n const query = `${this.config.apiUrl}${this.config.databaseEndpoint}`.toLowerCase().indexOf('filesystem') === -1 ?\r\n { name: fileName, dbAppId: this.config.dbAppId } :\r\n { name: fileName, destination: this.config.uploadPath };\r\n\r\n return this.http.post<boolean>(`${this.config.apiUrl}${this.config.databaseEndpoint}/exists`, query);\r\n }\r\n\r\n public download(request: FileUploadRequest): Observable<Blob> {\r\n return this.http.post(`${this.config.apiUrl}${this.config.databaseEndpoint}/stream`, request, { responseType: 'blob' });\r\n }\r\n\r\n public getUploadInfo(request: FileUploadRequest):\r\n Observable<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]> {\r\n return this.http.post<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]>\r\n (`${this.config.apiUrl}${this.config.databaseEndpoint}/info`, request);\r\n }\r\n}\r\n","import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core';\r\nimport { MatDialogRef } from '@angular/material/dialog';\r\nimport { forkJoin } from 'rxjs';\r\n\r\nimport { UploadService } from './../../services/upload.service';\r\n\r\n@Component({\r\n templateUrl: './upload-dialog.component.html',\r\n styleUrls: ['./upload-dialog.component.css']\r\n})\r\nexport class UploadDialogComponent implements OnInit {\r\n //#region Services\r\n public dialogRef = inject(MatDialogRef<UploadDialogComponent>);\r\n public uploadService = inject(UploadService);\r\n //#endregion\r\n\r\n @ViewChild('file', { static: true }) file!: ElementRef;\r\n public files: Set<File> = new Set();\r\n existingFileConflict?: string;\r\n\r\n // State\r\n progress: any;\r\n canBeClosed = true;\r\n primaryButtonText?: string;\r\n showCancelButton = true;\r\n uploading = false;\r\n uploadSuccessful = false;\r\n\r\n ngOnInit() {\r\n this.primaryButtonText = this.uploadService.config.uploadDialogUploadButtonText;\r\n }\r\n\r\n addFiles() {\r\n this.file.nativeElement.click();\r\n }\r\n\r\n onFilesAdded() {\r\n const files: { [key: string]: File } = this.file.nativeElement.files;\r\n for (const key in files) {\r\n if (!isNaN(parseInt(key))) {\r\n // See if the file already exists\r\n this.uploadService.exists(files[key].name)\r\n .subscribe(exists => {\r\n if (exists) {\r\n this.existingFileConflict = files[key].name;\r\n }\r\n\r\n if (!exists) {\r\n this.files.add(files[key]);\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n closeDialog() {\r\n // if everything was uploaded already, just close the dialog\r\n if (this.uploadSuccessful) {\r\n return this.dialogRef.close();\r\n }\r\n\r\n // set the component state to \"uploading\"\r\n this.uploading = true;\r\n\r\n // start the upload and save the progress map\r\n this.progress = this.uploadService.upload(this.files);\r\n\r\n // convert the progress map into an array\r\n const allProgressObservables: any[] = [];\r\n\r\n for (let key in this.progress) {\r\n allProgressObservables.push(this.progress[key].progress);\r\n }\r\n\r\n // Adjust the state variables\r\n\r\n // The OK-button should have the text \"Finish\" now\r\n this.primaryButtonText = this.uploadService.config.uploadDialogFinishButtonText;\r\n\r\n // The dialog should not be closed while uploading\r\n this.canBeClosed = false;\r\n this.dialogRef.disableClose = true;\r\n\r\n // Hide the cancel-button\r\n this.showCancelButton = false;\r\n\r\n // When all progress-observables are completed...\r\n forkJoin(allProgressObservables).subscribe(end => {\r\n // ... the dialog can be closed again...\r\n this.canBeClosed = true;\r\n this.dialogRef.disableClose = false;\r\n\r\n // ... the upload was successful...\r\n this.uploadSuccessful = true;\r\n\r\n // ... and the component is no longer uploading\r\n this.uploading = false;\r\n });\r\n }\r\n}\r\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@if (existingFileConflict) {\n <div id=\"conflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n </div>\n}\n\n<mat-dialog-content>\n <mat-list>\n @for (file of files; track file) {\n <mat-list-item>\n <h4 mat-line>{{file.name}}</h4>\n @if (progress) {\n <mat-progress-bar mode=\"determinate\" [value]=\"progress[file.name].progress | async\"/>\n }\n </mat-list-item>\n }\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n @if (showCancelButton) {\n <button mat-button mat-dialog-close>{{ uploadService.config.uploadDialogCancelButtonText }}</button>\n }\n @if (files.size > 0) {\n <button mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n }\n</mat-dialog-actions>\n","import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\n\r\nimport { UploadService } from './../../services/upload.service';\r\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\r\n\r\n@Component({\r\n selector: 'cp-upload',\r\n template: '<button mat-raised-button (click)=\"openUploadDialog()\">{{ uploadButtonText }}</button>'\r\n})\r\nexport class UploadComponent implements OnInit {\r\n //#region Services\r\n public dialog = inject(MatDialog);\r\n public uploadService = inject(UploadService);\r\n //#endregion\r\n\r\n @Output() dialogClosed = new EventEmitter();\r\n uploadButtonText!: string;\r\n\r\n ngOnInit(): void {\r\n this.uploadButtonText = this.uploadService.config.uploadButtonText ?\r\n this.uploadService.config.uploadButtonText :\r\n 'Upload';\r\n }\r\n\r\n public openUploadDialog() {\r\n this.dialog.open(UploadDialogComponent, { width: '50%' })\r\n .afterClosed().subscribe(() => this.dialogClosed.emit());\r\n }\r\n}\r\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatListModule } from '@angular/material/list';\r\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\n\r\nimport { UploadService } from './services/upload.service';\r\n\r\nimport { UploadComponent } from './components/upload/upload.component';\r\nimport { UploadDialogComponent } from './components/upload-dialog/upload-dialog.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n UploadComponent,\r\n UploadDialogComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n MatButtonModule,\r\n MatDialogModule,\r\n MatListModule,\r\n MatProgressBarModule\r\n ],\r\n exports: [\r\n UploadComponent,\r\n UploadDialogComponent\r\n ]\r\n})\r\nexport class UploadModule {\r\n static forRoot(uploadConfig: ServiceConfig): ModuleWithProviders<UploadModule> {\r\n return {\r\n ngModule: UploadModule,\r\n providers: [\r\n UploadService,\r\n { provide: ServiceConfig, useValue: uploadConfig }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: UploadModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'UploadModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibServiceConfig"],"mappings":";;;;;;;;;;;;;;;;AAEM,MAAO,aAAc,SAAQA,eAAmB,CAAA;;AAgBlD,IAAA,WAAA,CAAY,yBAA2C,KAAK,EAAA;QACxD,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAhBlC,IAAgB,CAAA,gBAAA,GAAG,kBAAkB,CAAC;QACtC,IAAiB,CAAA,iBAAA,GAAG,cAAc,CAAC;;QAOnC,IAAgB,CAAA,gBAAA,GAAG,QAAQ,CAAC;QAC5B,IAA4B,CAAA,4BAAA,GAAG,QAAQ,CAAC;QACx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/lib/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/src/lib/services/app-path-config.service.ts","../../../../projects/cleavelandprice/ngx-lib/src/lib/ngx-lib.module.ts","../../../../projects/cleavelandprice/ngx-lib/src/public_api.ts","../../../../projects/cleavelandprice/ngx-lib/src/cleavelandprice-ngx-lib.ts"],"sourcesContent":["export class ServiceConfig {\r\n useSsl = false;\r\n customApiUrl
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/src/lib/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/src/lib/services/app-path-config.service.ts","../../../../projects/cleavelandprice/ngx-lib/src/lib/ngx-lib.module.ts","../../../../projects/cleavelandprice/ngx-lib/src/public_api.ts","../../../../projects/cleavelandprice/ngx-lib/src/cleavelandprice-ngx-lib.ts"],"sourcesContent":["export class ServiceConfig {\r\n useSsl = false;\r\n customApiUrl?: string;\r\n\r\n get apiUrl(): string {\r\n return this.customApiUrl ? this.customApiUrl :\r\n this.useSsl ?\r\n 'https://utilityapi.cleavelandprice.com' :\r\n 'http://utilityapi';\r\n }\r\n\r\n /* Since TypeScript's implementation of overloads sucks, I'm doing something weird here.\r\n useSsl_or_customApiUrl will usually be a boolean value that determines whether or not SSL is used with the normal utilityapi URL options.\r\n But if you want to completely disregard the utilityapi URL and use your own, you would pass the URL via this parameter. */\r\n constructor(useSsl_or_customApiUrl: boolean | string = false) {\r\n if (typeof useSsl_or_customApiUrl === 'boolean') {\r\n this.useSsl = useSsl_or_customApiUrl;\r\n } else if (typeof useSsl_or_customApiUrl === 'string') {\r\n this.customApiUrl = useSsl_or_customApiUrl;\r\n }\r\n }\r\n}","import { HttpClient } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { AppPathConfig } from '../model/app-path-config';\r\nimport { ServiceConfig } from '../model/service-config';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AppPathConfigService {\r\n //#region Services\r\n private config = inject(ServiceConfig, { optional: true }) ?? new ServiceConfig();\r\n private http = inject(HttpClient);\r\n //#endregion\r\n\r\n url!: string;\r\n\r\n constructor() {\r\n this.url = `${this.config.apiUrl}/apppathconfigs`\r\n }\r\n\r\n getAll(): Observable<AppPathConfig[]> {\r\n return this.http.get<AppPathConfig[]>(this.url);\r\n }\r\n\r\n getById(id: number): Observable<AppPathConfig> {\r\n return this.http.get<AppPathConfig>(`${this.url}/${id}`);\r\n }\r\n\r\n getByAppId(id: number): Observable<AppPathConfig[]> {\r\n return this.http.get<AppPathConfig[]>(`${this.url}/appid/${id}`);\r\n }\r\n\r\n getByApp(name: string): Observable<AppPathConfig[]> {\r\n return this.http.get<AppPathConfig[]>(`${this.url}/app/${name}`);\r\n }\r\n\r\n getByAppTypeId(id: number): Observable<AppPathConfig[]> {\r\n return this.http.get<AppPathConfig[]>(`${this.url}/apptypeid/${id}`);\r\n }\r\n\r\n getByAppType(name: string): Observable<AppPathConfig[]> {\r\n return this.http.get<AppPathConfig[]>(`${this.url}/apptype/${name}`);\r\n }\r\n\r\n getByAppFunction(name: string): Observable<AppPathConfig[]> {\r\n return this.http.get<AppPathConfig[]>(`${this.url}/function/${name}`);\r\n }\r\n}\r\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { AppPathConfigService } from './services/app-path-config.service';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\n\r\n@NgModule({\r\n declarations: [\r\n ],\r\n imports: [\r\n ],\r\n exports: [\r\n ]\r\n})\r\nexport class NgxLibModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<NgxLibModule> {\r\n return {\r\n ngModule: NgxLibModule,\r\n providers: [\r\n AppPathConfigService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: NgxLibModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'NgxLibModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/*\r\n * Public API Surface of ngx-lib\r\n */\r\n\r\nexport * from './lib/model/app';\r\nexport * from './lib/model/app-path-config';\r\nexport * from './lib/model/app-type';\r\nexport * from './lib/model/service-config';\r\n\r\nexport * from './lib/services/app-path-config.service';\r\n\r\nexport * from './lib/ngx-lib.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAAa,aAAa,CAAA;AAItB,IAAA,IAAI,MAAM,GAAA;QACN,OAAO,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY;YACxC,IAAI,CAAC,MAAM;AACP,gBAAA,wCAAwC;AACxC,gBAAA,mBAAmB,CAAC;KAC/B;AAED;;AAE8H;AAC9H,IAAA,WAAA,CAAY,yBAA2C,KAAK,EAAA;QAb5D,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;AAcX,QAAA,IAAI,OAAO,sBAAsB,KAAK,SAAS,EAAE;AAC7C,YAAA,IAAI,CAAC,MAAM,GAAG,sBAAsB,CAAC;SACxC;AAAM,aAAA,IAAI,OAAO,sBAAsB,KAAK,QAAQ,EAAE;AACnD,YAAA,IAAI,CAAC,YAAY,GAAG,sBAAsB,CAAC;SAC9C;KACJ;AACJ;;MCXY,oBAAoB,CAAA;AAQ/B,IAAA,WAAA,GAAA;;AANQ,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,aAAa,EAAE,CAAC;AAC1E,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;QAMhC,IAAI,CAAC,GAAG,GAAG,CAAG,EAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAA,eAAA,CAAiB,CAAA;KAClD;IAED,MAAM,GAAA;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,IAAI,CAAC,GA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|
|
1
1
|
{
|
|
2
2
|
"comment": "NGX-LIB primary entry point package.json",
|
|
3
3
|
"name": "@cleavelandprice/ngx-lib",
|
|
4
|
-
"version": "3.11.
|
|
4
|
+
"version": "3.11.4",
|
|
5
5
|
"description": "Angular 15+ library providing foundational functionality to Cleaveland-Price applications",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/common": "^17.1.2",
|
|
@@ -9,27 +9,27 @@ export declare class EditorComponent implements OnInit, ControlValueAccessor {
|
|
|
9
9
|
private data;
|
|
10
10
|
private dialogRef;
|
|
11
11
|
private dialog;
|
|
12
|
-
editor
|
|
12
|
+
editor?: QuillEditorComponent;
|
|
13
13
|
value: any;
|
|
14
14
|
onChange: (_: any) => void;
|
|
15
15
|
onTouched: () => void;
|
|
16
|
-
config
|
|
17
|
-
placeholder
|
|
16
|
+
config?: Config;
|
|
17
|
+
placeholder?: string;
|
|
18
18
|
format: 'object' | 'html' | 'text' | 'json';
|
|
19
19
|
height: string;
|
|
20
20
|
width: string;
|
|
21
21
|
fullscreenHeight: string;
|
|
22
22
|
fullscreenWidth: string;
|
|
23
23
|
fullscreenMode: 'expand' | 'popout';
|
|
24
|
-
enableTooltips
|
|
25
|
-
fullscreen
|
|
26
|
-
readonly
|
|
27
|
-
applyReadonlyStyle
|
|
28
|
-
showToolbar
|
|
29
|
-
showBorder
|
|
30
|
-
imageResizeModule
|
|
31
|
-
imageDropModule
|
|
32
|
-
syntaxModule
|
|
24
|
+
enableTooltips?: boolean;
|
|
25
|
+
fullscreen?: boolean;
|
|
26
|
+
readonly?: boolean;
|
|
27
|
+
applyReadonlyStyle?: boolean;
|
|
28
|
+
showToolbar?: boolean;
|
|
29
|
+
showBorder?: boolean;
|
|
30
|
+
imageResizeModule?: boolean;
|
|
31
|
+
imageDropModule?: boolean;
|
|
32
|
+
syntaxModule?: boolean;
|
|
33
33
|
fullscreenChanged: EventEmitter<boolean>;
|
|
34
34
|
onBlur: EventEmitter<Blur>;
|
|
35
35
|
onContentChanged: EventEmitter<ContentChange>;
|
|
@@ -10,7 +10,7 @@ export declare class EditorComponent extends EditorComponentBase implements OnIn
|
|
|
10
10
|
private dlgRef;
|
|
11
11
|
private dlg;
|
|
12
12
|
private activeDirectoryService;
|
|
13
|
-
users
|
|
13
|
+
users?: User[];
|
|
14
14
|
constructor(data: DialogData, dlgRef: MatDialogRef<EditorComponent>, dlg: MatDialog, activeDirectoryService: ActiveDirectoryService);
|
|
15
15
|
ngOnInit(): void;
|
|
16
16
|
toggleFullscreen(): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Config } from './config';
|
|
2
2
|
export interface DialogData {
|
|
3
3
|
value: any;
|
|
4
|
-
config
|
|
5
|
-
placeholder
|
|
4
|
+
config?: Config;
|
|
5
|
+
placeholder?: string;
|
|
6
6
|
format: 'object' | 'html' | 'text' | 'json';
|
|
7
7
|
height: string;
|
|
8
8
|
width: string;
|
|
@@ -4,8 +4,8 @@ import { PhotoItem } from '../../model/photo-item';
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class EmployeePhotoComponent implements OnInit {
|
|
6
6
|
private activeDirectoryService;
|
|
7
|
-
employee
|
|
8
|
-
accountName
|
|
7
|
+
employee?: CleavelandPriceUser;
|
|
8
|
+
accountName?: string;
|
|
9
9
|
employeePhotos?: PhotoItem[];
|
|
10
10
|
size: string;
|
|
11
11
|
notRound: boolean;
|
|
@@ -2,8 +2,8 @@ import { ServiceConfig as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';
|
|
|
2
2
|
export declare class ServiceConfig extends NgxLibServiceConfig {
|
|
3
3
|
usersEndpoint: string;
|
|
4
4
|
listItemsEndpoint: string;
|
|
5
|
-
username
|
|
6
|
-
password
|
|
5
|
+
username?: string;
|
|
6
|
+
password?: string;
|
|
7
7
|
photos: {
|
|
8
8
|
site: string;
|
|
9
9
|
list: string;
|
|
@@ -7,10 +7,10 @@ export declare class UploadDialogComponent implements OnInit {
|
|
|
7
7
|
uploadService: UploadService;
|
|
8
8
|
file: ElementRef;
|
|
9
9
|
files: Set<File>;
|
|
10
|
-
existingFileConflict
|
|
10
|
+
existingFileConflict?: string;
|
|
11
11
|
progress: any;
|
|
12
12
|
canBeClosed: boolean;
|
|
13
|
-
primaryButtonText
|
|
13
|
+
primaryButtonText?: string;
|
|
14
14
|
showCancelButton: boolean;
|
|
15
15
|
uploading: boolean;
|
|
16
16
|
uploadSuccessful: boolean;
|
|
@@ -2,10 +2,10 @@ import { ServiceConfig as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';
|
|
|
2
2
|
export declare class ServiceConfig extends NgxLibServiceConfig {
|
|
3
3
|
databaseEndpoint: string;
|
|
4
4
|
uploadDialogTitle: string;
|
|
5
|
-
uploadPath
|
|
6
|
-
comment
|
|
7
|
-
dbAppId
|
|
8
|
-
externalReferenceId
|
|
5
|
+
uploadPath?: string;
|
|
6
|
+
comment?: string;
|
|
7
|
+
dbAppId?: string;
|
|
8
|
+
externalReferenceId?: string;
|
|
9
9
|
uploadButtonText: string;
|
|
10
10
|
uploadDialogCancelButtonText: string;
|
|
11
11
|
uploadDialogFinishButtonText: string;
|