@cleavelandprice/ngx-lib 3.1.30 → 3.1.32

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 (32) hide show
  1. package/esm2020/quill-editor/cleavelandprice-ngx-lib-quill-editor.mjs +5 -0
  2. package/esm2020/quill-editor/components/editor/editor.component.mjs +211 -0
  3. package/esm2020/quill-editor/model/buttons.mjs +51 -0
  4. package/esm2020/quill-editor/model/config.mjs +31 -0
  5. package/esm2020/quill-editor/model/dialog-data.mjs +2 -0
  6. package/esm2020/quill-editor/model/icons.mjs +9 -0
  7. package/esm2020/quill-editor/model/tooltips.mjs +54 -0
  8. package/esm2020/quill-editor/public_api.mjs +7 -0
  9. package/esm2020/quill-editor/quill-editor.module.mjs +65 -0
  10. package/esm2020/sharepoint/components/employee-photo/employee-photo.component.mjs +23 -8
  11. package/esm2020/upload/components/upload-dialog/upload-dialog.component.mjs +1 -1
  12. package/fesm2015/cleavelandprice-ngx-lib-quill-editor.mjs +425 -0
  13. package/fesm2015/cleavelandprice-ngx-lib-quill-editor.mjs.map +1 -0
  14. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs +21 -6
  15. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
  16. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
  17. package/fesm2020/cleavelandprice-ngx-lib-quill-editor.mjs +418 -0
  18. package/fesm2020/cleavelandprice-ngx-lib-quill-editor.mjs.map +1 -0
  19. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs +21 -6
  20. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
  21. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
  22. package/package.json +9 -1
  23. package/quill-editor/components/editor/editor.component.d.ts +53 -0
  24. package/quill-editor/index.d.ts +5 -0
  25. package/quill-editor/model/buttons.d.ts +28 -0
  26. package/quill-editor/model/config.d.ts +24 -0
  27. package/quill-editor/model/dialog-data.d.ts +20 -0
  28. package/quill-editor/model/icons.d.ts +6 -0
  29. package/quill-editor/model/tooltips.d.ts +31 -0
  30. package/quill-editor/public_api.d.ts +6 -0
  31. package/quill-editor/quill-editor.module.d.ts +17 -0
  32. package/sharepoint/components/employee-photo/employee-photo.component.d.ts +9 -4
