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