@cleavelandprice/ngx-lib 2.2.2 → 2.3.8

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