@cleavelandprice/ngx-lib 2.2.3 → 2.3.7

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