@@ -1 +1 @@
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/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 { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\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: NgxLibDefaultConfig.apiUrl,\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","import { Injectable, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport moment from 'moment';\r\n\r\nimport { defaultConfig } from '../model/default-config';\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 { UserRequest } from '../model/user-request';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n private cache: {\r\n users: CacheObject<User> | null,\r\n photos: CacheObject<PhotoItem> | null\r\n } | null = null;\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 = moment(cache.lastUpdate)\r\n .add(lifeMinutes, 'minutes');\r\n\r\n return moment().isAfter(expiration);\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n\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 this.config.caching = this.config.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n\r\n this.cache = {\r\n photos: null,\r\n users: null\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 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 //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.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 ?? defaultConfig.username,\r\n password: this.config?.password ?? defaultConfig.password,\r\n site: this.config?.photos.site ?? defaultConfig.photos.site,\r\n list: this.config?.photos.list ?? defaultConfig.photos.list,\r\n additionalPropertiesToRetrieve: defaultConfig.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: moment()\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 ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.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: moment()\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 = null;\r\n\r\n if (this.config.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { of, map } from 'rxjs';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\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 constructor (private sharePointService: 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, Input } from '@angular/core';\nimport { 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 {\n @Input() employee!: CleavelandPriceUser;\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n}","<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">","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":["NgxLibDefaultConfig","i1.ServiceConfig","i1.SharePointService","i2.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;AAKa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;AAClC,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;;;MCxBQ,aAAa,CAAA;AAazB;;MCEY,iBAAiB,CAAA;;;;IAwB5B,WAA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AAA,EAAA,CAAA,CAAA;AAGb,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAPzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAOH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,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/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/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 { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\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: NgxLibDefaultConfig.apiUrl,\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","import { Injectable, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport moment from 'moment';\r\n\r\nimport { defaultConfig } from '../model/default-config';\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 { UserRequest } from '../model/user-request';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n private cache: {\r\n users: CacheObject<User> | null,\r\n photos: CacheObject<PhotoItem> | null\r\n } | null = null;\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 = moment(cache.lastUpdate)\r\n .add(lifeMinutes, 'minutes');\r\n\r\n return moment().isAfter(expiration);\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n\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 this.config.caching = this.config.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n\r\n this.cache = {\r\n photos: null,\r\n users: null\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 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 //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.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 ?? defaultConfig.username,\r\n password: this.config?.password ?? defaultConfig.password,\r\n site: this.config?.photos.site ?? defaultConfig.photos.site,\r\n list: this.config?.photos.list ?? defaultConfig.photos.list,\r\n additionalPropertiesToRetrieve: defaultConfig.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: moment()\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 ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.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: moment()\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 = null;\r\n\r\n if (this.config.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { of, map } from 'rxjs';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\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 constructor (private sharePointService: 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, 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 @Input() employee: CleavelandPriceUser | null = null;\n // Or...\n @Input() accountName: string | null = null;\n\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n\n constructor(private activeDirectoryService: ActiveDirectoryService) { }\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}","<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>","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":["NgxLibDefaultConfig","i1.ServiceConfig","i1.SharePointService","i2","i3.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;;AAKa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;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A,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAPzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAOH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,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 +1 @@
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 { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\r\nimport { ServiceConfig } from \"./service-config\";\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: NgxLibDefaultConfig.apiUrl,\r\n databaseEndpoint: '/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 databaseEndpoint!: 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';\r\nimport { HttpClient, HttpRequest, HttpEventType, HttpResponse, HttpHeaders } from '@angular/common/http';\r\nimport { Subject , Observable } from 'rxjs';\r\n\r\nimport { DatabaseFileInfo } from '../model/database-file-info';\r\nimport { defaultConfig } from '../model/default-config';\r\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\r\nimport { FileUploadRequest } from '../model/file-upload-request';\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 constructor(private http: HttpClient,\r\n @Optional() public config: ServiceConfig) {\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\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, 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 @ViewChild('file', { static: true }) file!: ElementRef;\r\n public files: Set<File> = new Set();\r\n existingFileConflict: string | null = null;\r\n\r\n // State\r\n progress: any;\r\n canBeClosed = true;\r\n primaryButtonText: string | null = null;\r\n showCancelButton = true;\r\n uploading = false;\r\n uploadSuccessful = false;\r\n \r\n constructor(public dialogRef: MatDialogRef<UploadDialogComponent>, public uploadService: UploadService) { }\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 = [];\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<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';\r\nimport { MatDialog } from '@angular/material/dialog';\r\n\r\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\r\nimport { UploadService } from './../../services/upload.service';\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 @Output() dialogClosed = new EventEmitter();\r\n uploadButtonText!: string;\r\n\r\n constructor(public dialog: MatDialog, public uploadService: UploadService) { }\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":["NgxLibDefaultConfig","i2.ServiceConfig","i1","i2.UploadService","i3"],"mappings":";;;;;;;;;;;;;;;;;;AAGa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;AAClC,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,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;;;MChBlC,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QAGI,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;;ACLD;MAKa,aAAa,CAAA;IACxB,WAAoB,CAAA,IAAgB,EACf,MAAqB,EAAA;QADtB,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QACf,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EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAXrB,YAAY;QACZ,eAAe;QACf,eAAe;QACf,aAAa;QACb,oBAAoB,CAAA,EAAA,CAAA,CAAA;2FAOX,YAAY,EAAA,UAAA,EAAA,CAAA;kBAjBxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,eAAe;wBACf,qBAAqB;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;;0BAYgB,QAAQ;;0BAAI,QAAQ;;;AC3CrC;;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 { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\r\nimport { ServiceConfig } from \"./service-config\";\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: NgxLibDefaultConfig.apiUrl,\r\n databaseEndpoint: '/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 databaseEndpoint!: 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';\r\nimport { HttpClient, HttpRequest, HttpEventType, HttpResponse, HttpHeaders } from '@angular/common/http';\r\nimport { Subject , Observable } from 'rxjs';\r\n\r\nimport { DatabaseFileInfo } from '../model/database-file-info';\r\nimport { defaultConfig } from '../model/default-config';\r\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\r\nimport { FileUploadRequest } from '../model/file-upload-request';\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 constructor(private http: HttpClient,\r\n @Optional() public config: ServiceConfig) {\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\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, 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 @ViewChild('file', { static: true }) file!: ElementRef;\r\n public files: Set<File> = new Set();\r\n existingFileConflict: string | null = null;\r\n\r\n // State\r\n progress: any;\r\n canBeClosed = true;\r\n primaryButtonText: string | null = null;\r\n showCancelButton = true;\r\n uploading = false;\r\n uploadSuccessful = false;\r\n \r\n constructor(public dialogRef: MatDialogRef<UploadDialogComponent>, public uploadService: UploadService) { }\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<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';\r\nimport { MatDialog } from '@angular/material/dialog';\r\n\r\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\r\nimport { UploadService } from './../../services/upload.service';\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 @Output() dialogClosed = new EventEmitter();\r\n uploadButtonText!: string;\r\n\r\n constructor(public dialog: MatDialog, public uploadService: UploadService) { }\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":["NgxLibDefaultConfig","i2.ServiceConfig","i1","i2.UploadService","i3"],"mappings":";;;;;;;;;;;;;;;;;;AAGa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;AAClC,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,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;;;MChBlC,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QAGI,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;;ACLD;MAKa,aAAa,CAAA;IACxB,WAAoB,CAAA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A,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAXrB,YAAY;QACZ,eAAe;QACf,eAAe;QACf,aAAa;QACb,oBAAoB,CAAA,EAAA,CAAA,CAAA;2FAOX,YAAY,EAAA,UAAA,EAAA,CAAA;kBAjBxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,eAAe;wBACf,qBAAqB;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;;0BAYgB,QAAQ;;0BAAI,QAAQ;;;AC3CrC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "comment": "NGX-LIB primary entry point package.json",
3
3
  "name": "@cleavelandprice/ngx-lib",
4
- "version": "3.1.30",
4
+ "version": "3.1.32",
5
5
  "description": "Angular 14+ library providing foundational functionality to Cleaveland-Price applications",
6
6
  "peerDependencies": {
7
7
  "@angular/common": "^14.2.1",
@@ -96,6 +96,14 @@
96
96
  "node": "./fesm2015/cleavelandprice-ngx-lib-dialog.mjs",
97
97
  "default": "./fesm2020/cleavelandprice-ngx-lib-dialog.mjs"
98
98
  },
99
+ "./quill-editor": {
100
+ "types": "./quill-editor/index.d.ts",
101
+ "esm2020": "./esm2020/quill-editor/cleavelandprice-ngx-lib-quill-editor.mjs",
102
+ "es2020": "./fesm2020/cleavelandprice-ngx-lib-quill-editor.mjs",
103
+ "es2015": "./fesm2015/cleavelandprice-ngx-lib-quill-editor.mjs",
104
+ "node": "./fesm2015/cleavelandprice-ngx-lib-quill-editor.mjs",
105
+ "default": "./fesm2020/cleavelandprice-ngx-lib-quill-editor.mjs"
106
+ },
99
107
  "./sharepoint": {
100
108
  "types": "./sharepoint/index.d.ts",
101
109
  "esm2020": "./esm2020/sharepoint/cleavelandprice-ngx-lib-sharepoint.mjs",
@@ -0,0 +1,53 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
4
+ import { ActiveDirectoryService, User } from '@cleavelandprice/ngx-lib/active-directory';
5
+ import { ContentChange, Blur, Focus, EditorChangeContent, EditorChangeSelection, SelectionChange, QuillEditorComponent } from 'ngx-quill';
6
+ import 'quill-mention';
7
+ import { Config } from '../../model/config';
8
+ import { DialogData } from '../../model/dialog-data';
9
+ import * as i0 from "@angular/core";
10
+ export declare class EditorComponent implements OnInit {
11
+ private dialogRef;
12
+ private activeDirectoryService;
13
+ private dialog;
14
+ editor: QuillEditorComponent | undefined;
15
+ formGroup: FormGroup;
16
+ controlName: string;
17
+ ngModelValue: string | undefined;
18
+ config: Config;
19
+ placeholder: string | undefined;
20
+ users: User[] | undefined;
21
+ format: 'object' | 'html' | 'text' | 'json';
22
+ height: string;
23
+ width: string;
24
+ maxHeight: string;
25
+ maxWidth: string;
26
+ enableTooltips: boolean;
27
+ fullscreen: boolean;
28
+ fullscreenMode: 'expand' | 'popout';
29
+ readonly: boolean;
30
+ fullscreenChanged: EventEmitter<boolean>;
31
+ onBlur: EventEmitter<Blur>;
32
+ onContentChanged: EventEmitter<ContentChange>;
33
+ onEditorChanged: EventEmitter<EditorChangeContent | EditorChangeSelection>;
34
+ onEditorCreated: EventEmitter<any>;
35
+ onFocus: EventEmitter<Focus>;
36
+ onSelectionChanged: EventEmitter<SelectionChange>;
37
+ constructor(data: DialogData, dialogRef: MatDialogRef<EditorComponent>, activeDirectoryService: ActiveDirectoryService, dialog: MatDialog);
38
+ ngOnInit(): void;
39
+ toggleFullscreen(): void;
40
+ tooltip(val: string): string;
41
+ get modules(): {
42
+ imageResize: {};
43
+ imageDrop: boolean;
44
+ syntax: boolean;
45
+ mention: {
46
+ allowedChars: RegExp;
47
+ onSelect: (item: DOMStringMap, insertItem: any) => void;
48
+ source: (searchTerm: string, renderList: any) => void;
49
+ };
50
+ } | undefined;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditorComponent, [{ optional: true; }, { optional: true; }, null, null]>;
52
+ static ɵcmp: i0.ɵɵComponentDeclaration<EditorComponent, "cpquill-editor", never, { "formGroup": "formGroup"; "controlName": "controlName"; "ngModelValue": "ngModelValue"; "config": "config"; "placeholder": "placeholder"; "users": "users"; "format": "format"; "height": "height"; "width": "width"; "maxHeight": "maxHeight"; "maxWidth": "maxWidth"; "enableTooltips": "enableTooltips"; "fullscreen": "fullscreen"; "fullscreenMode": "fullscreenMode"; "readonly": "readonly"; }, { "fullscreenChanged": "fullscreenChanged"; "onBlur": "onBlur"; "onContentChanged": "onContentChanged"; "onEditorChanged": "onEditorChanged"; "onEditorCreated": "onEditorCreated"; "onFocus": "onFocus"; "onSelectionChanged": "onSelectionChanged"; }, never, never, false>;
53
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@cleavelandprice/ngx-lib/quill-editor" />
5
+ export * from './public_api';
@@ -0,0 +1,28 @@
1
+ export declare class Buttons {
2
+ bold: boolean;
3
+ italic: boolean;
4
+ strike: boolean;
5
+ underline: boolean;
6
+ link: boolean;
7
+ image: boolean;
8
+ video: boolean;
9
+ blockquote: boolean;
10
+ codeblock: boolean;
11
+ h1: boolean;
12
+ h2: boolean;
13
+ color: boolean;
14
+ bulleted: boolean;
15
+ ordered: boolean;
16
+ subScript: boolean;
17
+ superScript: boolean;
18
+ increaseIndent: boolean;
19
+ decreaseIndent: boolean;
20
+ align: boolean;
21
+ font: boolean;
22
+ fontSize: boolean;
23
+ headingStyle: boolean;
24
+ clean: boolean;
25
+ formula: boolean;
26
+ rtl: boolean;
27
+ editorSize: boolean;
28
+ }
@@ -0,0 +1,24 @@
1
+ import { Buttons } from "./buttons";
2
+ import { Icons } from "./icons";
3
+ import { Tooltips } from "./tooltips";
4
+ export declare class Config {
5
+ buttons: Buttons;
6
+ tooltips: Tooltips;
7
+ icons: Icons;
8
+ format: 'object' | 'html' | 'text' | 'json';
9
+ height: string;
10
+ width: string;
11
+ maxHeight: string;
12
+ maxWidth: string;
13
+ enableTooltips: boolean;
14
+ fullscreen: boolean;
15
+ fullscreenMode: 'expand' | 'popout';
16
+ readonly: boolean;
17
+ showBlockStyle: () => boolean;
18
+ showFontStyle: () => boolean;
19
+ showQuickHeadingStyle: () => boolean;
20
+ showIndentStyle: () => boolean;
21
+ showListStyle: () => boolean;
22
+ showMedia: () => boolean;
23
+ showScriptStyle: () => boolean;
24
+ }
@@ -0,0 +1,20 @@
1
+ import { FormGroup } from "@angular/forms";
2
+ import { User } from "@cleavelandprice/ngx-lib/active-directory";
3
+ import { Config } from "./config";
4
+ export interface DialogData {
5
+ formGroup: FormGroup;
6
+ controlName: string;
7
+ value: string | undefined;
8
+ config: Config;
9
+ placeholder: string | undefined;
10
+ format: 'object' | 'html' | 'text' | 'json';
11
+ height: string;
12
+ width: string;
13
+ maxHeight: string;
14
+ maxWidth: string;
15
+ enableTooltips: boolean;
16
+ fullscreen: boolean;
17
+ fullscreenMode: 'expand' | 'popout';
18
+ readonly: boolean;
19
+ users: User[] | undefined;
20
+ }
@@ -0,0 +1,6 @@
1
+ export declare class Icons {
2
+ maximize: string;
3
+ minimize: string;
4
+ popout: string;
5
+ popin: string;
6
+ }
@@ -0,0 +1,31 @@
1
+ export declare class Tooltips {
2
+ bold: string;
3
+ italic: string;
4
+ strike: string;
5
+ underline: string;
6
+ link: string;
7
+ image: string;
8
+ video: string;
9
+ blockquote: string;
10
+ codeblock: string;
11
+ h1: string;
12
+ h2: string;
13
+ color: string;
14
+ bulleted: string;
15
+ ordered: string;
16
+ subScript: string;
17
+ superScript: string;
18
+ increaseIndent: string;
19
+ decreaseIndent: string;
20
+ align: string;
21
+ font: string;
22
+ fontSize: string;
23
+ headingStyle: string;
24
+ clean: string;
25
+ formula: string;
26
+ rtl: string;
27
+ maximize: string;
28
+ minimize: string;
29
+ popout: string;
30
+ popin: string;
31
+ }
@@ -0,0 +1,6 @@
1
+ export * from './model/buttons';
2
+ export * from './model/icons';
3
+ export * from './model/tooltips';
4
+ export * from './model/config';
5
+ export * from './components/editor/editor.component';
6
+ export * from './quill-editor.module';
@@ -0,0 +1,17 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "./components/editor/editor.component";
4
+ import * as i2 from "@angular/common";
5
+ import * as i3 from "@angular/forms";
6
+ import * as i4 from "@angular/material/button";
7
+ import * as i5 from "@angular/material/dialog";
8
+ import * as i6 from "@angular/material/icon";
9
+ import * as i7 from "@angular/material/tooltip";
10
+ import * as i8 from "ngx-quill";
11
+ export declare class QuillEditorModule {
12
+ static forRoot(): ModuleWithProviders<QuillEditorModule>;
13
+ constructor(parentModule: QuillEditorModule);
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<QuillEditorModule, [{ optional: true; skipSelf: true; }]>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<QuillEditorModule, [typeof i1.EditorComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.MatButtonModule, typeof i5.MatDialogModule, typeof i6.MatIconModule, typeof i7.MatTooltipModule, typeof i8.QuillModule], [typeof i1.EditorComponent]>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<QuillEditorModule>;
17
+ }
@@ -1,11 +1,16 @@
1
- import { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';
1
+ import { OnInit } from '@angular/core';
2
+ import { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';
2
3
  import { PhotoItem } from '../../model/photo-item';
3
4
  import * as i0 from "@angular/core";
4
- export declare class EmployeePhotoComponent {
5
- employee: CleavelandPriceUser;
5
+ export declare class EmployeePhotoComponent implements OnInit {
6
+ private activeDirectoryService;
7
+ employee: CleavelandPriceUser | null;
8
+ accountName: string | null;
6
9
  employeePhotos?: PhotoItem[];
7
10
  size: string;
8
11
  notRound: boolean;
12
+ constructor(activeDirectoryService: ActiveDirectoryService);
13
+ ngOnInit(): void;
9
14
  static ɵfac: i0.ɵɵFactoryDeclaration<EmployeePhotoComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<EmployeePhotoComponent, "employee-photo", never, { "employee": "employee"; "employeePhotos": "employeePhotos"; "size": "size"; "notRound": "notRound"; }, {}, never, never, false>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<EmployeePhotoComponent, "employee-photo", never, { "employee": "employee"; "accountName": "accountName"; "employeePhotos": "employeePhotos"; "size": "size"; "notRound": "notRound"; }, {}, never, never, false>;
11
16
  }