@cleavelandprice/ngx-lib 2.2.2 → 2.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/README.md +6 -616
  2. package/active-directory/active-directory.module.d.ts +11 -0
  3. package/active-directory/index.d.ts +5 -0
  4. package/active-directory/model/ad-object.d.ts +13 -0
  5. package/active-directory/model/cache-object.d.ts +4 -0
  6. package/active-directory/model/caching-config.d.ts +4 -0
  7. package/active-directory/model/default-caching-config.d.ts +2 -0
  8. package/active-directory/model/default-config.d.ts +2 -0
  9. package/active-directory/model/default-logging-config.d.ts +2 -0
  10. package/active-directory/model/logging-config.d.ts +6 -0
  11. package/active-directory/model/service-config.d.ts +7 -0
  12. package/active-directory/model/user-or-group.d.ts +7 -0
  13. package/active-directory/model/user.d.ts +23 -0
  14. package/active-directory/public_api.d.ts +8 -0
  15. package/active-directory/services/active-directory.service.d.ts +18 -0
  16. package/authentication/authentication.module.d.ts +20 -0
  17. package/authentication/components/login/login.component.d.ts +13 -0
  18. package/authentication/components/login-form/login-form.component.d.ts +23 -0
  19. package/authentication/index.d.ts +5 -0
  20. package/authentication/model/authenticated-user.d.ts +9 -0
  21. package/authentication/model/authentication-request.d.ts +6 -0
  22. package/{src/authentication → authentication}/model/authentication-token.d.ts +0 -0
  23. package/authentication/model/default-config.d.ts +2 -0
  24. package/authentication/model/login-form-data.d.ts +3 -0
  25. package/authentication/model/service-config.d.ts +3 -0
  26. package/authentication/public_api.d.ts +9 -0
  27. package/authentication/services/authentication.service.d.ts +25 -0
  28. package/dialog/components/base/base.component.d.ts +20 -0
  29. package/dialog/components/confirmation/confirmation.component.d.ts +12 -0
  30. package/dialog/components/input/input.component.d.ts +12 -0
  31. package/dialog/components/message/message.component.d.ts +12 -0
  32. package/dialog/dialog.module.d.ts +17 -0
  33. package/dialog/index.d.ts +5 -0
  34. package/{src/dialog/model/confirmation-dialog-mode.enum.d.ts → dialog/model/confirmation-dialog-mode.d.ts} +0 -0
  35. package/dialog/model/dialog-base-data.d.ts +10 -0
  36. package/dialog/model/dialog-type.d.ts +5 -0
  37. package/dialog/public_api.d.ts +8 -0
  38. package/esm2020/active-directory/active-directory.module.mjs +38 -0
  39. package/esm2020/active-directory/cleavelandprice-ngx-lib-active-directory.mjs +5 -0
  40. package/esm2020/active-directory/model/ad-object.mjs +2 -0
  41. package/esm2020/active-directory/model/cache-object.mjs +3 -0
  42. package/esm2020/active-directory/model/caching-config.mjs +2 -0
  43. package/esm2020/active-directory/model/default-caching-config.mjs +5 -0
  44. package/esm2020/active-directory/model/default-config.mjs +8 -0
  45. package/esm2020/active-directory/model/default-logging-config.mjs +7 -0
  46. package/esm2020/active-directory/model/logging-config.mjs +2 -0
  47. package/esm2020/active-directory/model/service-config.mjs +3 -0
  48. package/esm2020/active-directory/model/user-or-group.mjs +2 -0
  49. package/esm2020/active-directory/model/user.mjs +2 -0
  50. package/esm2020/active-directory/public_api.mjs +9 -0
  51. package/esm2020/active-directory/services/active-directory.service.mjs +89 -0
  52. package/esm2020/authentication/authentication.module.mjs +77 -0
  53. package/esm2020/authentication/cleavelandprice-ngx-lib-authentication.mjs +5 -0
  54. package/esm2020/authentication/components/login/login.component.mjs +39 -0
  55. package/esm2020/authentication/components/login-form/login-form.component.mjs +60 -0
  56. package/esm2020/authentication/model/authenticated-user.mjs +2 -0
  57. package/esm2020/authentication/model/authentication-request.mjs +2 -0
  58. package/esm2020/authentication/model/authentication-token.mjs +2 -0
  59. package/esm2020/authentication/model/default-config.mjs +4 -0
  60. package/esm2020/authentication/model/login-form-data.mjs +2 -0
  61. package/esm2020/authentication/model/service-config.mjs +3 -0
  62. package/esm2020/authentication/public_api.mjs +11 -0
  63. package/esm2020/authentication/services/authentication.service.mjs +120 -0
  64. package/esm2020/cleavelandprice-ngx-lib.mjs +1 -1
  65. package/esm2020/dialog/cleavelandprice-ngx-lib-dialog.mjs +5 -0
  66. package/esm2020/dialog/components/base/base.component.mjs +84 -0
  67. package/esm2020/dialog/components/confirmation/confirmation.component.mjs +23 -0
  68. package/esm2020/dialog/components/input/input.component.mjs +23 -0
  69. package/esm2020/dialog/components/message/message.component.mjs +23 -0
  70. package/esm2020/dialog/dialog.module.mjs +63 -0
  71. package/esm2020/dialog/model/confirmation-dialog-mode.mjs +8 -0
  72. package/esm2020/dialog/model/dialog-base-data.mjs +2 -0
  73. package/esm2020/dialog/model/dialog-type.mjs +7 -0
  74. package/esm2020/dialog/public_api.mjs +9 -0
  75. package/esm2020/lib/ngx-lib.module.mjs +16 -0
  76. package/esm2020/public_api.mjs +5 -8
  77. package/esm2020/sharepoint/cleavelandprice-ngx-lib-sharepoint.mjs +5 -0
  78. package/esm2020/sharepoint/model/base-item.mjs +2 -0
  79. package/esm2020/sharepoint/model/base-request-credential.mjs +2 -0
  80. package/esm2020/sharepoint/model/base-request.mjs +2 -0
  81. package/esm2020/sharepoint/model/cache-object.mjs +3 -0
  82. package/esm2020/sharepoint/model/caching-config.mjs +2 -0
  83. package/esm2020/sharepoint/model/default-config.mjs +25 -0
  84. package/esm2020/sharepoint/model/file-request.mjs +2 -0
  85. package/esm2020/sharepoint/model/folder-request.mjs +2 -0
  86. package/esm2020/sharepoint/model/list-item.mjs +2 -0
  87. package/esm2020/sharepoint/model/list-items-request.mjs +2 -0
  88. package/esm2020/sharepoint/model/logging-config.mjs +2 -0
  89. package/esm2020/sharepoint/model/photo-item.mjs +2 -0
  90. package/esm2020/sharepoint/model/service-config.mjs +3 -0
  91. package/esm2020/sharepoint/model/uri-request.mjs +2 -0
  92. package/esm2020/sharepoint/model/user-request.mjs +2 -0
  93. package/esm2020/sharepoint/model/user.mjs +2 -0
  94. package/esm2020/sharepoint/public_api.mjs +18 -0
  95. package/esm2020/sharepoint/services/sharepoint.service.mjs +152 -0
  96. package/esm2020/sharepoint/sharepoint.module.mjs +38 -0
  97. package/esm2020/upload/cleavelandprice-ngx-lib-upload.mjs +5 -0
  98. package/esm2020/upload/components/upload/upload.component.mjs +33 -0
  99. package/esm2020/upload/components/upload-dialog/upload-dialog.component.mjs +92 -0
  100. package/esm2020/upload/model/database-file-info.mjs +2 -0
  101. package/esm2020/upload/model/file-upload-request.mjs +2 -0
  102. package/esm2020/upload/model/filesystem-file-info.mjs +2 -0
  103. package/esm2020/upload/model/service-config.mjs +3 -0
  104. package/esm2020/upload/public_api.mjs +9 -0
  105. package/esm2020/upload/services/upload.service.mjs +93 -0
  106. package/esm2020/upload/upload.module.mjs +61 -0
  107. package/esm2020/url-utilities/cleavelandprice-ngx-lib-url-utilities.mjs +5 -0
  108. package/esm2020/url-utilities/pipes/safe-resource-url.pipe.mjs +20 -0
  109. package/esm2020/url-utilities/pipes/safe-url.pipe.mjs +20 -0
  110. package/esm2020/url-utilities/pipes/uri-scheme.pipe.mjs +105 -0
  111. package/esm2020/url-utilities/public_api.mjs +5 -0
  112. package/esm2020/url-utilities/url-utilities.module.mjs +34 -0
  113. package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs +156 -0
  114. package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -0
  115. package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs +299 -0
  116. package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs.map +1 -0
  117. package/fesm2015/cleavelandprice-ngx-lib-dialog.mjs +218 -0
  118. package/fesm2015/cleavelandprice-ngx-lib-dialog.mjs.map +1 -0
  119. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs +233 -0
  120. package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -0
  121. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs +280 -0
  122. package/fesm2015/cleavelandprice-ngx-lib-upload.mjs.map +1 -0
  123. package/fesm2015/cleavelandprice-ngx-lib-url-utilities.mjs +176 -0
  124. package/fesm2015/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -0
  125. package/fesm2015/cleavelandprice-ngx-lib.mjs +11 -1398
  126. package/fesm2015/cleavelandprice-ngx-lib.mjs.map +1 -1
  127. package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs +147 -0
  128. package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -0
  129. package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs +290 -0
  130. package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs.map +1 -0
  131. package/fesm2020/cleavelandprice-ngx-lib-dialog.mjs +212 -0
  132. package/fesm2020/cleavelandprice-ngx-lib-dialog.mjs.map +1 -0
  133. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs +219 -0
  134. package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -0
  135. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs +273 -0
  136. package/fesm2020/cleavelandprice-ngx-lib-upload.mjs.map +1 -0
  137. package/fesm2020/cleavelandprice-ngx-lib-url-utilities.mjs +176 -0
  138. package/fesm2020/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -0
  139. package/fesm2020/cleavelandprice-ngx-lib.mjs +11 -1370
  140. package/fesm2020/cleavelandprice-ngx-lib.mjs.map +1 -1
  141. package/lib/ngx-lib.module.d.ts +6 -0
  142. package/package.json +57 -12
  143. package/public_api.d.ts +1 -7
  144. package/sharepoint/index.d.ts +5 -0
  145. package/sharepoint/model/base-item.d.ts +4 -0
  146. package/sharepoint/model/base-request-credential.d.ts +4 -0
  147. package/sharepoint/model/base-request.d.ts +8 -0
  148. package/sharepoint/model/cache-object.d.ts +4 -0
  149. package/sharepoint/model/caching-config.d.ts +4 -0
  150. package/sharepoint/model/default-config.d.ts +2 -0
  151. package/sharepoint/model/file-request.d.ts +4 -0
  152. package/sharepoint/model/folder-request.d.ts +4 -0
  153. package/sharepoint/model/list-item.d.ts +10 -0
  154. package/sharepoint/model/list-items-request.d.ts +5 -0
  155. package/sharepoint/model/logging-config.d.ts +6 -0
  156. package/sharepoint/model/photo-item.d.ts +11 -0
  157. package/sharepoint/model/service-config.d.ts +16 -0
  158. package/sharepoint/model/uri-request.d.ts +4 -0
  159. package/sharepoint/model/user-request.d.ts +4 -0
  160. package/sharepoint/model/user.d.ts +12 -0
  161. package/sharepoint/public_api.d.ts +16 -0
  162. package/sharepoint/services/sharepoint.service.d.ts +25 -0
  163. package/sharepoint/sharepoint.module.d.ts +11 -0
  164. package/{src/file-upload → upload}/components/upload/upload.component.d.ts +0 -0
  165. package/{src/file-upload → upload}/components/upload-dialog/upload-dialog.component.d.ts +3 -3
  166. package/upload/index.d.ts +5 -0
  167. package/{src/file-upload → upload}/model/database-file-info.d.ts +0 -0
  168. package/{src/file-upload → upload}/model/file-upload-request.d.ts +0 -0
  169. package/{src/file-upload → upload}/model/filesystem-file-info.d.ts +0 -0
  170. package/{src/file-upload/model/upload.service.config.d.ts → upload/model/service-config.d.ts} +1 -1
  171. package/upload/public_api.d.ts +8 -0
  172. package/{src/file-upload → upload}/services/upload.service.d.ts +6 -8
  173. package/upload/upload.module.d.ts +16 -0
  174. package/url-utilities/index.d.ts +5 -0
  175. package/url-utilities/pipes/safe-resource-url.pipe.d.ts +10 -0
  176. package/{src/url → url-utilities}/pipes/safe-url.pipe.d.ts +0 -0
  177. package/{src/url → url-utilities}/pipes/uri-scheme.pipe.d.ts +1 -1
  178. package/url-utilities/public_api.d.ts +4 -0
  179. package/url-utilities/url-utilities.module.d.ts +10 -0
  180. package/esm2020/src/authentication/authentication.module.mjs +0 -112
  181. package/esm2020/src/authentication/components/login/login.component.mjs +0 -40
  182. package/esm2020/src/authentication/components/login-form/login-form.component.mjs +0 -45
  183. package/esm2020/src/authentication/model/authentication-token.mjs +0 -2
  184. package/esm2020/src/authentication/model/authentication.service.config.mjs +0 -3
  185. package/esm2020/src/authentication/services/authentication.service.mjs +0 -138
  186. package/esm2020/src/dialog/components/_dialog/dialog.component.mjs +0 -83
  187. package/esm2020/src/dialog/components/confirmation-dialog/confirmation-dialog.component.mjs +0 -21
  188. package/esm2020/src/dialog/components/input-dialog/input-dialog.component.mjs +0 -21
  189. package/esm2020/src/dialog/components/message-dialog/message-dialog.component.mjs +0 -21
  190. package/esm2020/src/dialog/dialog.module.mjs +0 -74
  191. package/esm2020/src/dialog/model/confirmation-dialog-mode.enum.mjs +0 -8
  192. package/esm2020/src/email/email.module.mjs +0 -47
  193. package/esm2020/src/email/model/email-dto.mjs +0 -2
  194. package/esm2020/src/email/model/email-sender.mjs +0 -2
  195. package/esm2020/src/email/model/email.mjs +0 -2
  196. package/esm2020/src/email/model/email.service.config.mjs +0 -3
  197. package/esm2020/src/email/services/email.service.mjs +0 -31
  198. package/esm2020/src/employee/employee.module.mjs +0 -91
  199. package/esm2020/src/employee/model/employee.mjs +0 -2
  200. package/esm2020/src/employee/model/employee.service.config.mjs +0 -3
  201. package/esm2020/src/employee/pipes/departments.pipe.mjs +0 -24
  202. package/esm2020/src/employee/pipes/employee-by-dn.pipe.mjs +0 -17
  203. package/esm2020/src/employee/pipes/employee-photo-url.pipe.mjs +0 -27
  204. package/esm2020/src/employee/pipes/employees-with-property-value.pipe.mjs +0 -17
  205. package/esm2020/src/employee/pipes/filter-employees.pipe.mjs +0 -22
  206. package/esm2020/src/employee/pipes/is-member-of.pipe.mjs +0 -17
  207. package/esm2020/src/employee/pipes/sort-employees.pipe.mjs +0 -44
  208. package/esm2020/src/employee/services/employee.service.mjs +0 -41
  209. package/esm2020/src/file-upload/components/upload/upload.component.mjs +0 -34
  210. package/esm2020/src/file-upload/components/upload-dialog/upload-dialog.component.mjs +0 -102
  211. package/esm2020/src/file-upload/model/database-file-info.mjs +0 -2
  212. package/esm2020/src/file-upload/model/file-upload-request.mjs +0 -2
  213. package/esm2020/src/file-upload/model/filesystem-file-info.mjs +0 -2
  214. package/esm2020/src/file-upload/model/upload.service.config.mjs +0 -3
  215. package/esm2020/src/file-upload/services/upload.service.mjs +0 -93
  216. package/esm2020/src/file-upload/upload.module.mjs +0 -93
  217. package/esm2020/src/sharepoint/model/sharepoint-calendar-event.mjs +0 -2
  218. package/esm2020/src/sharepoint/model/sharepoint-customer-visit.mjs +0 -2
  219. package/esm2020/src/sharepoint/model/sharepoint-employee-picture.mjs +0 -2
  220. package/esm2020/src/sharepoint/model/sharepoint-list-item.mjs +0 -2
  221. package/esm2020/src/sharepoint/model/sharepoint-list.mjs +0 -2
  222. package/esm2020/src/sharepoint/model/sharepoint-person.mjs +0 -2
  223. package/esm2020/src/sharepoint/model/sharepoint-picture.mjs +0 -2
  224. package/esm2020/src/sharepoint/model/sharepoint.service.config.mjs +0 -3
  225. package/esm2020/src/sharepoint/pipes/sharepoint-photo-url.pipe.mjs +0 -16
  226. package/esm2020/src/sharepoint/pipes/sharepoint-url.pipe.mjs +0 -16
  227. package/esm2020/src/sharepoint/services/sharepoint.service.mjs +0 -77
  228. package/esm2020/src/sharepoint/sharepoint.module.mjs +0 -69
  229. package/esm2020/src/url/pipes/safe-url.pipe.mjs +0 -21
  230. package/esm2020/src/url/pipes/uri-scheme.pipe.mjs +0 -103
  231. package/esm2020/src/url/url.module.mjs +0 -38
  232. package/src/authentication/authentication.module.d.ts +0 -31
  233. package/src/authentication/components/login/login.component.d.ts +0 -15
  234. package/src/authentication/components/login-form/login-form.component.d.ts +0 -20
  235. package/src/authentication/model/authentication.service.config.d.ts +0 -3
  236. package/src/authentication/services/authentication.service.d.ts +0 -68
  237. package/src/dialog/components/_dialog/dialog.component.d.ts +0 -22
  238. package/src/dialog/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -9
  239. package/src/dialog/components/input-dialog/input-dialog.component.d.ts +0 -9
  240. package/src/dialog/components/message-dialog/message-dialog.component.d.ts +0 -9
  241. package/src/dialog/dialog.module.d.ts +0 -20
  242. package/src/email/email.module.d.ts +0 -14
  243. package/src/email/model/email-dto.d.ts +0 -13
  244. package/src/email/model/email-sender.d.ts +0 -6
  245. package/src/email/model/email.d.ts +0 -9
  246. package/src/email/model/email.service.config.d.ts +0 -7
  247. package/src/email/services/email.service.d.ts +0 -13
  248. package/src/employee/employee.module.d.ts +0 -28
  249. package/src/employee/model/employee.d.ts +0 -35
  250. package/src/employee/model/employee.service.config.d.ts +0 -3
  251. package/src/employee/pipes/departments.pipe.d.ts +0 -8
  252. package/src/employee/pipes/employee-by-dn.pipe.d.ts +0 -8
  253. package/src/employee/pipes/employee-photo-url.pipe.d.ts +0 -9
  254. package/src/employee/pipes/employees-with-property-value.pipe.d.ts +0 -8
  255. package/src/employee/pipes/filter-employees.pipe.d.ts +0 -8
  256. package/src/employee/pipes/is-member-of.pipe.d.ts +0 -8
  257. package/src/employee/pipes/sort-employees.pipe.d.ts +0 -9
  258. package/src/employee/services/employee.service.d.ts +0 -15
  259. package/src/file-upload/upload.module.d.ts +0 -26
  260. package/src/sharepoint/model/sharepoint-calendar-event.d.ts +0 -6
  261. package/src/sharepoint/model/sharepoint-customer-visit.d.ts +0 -8
  262. package/src/sharepoint/model/sharepoint-employee-picture.d.ts +0 -5
  263. package/src/sharepoint/model/sharepoint-list-item.d.ts +0 -11
  264. package/src/sharepoint/model/sharepoint-list.d.ts +0 -8
  265. package/src/sharepoint/model/sharepoint-person.d.ts +0 -9
  266. package/src/sharepoint/model/sharepoint-picture.d.ts +0 -14
  267. package/src/sharepoint/model/sharepoint.service.config.d.ts +0 -5
  268. package/src/sharepoint/pipes/sharepoint-photo-url.pipe.d.ts +0 -8
  269. package/src/sharepoint/pipes/sharepoint-url.pipe.d.ts +0 -7
  270. package/src/sharepoint/services/sharepoint.service.d.ts +0 -23
  271. package/src/sharepoint/sharepoint.module.d.ts +0 -24
  272. package/src/url/url.module.d.ts +0 -11
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-dialog.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/dialog/src/model/confirmation-dialog-mode.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/model/dialog-type.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/base/base.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/base/base.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/confirmation/confirmation.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/confirmation/confirmation.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/input/input.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/input/input.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/message/message.component.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/components/message/message.component.html","../../../../projects/cleavelandprice/ngx-lib/dialog/src/dialog.module.ts","../../../../projects/cleavelandprice/ngx-lib/dialog/src/cleavelandprice-ngx-lib-dialog.ts"],"sourcesContent":["export enum ConfirmationDialogMode {\r\n OkCancel,\r\n YesNo,\r\n TrueFalse,\r\n Custom\r\n}","export enum DialogType {\r\n Confirmation,\r\n Input,\r\n Message\r\n}","import { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { ConfirmationDialogMode } from '../../model/confirmation-dialog-mode';\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\n\n@Component({\n selector: 'dialog-base',\n templateUrl: './base.component.html',\n styleUrls: ['./base.component.css']\n})\nexport class BaseComponent {\n // This is so that DialogType can be publish accessible from the HTML template\n DialogType = DialogType;\n @Input() dialogType = DialogType.Message;\n @Input() data!: DialogBaseData;\n @Output() closed = new EventEmitter<any>();\n\n ConfirmationDialogMode = ConfirmationDialogMode;\n\n // Form values\n userInput!: string;\n checkboxValue!: boolean;\n\n get customTrueText(): string | null {\n return this.data.customTrueFalseText ?\n this.data.customTrueFalseText[0] :\n null;\n }\n\n get customFalseText(): string | null {\n return this.data.customTrueFalseText ?\n this.data.customTrueFalseText[1] :\n null;\n }\n\n close(): void {\n let data: any;\n\n switch (this.dialogType) {\n case DialogType.Message:\n data = this.data.checkboxMessage ?\n {\n checkbox: this.checkboxValue || false\n } :\n null;\n break;\n case DialogType.Input:\n data = this.data.checkboxMessage ?\n {\n response: this.userInput,\n checkbox: this.checkboxValue || false\n } :\n this.userInput;\n break;\n case DialogType.Confirmation:\n data = this.data.checkboxMessage ?\n {\n response: true,\n checkbox: this.checkboxValue || false\n } :\n true;\n break;\n }\n\n this.closed.emit(data);\n }\n\n cancel(): void {\n let data: any;\n\n if (this.dialogType === DialogType.Confirmation) {\n data = this.data.checkboxMessage ?\n {\n response: false,\n checkbox: this.checkboxValue || false\n } :\n false;\n }\n\n this.closed.emit(data);\n }\n}\n","<h2 *ngIf=\"data?.title\" mat-dialog-title [innerHTML]=\"data.title\"></h2>\n\n<mat-dialog-content>\n <div *ngIf=\"data?.message\" [innerHTML]=\"data.message\"></div>\n\n <mat-form-field *ngIf=\"dialogType === DialogType.Input\">\n <textarea matInput [placeholder]=\"data.placeholder ?? ''\" [(ngModel)]=\"userInput\"></textarea>\n </mat-form-field>\n\n <div id=\"checkbox\" *ngIf=\"data?.checkboxMessage\">\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\n <span [innerHTML]=\"data.checkboxMessage\"></span>\n </mat-checkbox>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions>\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType === DialogType.Input && !userInput\">\n <span [ngSwitch]=\"data.mode\">\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">Yes</span>\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">True</span>\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueText }}</span>\n <span *ngSwitchDefault>OK</span>\n </span>\n </button>\n <button *ngIf=\"dialogType !== DialogType.Message\" mat-raised-button (click)=\"cancel()\">\n <span [ngSwitch]=\"data.mode\">\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">No</span>\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">False</span>\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customFalseText }}</span>\n <span *ngSwitchDefault>Cancel</span>\n </span>\n </button>\n</mat-dialog-actions>","import { Component, Inject } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\n\n@Component({\n selector: 'dialog-confirmation',\n templateUrl: './confirmation.component.html',\n styleUrls: ['./confirmation.component.css']\n})\nexport class ConfirmationComponent {\n dialogType = DialogType.Confirmation;\n\n constructor(@Inject(MAT_DIALOG_DATA) public data: DialogBaseData,\n public dialogRef: MatDialogRef<ConfirmationComponent>) {\n }\n}\n","<dialog-base\n [data]=\"data\"\n [dialogType]=\"dialogType\"\n (closed)=\"dialogRef.close($event)\">\n</dialog-base>","import { Component, Inject } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\n\n@Component({\n selector: 'dialog-input',\n templateUrl: './input.component.html',\n styleUrls: ['./input.component.css']\n})\nexport class InputComponent {\n dialogType = DialogType.Input;\n\n constructor(@Inject(MAT_DIALOG_DATA) public data: DialogBaseData,\n public dialogRef: MatDialogRef<InputComponent>) {\n }\n}\n","<dialog-base\n [data]=\"data\"\n [dialogType]=\"dialogType\"\n (closed)=\"dialogRef.close($event)\">\n</dialog-base>","import { Component, Inject } from '@angular/core';\nimport { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';\nimport { DialogBaseData } from '../../model/dialog-base-data';\nimport { DialogType } from '../../model/dialog-type';\n\n@Component({\n selector: 'dialog-message',\n templateUrl: './message.component.html',\n styleUrls: ['./message.component.css']\n})\nexport class MessageComponent {\n dialogType = DialogType.Message;\n\n constructor(@Inject(MAT_DIALOG_DATA) public data: DialogBaseData,\n public dialogRef: MatDialogRef<MessageComponent>) {\n }\n}\n","<dialog-base\n [data]=\"data\"\n [dialogType]=\"dialogType\"\n (closed)=\"dialogRef.close($event)\">\n</dialog-base>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\n\nimport { BaseComponent } from './components/base/base.component';\nimport { ConfirmationComponent } from './components/confirmation/confirmation.component';\nimport { InputComponent } from './components/input/input.component';\nimport { MessageComponent } from './components/message/message.component';\n\n@NgModule({\n declarations: [\n BaseComponent,\n ConfirmationComponent,\n InputComponent,\n MessageComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n\n MatButtonModule,\n MatCheckboxModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule\n ],\n exports: [\n BaseComponent,\n ConfirmationComponent,\n InputComponent,\n MessageComponent\n ]\n})\nexport class DialogModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i5","i1","i2.BaseComponent"],"mappings":";;;;;;;;;;;;;;;;;IAAY,uBAKX;AALD,CAAA,UAAY,sBAAsB,EAAA;AAC9B,IAAA,sBAAA,CAAA,sBAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,sBAAA,CAAA,sBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAK,CAAA;AACL,IAAA,sBAAA,CAAA,sBAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACT,IAAA,sBAAA,CAAA,sBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACV,CAAC,EALW,sBAAsB,KAAtB,sBAAsB,GAKjC,EAAA,CAAA,CAAA;;ICLW,WAIX;AAJD,CAAA,UAAY,UAAU,EAAA;AAClB,IAAA,UAAA,CAAA,UAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAY,CAAA;AACZ,IAAA,UAAA,CAAA,UAAA,CAA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A,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAhBrB,YAAY;QACZ,WAAW;QAEX,eAAe;QACf,iBAAiB;QACjB,eAAe;QACf,kBAAkB;QAClB,cAAc,CAAA,EAAA,CAAA,CAAA;2FASL,YAAY,EAAA,UAAA,EAAA,CAAA;kBAxBxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,aAAa;wBACb,qBAAqB;wBACrB,cAAc;wBACd,gBAAgB;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBAEX,eAAe;wBACf,iBAAiB;wBACjB,eAAe;wBACf,kBAAkB;wBAClB,cAAc;AACf,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,aAAa;wBACb,qBAAqB;wBACrB,cAAc;wBACd,gBAAgB;AACjB,qBAAA;AACF,iBAAA,CAAA;;;ACtCD;;AAEG;;;;"}
@@ -0,0 +1,219 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Optional, NgModule, SkipSelf } from '@angular/core';
3
+ import { of } from 'rxjs';
4
+ import moment from 'moment';
5
+ import * as i2 from '@angular/common/http';
6
+ import { CommonModule } from '@angular/common';
7
+
8
+ class ServiceConfig {
9
+ }
10
+
11
+ const defaultConfig = {
12
+ apiUrl: 'http://utilityapi',
13
+ usersEndpoint: '/sharepoint/users',
14
+ listItemsEndpoint: '/sharepoint/listitems',
15
+ username: 'viewer',
16
+ password: 'viewer',
17
+ photos: {
18
+ site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',
19
+ list: 'Employee Thumbnail Photos',
20
+ additionalPropertiesToRetrieve: [
21
+ 'EncodedAbsUrl'
22
+ ]
23
+ },
24
+ caching: {
25
+ enabled: true,
26
+ lifeMinutes: 720
27
+ },
28
+ logging: {
29
+ dataCached: true,
30
+ cachedDataReturned: true,
31
+ freshDataReturned: true,
32
+ cacheCleared: true
33
+ }
34
+ };
35
+
36
+ //#region Imports
37
+ //#endregion
38
+ class SharepointService {
39
+ //#endregion
40
+ //#region Initialization
41
+ // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.
42
+ constructor(config, http) {
43
+ this.config = config;
44
+ this.http = http;
45
+ this.cache = null;
46
+ this.defaultCacheLifeMinutes = 720;
47
+ this.config = this.config ?? defaultConfig;
48
+ this.configureCaching();
49
+ this.configureLogging();
50
+ }
51
+ //#region Utilities
52
+ cacheExpired(cache) {
53
+ if (!cache) {
54
+ return true;
55
+ }
56
+ const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;
57
+ const expiration = moment(cache.lastUpdate)
58
+ .add(lifeMinutes, 'minutes');
59
+ return moment().isAfter(expiration);
60
+ }
61
+ configureCaching() {
62
+ // If caching config is missing entirely, give it a default
63
+ this.config.caching = this.config.caching ?? {
64
+ enabled: false,
65
+ lifeMinutes: this.defaultCacheLifeMinutes
66
+ };
67
+ this.cache = {
68
+ photos: null,
69
+ users: null
70
+ };
71
+ }
72
+ configureLogging() {
73
+ // If logging config is missing entirely, give it a default
74
+ this.config.logging = this.config.logging ?? {
75
+ dataCached: false,
76
+ cachedDataReturned: false,
77
+ freshDataReturned: false,
78
+ cacheCleared: false
79
+ };
80
+ }
81
+ //#endregion
82
+ getListItems(request) {
83
+ const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;
84
+ const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;
85
+ return this.http.post(`${apiUrl}${endpoint}`, request);
86
+ }
87
+ getPhotos() {
88
+ const request = {
89
+ username: this.config?.username ?? defaultConfig.username,
90
+ password: this.config?.password ?? defaultConfig.password,
91
+ site: this.config?.photos.site ?? defaultConfig.photos.site,
92
+ list: this.config?.photos.list ?? defaultConfig.photos.list,
93
+ additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve
94
+ };
95
+ const observable$ = this.getListItems(request);
96
+ if (this.config.caching?.enabled) {
97
+ if (this.cacheExpired(this.cache?.photos)) {
98
+ // Get the data and cache it
99
+ observable$.subscribe(data => {
100
+ this.cache.photos = {
101
+ data,
102
+ lastUpdate: moment()
103
+ };
104
+ if (this.config.logging?.dataCached) {
105
+ const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;
106
+ console.log(`Photos cached for ${lifeMinutes} minutes`);
107
+ }
108
+ });
109
+ }
110
+ else {
111
+ // Cache exists and hasn't expired yet
112
+ if (this.config.logging?.cachedDataReturned) {
113
+ console.log('Returning cached photos');
114
+ }
115
+ return of(this.cache.photos.data);
116
+ }
117
+ }
118
+ // Cache is either disabled or expired, return data from API
119
+ if (this.config.logging?.freshDataReturned) {
120
+ console.log('Returning fresh photos');
121
+ }
122
+ return observable$;
123
+ }
124
+ getUsers(request, id) {
125
+ const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;
126
+ const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;
127
+ const observable$ = this.http.post(`${apiUrl}${endpoint}/${id ?? ''}`, request);
128
+ //#region Single user
129
+ if (id) {
130
+ return observable$;
131
+ }
132
+ //#endregion
133
+ //#region Multiple users
134
+ if (this.config.caching?.enabled) {
135
+ if (this.cacheExpired(this.cache.users)) {
136
+ // Get the data and cache it
137
+ observable$.subscribe(data => {
138
+ this.cache.users = {
139
+ data: data,
140
+ lastUpdate: moment()
141
+ };
142
+ if (this.config.logging?.dataCached) {
143
+ const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;
144
+ console.log(`Users cached for ${lifeMinutes} minutes`);
145
+ }
146
+ });
147
+ }
148
+ else {
149
+ // Cache exists and hasn't expired yet
150
+ if (this.config.logging?.cachedDataReturned) {
151
+ console.log('Returning cached users');
152
+ }
153
+ return of(this.cache.users.data);
154
+ }
155
+ }
156
+ // Cache is either disabled or expired, return data from API
157
+ if (this.config.logging?.freshDataReturned) {
158
+ console.log('Returning fresh users');
159
+ }
160
+ return observable$;
161
+ //#endregion
162
+ }
163
+ clearCache() {
164
+ this.cache = null;
165
+ if (this.config.logging?.cacheCleared) {
166
+ console.log('Cache cleared');
167
+ }
168
+ }
169
+ }
170
+ SharepointService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SharepointService, deps: [{ token: ServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
171
+ SharepointService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SharepointService, providedIn: 'root' });
172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SharepointService, decorators: [{
173
+ type: Injectable,
174
+ args: [{
175
+ providedIn: 'root'
176
+ }]
177
+ }], ctorParameters: function () { return [{ type: ServiceConfig, decorators: [{
178
+ type: Optional
179
+ }] }, { type: i2.HttpClient }]; } });
180
+
181
+ class SharepointModule {
182
+ constructor(parentModule) {
183
+ if (parentModule) {
184
+ throw new Error('SharepointModule is already loaded. Import it in the AppModule only');
185
+ }
186
+ }
187
+ static forRoot(config) {
188
+ return {
189
+ ngModule: SharepointModule,
190
+ providers: [
191
+ SharepointService,
192
+ { provide: ServiceConfig, useValue: config }
193
+ ]
194
+ };
195
+ }
196
+ }
197
+ SharepointModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SharepointModule, deps: [{ token: SharepointModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
198
+ SharepointModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: SharepointModule, imports: [CommonModule] });
199
+ SharepointModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SharepointModule, imports: [CommonModule] });
200
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SharepointModule, decorators: [{
201
+ type: NgModule,
202
+ args: [{
203
+ declarations: [],
204
+ imports: [
205
+ CommonModule
206
+ ]
207
+ }]
208
+ }], ctorParameters: function () { return [{ type: SharepointModule, decorators: [{
209
+ type: Optional
210
+ }, {
211
+ type: SkipSelf
212
+ }] }]; } });
213
+
214
+ /**
215
+ * Generated bundle index. Do not edit.
216
+ */
217
+
218
+ export { ServiceConfig, SharepointModule, SharepointService };
219
+ //# sourceMappingURL=cleavelandprice-ngx-lib-sharepoint.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: 'http://utilityapi',\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","//#region Imports\nimport { Injectable, Optional } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, of } from 'rxjs';\n\nimport { defaultConfig } from '../model/default-config';\n\nimport { CacheObject } from '../model/cache-object';\nimport { ListItem } from '../model/list-item';\nimport { ListItemsRequest } from '../model/list-items-request';\nimport { PhotoItem } from '../model/photo-item';\nimport { ServiceConfig } from '../model/service-config';\nimport { UserRequest } from '../model/user-request';\nimport { User } from '../model/user';\n\nimport moment from 'moment';\n//#endregion\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SharepointService {\n private cache: {\n users: CacheObject<User> | null,\n photos: CacheObject<PhotoItem> | null\n } | null = null;\n\n private defaultCacheLifeMinutes = 720;\n\n //#region Utilities\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\n if (!cache) {\n return true;\n }\n\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n const expiration = moment(cache.lastUpdate)\n .add(lifeMinutes, 'minutes');\n\n return moment().isAfter(expiration);\n }\n //#endregion\n\n //#region Initialization\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\n constructor(@Optional() private config: ServiceConfig,\n private http: HttpClient) {\n\n this.config = this.config ?? defaultConfig;\n\n this.configureCaching();\n this.configureLogging();\n }\n\n private configureCaching(): void {\n // If caching config is missing entirely, give it a default\n this.config.caching = this.config.caching ?? {\n enabled: false,\n lifeMinutes: this.defaultCacheLifeMinutes\n };\n\n this.cache = {\n photos: null,\n users: null\n };\n }\n\n private configureLogging(): void {\n // If logging config is missing entirely, give it a default\n this.config.logging = this.config.logging ?? {\n dataCached: false,\n cachedDataReturned: false,\n freshDataReturned: false,\n cacheCleared: false\n }\n }\n //#endregion\n\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\n\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\n }\n\n getPhotos(): Observable<PhotoItem[]> {\n const request: ListItemsRequest = {\n username: this.config?.username ?? defaultConfig.username,\n password: this.config?.password ?? defaultConfig.password,\n site: this.config?.photos.site ?? defaultConfig.photos.site,\n list: this.config?.photos.list ?? defaultConfig.photos.list,\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\n };\n\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\n\n if (this.config.caching?.enabled) {\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\n // Get the data and cache it\n observable$.subscribe(data => {\n this.cache!.photos = {\n data,\n lastUpdate: moment()\n };\n\n if (this.config.logging?.dataCached) {\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n console.log(`Photos cached for ${lifeMinutes} minutes`);\n }\n });\n } else {\n // Cache exists and hasn't expired yet\n if (this.config.logging?.cachedDataReturned) {\n console.log('Returning cached photos');\n }\n\n return of(this.cache!.photos!.data);\n }\n }\n\n // Cache is either disabled or expired, return data from API\n if (this.config.logging?.freshDataReturned) {\n console.log('Returning fresh photos');\n }\n\n return observable$;\n }\n\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\n \n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\n\n //#region Single user\n if (id) {\n return observable$;\n }\n //#endregion\n\n //#region Multiple users\n if (this.config.caching?.enabled) {\n if (this.cacheExpired<User>(this.cache!.users!)) {\n // Get the data and cache it\n observable$.subscribe(data => {\n this.cache!.users = {\n data: data as User[],\n lastUpdate: moment()\n };\n\n if (this.config.logging?.dataCached) {\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\n console.log(`Users cached for ${lifeMinutes} minutes`);\n }\n });\n } else {\n // Cache exists and hasn't expired yet\n if (this.config.logging?.cachedDataReturned) {\n console.log('Returning cached users');\n }\n\n return of(this.cache!.users!.data);\n }\n }\n\n // Cache is either disabled or expired, return data from API\n if (this.config.logging?.freshDataReturned) {\n console.log('Returning fresh users');\n }\n\n return observable$;\n //#endregion\n }\n\n clearCache(): void {\n this.cache = null;\n\n if (this.config.logging?.cacheCleared) {\n console.log('Cache cleared');\n }\n }\n}","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ServiceConfig } from './model/service-config';\nimport { SharepointService } from './services/sharepoint.service';\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule\n ]\n})\nexport class SharepointModule {\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharepointModule> {\n return {\n ngModule: SharepointModule,\n providers: [\n SharepointService,\n { provide: ServiceConfig, useValue: config }\n ]\n };\n }\n\n constructor( @Optional() @SkipSelf() parentModule: SharepointModule) {\n if (parentModule) {\n throw new Error(\n 'SharepointModule is already loaded. Import it in the AppModule only');\n }\n }\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.ServiceConfig"],"mappings":";;;;;;;MAGa,aAAa,CAAA;AAazB;;ACbM,MAAM,aAAa,GAAkB;AACxC,IAAA,MAAM,EAAE,mBAAmB;AAC3B,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,iBAAiB,EAAE,uBAAuB;AAC1C,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE;AACJ,QAAA,IAAI,EAAE,uDAAuD;AAC7D,QAAA,I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AS,EAAE;gBACT,iBAAiB;AACjB,gBAAA,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC7C,aAAA;SACF,CAAC;KACH;;AATU,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,kBAWwB,gBAAgB,EAAA,QAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAXxD,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHzB,YAAY,CAAA,EAAA,CAAA,CAAA;AAGH,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAGH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACF,iBAAA,CAAA;0DAYoD,gBAAgB,EAAA,UAAA,EAAA,CAAA;0BAArD,QAAQ;;0BAAI,QAAQ;;;ACtBpC;;AAEG;;;;"}
@@ -0,0 +1,273 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Optional, Component, ViewChild, EventEmitter, Output, NgModule, SkipSelf } from '@angular/core';
3
+ import { Subject, forkJoin } from 'rxjs';
4
+ import * as i1$1 from '@angular/material/dialog';
5
+ import { MatDialogModule } from '@angular/material/dialog';
6
+ import * as i1 from '@angular/common/http';
7
+ import { HttpRequest, HttpHeaders, HttpEventType, HttpResponse } from '@angular/common/http';
8
+ import * as i3 from '@angular/common';
9
+ import { CommonModule } from '@angular/common';
10
+ import * as i4 from '@angular/material/list';
11
+ import { MatListModule } from '@angular/material/list';
12
+ import * as i5 from '@angular/material/core';
13
+ import * as i6 from '@angular/material/progress-bar';
14
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
15
+
16
+ class ServiceConfig {
17
+ }
18
+
19
+ // https://malcoded.com/posts/angular-file-upload-component-with-express
20
+ class UploadService {
21
+ constructor(http, config) {
22
+ this.http = http;
23
+ this.uploadApiUrl = config.uploadApiUrl;
24
+ this.uploadPath = config.uploadPath || '';
25
+ this.dbAppId = config.dbAppId || '';
26
+ this.externalReferenceId = config.externalReferenceId || '';
27
+ this.comment = config.comment || '';
28
+ // UI configuration
29
+ this.uploadButtonText = config.uploadButtonText ?? '';
30
+ this.uploadDialogTitle = config.uploadDialogTitle ?? '';
31
+ this.uploadDialogAddFilesButtonText = config.uploadDialogAddFilesButtonText ?? '';
32
+ this.uploadDialogCancelButtonText = config.uploadDialogCancelButtonText ?? '';
33
+ this.uploadDialogUploadButtonText = config.uploadDialogUploadButtonText ?? '';
34
+ this.uploadDialogFinishButtonText = config.uploadDialogFinishButtonText ?? '';
35
+ }
36
+ upload(files) {
37
+ // this will be the our resulting map
38
+ const status = {};
39
+ files.forEach(file => {
40
+ // create a new multipart-form for every file
41
+ const formData = new FormData();
42
+ formData.append('file', file, file.name);
43
+ // create a http-post request and pass the form
44
+ // tell it to report the upload progress
45
+ // A 'Destination' header is used to optionally configure the file upload destination (filesystem)
46
+ // A 'DbAppId' header is used to configure the unique identifier of database uploads
47
+ const req = new HttpRequest('POST', this.uploadApiUrl, formData, {
48
+ reportProgress: true,
49
+ responseType: 'blob',
50
+ headers: new HttpHeaders()
51
+ .set('Destination', this.uploadPath)
52
+ .set('DbAppId', this.dbAppId)
53
+ .set('ExternalReferenceId', this.externalReferenceId)
54
+ .set('Comment', this.comment)
55
+ /*headers: this.uploadPath ?
56
+ new HttpHeaders({ 'Destination': this.uploadPath }) :
57
+ this.dbAppId ?
58
+ new HttpHeaders({ 'DbAppId': this.dbAppId }) :
59
+ null*/
60
+ });
61
+ // create a new progress-subject for every file
62
+ const progress = new Subject();
63
+ // send the http-request and subscribe for progress-updates
64
+ this.http.request(req).subscribe(event => {
65
+ if (event.type === HttpEventType.UploadProgress) {
66
+ // calculate the progress percentage
67
+ const percentDone = Math.round(100 * event.loaded / (event.total ?? 1));
68
+ // pass the percentage into the progress-stream
69
+ progress.next(percentDone);
70
+ }
71
+ else if (event instanceof HttpResponse) {
72
+ // Close the progress-stream if we get an answer form the API
73
+ // The upload is complete
74
+ progress.complete();
75
+ }
76
+ });
77
+ // Save every progress-observable in a map of all observables
78
+ status[file.name] = {
79
+ progress: progress.asObservable()
80
+ };
81
+ });
82
+ // return the map of progress.observables
83
+ return status;
84
+ }
85
+ exists(fileName) {
86
+ const query = this.uploadApiUrl.toLowerCase().indexOf('filesystem') === -1 ?
87
+ { name: fileName, dbAppId: this.dbAppId } :
88
+ { name: fileName, destination: this.uploadPath };
89
+ return this.http.post(`${this.uploadApiUrl}/exists`, query);
90
+ }
91
+ download(request) {
92
+ return this.http.post(`${this.uploadApiUrl}/stream`, request, { responseType: 'blob' });
93
+ }
94
+ getUploadInfo(request) {
95
+ return this.http.post(`${this.uploadApiUrl}/info`, request);
96
+ }
97
+ }
98
+ UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadService, deps: [{ token: i1.HttpClient }, { token: ServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
99
+ UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadService });
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadService, decorators: [{
101
+ type: Injectable
102
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: ServiceConfig, decorators: [{
103
+ type: Optional
104
+ }] }]; } });
105
+
106
+ class UploadDialogComponent {
107
+ constructor(dialogRef, uploadService) {
108
+ this.dialogRef = dialogRef;
109
+ this.uploadService = uploadService;
110
+ this.files = new Set();
111
+ this.existingFileConflict = null;
112
+ this.canBeClosed = true;
113
+ this.showCancelButton = true;
114
+ this.uploading = false;
115
+ this.uploadSuccessful = false;
116
+ }
117
+ ngOnInit() {
118
+ this.uploadDialogTitle = this.uploadService.uploadDialogTitle ?? 'Upload Files';
119
+ this.uploadDialogAddFilesButtonText = this.uploadService.uploadDialogAddFilesButtonText ?? 'Add Files';
120
+ this.uploadDialogCancelButtonText = this.uploadService.uploadDialogCancelButtonText ?? 'Cancel';
121
+ this.uploadDialogUploadButtonText = this.uploadService.uploadDialogUploadButtonText ?? 'Upload';
122
+ this.uploadDialogFinishButtonText = this.uploadService.uploadDialogFinishButtonText ?? 'Finish';
123
+ this.primaryButtonText = this.uploadDialogUploadButtonText;
124
+ }
125
+ addFiles() {
126
+ this.file.nativeElement.click();
127
+ }
128
+ onFilesAdded() {
129
+ const files = this.file.nativeElement.files;
130
+ for (const key in files) {
131
+ if (!isNaN(parseInt(key))) {
132
+ // See if the file already exists
133
+ this.uploadService.exists(files[key].name)
134
+ .subscribe(exists => {
135
+ if (exists) {
136
+ this.existingFileConflict = files[key].name;
137
+ }
138
+ if (!exists) {
139
+ this.files.add(files[key]);
140
+ }
141
+ });
142
+ }
143
+ }
144
+ }
145
+ closeDialog() {
146
+ // if everything was uploaded already, just close the dialog
147
+ if (this.uploadSuccessful) {
148
+ return this.dialogRef.close();
149
+ }
150
+ // set the component state to "uploading"
151
+ this.uploading = true;
152
+ // start the upload and save the progress map
153
+ this.progress = this.uploadService.upload(this.files);
154
+ // convert the progress map into an array
155
+ const allProgressObservables = [];
156
+ for (let key in this.progress) {
157
+ allProgressObservables.push(this.progress[key].progress);
158
+ }
159
+ // Adjust the state variables
160
+ // The OK-button should have the text "Finish" now
161
+ this.primaryButtonText = this.uploadDialogFinishButtonText;
162
+ // The dialog should not be closed while uploading
163
+ this.canBeClosed = false;
164
+ this.dialogRef.disableClose = true;
165
+ // Hide the cancel-button
166
+ this.showCancelButton = false;
167
+ // When all progress-observables are completed...
168
+ forkJoin(allProgressObservables).subscribe(end => {
169
+ // ... the dialog can be closed again...
170
+ this.canBeClosed = true;
171
+ this.dialogRef.disableClose = false;
172
+ // ... the upload was successful...
173
+ this.uploadSuccessful = true;
174
+ // ... and the component is no longer uploading
175
+ this.uploading = false;
176
+ });
177
+ }
178
+ }
179
+ UploadDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
180
+ UploadDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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 />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\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: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i4.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i4.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i5.MatLine, selector: "[mat-line], [matLine]" }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }] });
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadDialogComponent, decorators: [{
182
+ type: Component,
183
+ args: [{ selector: 'cp-upload-dialog', template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\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"] }]
184
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: UploadService }]; }, propDecorators: { file: [{
185
+ type: ViewChild,
186
+ args: ['file', { static: true }]
187
+ }] } });
188
+
189
+ class UploadComponent {
190
+ constructor(dialog, uploadService) {
191
+ this.dialog = dialog;
192
+ this.uploadService = uploadService;
193
+ this.dialogClosed = new EventEmitter();
194
+ }
195
+ ngOnInit() {
196
+ this.uploadButtonText = this.uploadService.uploadButtonText ?
197
+ this.uploadService.uploadButtonText :
198
+ 'Upload';
199
+ }
200
+ openUploadDialog() {
201
+ this.dialog.open(UploadDialogComponent, { width: '50%' })
202
+ .afterClosed().subscribe(() => this.dialogClosed.emit());
203
+ }
204
+ }
205
+ UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadComponent, deps: [{ token: i1$1.MatDialog }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
206
+ UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: UploadComponent, selector: "cp-upload", outputs: { dialogClosed: "dialogClosed" }, ngImport: i0, template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>', isInline: true });
207
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadComponent, decorators: [{
208
+ type: Component,
209
+ args: [{
210
+ selector: 'cp-upload',
211
+ template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>'
212
+ }]
213
+ }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: UploadService }]; }, propDecorators: { dialogClosed: [{
214
+ type: Output
215
+ }] } });
216
+
217
+ class UploadModule {
218
+ constructor(parentModule) {
219
+ if (parentModule) {
220
+ throw new Error('UploadModule is already loaded. Import it in the AppModule only');
221
+ }
222
+ }
223
+ static forRoot(uploadConfig) {
224
+ return {
225
+ ngModule: UploadModule,
226
+ providers: [
227
+ UploadService,
228
+ { provide: ServiceConfig, useValue: uploadConfig }
229
+ ]
230
+ };
231
+ }
232
+ }
233
+ UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, deps: [{ token: UploadModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
234
+ UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
235
+ UploadDialogComponent], imports: [CommonModule,
236
+ MatDialogModule,
237
+ MatListModule,
238
+ MatProgressBarModule], exports: [UploadComponent,
239
+ UploadDialogComponent] });
240
+ UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, imports: [CommonModule,
241
+ MatDialogModule,
242
+ MatListModule,
243
+ MatProgressBarModule] });
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: UploadModule, decorators: [{
245
+ type: NgModule,
246
+ args: [{
247
+ declarations: [
248
+ UploadComponent,
249
+ UploadDialogComponent
250
+ ],
251
+ imports: [
252
+ CommonModule,
253
+ MatDialogModule,
254
+ MatListModule,
255
+ MatProgressBarModule
256
+ ],
257
+ exports: [
258
+ UploadComponent,
259
+ UploadDialogComponent
260
+ ]
261
+ }]
262
+ }], ctorParameters: function () { return [{ type: UploadModule, decorators: [{
263
+ type: Optional
264
+ }, {
265
+ type: SkipSelf
266
+ }] }]; } });
267
+
268
+ /**
269
+ * Generated bundle index. Do not edit.
270
+ */
271
+
272
+ export { ServiceConfig, UploadComponent, UploadDialogComponent, UploadModule, UploadService };
273
+ //# sourceMappingURL=cleavelandprice-ngx-lib-upload.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-upload.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/upload/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/services/upload.service.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload-dialog/upload-dialog.component.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload-dialog/upload-dialog.component.html","../../../../projects/cleavelandprice/ngx-lib/upload/src/components/upload/upload.component.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/upload.module.ts","../../../../projects/cleavelandprice/ngx-lib/upload/src/cleavelandprice-ngx-lib-upload.ts"],"sourcesContent":["export class ServiceConfig {\r\n uploadApiUrl!: string;\r\n uploadPath?: string;\r\n dbAppId?: string;\r\n externalReferenceId?: string;\r\n comment?: string;\r\n\r\n // UI configuration\r\n uploadButtonText?: string;\r\n uploadDialogTitle?: string;\r\n uploadDialogAddFilesButtonText?: string;\r\n uploadDialogCancelButtonText?: string;\r\n uploadDialogUploadButtonText?: string;\r\n uploadDialogFinishButtonText?: string;\r\n}\r\n","import { Injectable, Optional } from '@angular/core';\nimport { HttpClient, HttpRequest, HttpEventType, HttpResponse, HttpHeaders } from '@angular/common/http';\nimport { Subject , Observable } from 'rxjs';\nimport { ServiceConfig } from '../model/service-config';\nimport { FileUploadRequest } from '../model/file-upload-request';\nimport { DatabaseFileInfo } from '../model/database-file-info';\nimport { FilesystemFileInfo } from '../model/filesystem-file-info';\n\n// https://malcoded.com/posts/angular-file-upload-component-with-express\n\n@Injectable()\nexport class UploadService {\n public uploadApiUrl: string;\n public uploadPath: string;\n public dbAppId: string;\n public externalReferenceId: string;\n public comment: string;\n\n // UI configuration\n public uploadButtonText: string;\n public uploadDialogTitle: string;\n public uploadDialogAddFilesButtonText: string;\n public uploadDialogCancelButtonText: string;\n public uploadDialogUploadButtonText: string;\n public uploadDialogFinishButtonText: string;\n\n constructor(private http: HttpClient,\n @Optional() config: ServiceConfig) {\n this.uploadApiUrl = config.uploadApiUrl;\n this.uploadPath = config.uploadPath || '';\n this.dbAppId = config.dbAppId || '';\n this.externalReferenceId = config.externalReferenceId || '';\n this.comment = config.comment || '';\n\n // UI configuration\n this.uploadButtonText = config.uploadButtonText ?? '';\n this.uploadDialogTitle = config.uploadDialogTitle ?? '';\n this.uploadDialogAddFilesButtonText = config.uploadDialogAddFilesButtonText ?? '';\n this.uploadDialogCancelButtonText = config.uploadDialogCancelButtonText ?? '';\n this.uploadDialogUploadButtonText = config.uploadDialogUploadButtonText ?? '';\n this.uploadDialogFinishButtonText = config.uploadDialogFinishButtonText ?? '';\n }\n\n public upload(files: Set<File>): any { // {[key: string]: Observable<number>} {\n // this will be the our resulting map\n const status: {[key: string]: {progress: Observable<number>}} = {};\n\n files.forEach(file => {\n // create a new multipart-form for every file\n const formData: FormData = new FormData();\n formData.append('file', file, file.name);\n\n // create a http-post request and pass the form\n // tell it to report the upload progress\n\n // A 'Destination' header is used to optionally configure the file upload destination (filesystem)\n // A 'DbAppId' header is used to configure the unique identifier of database uploads\n const req = new HttpRequest('POST', this.uploadApiUrl, formData, {\n reportProgress: true,\n responseType: 'blob',\n headers: new HttpHeaders()\n .set('Destination', this.uploadPath)\n .set('DbAppId', this.dbAppId)\n .set('ExternalReferenceId', this.externalReferenceId)\n .set('Comment', this.comment)\n /*headers: this.uploadPath ?\n new HttpHeaders({ 'Destination': this.uploadPath }) :\n this.dbAppId ?\n new HttpHeaders({ 'DbAppId': this.dbAppId }) :\n null*/\n });\n\n // create a new progress-subject for every file\n const progress = new Subject<number>();\n\n // send the http-request and subscribe for progress-updates\n this.http.request(req).subscribe(event => {\n if (event.type === HttpEventType.UploadProgress) {\n\n // calculate the progress percentage\n const percentDone = Math.round(100 * event.loaded / (event.total ?? 1));\n\n // pass the percentage into the progress-stream\n progress.next(percentDone);\n } else if (event instanceof HttpResponse) {\n\n // Close the progress-stream if we get an answer form the API\n // The upload is complete\n progress.complete();\n }\n });\n\n // Save every progress-observable in a map of all observables\n status[file.name] = {\n progress: progress.asObservable()\n };\n });\n\n // return the map of progress.observables\n return status;\n }\n\n public exists(fileName: string): Observable<boolean> {\n const query = this.uploadApiUrl.toLowerCase().indexOf('filesystem') === -1 ?\n { name: fileName, dbAppId: this.dbAppId } :\n { name: fileName, destination: this.uploadPath };\n\n return this.http.post<boolean>(`${this.uploadApiUrl}/exists`, query);\n }\n\n public download(request: FileUploadRequest): Observable<Blob> {\n return this.http.post(`${this.uploadApiUrl}/stream`, request, { responseType: 'blob' });\n }\n\n public getUploadInfo(request: FileUploadRequest):\n Observable<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]> {\n return this.http.post<DatabaseFileInfo | DatabaseFileInfo[] | FilesystemFileInfo | FilesystemFileInfo[]>\n (`${this.uploadApiUrl}/info`, request);\n }\n}\n","import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { UploadService } from './../../services/upload.service';\nimport { forkJoin } from 'rxjs';\n\n@Component({\n selector: 'cp-upload-dialog',\n templateUrl: './upload-dialog.component.html',\n styleUrls: ['./upload-dialog.component.css']\n})\nexport class UploadDialogComponent implements OnInit {\n @ViewChild('file', { static: true }) file!: ElementRef;\n public files: Set<File> = new Set();\n existingFileConflict: string | null = null;\n\n // State\n progress: any;\n canBeClosed = true;\n primaryButtonText!: string;\n showCancelButton = true;\n uploading = false;\n uploadSuccessful = false;\n\n // UI configuration\n uploadDialogTitle!: string;\n uploadDialogAddFilesButtonText!: string;\n uploadDialogCancelButtonText!: string;\n uploadDialogUploadButtonText!: string;\n uploadDialogFinishButtonText!: string;\n\n constructor(public dialogRef: MatDialogRef<UploadDialogComponent>, public uploadService: UploadService) { }\n\n ngOnInit() {\n this.uploadDialogTitle = this.uploadService.uploadDialogTitle ?? 'Upload Files';\n\n this.uploadDialogAddFilesButtonText = this.uploadService.uploadDialogAddFilesButtonText ?? 'Add Files';\n\n this.uploadDialogCancelButtonText = this.uploadService.uploadDialogCancelButtonText ?? 'Cancel';\n\n this.uploadDialogUploadButtonText = this.uploadService.uploadDialogUploadButtonText ?? 'Upload';\n\n this.uploadDialogFinishButtonText = this.uploadService.uploadDialogFinishButtonText ?? 'Finish';\n\n this.primaryButtonText = this.uploadDialogUploadButtonText;\n }\n\n addFiles() {\n this.file.nativeElement.click();\n }\n\n onFilesAdded() {\n const files: { [key: string]: File } = this.file.nativeElement.files;\n for (const key in files) {\n if (!isNaN(parseInt(key))) {\n // See if the file already exists\n this.uploadService.exists(files[key].name)\n .subscribe(exists => {\n if (exists) {\n this.existingFileConflict = files[key].name;\n }\n\n if (!exists) {\n this.files.add(files[key]);\n }\n });\n }\n }\n }\n\n closeDialog() {\n // if everything was uploaded already, just close the dialog\n if (this.uploadSuccessful) {\n return this.dialogRef.close();\n }\n\n // set the component state to \"uploading\"\n this.uploading = true;\n\n // start the upload and save the progress map\n this.progress = this.uploadService.upload(this.files);\n\n // convert the progress map into an array\n const allProgressObservables = [];\n\n for (let key in this.progress) {\n allProgressObservables.push(this.progress[key].progress);\n }\n\n // Adjust the state variables\n\n // The OK-button should have the text \"Finish\" now\n this.primaryButtonText = this.uploadDialogFinishButtonText;\n\n // The dialog should not be closed while uploading\n this.canBeClosed = false;\n this.dialogRef.disableClose = true;\n\n // Hide the cancel-button\n this.showCancelButton = false;\n\n // When all progress-observables are completed...\n forkJoin(allProgressObservables).subscribe(end => {\n // ... the dialog can be closed again...\n this.canBeClosed = true;\n this.dialogRef.disableClose = false;\n\n // ... the upload was successful...\n this.uploadSuccessful = true;\n\n // ... and the component is no longer uploading\n this.uploading = false;\n });\n }\n}\n","<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\n\n<div mat-dialog-title id=\"title\">\n <div>{{ uploadDialogTitle }}</div>\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\n {{ uploadDialogAddFilesButtonText }}\n </button>\n</div>\n\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\n</div>\n\n<mat-dialog-content>\n <mat-list>\n <mat-list-item *ngFor=\"let file of files\">\n <h4 mat-line>{{file.name}}</h4>\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\n </mat-list-item>\n </mat-list>\n</mat-dialog-content>\n\n<mat-dialog-actions id=\"actions\">\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\n</mat-dialog-actions>\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { MatDialog } from '@angular/material/dialog';\nimport { UploadDialogComponent } from './../upload-dialog/upload-dialog.component';\nimport { UploadService } from './../../services/upload.service';\n\n@Component({\n selector: 'cp-upload',\n template: '<button mat-raised-button (click)=\"openUploadDialog()\">{{ uploadButtonText }}</button>'\n})\nexport class UploadComponent implements OnInit {\n @Output() dialogClosed = new EventEmitter();\n uploadButtonText!: string;\n\n constructor(public dialog: MatDialog, public uploadService: UploadService) { }\n\n ngOnInit(): void {\n this.uploadButtonText = this.uploadService.uploadButtonText ?\n this.uploadService.uploadButtonText :\n 'Upload';\n }\n\n public openUploadDialog() {\n this.dialog.open(UploadDialogComponent, { width: '50%' })\n .afterClosed().subscribe(() => this.dialogClosed.emit());\n }\n}\n","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatListModule } from '@angular/material/list';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { UploadComponent } from './components/upload/upload.component';\nimport { UploadDialogComponent } from './components/upload-dialog/upload-dialog.component';\nimport { ServiceConfig } from './model/service-config';\nimport { UploadService } from './services/upload.service';\n\n@NgModule({\n declarations: [\n UploadComponent,\n UploadDialogComponent\n ],\n imports: [\n CommonModule,\n MatDialogModule,\n MatListModule,\n MatProgressBarModule\n ],\n exports: [\n UploadComponent,\n UploadDialogComponent\n ]\n})\nexport class UploadModule {\n static forRoot(uploadConfig: ServiceConfig): ModuleWithProviders<UploadModule> {\n return {\n ngModule: UploadModule,\n providers: [\n UploadService,\n { provide: ServiceConfig, useValue: uploadConfig }\n ]\n };\n }\n\n constructor(@Optional() @SkipSelf() parentModule: UploadModule) {\n if (parentModule) {\n throw new Error(\n 'UploadModule is already loaded. Import it in the AppModule only');\n }\n }\n}\n","/**\n * Generated bundle index.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