@cleavelandprice/ngx-lib 2.1.3 → 2.2.0

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 (157) hide show
  1. package/README.md +615 -615
  2. package/esm2020/cleavelandprice-ngx-lib.mjs +5 -0
  3. package/{esm2015/public_api.js → esm2020/public_api.mjs} +1 -1
  4. package/esm2020/src/authentication/authentication.module.mjs +112 -0
  5. package/esm2020/src/authentication/components/login/login.component.mjs +40 -0
  6. package/esm2020/src/authentication/components/login-form/login-form.component.mjs +45 -0
  7. package/esm2020/src/authentication/model/authentication-token.mjs +2 -0
  8. package/{esm2015/src/authentication/model/authentication.service.config.js → esm2020/src/authentication/model/authentication.service.config.mjs} +1 -1
  9. package/esm2020/src/authentication/services/authentication.service.mjs +136 -0
  10. package/esm2020/src/dialog/components/_dialog/dialog.component.mjs +83 -0
  11. package/esm2020/src/dialog/components/confirmation-dialog/confirmation-dialog.component.mjs +21 -0
  12. package/esm2020/src/dialog/components/input-dialog/input-dialog.component.mjs +21 -0
  13. package/esm2020/src/dialog/components/message-dialog/message-dialog.component.mjs +21 -0
  14. package/esm2020/src/dialog/dialog.module.mjs +74 -0
  15. package/{esm2015/src/dialog/model/confirmation-dialog-mode.enum.js → esm2020/src/dialog/model/confirmation-dialog-mode.enum.mjs} +1 -1
  16. package/esm2020/src/email/email.module.mjs +47 -0
  17. package/esm2020/src/email/model/email-dto.mjs +2 -0
  18. package/{esm2015/src/email/model/email-sender.js → esm2020/src/email/model/email-sender.mjs} +2 -1
  19. package/{esm2015/src/email/model/email.js → esm2020/src/email/model/email.mjs} +2 -1
  20. package/{esm2015/src/email/model/email.service.config.js → esm2020/src/email/model/email.service.config.mjs} +1 -1
  21. package/esm2020/src/email/services/email.service.mjs +31 -0
  22. package/esm2020/src/employee/employee.module.mjs +91 -0
  23. package/esm2020/src/employee/model/employee.mjs +2 -0
  24. package/{esm2015/src/employee/model/employee.service.config.js → esm2020/src/employee/model/employee.service.config.mjs} +1 -1
  25. package/esm2020/src/employee/pipes/departments.pipe.mjs +24 -0
  26. package/esm2020/src/employee/pipes/employee-by-dn.pipe.mjs +17 -0
  27. package/esm2020/src/employee/pipes/employee-photo-url.pipe.mjs +27 -0
  28. package/esm2020/src/employee/pipes/employees-with-property-value.pipe.mjs +17 -0
  29. package/esm2020/src/employee/pipes/filter-employees.pipe.mjs +22 -0
  30. package/esm2020/src/employee/pipes/is-member-of.pipe.mjs +17 -0
  31. package/esm2020/src/employee/pipes/sort-employees.pipe.mjs +44 -0
  32. package/esm2020/src/employee/services/employee.service.mjs +41 -0
  33. package/esm2020/src/file-upload/components/upload/upload.component.mjs +34 -0
  34. package/esm2020/src/file-upload/components/upload-dialog/upload-dialog.component.mjs +102 -0
  35. package/{esm2015/src/file-upload/model/database-file-info.js → esm2020/src/file-upload/model/database-file-info.mjs} +2 -1
  36. package/{esm2015/src/file-upload/model/file-upload-request.js → esm2020/src/file-upload/model/file-upload-request.mjs} +2 -1
  37. package/esm2020/src/file-upload/model/filesystem-file-info.mjs +2 -0
  38. package/esm2020/src/file-upload/model/upload.service.config.mjs +3 -0
  39. package/esm2020/src/file-upload/services/upload.service.mjs +93 -0
  40. package/esm2020/src/file-upload/upload.module.mjs +93 -0
  41. package/{esm2015/src/sharepoint/model/sharepoint-calendar-event.js → esm2020/src/sharepoint/model/sharepoint-calendar-event.mjs} +2 -1
  42. package/esm2020/src/sharepoint/model/sharepoint-customer-visit.mjs +2 -0
  43. package/{esm2015/src/sharepoint/model/sharepoint-employee-picture.js → esm2020/src/sharepoint/model/sharepoint-employee-picture.mjs} +2 -1
  44. package/esm2020/src/sharepoint/model/sharepoint-list-item.mjs +2 -0
  45. package/esm2020/src/sharepoint/model/sharepoint-list.mjs +2 -0
  46. package/esm2020/src/sharepoint/model/sharepoint-person.mjs +2 -0
  47. package/esm2020/src/sharepoint/model/sharepoint-picture.mjs +2 -0
  48. package/{esm2015/src/sharepoint/model/sharepoint.service.config.js → esm2020/src/sharepoint/model/sharepoint.service.config.mjs} +1 -1
  49. package/esm2020/src/sharepoint/pipes/sharepoint-photo-url.pipe.mjs +16 -0
  50. package/esm2020/src/sharepoint/pipes/sharepoint-url.pipe.mjs +16 -0
  51. package/esm2020/src/sharepoint/services/sharepoint.service.mjs +71 -0
  52. package/esm2020/src/sharepoint/sharepoint.module.mjs +69 -0
  53. package/esm2020/src/url/pipes/safe-url.pipe.mjs +21 -0
  54. package/esm2020/src/url/pipes/uri-scheme.pipe.mjs +103 -0
  55. package/esm2020/src/url/url.module.mjs +38 -0
  56. package/fesm2015/cleavelandprice-ngx-lib.mjs +1406 -0
  57. package/fesm2015/cleavelandprice-ngx-lib.mjs.map +1 -0
  58. package/fesm2020/cleavelandprice-ngx-lib.mjs +1378 -0
  59. package/fesm2020/cleavelandprice-ngx-lib.mjs.map +1 -0
  60. package/index.d.ts +5 -0
  61. package/package.json +22 -10
  62. package/src/authentication/authentication.module.d.ts +17 -0
  63. package/src/authentication/components/login/login.component.d.ts +6 -1
  64. package/src/authentication/components/login-form/login-form.component.d.ts +3 -0
  65. package/src/authentication/model/authentication-token.d.ts +1 -8
  66. package/src/authentication/services/authentication.service.d.ts +12 -2
  67. package/src/dialog/components/_dialog/dialog.component.d.ts +3 -0
  68. package/src/dialog/components/confirmation-dialog/confirmation-dialog.component.d.ts +3 -0
  69. package/src/dialog/components/input-dialog/input-dialog.component.d.ts +3 -0
  70. package/src/dialog/components/message-dialog/message-dialog.component.d.ts +3 -0
  71. package/src/dialog/dialog.module.d.ts +14 -0
  72. package/src/email/email.module.d.ts +5 -0
  73. package/src/email/services/email.service.d.ts +3 -0
  74. package/src/employee/employee.module.d.ts +12 -0
  75. package/src/employee/pipes/departments.pipe.d.ts +3 -0
  76. package/src/employee/pipes/employee-by-dn.pipe.d.ts +3 -0
  77. package/src/employee/pipes/employee-photo-url.pipe.d.ts +3 -0
  78. package/src/employee/pipes/employees-with-property-value.pipe.d.ts +3 -0
  79. package/src/employee/pipes/filter-employees.pipe.d.ts +3 -0
  80. package/src/employee/pipes/is-member-of.pipe.d.ts +3 -0
  81. package/src/employee/pipes/sort-employees.pipe.d.ts +3 -0
  82. package/src/employee/services/employee.service.d.ts +3 -0
  83. package/src/file-upload/components/upload/upload.component.d.ts +3 -0
  84. package/src/file-upload/components/upload-dialog/upload-dialog.component.d.ts +3 -0
  85. package/src/file-upload/services/upload.service.d.ts +3 -0
  86. package/src/file-upload/upload.module.d.ts +13 -0
  87. package/src/sharepoint/model/sharepoint-calendar-event.d.ts +3 -3
  88. package/src/sharepoint/model/sharepoint-customer-visit.d.ts +5 -5
  89. package/src/sharepoint/model/sharepoint-employee-picture.d.ts +2 -3
  90. package/src/sharepoint/model/sharepoint-list-item.d.ts +9 -9
  91. package/src/sharepoint/model/sharepoint-list.d.ts +8 -0
  92. package/src/sharepoint/model/sharepoint-person.d.ts +9 -0
  93. package/src/sharepoint/model/sharepoint-picture.d.ts +11 -8
  94. package/src/sharepoint/model/sharepoint.service.config.d.ts +2 -5
  95. package/src/sharepoint/pipes/sharepoint-photo-url.pipe.d.ts +3 -0
  96. package/src/sharepoint/pipes/sharepoint-url.pipe.d.ts +3 -0
  97. package/src/sharepoint/services/sharepoint.service.d.ts +11 -6
  98. package/src/sharepoint/sharepoint.module.d.ts +9 -4
  99. package/src/url/pipes/safe-url.pipe.d.ts +3 -0
  100. package/src/url/pipes/uri-scheme.pipe.d.ts +3 -0
  101. package/src/url/url.module.d.ts +7 -0
  102. package/bundles/cleavelandprice-ngx-lib.umd.js +0 -1360
  103. package/bundles/cleavelandprice-ngx-lib.umd.js.map +0 -1
  104. package/bundles/cleavelandprice-ngx-lib.umd.min.js +0 -2
  105. package/bundles/cleavelandprice-ngx-lib.umd.min.js.map +0 -1
  106. package/cleavelandprice-ngx-lib.d.ts +0 -5
  107. package/cleavelandprice-ngx-lib.metadata.json +0 -1
  108. package/esm2015/cleavelandprice-ngx-lib.js +0 -6
  109. package/esm2015/src/authentication/authentication.module.js +0 -84
  110. package/esm2015/src/authentication/components/login/login.component.js +0 -41
  111. package/esm2015/src/authentication/components/login-form/login-form.component.js +0 -41
  112. package/esm2015/src/authentication/model/authentication-token.js +0 -1
  113. package/esm2015/src/authentication/services/authentication.service.js +0 -129
  114. package/esm2015/src/dialog/components/_dialog/dialog.component.js +0 -75
  115. package/esm2015/src/dialog/components/confirmation-dialog/confirmation-dialog.component.js +0 -19
  116. package/esm2015/src/dialog/components/input-dialog/input-dialog.component.js +0 -19
  117. package/esm2015/src/dialog/components/message-dialog/message-dialog.component.js +0 -19
  118. package/esm2015/src/dialog/dialog.module.js +0 -54
  119. package/esm2015/src/email/email.module.js +0 -41
  120. package/esm2015/src/email/model/email-dto.js +0 -1
  121. package/esm2015/src/email/services/email.service.js +0 -30
  122. package/esm2015/src/employee/employee.module.js +0 -73
  123. package/esm2015/src/employee/model/employee.js +0 -1
  124. package/esm2015/src/employee/pipes/departments.pipe.js +0 -20
  125. package/esm2015/src/employee/pipes/employee-by-dn.pipe.js +0 -13
  126. package/esm2015/src/employee/pipes/employee-photo-url.pipe.js +0 -23
  127. package/esm2015/src/employee/pipes/employees-with-property-value.pipe.js +0 -13
  128. package/esm2015/src/employee/pipes/filter-employees.pipe.js +0 -18
  129. package/esm2015/src/employee/pipes/is-member-of.pipe.js +0 -13
  130. package/esm2015/src/employee/pipes/sort-employees.pipe.js +0 -40
  131. package/esm2015/src/employee/services/employee.service.js +0 -40
  132. package/esm2015/src/file-upload/components/upload/upload.component.js +0 -34
  133. package/esm2015/src/file-upload/components/upload-dialog/upload-dialog.component.js +0 -101
  134. package/esm2015/src/file-upload/model/filesystem-file-info.js +0 -1
  135. package/esm2015/src/file-upload/model/upload.service.config.js +0 -3
  136. package/esm2015/src/file-upload/services/upload.service.js +0 -91
  137. package/esm2015/src/file-upload/upload.module.js +0 -73
  138. package/esm2015/src/sharepoint/model/sharepoint-customer-visit.js +0 -1
  139. package/esm2015/src/sharepoint/model/sharepoint-list-item.js +0 -1
  140. package/esm2015/src/sharepoint/model/sharepoint-list-items-request.js +0 -1
  141. package/esm2015/src/sharepoint/model/sharepoint-picture.js +0 -1
  142. package/esm2015/src/sharepoint/model/sharepoint-uri-request.js +0 -1
  143. package/esm2015/src/sharepoint/model/sharepoint-user-request.js +0 -1
  144. package/esm2015/src/sharepoint/model/sharepoint-user.js +0 -1
  145. package/esm2015/src/sharepoint/pipes/sharepoint-photo-url.pipe.js +0 -12
  146. package/esm2015/src/sharepoint/pipes/sharepoint-url.pipe.js +0 -12
  147. package/esm2015/src/sharepoint/services/sharepoint.service.js +0 -71
  148. package/esm2015/src/sharepoint/sharepoint.module.js +0 -65
  149. package/esm2015/src/url/pipes/safe-url.pipe.js +0 -20
  150. package/esm2015/src/url/pipes/uri-scheme.pipe.js +0 -99
  151. package/esm2015/src/url/url.module.js +0 -31
  152. package/fesm2015/cleavelandprice-ngx-lib.js +0 -1247
  153. package/fesm2015/cleavelandprice-ngx-lib.js.map +0 -1
  154. package/src/sharepoint/model/sharepoint-list-items-request.d.ts +0 -10
  155. package/src/sharepoint/model/sharepoint-uri-request.d.ts +0 -5
  156. package/src/sharepoint/model/sharepoint-user-request.d.ts +0 -6
  157. package/src/sharepoint/model/sharepoint-user.d.ts +0 -8
