@cleavelandprice/ngx-lib 2.1.2 → 2.2.1

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