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