@@ -0,0 +1,1406 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, Inject, NgModule, Injectable, Optional, SkipSelf, Pipe, ViewChild } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i5 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import * as i3 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import * as i4 from '@angular/material/checkbox';
10
+ import { MatCheckboxModule } from '@angular/material/checkbox';
11
+ import * as i1$1 from '@angular/material/dialog';
12
+ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
13
+ import * as i6 from '@angular/material/input';
14
+ import { MatInputModule } from '@angular/material/input';
15
+ import * as i7 from '@angular/material/progress-bar';
16
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
17
+ import * as i9 from '@angular/material/progress-spinner';
18
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
19
+ import { MatSelectModule } from '@angular/material/select';
20
+ import * as i4$1 from '@angular/material/tooltip';
21
+ import { MatTooltipModule } from '@angular/material/tooltip';
22
+ import * as i5$1 from '@angular/material/form-field';
23
+ import { JwtHelperService } from '@auth0/angular-jwt';
24
+ import * as i2 from '@angular/common/http';
25
+ import { HttpRequest, HttpHeaders, HttpEventType, HttpResponse, HttpClientModule } from '@angular/common/http';
26
+ import { of, Subject, forkJoin } from 'rxjs';
27
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
28
+ import * as i5$2 from '@angular/material/list';
29
+ import { MatListModule } from '@angular/material/list';
30
+ import * as i6$1 from '@angular/material/core';
31
+ import * as i1$2 from '@angular/platform-browser';
32
+
33
+ var ConfirmationDialogMode;
34
+ (function (ConfirmationDialogMode) {
35
+ ConfirmationDialogMode[ConfirmationDialogMode["OkCancel"] = 0] = "OkCancel";
36
+ ConfirmationDialogMode[ConfirmationDialogMode["YesNo"] = 1] = "YesNo";
37
+ ConfirmationDialogMode[ConfirmationDialogMode["TrueFalse"] = 2] = "TrueFalse";
38
+ ConfirmationDialogMode[ConfirmationDialogMode["Custom"] = 3] = "Custom";
39
+ })(ConfirmationDialogMode || (ConfirmationDialogMode = {}));
40
+
41
+ class DialogComponent {
42
+ constructor() {
43
+ this.closed = new EventEmitter();
44
+ this.ConfirmationDialogMode = ConfirmationDialogMode;
45
+ this.mode = ConfirmationDialogMode.OkCancel;
46
+ this.customTrueFalseText = null;
47
+ }
48
+ ngOnInit() {
49
+ if (this.data) {
50
+ this.title = this.data.title || null;
51
+ this.message = this.data.message || null;
52
+ this.checkboxMessage = this.data.checkboxMessage || null;
53
+ this.placeholder = this.data.placeholder || null;
54
+ this.userInput = this.data.value || null;
55
+ this.mode = this.data.mode || ConfirmationDialogMode.OkCancel;
56
+ this.customTrueFalseText = this.data.customTrueFalseText;
57
+ }
58
+ }
59
+ close() {
60
+ let data;
61
+ switch (this.dialogType) {
62
+ case 'message':
63
+ data = this.checkboxMessage ?
64
+ {
65
+ checkbox: this.checkboxValue || false
66
+ } :
67
+ null;
68
+ break;
69
+ case 'input':
70
+ data = this.checkboxMessage ?
71
+ {
72
+ response: this.userInput,
73
+ checkbox: this.checkboxValue || false
74
+ } :
75
+ this.userInput;
76
+ break;
77
+ case 'confirmation':
78
+ data = this.checkboxMessage ?
79
+ {
80
+ response: true,
81
+ checkbox: this.checkboxValue || false
82
+ } :
83
+ true;
84
+ break;
85
+ }
86
+ this.closed.emit(data);
87
+ }
88
+ cancel() {
89
+ let data;
90
+ if (this.dialogType === 'confirmation') {
91
+ data = this.checkboxMessage ?
92
+ {
93
+ response: false,
94
+ checkbox: this.checkboxValue || false
95
+ } :
96
+ false;
97
+ }
98
+ this.closed.emit(data);
99
+ }
100
+ }
101
+ DialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
102
+ DialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: DialogComponent, selector: "cp-dialog", inputs: { dialogType: "dialogType", data: "data" }, outputs: { closed: "closed" }, ngImport: i0, template: "<h2 *ngIf=\"title\" mat-dialog-title [innerHTML]=\"title\"></h2>\r\n\r\n<mat-dialog-content>\r\n <div *ngIf=\"message\" [innerHTML]=\"message\"></div>\r\n\r\n <mat-form-field *ngIf=\"dialogType === 'input'\">\r\n <textarea matInput [placeholder]=\"placeholder\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n\r\n <div id=\"checkbox\" *ngIf=\"checkboxMessage\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType === 'input' && !userInput\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">Yes</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">True</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[0] }}</span>\r\n <span *ngSwitchDefault>OK</span>\r\n </span>\r\n </button>\r\n <button *ngIf=\"dialogType !== 'message'\" mat-raised-button (click)=\"cancel()\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">No</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">False</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[1] }}</span>\r\n <span *ngSwitchDefault>Cancel</span>\r\n </span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
103
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogComponent, decorators: [{
104
+ type: Component,
105
+ args: [{ selector: 'cp-dialog', template: "<h2 *ngIf=\"title\" mat-dialog-title [innerHTML]=\"title\"></h2>\r\n\r\n<mat-dialog-content>\r\n <div *ngIf=\"message\" [innerHTML]=\"message\"></div>\r\n\r\n <mat-form-field *ngIf=\"dialogType === 'input'\">\r\n <textarea matInput [placeholder]=\"placeholder\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n\r\n <div id=\"checkbox\" *ngIf=\"checkboxMessage\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType === 'input' && !userInput\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">Yes</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">True</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[0] }}</span>\r\n <span *ngSwitchDefault>OK</span>\r\n </span>\r\n </button>\r\n <button *ngIf=\"dialogType !== 'message'\" mat-raised-button (click)=\"cancel()\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">No</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">False</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[1] }}</span>\r\n <span *ngSwitchDefault>Cancel</span>\r\n </span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"] }]
106
+ }], propDecorators: { dialogType: [{
107
+ type: Input
108
+ }], data: [{
109
+ type: Input
110
+ }], closed: [{
111
+ type: Output
112
+ }] } });
113
+
114
+ class ConfirmationDialogComponent {
115
+ constructor(dialogRef, data) {
116
+ this.dialogRef = dialogRef;
117
+ this.data = data;
118
+ }
119
+ }
120
+ ConfirmationDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ConfirmationDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
121
+ ConfirmationDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ConfirmationDialogComponent, selector: "cp-confirmation-dialog", ngImport: i0, template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'confirmation'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>", dependencies: [{ kind: "component", type: DialogComponent, selector: "cp-dialog", inputs: ["dialogType", "data"], outputs: ["closed"] }] });
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
123
+ type: Component,
124
+ args: [{ selector: 'cp-confirmation-dialog', template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'confirmation'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>" }]
125
+ }], ctorParameters: function () {
126
+ return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
127
+ type: Inject,
128
+ args: [MAT_DIALOG_DATA]
129
+ }] }];
130
+ } });
131
+
132
+ class InputDialogComponent {
133
+ constructor(dialogRef, data) {
134
+ this.dialogRef = dialogRef;
135
+ this.data = data;
136
+ }
137
+ }
138
+ InputDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: InputDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
139
+ InputDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: InputDialogComponent, selector: "cp-input-dialog", ngImport: i0, template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'input'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>", dependencies: [{ kind: "component", type: DialogComponent, selector: "cp-dialog", inputs: ["dialogType", "data"], outputs: ["closed"] }] });
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: InputDialogComponent, decorators: [{
141
+ type: Component,
142
+ args: [{ selector: 'cp-input-dialog', template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'input'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>" }]
143
+ }], ctorParameters: function () {
144
+ return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
145
+ type: Inject,
146
+ args: [MAT_DIALOG_DATA]
147
+ }] }];
148
+ } });
149
+
150
+ class MessageDialogComponent {
151
+ constructor(dialogRef, data) {
152
+ this.dialogRef = dialogRef;
153
+ this.data = data;
154
+ }
155
+ }
156
+ MessageDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MessageDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
157
+ MessageDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MessageDialogComponent, selector: "cp-message-dialog", ngImport: i0, template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'message'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>", dependencies: [{ kind: "component", type: DialogComponent, selector: "cp-dialog", inputs: ["dialogType", "data"], outputs: ["closed"] }] });
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MessageDialogComponent, decorators: [{
159
+ type: Component,
160
+ args: [{ selector: 'cp-message-dialog', template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'message'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>" }]
161
+ }], ctorParameters: function () {
162
+ return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
163
+ type: Inject,
164
+ args: [MAT_DIALOG_DATA]
165
+ }] }];
166
+ } });
167
+
168
+ //#region Imports
169
+ //#endregion
170
+ class DialogModule {
171
+ }
172
+ DialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
173
+ DialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: DialogModule, declarations: [DialogComponent,
174
+ ConfirmationDialogComponent,
175
+ InputDialogComponent,
176
+ MessageDialogComponent], imports: [CommonModule,
177
+ FormsModule,
178
+ MatButtonModule,
179
+ MatCheckboxModule,
180
+ MatInputModule,
181
+ MatDialogModule], exports: [ConfirmationDialogComponent,
182
+ InputDialogComponent,
183
+ MessageDialogComponent] });
184
+ DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogModule, imports: [CommonModule,
185
+ FormsModule,
186
+ MatButtonModule,
187
+ MatCheckboxModule,
188
+ MatInputModule,
189
+ MatDialogModule] });
190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogModule, decorators: [{
191
+ type: NgModule,
192
+ args: [{
193
+ imports: [
194
+ CommonModule,
195
+ FormsModule,
196
+ MatButtonModule,
197
+ MatCheckboxModule,
198
+ MatInputModule,
199
+ MatDialogModule
200
+ ],
201
+ declarations: [
202
+ DialogComponent,
203
+ ConfirmationDialogComponent,
204
+ InputDialogComponent,
205
+ MessageDialogComponent
206
+ ],
207
+ exports: [
208
+ ConfirmationDialogComponent,
209
+ InputDialogComponent,
210
+ MessageDialogComponent
211
+ ],
212
+ entryComponents: [
213
+ ConfirmationDialogComponent,
214
+ InputDialogComponent,
215
+ MessageDialogComponent
216
+ ]
217
+ }]
218
+ }] });
219
+
220
+ class AuthenticationServiceConfig {
221
+ }
222
+
223
+ class SharePointServiceConfig {
224
+ }
225
+
226
+ //#region Imports
227
+ //#endregion
228
+ class SharePointService {
229
+ //#endregion
230
+ constructor(config, http) {
231
+ this.config = config;
232
+ this.http = http;
233
+ }
234
+ //#region Utilities
235
+ getListItems(list) {
236
+ return this.http.post(this.config.sharePointApiUrl, list);
237
+ }
238
+ getListItemsSimple(list, view, site, limit) {
239
+ return this.http.get(`${this.config.sharePointApiUrl}/${list}/${view}/${site}/${limit}`);
240
+ }
241
+ getPeople(storePeople) {
242
+ // Do we already have people stored locally?
243
+ if (this.people) {
244
+ return of(this.people);
245
+ // return Observable.of(this.people);
246
+ }
247
+ // Should we store people locally for subsequent calls?
248
+ if (storePeople) {
249
+ this.http.get(`${this.config.sharePointApiUrl}/people`)
250
+ .subscribe(peeps => this.people = peeps);
251
+ }
252
+ return this.http.get(`${this.config.sharePointApiUrl}/people`);
253
+ }
254
+ getPhotos(storePhotos) {
255
+ // Do we already have photos stored locally?
256
+ if (this.photos) {
257
+ return of(this.photos);
258
+ // return Observable.of(this.photos);
259
+ }
260
+ const spList = {
261
+ list: 'Employee Thumbnail Photos',
262
+ view: 'All Pictures',
263
+ site: 'http://cpsp1/DigitalDisplay',
264
+ userName: this.config.userName,
265
+ password: this.config.password
266
+ };
267
+ // Should we store photos locally for subsequent calls?
268
+ if (storePhotos) {
269
+ this.http.post(this.config.sharePointApiUrl, spList)
270
+ .subscribe(photos => this.photos = photos);
271
+ }
272
+ return this.http.post(this.config.sharePointApiUrl, spList);
273
+ }
274
+ getCustomerVisits() {
275
+ const list = {
276
+ list: 'Customer Visits',
277
+ view: 'All Events',
278
+ userName: this.config.userName,
279
+ password: this.config.password
280
+ };
281
+ return this.http.post(this.config.sharePointApiUrl, list);
282
+ }
283
+ }
284
+ SharePointService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointService, deps: [{ token: SharePointServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
285
+ SharePointService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointService });
286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointService, decorators: [{
287
+ type: Injectable
288
+ }], ctorParameters: function () {
289
+ return [{ type: SharePointServiceConfig, decorators: [{
290
+ type: Optional
291
+ }] }, { type: i2.HttpClient }];
292
+ } });
293
+
294
+ //#region Imports
295
+ //#endregion
296
+ /**
297
+ * Authenticate Active Directory user
298
+ */
299
+ class AuthenticationService {
300
+ //#endregion
301
+ //#region Lifecycle
302
+ /**
303
+ * @ignore
304
+ */
305
+ constructor(config, http, sharePointService) {
306
+ this.http = http;
307
+ this.sharePointService = sharePointService;
308
+ this.authenticatedChanged = new EventEmitter();
309
+ this.authenticatingChanged = new EventEmitter();
310
+ /**
311
+ * Flag set to true while the service is attempting to authenticate the user
312
+ */
313
+ this.authenticating = false;
314
+ /**
315
+ * Flag set to true when the user is successfully authenticated
316
+ */
317
+ this.authenticated = false;
318
+ this.authenticationApiUrl = config.authenticationApiUrl;
319
+ this.checkForExistingToken();
320
+ }
321
+ //#endregion
322
+ //#region Utilities
323
+ /**
324
+ * Authenticate the user and store the token in Local Storage
325
+ *
326
+ * @param username AD sAMAccountName
327
+ * @param password
328
+ * @param adminGroup AD group that determines if authenticated user is considered an administrator of the app
329
+ */
330
+ login(username, password, adminGroup) {
331
+ const today = new Date();
332
+ const expiration = new Date().setFullYear(today.getFullYear() + 10);
333
+ const request = {
334
+ username: username,
335
+ password: password,
336
+ adminGroup: adminGroup,
337
+ expirationDate: expiration // moment().add(10, 'years').toDate()
338
+ };
339
+ this.authenticating = true;
340
+ this.authenticatingChanged.emit(this.authenticating);
341
+ this.http.post(this.authenticationApiUrl, request)
342
+ .subscribe(token => this.validateUser(token), err => {
343
+ this.authenticating = false;
344
+ this.authenticatingChanged.emit(this.authenticating);
345
+ });
346
+ }
347
+ /**
348
+ * Logout the user and delete the token from Local Storage
349
+ */
350
+ logout() {
351
+ if (localStorage.getItem('token')) {
352
+ localStorage.removeItem('token');
353
+ }
354
+ this.authenticatedUser = null;
355
+ this.authenticated = false;
356
+ this.authenticatedChanged.emit(false);
357
+ }
358
+ /**
359
+ * @ignore
360
+ */
361
+ validateUser(token) {
362
+ if (!token) {
363
+ return;
364
+ }
365
+ const jwtHelper = new JwtHelperService();
366
+ const decoded = jwtHelper.decodeToken(token);
367
+ if (jwtHelper.isTokenExpired(token)) {
368
+ this.logout();
369
+ return;
370
+ }
371
+ this.authenticatedUser = {
372
+ admin: decoded.role === 'Admin',
373
+ displayName: decoded.displayName,
374
+ accountName: decoded.winaccountname,
375
+ distinguishedName: decoded.distinguishedName,
376
+ employeeNumber: decoded.employeeNumber,
377
+ memberOf: decoded.memberOf
378
+ };
379
+ localStorage.setItem('token', token);
380
+ this.getPhoto();
381
+ this.authenticated = true;
382
+ this.authenticatedChanged.emit(this.authenticated);
383
+ this.authenticating = false;
384
+ this.authenticatingChanged.emit(this.authenticating);
385
+ }
386
+ /**
387
+ * @ignore
388
+ */
389
+ getPhoto() {
390
+ this.sharePointService.getPhotos()
391
+ .subscribe(photos => {
392
+ // The user may have been logged out by the time the photos came back
393
+ if (!this.authenticatedUser || !this.authenticatedUser.employeeNumber) {
394
+ return;
395
+ }
396
+ const photo = photos.find(pic => +pic.ows_EmployeeNumber === +this.authenticatedUser.employeeNumber);
397
+ if (photo) {
398
+ this.authenticatedUser.photoUrl = photo.ows_EncodedAbsUrl;
399
+ }
400
+ });
401
+ }
402
+ /**
403
+ * @ignore
404
+ */
405
+ checkForExistingToken() {
406
+ if (localStorage.getItem('token')) {
407
+ this.validateUser(localStorage.getItem('token'));
408
+ }
409
+ }
410
+ }
411
+ AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationService, deps: [{ token: AuthenticationServiceConfig, optional: true }, { token: i2.HttpClient }, { token: SharePointService }], target: i0.ɵɵFactoryTarget.Injectable });
412
+ AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationService });
413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationService, decorators: [{
414
+ type: Injectable
415
+ }], ctorParameters: function () {
416
+ return [{ type: AuthenticationServiceConfig, decorators: [{
417
+ type: Optional
418
+ }] }, { type: i2.HttpClient }, { type: SharePointService }];
419
+ }, propDecorators: { authenticatedChanged: [{
420
+ type: Output
421
+ }], authenticatingChanged: [{
422
+ type: Output
423
+ }] } });
424
+
425
+ class LoginFormComponent {
426
+ constructor(dialogRef, sharePointService, authenticationService, data) {
427
+ this.dialogRef = dialogRef;
428
+ this.sharePointService = sharePointService;
429
+ this.authenticationService = authenticationService;
430
+ this.data = data;
431
+ this.adminGroup = data.adminGroup;
432
+ }
433
+ ngOnInit() {
434
+ this.authenticationService.authenticatedChanged
435
+ .subscribe(authenticated => {
436
+ if (authenticated) {
437
+ this.dialogRef.close();
438
+ }
439
+ });
440
+ }
441
+ authenticate() {
442
+ if (!this.sharePointService || !this.username || !this.password) {
443
+ return;
444
+ }
445
+ this.authenticationService.login(this.username, this.password, this.adminGroup);
446
+ }
447
+ }
448
+ LoginFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginFormComponent, deps: [{ token: i1$1.MatDialogRef }, { token: SharePointService }, { token: AuthenticationService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
449
+ LoginFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: LoginFormComponent, selector: "cp-login-form", ngImport: i0, template: "<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content [class.loginError]=\"loginError\">\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating\">\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Username\" [(ngModel)]=\"username\" name=\"username\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <input matInput type=\"password\" placeholder=\"Password\" [(ngModel)]=\"password\" name=\"password\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && loginError\" class=\"alert alert-danger\">\r\n Bad username or password\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button type=\"button\" mat-raised-button (click)=\"authenticate()\">OK</button>\r\n <button type=\"button\" mat-button (click)=\"dialogRef.close()\">Cancel</button>\r\n</mat-dialog-actions>", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}mat-dialog-content{height:150px}mat-dialog-content.loginError{height:200px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }] });
450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginFormComponent, decorators: [{
451
+ type: Component,
452
+ args: [{ selector: 'cp-login-form', template: "<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content [class.loginError]=\"loginError\">\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating\">\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Username\" [(ngModel)]=\"username\" name=\"username\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <input matInput type=\"password\" placeholder=\"Password\" [(ngModel)]=\"password\" name=\"password\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && loginError\" class=\"alert alert-danger\">\r\n Bad username or password\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button type=\"button\" mat-raised-button (click)=\"authenticate()\">OK</button>\r\n <button type=\"button\" mat-button (click)=\"dialogRef.close()\">Cancel</button>\r\n</mat-dialog-actions>", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}mat-dialog-content{height:150px}mat-dialog-content.loginError{height:200px}\n"] }]
453
+ }], ctorParameters: function () {
454
+ return [{ type: i1$1.MatDialogRef }, { type: SharePointService }, { type: AuthenticationService }, { type: undefined, decorators: [{
455
+ type: Inject,
456
+ args: [MAT_DIALOG_DATA]
457
+ }] }];
458
+ } });
459
+
460
+ class LoginComponent {
461
+ constructor(dialog, authenticationService) {
462
+ this.dialog = dialog;
463
+ this.authenticationService = authenticationService;
464
+ }
465
+ ngOnInit() {
466
+ }
467
+ login() {
468
+ this.dialog.open(LoginFormComponent, {
469
+ data: { adminGroup: this.adminGroup }
470
+ });
471
+ }
472
+ confirmLogout() {
473
+ const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
474
+ data: { message: `Are you sure you want to logout?` }
475
+ });
476
+ dialogRef.afterClosed().subscribe(result => {
477
+ if (result) {
478
+ this.authenticationService.logout();
479
+ }
480
+ });
481
+ }
482
+ }
483
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginComponent, deps: [{ token: i1$1.MatDialog }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
484
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: LoginComponent, selector: "cp-login", inputs: { adminGroup: "adminGroup" }, ngImport: i0, template: "<div id=\"user-id\">\r\n <i id=\"unauthenticated-user-image\" *ngIf=\"!authenticationService.authenticated\"\r\n class=\"fa fa-user-circle\"\r\n [class.fa-spin]=\"authenticationService.authenticating\"\r\n aria-hidden=\"true\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\"></i>\r\n\r\n <img id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && authenticationService.authenticatedUser.photoUrl\"\r\n [src]=\"authenticationService.authenticatedUser.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n\r\n <i id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && !authenticationService.authenticatedUser.photoUrl\"\r\n class=\"fa fa-user-circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"></i>\r\n\r\n <div id=\"user-name\" *ngIf=\"authenticationService.authenticated\">\r\n {{ authenticationService.authenticatedUser.displayName }}\r\n </div>\r\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}.fa{font-size:2em}img{border-radius:100%;width:2em;height:2em}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginComponent, decorators: [{
486
+ type: Component,
487
+ args: [{ selector: 'cp-login', template: "<div id=\"user-id\">\r\n <i id=\"unauthenticated-user-image\" *ngIf=\"!authenticationService.authenticated\"\r\n class=\"fa fa-user-circle\"\r\n [class.fa-spin]=\"authenticationService.authenticating\"\r\n aria-hidden=\"true\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\"></i>\r\n\r\n <img id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && authenticationService.authenticatedUser.photoUrl\"\r\n [src]=\"authenticationService.authenticatedUser.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n\r\n <i id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && !authenticationService.authenticatedUser.photoUrl\"\r\n class=\"fa fa-user-circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"></i>\r\n\r\n <div id=\"user-name\" *ngIf=\"authenticationService.authenticated\">\r\n {{ authenticationService.authenticatedUser.displayName }}\r\n </div>\r\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}.fa{font-size:2em}img{border-radius:100%;width:2em;height:2em}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}\n"] }]
488
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: AuthenticationService }]; }, propDecorators: { adminGroup: [{
489
+ type: Input
490
+ }] } });
491
+
492
+ //#region Imports
493
+ //#endregion
494
+ /**
495
+ * Provides a component and a service that allows you to perform Active/Directory authentication
496
+ */
497
+ class AuthenticationModule {
498
+ constructor(parentModule) {
499
+ if (parentModule) {
500
+ throw new Error('AuthenticationModule is already loaded. Import it in the AppModule only');
501
+ }
502
+ }
503
+ static forRoot(authenticationConfig) {
504
+ return {
505
+ ngModule: AuthenticationModule,
506
+ providers: [
507
+ AuthenticationService,
508
+ { provide: AuthenticationServiceConfig, useValue: authenticationConfig }
509
+ ]
510
+ };
511
+ }
512
+ }
513
+ AuthenticationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, deps: [{ token: AuthenticationModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
514
+ AuthenticationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, declarations: [LoginComponent,
515
+ LoginFormComponent], imports: [CommonModule,
516
+ FormsModule,
517
+ MatButtonModule,
518
+ MatCheckboxModule,
519
+ MatDialogModule,
520
+ MatInputModule,
521
+ MatProgressBarModule,
522
+ MatProgressSpinnerModule,
523
+ MatTooltipModule,
524
+ MatSelectModule,
525
+ DialogModule], exports: [LoginComponent,
526
+ LoginFormComponent] });
527
+ AuthenticationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, imports: [CommonModule,
528
+ FormsModule,
529
+ MatButtonModule,
530
+ MatCheckboxModule,
531
+ MatDialogModule,
532
+ MatInputModule,
533
+ MatProgressBarModule,
534
+ MatProgressSpinnerModule,
535
+ MatTooltipModule,
536
+ MatSelectModule,
537
+ DialogModule] });
538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, decorators: [{
539
+ type: NgModule,
540
+ args: [{
541
+ imports: [
542
+ CommonModule,
543
+ FormsModule,
544
+ MatButtonModule,
545
+ MatCheckboxModule,
546
+ MatDialogModule,
547
+ MatInputModule,
548
+ MatProgressBarModule,
549
+ MatProgressSpinnerModule,
550
+ MatTooltipModule,
551
+ MatSelectModule,
552
+ DialogModule
553
+ ],
554
+ declarations: [
555
+ LoginComponent,
556
+ LoginFormComponent
557
+ ],
558
+ exports: [
559
+ LoginComponent,
560
+ LoginFormComponent
561
+ ],
562
+ providers: [],
563
+ entryComponents: [
564
+ LoginFormComponent
565
+ ]
566
+ }]
567
+ }], ctorParameters: function () {
568
+ return [{ type: AuthenticationModule, decorators: [{
569
+ type: Optional
570
+ }, {
571
+ type: SkipSelf
572
+ }] }];
573
+ } });
574
+
575
+ class EmailServiceConfig {
576
+ }
577
+
578
+ //#region Imports
579
+ //#endregion
580
+ class EmailService {
581
+ constructor(config, http) {
582
+ this.http = http;
583
+ this.emailServiceConfig = config;
584
+ }
585
+ send(email) {
586
+ const dto = {
587
+ server: this.emailServiceConfig.server,
588
+ smtpPort: this.emailServiceConfig.smtpPort,
589
+ sender: this.emailServiceConfig.sender,
590
+ subject: email.subject,
591
+ content: email.content,
592
+ recipients: email.recipients
593
+ };
594
+ return this.http.post(this.emailServiceConfig.emailApiUrl, dto);
595
+ }
596
+ }
597
+ EmailService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailService, deps: [{ token: EmailServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
598
+ EmailService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailService });
599
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailService, decorators: [{
600
+ type: Injectable
601
+ }], ctorParameters: function () {
602
+ return [{ type: EmailServiceConfig, decorators: [{
603
+ type: Optional
604
+ }] }, { type: i2.HttpClient }];
605
+ } });
606
+
607
+ //#region Imports
608
+ //#endregion
609
+ class EmailModule {
610
+ constructor(parentModule) {
611
+ if (parentModule) {
612
+ throw new Error('EmailModule is already loaded. Import it in the AppModule only');
613
+ }
614
+ }
615
+ static forRoot(emailConfig) {
616
+ return {
617
+ ngModule: EmailModule,
618
+ providers: [
619
+ EmailService,
620
+ { provide: EmailServiceConfig, useValue: emailConfig }
621
+ ]
622
+ };
623
+ }
624
+ }
625
+ EmailModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, deps: [{ token: EmailModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
626
+ EmailModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, imports: [CommonModule] });
627
+ EmailModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, imports: [CommonModule] });
628
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, decorators: [{
629
+ type: NgModule,
630
+ args: [{
631
+ imports: [CommonModule],
632
+ declarations: [],
633
+ exports: []
634
+ }]
635
+ }], ctorParameters: function () {
636
+ return [{ type: EmailModule, decorators: [{
637
+ type: Optional
638
+ }, {
639
+ type: SkipSelf
640
+ }] }];
641
+ } });
642
+
643
+ class EmployeeServiceConfig {
644
+ }
645
+
646
+ //#region Imports
647
+ //#endregion
648
+ class EmployeeService {
649
+ //#endregion
650
+ //#region Lifecycle
651
+ constructor(config, http) {
652
+ this.http = http;
653
+ this.employeeApiUrl = config.employeeApiUrl;
654
+ }
655
+ //#endregion
656
+ //#region Utilities
657
+ getEmployees(storeEmployees = false, includeDisabled = false) {
658
+ // Do we already have employees stored locally?
659
+ if (this.employees) {
660
+ return of(this.employees);
661
+ // return Observable.of(this.employees);
662
+ }
663
+ // Should we store employees locally for subsequent calls?
664
+ if (storeEmployees) {
665
+ this.http.get(`${this.employeeApiUrl}/false/${includeDisabled}`)
666
+ .subscribe(emps => this.employees = emps);
667
+ }
668
+ return this.http.get(`${this.employeeApiUrl}/false/${includeDisabled}`);
669
+ }
670
+ getEmployee(sAMAccountName) {
671
+ return this.http.get(`${this.employeeApiUrl}/name/${sAMAccountName}`);
672
+ }
673
+ }
674
+ EmployeeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeService, deps: [{ token: EmployeeServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
675
+ EmployeeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeService });
676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeService, decorators: [{
677
+ type: Injectable
678
+ }], ctorParameters: function () {
679
+ return [{ type: EmployeeServiceConfig, decorators: [{
680
+ type: Optional
681
+ }] }, { type: i2.HttpClient }];
682
+ } });
683
+
684
+ class DepartmentsPipe {
685
+ transform(employees, args) {
686
+ const departments = [];
687
+ employees
688
+ .filter(emp => emp.department)
689
+ .forEach(emp => {
690
+ if (departments.indexOf(emp.department) === -1) {
691
+ departments.push(emp.department);
692
+ }
693
+ });
694
+ return departments.sort();
695
+ }
696
+ }
697
+ DepartmentsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DepartmentsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
698
+ DepartmentsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: DepartmentsPipe, name: "departments" });
699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DepartmentsPipe, decorators: [{
700
+ type: Pipe,
701
+ args: [{
702
+ name: 'departments'
703
+ }]
704
+ }] });
705
+
706
+ class EmployeeByDnPipe {
707
+ transform(employees, dn) {
708
+ return employees
709
+ .find(emp => emp.distinguishedName.toLowerCase() === dn.toLowerCase());
710
+ }
711
+ }
712
+ EmployeeByDnPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeByDnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
713
+ EmployeeByDnPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeeByDnPipe, name: "employeeByDn" });
714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeByDnPipe, decorators: [{
715
+ type: Pipe,
716
+ args: [{
717
+ name: 'employeeByDn'
718
+ }]
719
+ }] });
720
+
721
+ class EmployeePhotoUrlPipe {
722
+ transform(employee, photos) {
723
+ if (!photos) {
724
+ return null;
725
+ }
726
+ // Try to match by employeeNumber, accountName, or title
727
+ const photo = photos
728
+ .find(pic => (pic.ows_EmployeeNumber && employee.employeeNumber && +pic.ows_EmployeeNumber === +employee.employeeNumber) ||
729
+ (pic.ows_AccountName && pic.ows_AccountName.toLowerCase() === employee.sAMAccountName.toLowerCase()) ||
730
+ (pic.ows_Title && pic.ows_Title.toLowerCase() === employee.displayName.toLowerCase()));
731
+ if (!photo) {
732
+ console.log(`No photo match for ${employee.displayName}`);
733
+ }
734
+ return photo ? photo.ows_EncodedAbsUrl : null;
735
+ }
736
+ }
737
+ EmployeePhotoUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeePhotoUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
738
+ EmployeePhotoUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeePhotoUrlPipe, name: "employeePhotoUrl" });
739
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeePhotoUrlPipe, decorators: [{
740
+ type: Pipe,
741
+ args: [{
742
+ name: 'employeePhotoUrl'
743
+ }]
744
+ }] });
745
+
746
+ class EmployeesWithPropertyValuePipe {
747
+ transform(employees, propertyName, propertyValue) {
748
+ return employees
749
+ .filter(emp => emp[propertyName] && emp[propertyName] === propertyValue);
750
+ }
751
+ }
752
+ EmployeesWithPropertyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeesWithPropertyValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
753
+ EmployeesWithPropertyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeesWithPropertyValuePipe, name: "employeesWithPropertyValue" });
754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeesWithPropertyValuePipe, decorators: [{
755
+ type: Pipe,
756
+ args: [{
757
+ name: 'employeesWithPropertyValue'
758
+ }]
759
+ }] });
760
+
761
+ class FilterEmployeesPipe {
762
+ transform(employees, filter) {
763
+ return filter ?
764
+ employees
765
+ .filter(emp => emp.displayName.toLowerCase().indexOf(filter.toLowerCase()) !== -1 ||
766
+ (emp.department && emp.department.toLowerCase().indexOf(filter.toLowerCase()) !== -1) ||
767
+ (emp.title && emp.title.toLowerCase().indexOf(filter.toLowerCase()) !== -1) ||
768
+ emp.sAMAccountName.toLowerCase().indexOf(filter.toLowerCase()) !== -1) :
769
+ employees;
770
+ }
771
+ }
772
+ FilterEmployeesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FilterEmployeesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
773
+ FilterEmployeesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: FilterEmployeesPipe, name: "filterEmployees" });
774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FilterEmployeesPipe, decorators: [{
775
+ type: Pipe,
776
+ args: [{
777
+ name: 'filterEmployees'
778
+ }]
779
+ }] });
780
+
781
+ class IsMemberOfPipe {
782
+ transform(employee, groupName) {
783
+ return employee.memberOf &&
784
+ (employee.memberOf.find(m => m.toLowerCase().indexOf(groupName.toLowerCase()) !== -1) !== undefined);
785
+ }
786
+ }
787
+ IsMemberOfPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsMemberOfPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
788
+ IsMemberOfPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsMemberOfPipe, name: "isMemberOf" });
789
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsMemberOfPipe, decorators: [{
790
+ type: Pipe,
791
+ args: [{
792
+ name: 'isMemberOf'
793
+ }]
794
+ }] });
795
+
796
+ class SortEmployeesPipe {
797
+ transform(employees, sortBy, dataType, reverse) {
798
+ return this.getSorted(employees, sortBy ? sortBy : 'displayName', dataType ? dataType : 'string', reverse ? reverse : false);
799
+ }
800
+ getSorted(employees, sortBy, dataType, reverse) {
801
+ const sorted = employees
802
+ .sort((a, b) => {
803
+ let valA, valB;
804
+ switch (dataType.toLowerCase()) {
805
+ case 'string':
806
+ valA = a[sortBy] ? a[sortBy].toString().toLowerCase() : null;
807
+ valB = b[sortBy] ? b[sortBy].toString().toLowerCase() : null;
808
+ break;
809
+ case 'number':
810
+ valA = a[sortBy] ? +a[sortBy] : null;
811
+ valB = b[sortBy] ? +b[sortBy] : null;
812
+ break;
813
+ case 'date':
814
+ valA = a[sortBy] ? a[sortBy] : null;
815
+ valB = b[sortBy] ? b[sortBy] : null;
816
+ break;
817
+ }
818
+ if (valA < valB) {
819
+ return -1;
820
+ }
821
+ if (valA > valB) {
822
+ return 1;
823
+ }
824
+ return 0;
825
+ });
826
+ return reverse ? sorted.reverse() : sorted;
827
+ }
828
+ }
829
+ SortEmployeesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SortEmployeesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
830
+ SortEmployeesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SortEmployeesPipe, name: "sortEmployees" });
831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SortEmployeesPipe, decorators: [{
832
+ type: Pipe,
833
+ args: [{
834
+ name: 'sortEmployees'
835
+ }]
836
+ }] });
837
+
838
+ //#region Imports
839
+ //#endregion
840
+ class EmployeeModule {
841
+ constructor(parentModule) {
842
+ if (parentModule) {
843
+ throw new Error('EmployeeModule is already loaded. Import it in the AppModule only');
844
+ }
845
+ }
846
+ static forRoot(employeeConfig) {
847
+ return {
848
+ ngModule: EmployeeModule,
849
+ providers: [
850
+ EmployeeService,
851
+ { provide: EmployeeServiceConfig, useValue: employeeConfig }
852
+ ]
853
+ };
854
+ }
855
+ }
856
+ EmployeeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, deps: [{ token: EmployeeModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
857
+ EmployeeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, declarations: [DepartmentsPipe,
858
+ EmployeeByDnPipe,
859
+ EmployeesWithPropertyValuePipe,
860
+ FilterEmployeesPipe,
861
+ IsMemberOfPipe,
862
+ EmployeePhotoUrlPipe,
863
+ SortEmployeesPipe], imports: [CommonModule], exports: [DepartmentsPipe,
864
+ EmployeeByDnPipe,
865
+ EmployeesWithPropertyValuePipe,
866
+ FilterEmployeesPipe,
867
+ IsMemberOfPipe,
868
+ EmployeePhotoUrlPipe,
869
+ SortEmployeesPipe] });
870
+ EmployeeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, imports: [CommonModule] });
871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, decorators: [{
872
+ type: NgModule,
873
+ args: [{
874
+ imports: [CommonModule],
875
+ declarations: [
876
+ DepartmentsPipe,
877
+ EmployeeByDnPipe,
878
+ EmployeesWithPropertyValuePipe,
879
+ FilterEmployeesPipe,
880
+ IsMemberOfPipe,
881
+ EmployeePhotoUrlPipe,
882
+ SortEmployeesPipe
883
+ ],
884
+ exports: [
885
+ DepartmentsPipe,
886
+ EmployeeByDnPipe,
887
+ EmployeesWithPropertyValuePipe,
888
+ FilterEmployeesPipe,
889
+ IsMemberOfPipe,
890
+ EmployeePhotoUrlPipe,
891
+ SortEmployeesPipe
892
+ ]
893
+ }]
894
+ }], ctorParameters: function () {
895
+ return [{ type: EmployeeModule, decorators: [{
896
+ type: Optional
897
+ }, {
898
+ type: SkipSelf
899
+ }] }];
900
+ } });
901
+
902
+ class SharePointPhotoUrlPipe {
903
+ transform(photo) {
904
+ return photo.ows_EncodedAbsUrl;
905
+ }
906
+ }
907
+ SharePointPhotoUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointPhotoUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
908
+ SharePointPhotoUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SharePointPhotoUrlPipe, name: "sharePointPhotoUrl" });
909
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointPhotoUrlPipe, decorators: [{
910
+ type: Pipe,
911
+ args: [{
912
+ name: 'sharePointPhotoUrl'
913
+ }]
914
+ }] });
915
+
916
+ class SharePointUrlPipe {
917
+ transform(url) {
918
+ return url !== null ? url.split(',')[0] : null;
919
+ }
920
+ }
921
+ SharePointUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
922
+ SharePointUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SharePointUrlPipe, name: "sharePointUrl" });
923
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointUrlPipe, decorators: [{
924
+ type: Pipe,
925
+ args: [{
926
+ name: 'sharePointUrl'
927
+ }]
928
+ }] });
929
+
930
+ //#region Imports
931
+ //#endregion
932
+ class SharePointModule {
933
+ constructor(parentModule) {
934
+ if (parentModule) {
935
+ throw new Error('SharePointModule is already loaded. Import it in the AppModule only');
936
+ }
937
+ }
938
+ static forRoot(sharePointConfig) {
939
+ return {
940
+ ngModule: SharePointModule,
941
+ providers: [
942
+ SharePointService,
943
+ { provide: SharePointServiceConfig, useValue: sharePointConfig }
944
+ ]
945
+ };
946
+ }
947
+ }
948
+ SharePointModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, deps: [{ token: SharePointModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
949
+ SharePointModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, declarations: [SharePointPhotoUrlPipe,
950
+ SharePointUrlPipe], imports: [CommonModule], exports: [SharePointPhotoUrlPipe,
951
+ SharePointUrlPipe] });
952
+ SharePointModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, imports: [CommonModule] });
953
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, decorators: [{
954
+ type: NgModule,
955
+ args: [{
956
+ imports: [
957
+ CommonModule
958
+ ],
959
+ declarations: [
960
+ SharePointPhotoUrlPipe,
961
+ SharePointUrlPipe
962
+ ],
963
+ exports: [
964
+ SharePointPhotoUrlPipe,
965
+ SharePointUrlPipe
966
+ ]
967
+ }]
968
+ }], ctorParameters: function () {
969
+ return [{ type: SharePointModule, decorators: [{
970
+ type: Optional
971
+ }, {
972
+ type: SkipSelf
973
+ }] }];
974
+ } });
975
+
976
+ class UploadServiceConfig {
977
+ }
978
+
979
+ // https://malcoded.com/posts/angular-file-upload-component-with-express
980
+ class UploadService {
981
+ constructor(http, config) {
982
+ this.http = http;
983
+ this.uploadApiUrl = config.uploadApiUrl;
984
+ this.uploadPath = config.uploadPath || '';
985
+ this.dbAppId = config.dbAppId || '';
986
+ this.externalReferenceId = config.externalReferenceId || '';
987
+ this.comment = config.comment || '';
988
+ // UI configuration
989
+ this.uploadButtonText = config.uploadButtonText;
990
+ this.uploadDialogTitle = config.uploadDialogTitle;
991
+ this.uploadDialogAddFilesButtonText = config.uploadDialogAddFilesButtonText;
992
+ this.uploadDialogCancelButtonText = config.uploadDialogCancelButtonText;
993
+ this.uploadDialogUploadButtonText = config.uploadDialogUploadButtonText;
994
+ this.uploadDialogFinishButtonText = config.uploadDialogFinishButtonText;
995
+ }
996
+ upload(files) {
997
+ // this will be the our resulting map
998
+ const status = {};
999
+ files.forEach(file => {
1000
+ // create a new multipart-form for every file
1001
+ const formData = new FormData();
1002
+ formData.append('file', file, file.name);
1003
+ // create a http-post request and pass the form
1004
+ // tell it to report the upload progress
1005
+ // A 'Destination' header is used to optionally configure the file upload destination (filesystem)
1006
+ // A 'DbAppId' header is used to configure the unique identifier of database uploads
1007
+ const req = new HttpRequest('POST', this.uploadApiUrl, formData, {
1008
+ reportProgress: true,
1009
+ responseType: 'blob',
1010
+ headers: new HttpHeaders()
1011
+ .set('Destination', this.uploadPath)
1012
+ .set('DbAppId', this.dbAppId)
1013
+ .set('ExternalReferenceId', this.externalReferenceId)
1014
+ .set('Comment', this.comment)
1015
+ /*headers: this.uploadPath ?
1016
+ new HttpHeaders({ 'Destination': this.uploadPath }) :
1017
+ this.dbAppId ?
1018
+ new HttpHeaders({ 'DbAppId': this.dbAppId }) :
1019
+ null*/
1020
+ });
1021
+ // create a new progress-subject for every file
1022
+ const progress = new Subject();
1023
+ // send the http-request and subscribe for progress-updates
1024
+ this.http.request(req).subscribe(event => {
1025
+ if (event.type === HttpEventType.UploadProgress) {
1026
+ // calculate the progress percentage
1027
+ const percentDone = Math.round(100 * event.loaded / event.total);
1028
+ // pass the percentage into the progress-stream
1029
+ progress.next(percentDone);
1030
+ }
1031
+ else if (event instanceof HttpResponse) {
1032
+ // Close the progress-stream if we get an answer form the API
1033
+ // The upload is complete
1034
+ progress.complete();
1035
+ }
1036
+ });
1037
+ // Save every progress-observable in a map of all observables
1038
+ status[file.name] = {
1039
+ progress: progress.asObservable()
1040
+ };
1041
+ });
1042
+ // return the map of progress.observables
1043
+ return status;
1044
+ }
1045
+ exists(fileName) {
1046
+ const query = this.uploadApiUrl.toLowerCase().indexOf('filesystem') === -1 ?
1047
+ { name: fileName, dbAppId: this.dbAppId } :
1048
+ { name: fileName, destination: this.uploadPath };
1049
+ return this.http.post(`${this.uploadApiUrl}/exists`, query);
1050
+ }
1051
+ download(request) {
1052
+ return this.http.post(`${this.uploadApiUrl}/stream`, request, { responseType: 'blob' });
1053
+ }
1054
+ getUploadInfo(request) {
1055
+ return this.http.post(`${this.uploadApiUrl}/info`, request);
1056
+ }
1057
+ }
1058
+ UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadService, deps: [{ token: i2.HttpClient }, { token: UploadServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1059
+ UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadService });
1060
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadService, decorators: [{
1061
+ type: Injectable
1062
+ }], ctorParameters: function () {
1063
+ return [{ type: i2.HttpClient }, { type: UploadServiceConfig, decorators: [{
1064
+ type: Optional
1065
+ }] }];
1066
+ } });
1067
+
1068
+ class UploadDialogComponent {
1069
+ constructor(dialogRef, uploadService) {
1070
+ this.dialogRef = dialogRef;
1071
+ this.uploadService = uploadService;
1072
+ this.files = new Set();
1073
+ this.canBeClosed = true;
1074
+ this.showCancelButton = true;
1075
+ this.uploading = false;
1076
+ this.uploadSuccessful = false;
1077
+ }
1078
+ ngOnInit() {
1079
+ this.uploadDialogTitle = this.uploadService.uploadDialogTitle ?
1080
+ this.uploadService.uploadDialogTitle :
1081
+ 'Upload Files';
1082
+ this.uploadDialogAddFilesButtonText = this.uploadService.uploadDialogAddFilesButtonText ?
1083
+ this.uploadService.uploadDialogAddFilesButtonText :
1084
+ 'Add Files';
1085
+ this.uploadDialogCancelButtonText = this.uploadService.uploadDialogCancelButtonText ?
1086
+ this.uploadService.uploadDialogCancelButtonText :
1087
+ 'Cancel';
1088
+ this.uploadDialogUploadButtonText = this.uploadService.uploadDialogUploadButtonText ?
1089
+ this.uploadService.uploadDialogUploadButtonText :
1090
+ 'Upload';
1091
+ this.uploadDialogFinishButtonText = this.uploadService.uploadDialogFinishButtonText ?
1092
+ this.uploadService.uploadDialogFinishButtonText :
1093
+ 'Finish';
1094
+ this.primaryButtonText = this.uploadDialogUploadButtonText;
1095
+ }
1096
+ addFiles() {
1097
+ this.file.nativeElement.click();
1098
+ }
1099
+ onFilesAdded() {
1100
+ const files = this.file.nativeElement.files;
1101
+ for (const key in files) {
1102
+ if (!isNaN(parseInt(key))) {
1103
+ // See if the file already exists
1104
+ this.uploadService.exists(files[key].name)
1105
+ .subscribe(exists => {
1106
+ if (exists) {
1107
+ this.existingFileConflict = files[key].name;
1108
+ }
1109
+ if (!exists) {
1110
+ this.files.add(files[key]);
1111
+ }
1112
+ });
1113
+ }
1114
+ }
1115
+ }
1116
+ closeDialog() {
1117
+ // if everything was uploaded already, just close the dialog
1118
+ if (this.uploadSuccessful) {
1119
+ return this.dialogRef.close();
1120
+ }
1121
+ // set the component state to "uploading"
1122
+ this.uploading = true;
1123
+ // start the upload and save the progress map
1124
+ this.progress = this.uploadService.upload(this.files);
1125
+ // convert the progress map into an array
1126
+ const allProgressObservables = [];
1127
+ for (let key in this.progress) {
1128
+ allProgressObservables.push(this.progress[key].progress);
1129
+ }
1130
+ // Adjust the state variables
1131
+ // The OK-button should have the text "Finish" now
1132
+ this.primaryButtonText = this.uploadDialogFinishButtonText;
1133
+ // The dialog should not be closed while uploading
1134
+ this.canBeClosed = false;
1135
+ this.dialogRef.disableClose = true;
1136
+ // Hide the cancel-button
1137
+ this.showCancelButton = false;
1138
+ // When all progress-observables are completed...
1139
+ forkJoin(allProgressObservables).subscribe(end => {
1140
+ // ... the dialog can be closed again...
1141
+ this.canBeClosed = true;
1142
+ this.dialogRef.disableClose = false;
1143
+ // ... the upload was successful...
1144
+ this.uploadSuccessful = true;
1145
+ // ... and the component is no longer uploading
1146
+ this.uploading = false;
1147
+ });
1148
+ }
1149
+ }
1150
+ UploadDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
1151
+ UploadDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: UploadDialogComponent, selector: "cp-upload-dialog", viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, static: true }], ngImport: i0, template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\r\n\r\n<div mat-dialog-title id=\"title\">\r\n <div>{{ uploadDialogTitle }}</div>\r\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\r\n {{ uploadDialogAddFilesButtonText }}\r\n </button>\r\n</div>\r\n\r\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\r\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\r\n</div>\r\n\r\n<mat-dialog-content>\r\n <mat-list>\r\n <mat-list-item *ngFor=\"let file of files\">\r\n <h4 mat-line>{{file.name}}</h4>\r\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\r\n </mat-list-item>\r\n </mat-list>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions id=\"actions\">\r\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\r\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\r\n</mat-dialog-actions>\r\n", styles: ["#title{display:flex;justify-content:space-between}#actions{display:flex;justify-content:flex-end}#conflict{font-size:.8em;color:red;margin-top:.5em}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$2.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i5$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i6$1.MatLine, selector: "[mat-line], [matLine]" }, { kind: "component", type: i7.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
1152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadDialogComponent, decorators: [{
1153
+ type: Component,
1154
+ args: [{ selector: 'cp-upload-dialog', template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\r\n\r\n<div mat-dialog-title id=\"title\">\r\n <div>{{ uploadDialogTitle }}</div>\r\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\r\n {{ uploadDialogAddFilesButtonText }}\r\n </button>\r\n</div>\r\n\r\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\r\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\r\n</div>\r\n\r\n<mat-dialog-content>\r\n <mat-list>\r\n <mat-list-item *ngFor=\"let file of files\">\r\n <h4 mat-line>{{file.name}}</h4>\r\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\r\n </mat-list-item>\r\n </mat-list>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions id=\"actions\">\r\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\r\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\r\n</mat-dialog-actions>\r\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"] }]
1155
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: UploadService }]; }, propDecorators: { file: [{
1156
+ type: ViewChild,
1157
+ args: ['file', { static: true }]
1158
+ }] } });
1159
+
1160
+ class UploadComponent {
1161
+ constructor(dialog, uploadService) {
1162
+ this.dialog = dialog;
1163
+ this.uploadService = uploadService;
1164
+ this.dialogClosed = new EventEmitter();
1165
+ }
1166
+ ngOnInit() {
1167
+ this.uploadButtonText = this.uploadService.uploadButtonText ?
1168
+ this.uploadService.uploadButtonText :
1169
+ 'Upload';
1170
+ }
1171
+ openUploadDialog() {
1172
+ this.dialog.open(UploadDialogComponent, { width: '50%' })
1173
+ .afterClosed().subscribe(() => this.dialogClosed.emit());
1174
+ }
1175
+ }
1176
+ UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadComponent, deps: [{ token: i1$1.MatDialog }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
1177
+ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: UploadComponent, selector: "cp-upload", outputs: { dialogClosed: "dialogClosed" }, ngImport: i0, template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>', isInline: true, dependencies: [{ kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
1178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadComponent, decorators: [{
1179
+ type: Component,
1180
+ args: [{
1181
+ selector: 'cp-upload',
1182
+ template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>'
1183
+ }]
1184
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: UploadService }]; }, propDecorators: { dialogClosed: [{
1185
+ type: Output
1186
+ }] } });
1187
+
1188
+ //#region Imports
1189
+ //#endregion
1190
+ class UploadModule {
1191
+ constructor(parentModule) {
1192
+ if (parentModule) {
1193
+ throw new Error('UploadModule is already loaded. Import it in the AppModule only');
1194
+ }
1195
+ }
1196
+ static forRoot(uploadConfig) {
1197
+ return {
1198
+ ngModule: UploadModule,
1199
+ providers: [
1200
+ UploadService,
1201
+ { provide: UploadServiceConfig, useValue: uploadConfig }
1202
+ ]
1203
+ };
1204
+ }
1205
+ }
1206
+ UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, deps: [{ token: UploadModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
1207
+ UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
1208
+ UploadDialogComponent], imports: [CommonModule,
1209
+ BrowserAnimationsModule,
1210
+ HttpClientModule,
1211
+ MatButtonModule,
1212
+ MatDialogModule,
1213
+ MatListModule,
1214
+ MatProgressBarModule], exports: [UploadComponent,
1215
+ UploadDialogComponent] });
1216
+ UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, imports: [CommonModule,
1217
+ BrowserAnimationsModule,
1218
+ HttpClientModule,
1219
+ MatButtonModule,
1220
+ MatDialogModule,
1221
+ MatListModule,
1222
+ MatProgressBarModule] });
1223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, decorators: [{
1224
+ type: NgModule,
1225
+ args: [{
1226
+ imports: [
1227
+ CommonModule,
1228
+ BrowserAnimationsModule,
1229
+ HttpClientModule,
1230
+ MatButtonModule,
1231
+ MatDialogModule,
1232
+ MatListModule,
1233
+ MatProgressBarModule
1234
+ ],
1235
+ declarations: [
1236
+ UploadComponent,
1237
+ UploadDialogComponent
1238
+ ],
1239
+ exports: [
1240
+ UploadComponent,
1241
+ UploadDialogComponent
1242
+ ],
1243
+ entryComponents: [
1244
+ UploadDialogComponent
1245
+ ]
1246
+ }]
1247
+ }], ctorParameters: function () {
1248
+ return [{ type: UploadModule, decorators: [{
1249
+ type: Optional
1250
+ }, {
1251
+ type: SkipSelf
1252
+ }] }];
1253
+ } });
1254
+
1255
+ // This pipe whitelists URLs so that they aren't prefixed with 'unsafe:' when they render in the DOM
1256
+ class SafeUrlPipe {
1257
+ constructor(domSanitizer) {
1258
+ this.domSanitizer = domSanitizer;
1259
+ }
1260
+ transform(value) {
1261
+ return this.domSanitizer.bypassSecurityTrustUrl(value);
1262
+ }
1263
+ }
1264
+ SafeUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SafeUrlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1265
+ SafeUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SafeUrlPipe, name: "safeUrl" });
1266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SafeUrlPipe, decorators: [{
1267
+ type: Pipe,
1268
+ args: [{
1269
+ name: 'safeUrl'
1270
+ }]
1271
+ }], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
1272
+
1273
+ class UriSchemePipe {
1274
+ // https://docs.microsoft.com/en-us/office/client-developer/office-uri-schemes
1275
+ transform(value) {
1276
+ if (!localStorage.getItem('useUriScheme')) {
1277
+ return value;
1278
+ }
1279
+ const urlSplit = value.split('.');
1280
+ const extension = urlSplit[urlSplit.length - 1];
1281
+ if (!extension) {
1282
+ return value;
1283
+ }
1284
+ const command = this.command(extension);
1285
+ const app = this.app(extension);
1286
+ return `ms-${app}:${command}|u|${value}`;
1287
+ }
1288
+ app(extension) {
1289
+ switch (extension.toLowerCase()) {
1290
+ // documents
1291
+ case 'doc':
1292
+ case 'docx':
1293
+ case 'docm':
1294
+ case 'docb':
1295
+ case 'dot':
1296
+ case 'dotx':
1297
+ case 'dotm': // templates
1298
+ return 'word';
1299
+ case 'xls':
1300
+ case 'xlsx':
1301
+ case 'xlm':
1302
+ case 'xlsm':
1303
+ case 'xlsb':
1304
+ case 'xlw':
1305
+ case 'xlt':
1306
+ case 'xltx':
1307
+ case 'xltm': // templates
1308
+ return 'excel';
1309
+ case 'ppt':
1310
+ case 'pptx':
1311
+ case 'pps':
1312
+ case 'ppsx':
1313
+ case 'pptm':
1314
+ case 'ppsm':
1315
+ case 'sldx':
1316
+ case 'sldm':
1317
+ case 'pot':
1318
+ case 'potx':
1319
+ case 'potm': // templates
1320
+ return 'powerpoint';
1321
+ case 'vsd':
1322
+ case 'vsdx':
1323
+ case 'vst':
1324
+ case 'vstx': // templates
1325
+ return 'visio';
1326
+ case 'mdb':
1327
+ case 'accdb':
1328
+ case 'accde':
1329
+ case 'accdr':
1330
+ case 'accdt': // templates
1331
+ return 'access';
1332
+ case 'mpp':
1333
+ case 'mppx':
1334
+ case 'mpt': // templates
1335
+ return 'project';
1336
+ case 'pub':
1337
+ return 'publisher';
1338
+ case 'xsn':
1339
+ return 'infopath';
1340
+ }
1341
+ }
1342
+ command(extension) {
1343
+ switch (extension.toLowerCase()) {
1344
+ case 'dot':
1345
+ case 'dotx':
1346
+ case 'dotm':
1347
+ case 'xlt':
1348
+ case 'xltx':
1349
+ case 'xltm':
1350
+ case 'pot':
1351
+ case 'potx':
1352
+ case 'potm':
1353
+ case 'vst':
1354
+ case 'vstx':
1355
+ case 'accdt':
1356
+ case 'mpt':
1357
+ return 'nft'; // new from template
1358
+ default:
1359
+ const openMode = 'v'; // for view, or 'e' or edit
1360
+ return `of${openMode}`; // default: open file as view/edit
1361
+ }
1362
+ }
1363
+ }
1364
+ UriSchemePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UriSchemePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1365
+ UriSchemePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: UriSchemePipe, name: "uriScheme", pure: false });
1366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UriSchemePipe, decorators: [{
1367
+ type: Pipe,
1368
+ args: [{
1369
+ name: 'uriScheme',
1370
+ pure: false
1371
+ }]
1372
+ }] });
1373
+
1374
+ //#region Imports
1375
+ //#endregion
1376
+ class UrlModule {
1377
+ }
1378
+ UrlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1379
+ UrlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, declarations: [SafeUrlPipe,
1380
+ UriSchemePipe], imports: [CommonModule], exports: [SafeUrlPipe,
1381
+ UriSchemePipe] });
1382
+ UrlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, imports: [CommonModule] });
1383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, decorators: [{
1384
+ type: NgModule,
1385
+ args: [{
1386
+ imports: [
1387
+ CommonModule
1388
+ ],
1389
+ declarations: [
1390
+ SafeUrlPipe,
1391
+ UriSchemePipe
1392
+ ],
1393
+ exports: [
1394
+ SafeUrlPipe,
1395
+ UriSchemePipe
1396
+ ],
1397
+ entryComponents: []
1398
+ }]
1399
+ }] });
1400
+
1401
+ /**
1402
+ * Generated bundle index. Do not edit.
1403
+ */
1404
+
1405
+ export { AuthenticationModule, AuthenticationService, AuthenticationServiceConfig, ConfirmationDialogComponent, ConfirmationDialogMode, DepartmentsPipe, DialogModule, EmailModule, EmailService, EmailServiceConfig, EmployeeByDnPipe, EmployeeModule, EmployeePhotoUrlPipe, EmployeeService, EmployeeServiceConfig, EmployeesWithPropertyValuePipe, FilterEmployeesPipe, InputDialogComponent, IsMemberOfPipe, LoginComponent, LoginFormComponent, MessageDialogComponent, SafeUrlPipe, SharePointModule, SharePointPhotoUrlPipe, SharePointService, SharePointServiceConfig, SharePointUrlPipe, SortEmployeesPipe, UploadComponent, UploadDialogComponent, UploadModule, UploadService, UploadServiceConfig, UriSchemePipe, UrlModule };
1406
+ //# sourceMappingURL=cleavelandprice-ngx-lib.mjs.map