@cleavelandprice/ngx-lib 2.2.3 → 2.3.7

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