@valtimo/components 4.23.0 → 5.2.0

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 (439) hide show
  1. package/esm2020/lib/components/alert/alert.component.mjs +138 -0
  2. package/esm2020/lib/components/alert/alert.module.mjs +33 -0
  3. package/esm2020/lib/components/alert/alert.service.mjs +80 -0
  4. package/esm2020/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.mjs +168 -0
  5. package/esm2020/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.mjs +33 -0
  6. package/esm2020/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.mjs +92 -0
  7. package/esm2020/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.mjs +35 -0
  8. package/esm2020/lib/components/camunda/form/camunda-form.components.mjs +41 -0
  9. package/esm2020/lib/components/camunda/form/camunda-form.module.mjs +35 -0
  10. package/esm2020/lib/components/camunda/form/custom/camunda-custom-form.component.mjs +40 -0
  11. package/esm2020/lib/components/camunda/form/custom/camunda-custom-form.module.mjs +33 -0
  12. package/esm2020/lib/components/camunda/form/generated/camunda-generated-form.component.mjs +67 -0
  13. package/esm2020/lib/components/camunda/form/generated/camunda-generated-form.module.mjs +63 -0
  14. package/esm2020/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.mjs +30 -0
  15. package/esm2020/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.mjs +63 -0
  16. package/esm2020/lib/components/camunda/form/generated/formfield/camunda-formfield.service.mjs +67 -0
  17. package/esm2020/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.mjs +41 -0
  18. package/esm2020/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.mjs +66 -0
  19. package/esm2020/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.mjs +33 -0
  20. package/esm2020/lib/components/camunda/form/generated/formfield/formfield.model.mjs +17 -0
  21. package/esm2020/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.mjs +30 -0
  22. package/esm2020/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.mjs +30 -0
  23. package/esm2020/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.mjs +30 -0
  24. package/esm2020/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.mjs +35 -0
  25. package/esm2020/lib/components/camunda/form/generated/formfield/validation/date.validators.mjs +59 -0
  26. package/esm2020/lib/components/card/card.component.mjs +36 -0
  27. package/esm2020/lib/components/card/card.module.mjs +33 -0
  28. package/esm2020/lib/components/components.module.mjs +26 -0
  29. package/esm2020/lib/components/data-list/data-list.component.mjs +33 -0
  30. package/esm2020/lib/components/data-list/data-list.module.mjs +33 -0
  31. package/esm2020/lib/components/dropzone/dropzone.component.mjs +156 -0
  32. package/esm2020/lib/components/dropzone/dropzone.module.mjs +37 -0
  33. package/esm2020/lib/components/field-auto-focus/field-auto-focus.directive.mjs +36 -0
  34. package/esm2020/lib/components/field-auto-focus/field-auto-focus.module.mjs +33 -0
  35. package/esm2020/lib/components/file-size/file-size.module.mjs +33 -0
  36. package/esm2020/lib/components/file-size/file-size.pipe.mjs +42 -0
  37. package/esm2020/lib/components/filter-sidebar/filter-sidebar.component.mjs +46 -0
  38. package/esm2020/lib/components/filter-sidebar/filter-sidebar.module.mjs +33 -0
  39. package/esm2020/lib/components/form-io/form-io-builder.component.mjs +39 -0
  40. package/esm2020/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.mjs +69 -0
  41. package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.mjs +90 -0
  42. package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader.component.mjs +78 -0
  43. package/esm2020/lib/components/form-io/form-io-uploader/form-io-uploader.formio.mjs +28 -0
  44. package/esm2020/lib/components/form-io/form-io.component.mjs +166 -0
  45. package/esm2020/lib/components/form-io/form-io.module.mjs +70 -0
  46. package/esm2020/lib/components/form-io/formio-config.mjs +22 -0
  47. package/esm2020/lib/components/form-io/services/form-io-dom.service.mjs +23 -0
  48. package/esm2020/lib/components/form-io/services/form-io-state.service.mjs +37 -0
  49. package/esm2020/lib/components/left-sidebar/left-sidebar.component.mjs +115 -0
  50. package/esm2020/lib/components/left-sidebar/left-sidebar.module.mjs +35 -0
  51. package/esm2020/lib/components/list/ListFilterPipe.directive.mjs +35 -0
  52. package/esm2020/lib/components/list/list.component.mjs +195 -0
  53. package/esm2020/lib/components/list/list.module.mjs +38 -0
  54. package/esm2020/lib/components/menu/menu-item-text.component.mjs +78 -0
  55. package/esm2020/lib/components/menu/menu-routing.module.mjs +33 -0
  56. package/esm2020/lib/components/menu/menu.component.mjs +66 -0
  57. package/esm2020/lib/components/menu/menu.init.mjs +32 -0
  58. package/esm2020/lib/components/menu/menu.module.mjs +39 -0
  59. package/esm2020/lib/components/menu/menu.service.mjs +122 -0
  60. package/esm2020/lib/components/menu/submenu-item-text.component.mjs +67 -0
  61. package/esm2020/lib/components/modal/modal.component.mjs +51 -0
  62. package/esm2020/lib/components/modal/modal.module.mjs +33 -0
  63. package/esm2020/lib/components/multiselect-dropdown/multiselect-dropdown.component.mjs +52 -0
  64. package/esm2020/lib/components/multiselect-dropdown/multiselect-dropdown.module.mjs +35 -0
  65. package/esm2020/lib/components/page-header/page-header.component.mjs +35 -0
  66. package/esm2020/lib/components/page-header/page-header.module.mjs +35 -0
  67. package/esm2020/lib/components/page-title/page-title.component.mjs +75 -0
  68. package/esm2020/lib/components/page-title/page-title.module.mjs +34 -0
  69. package/esm2020/lib/components/progress-bar/progress-bar.component.mjs +26 -0
  70. package/esm2020/lib/components/progress-bar/progress-bar.module.mjs +33 -0
  71. package/esm2020/lib/components/right-sidebar/right-sidebar.component.mjs +112 -0
  72. package/esm2020/lib/components/right-sidebar/right-sidebar.module.mjs +69 -0
  73. package/esm2020/lib/components/searchable-dropdown/searchable-dropdown.component.mjs +201 -0
  74. package/esm2020/lib/components/searchable-dropdown/searchable-dropdown.module.mjs +34 -0
  75. package/esm2020/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.mjs +65 -0
  76. package/esm2020/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.mjs +35 -0
  77. package/esm2020/lib/components/spinner/spinner.component.mjs +54 -0
  78. package/esm2020/lib/components/spinner/spinner.module.mjs +35 -0
  79. package/esm2020/lib/components/timeline/timeline.component.mjs +30 -0
  80. package/esm2020/lib/components/timeline/timeline.module.mjs +34 -0
  81. package/esm2020/lib/components/topbar/topbar.component.mjs +28 -0
  82. package/esm2020/lib/components/topbar/topbar.module.mjs +34 -0
  83. package/esm2020/lib/components/uploader/uploader-drag-drop.directive.mjs +58 -0
  84. package/esm2020/lib/components/uploader/uploader.component.mjs +70 -0
  85. package/esm2020/lib/components/uploader/uploader.module.mjs +35 -0
  86. package/esm2020/lib/components/version/version.service.mjs +36 -0
  87. package/esm2020/lib/components/view-content/type-converters/booleanTypeConverter.mjs +29 -0
  88. package/esm2020/lib/components/view-content/type-converters/dateTypeConverter.mjs +29 -0
  89. package/esm2020/lib/components/view-content/type-converters/enumTypeConverter.mjs +24 -0
  90. package/esm2020/lib/components/view-content/type-converters/relatedFilesTypeConverter.mjs +24 -0
  91. package/esm2020/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.mjs +27 -0
  92. package/esm2020/lib/components/view-content/type-converters/stringTypeConverter.mjs +24 -0
  93. package/esm2020/lib/components/view-content/type-converters/type-converters.model.mjs +37 -0
  94. package/esm2020/lib/components/view-content/view-content.service.mjs +52 -0
  95. package/esm2020/lib/components/webcam/webcam.component.mjs +102 -0
  96. package/esm2020/lib/components/webcam/webcam.module.mjs +34 -0
  97. package/esm2020/lib/components/widget/widget.component.mjs +89 -0
  98. package/esm2020/lib/components/widget/widget.module.mjs +33 -0
  99. package/esm2020/lib/models/alert.model.mjs +30 -0
  100. package/esm2020/lib/models/form-io.model.mjs +30 -0
  101. package/esm2020/lib/models/index.mjs +24 -0
  102. package/esm2020/lib/models/pagination.model.mjs +2 -0
  103. package/esm2020/lib/models/searchable-dropdown.model.mjs +2 -0
  104. package/esm2020/lib/models/timeline.model.mjs +44 -0
  105. package/esm2020/lib/models/version.model.mjs +17 -0
  106. package/{esm2015/public_api.js → esm2020/public_api.mjs} +3 -1
  107. package/esm2020/valtimo-components.mjs +5 -0
  108. package/fesm2015/valtimo-components.mjs +4934 -0
  109. package/fesm2015/valtimo-components.mjs.map +1 -0
  110. package/fesm2020/valtimo-components.mjs +4956 -0
  111. package/fesm2020/valtimo-components.mjs.map +1 -0
  112. package/lib/components/alert/alert.component.d.ts +4 -0
  113. package/lib/components/alert/alert.component.d.ts.map +1 -0
  114. package/lib/components/alert/alert.module.d.ts +7 -0
  115. package/lib/components/alert/alert.module.d.ts.map +1 -0
  116. package/lib/components/alert/alert.service.d.ts +4 -0
  117. package/lib/components/alert/alert.service.d.ts.map +1 -0
  118. package/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.d.ts +4 -0
  119. package/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.d.ts.map +1 -0
  120. package/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.d.ts +7 -0
  121. package/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.d.ts.map +1 -0
  122. package/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.d.ts +4 -0
  123. package/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.d.ts.map +1 -0
  124. package/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.d.ts +9 -0
  125. package/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.d.ts.map +1 -0
  126. package/lib/components/camunda/form/camunda-form.components.d.ts +4 -0
  127. package/lib/components/camunda/form/camunda-form.components.d.ts.map +1 -0
  128. package/lib/components/camunda/form/camunda-form.module.d.ts +9 -0
  129. package/lib/components/camunda/form/camunda-form.module.d.ts.map +1 -0
  130. package/lib/components/camunda/form/custom/camunda-custom-form.component.d.ts +4 -0
  131. package/lib/components/camunda/form/custom/camunda-custom-form.component.d.ts.map +1 -0
  132. package/lib/components/camunda/form/custom/camunda-custom-form.module.d.ts +7 -0
  133. package/lib/components/camunda/form/custom/camunda-custom-form.module.d.ts.map +1 -0
  134. package/lib/components/camunda/form/generated/camunda-generated-form.component.d.ts +4 -0
  135. package/lib/components/camunda/form/generated/camunda-generated-form.component.d.ts.map +1 -0
  136. package/lib/components/camunda/form/generated/camunda-generated-form.module.d.ts +17 -0
  137. package/lib/components/camunda/form/generated/camunda-generated-form.module.d.ts.map +1 -0
  138. package/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.d.ts +4 -0
  139. package/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.d.ts.map +1 -0
  140. package/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.d.ts +4 -0
  141. package/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.d.ts.map +1 -0
  142. package/lib/components/camunda/form/generated/formfield/camunda-formfield.service.d.ts +4 -0
  143. package/lib/components/camunda/form/generated/formfield/camunda-formfield.service.d.ts.map +1 -0
  144. package/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.d.ts +4 -0
  145. package/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.d.ts.map +1 -0
  146. package/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.d.ts +4 -0
  147. package/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.d.ts.map +1 -0
  148. package/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.d.ts +4 -0
  149. package/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.d.ts.map +1 -0
  150. package/lib/components/camunda/form/generated/formfield/formfield.model.d.ts +1 -0
  151. package/lib/components/camunda/form/generated/formfield/formfield.model.d.ts.map +1 -0
  152. package/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.d.ts +4 -0
  153. package/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.d.ts.map +1 -0
  154. package/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.d.ts +4 -0
  155. package/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.d.ts.map +1 -0
  156. package/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.d.ts +4 -0
  157. package/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.d.ts.map +1 -0
  158. package/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.d.ts +4 -0
  159. package/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.d.ts.map +1 -0
  160. package/lib/components/camunda/form/generated/formfield/validation/date.validators.d.ts +1 -0
  161. package/lib/components/camunda/form/generated/formfield/validation/date.validators.d.ts.map +1 -0
  162. package/lib/components/card/card.component.d.ts +4 -0
  163. package/lib/components/card/card.component.d.ts.map +1 -0
  164. package/lib/components/card/card.module.d.ts +7 -0
  165. package/lib/components/card/card.module.d.ts.map +1 -0
  166. package/lib/components/components.module.d.ts +5 -0
  167. package/lib/components/components.module.d.ts.map +1 -0
  168. package/lib/components/data-list/data-list.component.d.ts +4 -0
  169. package/lib/components/data-list/data-list.component.d.ts.map +1 -0
  170. package/lib/components/data-list/data-list.module.d.ts +7 -0
  171. package/lib/components/data-list/data-list.module.d.ts.map +1 -0
  172. package/lib/components/dropzone/dropzone.component.d.ts +4 -0
  173. package/lib/components/dropzone/dropzone.component.d.ts.map +1 -0
  174. package/lib/components/dropzone/dropzone.module.d.ts +11 -0
  175. package/lib/components/dropzone/dropzone.module.d.ts.map +1 -0
  176. package/lib/components/field-auto-focus/field-auto-focus.directive.d.ts +4 -0
  177. package/lib/components/field-auto-focus/field-auto-focus.directive.d.ts.map +1 -0
  178. package/lib/components/field-auto-focus/field-auto-focus.module.d.ts +7 -0
  179. package/lib/components/field-auto-focus/field-auto-focus.module.d.ts.map +1 -0
  180. package/lib/components/file-size/file-size.module.d.ts +7 -0
  181. package/lib/components/file-size/file-size.module.d.ts.map +1 -0
  182. package/lib/components/file-size/file-size.pipe.d.ts +4 -0
  183. package/lib/components/file-size/file-size.pipe.d.ts.map +1 -0
  184. package/lib/components/filter-sidebar/filter-sidebar.component.d.ts +4 -0
  185. package/lib/components/filter-sidebar/filter-sidebar.component.d.ts.map +1 -0
  186. package/lib/components/filter-sidebar/filter-sidebar.module.d.ts +7 -0
  187. package/lib/components/filter-sidebar/filter-sidebar.module.d.ts.map +1 -0
  188. package/lib/components/form-io/form-io-builder.component.d.ts +4 -0
  189. package/lib/components/form-io/form-io-builder.component.d.ts.map +1 -0
  190. package/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.d.ts +1 -0
  191. package/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.d.ts.map +1 -0
  192. package/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.d.ts +1 -0
  193. package/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.d.ts.map +1 -0
  194. package/lib/components/form-io/form-io-uploader/form-io-uploader.component.d.ts +4 -0
  195. package/lib/components/form-io/form-io-uploader/form-io-uploader.component.d.ts.map +1 -0
  196. package/lib/components/form-io/form-io-uploader/form-io-uploader.formio.d.ts +1 -0
  197. package/lib/components/form-io/form-io-uploader/form-io-uploader.formio.d.ts.map +1 -0
  198. package/lib/components/form-io/form-io.component.d.ts +5 -1
  199. package/lib/components/form-io/form-io.component.d.ts.map +1 -0
  200. package/lib/components/form-io/form-io.module.d.ts +16 -0
  201. package/lib/components/form-io/form-io.module.d.ts.map +1 -0
  202. package/lib/components/form-io/formio-config.d.ts +1 -0
  203. package/lib/components/form-io/formio-config.d.ts.map +1 -0
  204. package/lib/components/form-io/services/form-io-dom.service.d.ts +4 -0
  205. package/lib/components/form-io/services/form-io-dom.service.d.ts.map +1 -0
  206. package/lib/components/form-io/services/form-io-state.service.d.ts +4 -0
  207. package/lib/components/form-io/services/form-io-state.service.d.ts.map +1 -0
  208. package/lib/components/left-sidebar/left-sidebar.component.d.ts +4 -0
  209. package/lib/components/left-sidebar/left-sidebar.component.d.ts.map +1 -0
  210. package/lib/components/left-sidebar/left-sidebar.module.d.ts +9 -0
  211. package/lib/components/left-sidebar/left-sidebar.module.d.ts.map +1 -0
  212. package/lib/components/list/ListFilterPipe.directive.d.ts +4 -0
  213. package/lib/components/list/ListFilterPipe.directive.d.ts.map +1 -0
  214. package/lib/components/list/list.component.d.ts +4 -0
  215. package/lib/components/list/list.component.d.ts.map +1 -0
  216. package/lib/components/list/list.module.d.ts +12 -0
  217. package/lib/components/list/list.module.d.ts.map +1 -0
  218. package/lib/components/menu/menu-item-text.component.d.ts +4 -0
  219. package/lib/components/menu/menu-item-text.component.d.ts.map +1 -0
  220. package/lib/components/menu/menu-routing.module.d.ts +6 -0
  221. package/lib/components/menu/menu-routing.module.d.ts.map +1 -0
  222. package/lib/components/menu/menu.component.d.ts +4 -0
  223. package/lib/components/menu/menu.component.d.ts.map +1 -0
  224. package/lib/components/menu/menu.init.d.ts +1 -0
  225. package/lib/components/menu/menu.init.d.ts.map +1 -0
  226. package/lib/components/menu/menu.module.d.ts +12 -0
  227. package/lib/components/menu/menu.module.d.ts.map +1 -0
  228. package/lib/components/menu/menu.service.d.ts +4 -0
  229. package/lib/components/menu/menu.service.d.ts.map +1 -0
  230. package/lib/components/menu/submenu-item-text.component.d.ts +4 -0
  231. package/lib/components/menu/submenu-item-text.component.d.ts.map +1 -0
  232. package/lib/components/modal/modal.component.d.ts +4 -0
  233. package/lib/components/modal/modal.component.d.ts.map +1 -0
  234. package/lib/components/modal/modal.module.d.ts +7 -0
  235. package/lib/components/modal/modal.module.d.ts.map +1 -0
  236. package/lib/components/multiselect-dropdown/multiselect-dropdown.component.d.ts +6 -2
  237. package/lib/components/multiselect-dropdown/multiselect-dropdown.component.d.ts.map +1 -0
  238. package/lib/components/multiselect-dropdown/multiselect-dropdown.module.d.ts +9 -0
  239. package/lib/components/multiselect-dropdown/multiselect-dropdown.module.d.ts.map +1 -0
  240. package/lib/components/page-header/page-header.component.d.ts +8 -1
  241. package/lib/components/page-header/page-header.component.d.ts.map +1 -0
  242. package/lib/components/page-header/page-header.module.d.ts +9 -0
  243. package/lib/components/page-header/page-header.module.d.ts.map +1 -0
  244. package/lib/components/page-title/page-title.component.d.ts +8 -3
  245. package/lib/components/page-title/page-title.component.d.ts.map +1 -0
  246. package/lib/components/page-title/page-title.module.d.ts +8 -0
  247. package/lib/components/page-title/page-title.module.d.ts.map +1 -0
  248. package/lib/components/progress-bar/progress-bar.component.d.ts +4 -0
  249. package/lib/components/progress-bar/progress-bar.component.d.ts.map +1 -0
  250. package/lib/components/progress-bar/progress-bar.module.d.ts +7 -0
  251. package/lib/components/progress-bar/progress-bar.module.d.ts.map +1 -0
  252. package/lib/components/right-sidebar/right-sidebar.component.d.ts +4 -0
  253. package/lib/components/right-sidebar/right-sidebar.component.d.ts.map +1 -0
  254. package/lib/components/right-sidebar/right-sidebar.module.d.ts +11 -0
  255. package/lib/components/right-sidebar/right-sidebar.module.d.ts.map +1 -0
  256. package/lib/components/searchable-dropdown/searchable-dropdown.component.d.ts +4 -0
  257. package/lib/components/searchable-dropdown/searchable-dropdown.component.d.ts.map +1 -0
  258. package/lib/components/searchable-dropdown/searchable-dropdown.module.d.ts +8 -0
  259. package/lib/components/searchable-dropdown/searchable-dropdown.module.d.ts.map +1 -0
  260. package/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.d.ts +4 -0
  261. package/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.d.ts.map +1 -0
  262. package/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.d.ts +9 -0
  263. package/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.d.ts.map +1 -0
  264. package/lib/components/spinner/spinner.component.d.ts +4 -0
  265. package/lib/components/spinner/spinner.component.d.ts.map +1 -0
  266. package/lib/components/spinner/spinner.module.d.ts +9 -0
  267. package/lib/components/spinner/spinner.module.d.ts.map +1 -0
  268. package/lib/components/timeline/timeline.component.d.ts +4 -0
  269. package/lib/components/timeline/timeline.component.d.ts.map +1 -0
  270. package/lib/components/timeline/timeline.module.d.ts +8 -0
  271. package/lib/components/timeline/timeline.module.d.ts.map +1 -0
  272. package/lib/components/topbar/topbar.component.d.ts +4 -0
  273. package/lib/components/topbar/topbar.component.d.ts.map +1 -0
  274. package/lib/components/topbar/topbar.module.d.ts +8 -0
  275. package/lib/components/topbar/topbar.module.d.ts.map +1 -0
  276. package/lib/components/uploader/uploader-drag-drop.directive.d.ts +4 -0
  277. package/lib/components/uploader/uploader-drag-drop.directive.d.ts.map +1 -0
  278. package/lib/components/uploader/uploader.component.d.ts +4 -0
  279. package/lib/components/uploader/uploader.component.d.ts.map +1 -0
  280. package/lib/components/uploader/uploader.module.d.ts +9 -0
  281. package/lib/components/uploader/uploader.module.d.ts.map +1 -0
  282. package/lib/components/version/version.service.d.ts +4 -0
  283. package/lib/components/version/version.service.d.ts.map +1 -0
  284. package/lib/components/view-content/type-converters/booleanTypeConverter.d.ts +1 -0
  285. package/lib/components/view-content/type-converters/booleanTypeConverter.d.ts.map +1 -0
  286. package/lib/components/view-content/type-converters/dateTypeConverter.d.ts +1 -0
  287. package/lib/components/view-content/type-converters/dateTypeConverter.d.ts.map +1 -0
  288. package/lib/components/view-content/type-converters/enumTypeConverter.d.ts +1 -0
  289. package/lib/components/view-content/type-converters/enumTypeConverter.d.ts.map +1 -0
  290. package/lib/components/view-content/type-converters/relatedFilesTypeConverter.d.ts +1 -0
  291. package/lib/components/view-content/type-converters/relatedFilesTypeConverter.d.ts.map +1 -0
  292. package/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.d.ts +1 -0
  293. package/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.d.ts.map +1 -0
  294. package/lib/components/view-content/type-converters/stringTypeConverter.d.ts +1 -0
  295. package/lib/components/view-content/type-converters/stringTypeConverter.d.ts.map +1 -0
  296. package/lib/components/view-content/type-converters/type-converters.model.d.ts +1 -0
  297. package/lib/components/view-content/type-converters/type-converters.model.d.ts.map +1 -0
  298. package/lib/components/view-content/view-content.service.d.ts +4 -0
  299. package/lib/components/view-content/view-content.service.d.ts.map +1 -0
  300. package/lib/components/webcam/webcam.component.d.ts +4 -0
  301. package/lib/components/webcam/webcam.component.d.ts.map +1 -0
  302. package/lib/components/webcam/webcam.module.d.ts +8 -0
  303. package/lib/components/webcam/webcam.module.d.ts.map +1 -0
  304. package/lib/components/widget/widget.component.d.ts +4 -0
  305. package/lib/components/widget/widget.component.d.ts.map +1 -0
  306. package/lib/components/widget/widget.module.d.ts +7 -0
  307. package/lib/components/widget/widget.module.d.ts.map +1 -0
  308. package/lib/models/alert.model.d.ts +1 -0
  309. package/lib/models/alert.model.d.ts.map +1 -0
  310. package/lib/models/form-io.model.d.ts +1 -0
  311. package/lib/models/form-io.model.d.ts.map +1 -0
  312. package/lib/models/index.d.ts +1 -0
  313. package/lib/models/index.d.ts.map +1 -0
  314. package/lib/models/pagination.model.d.ts +1 -0
  315. package/lib/models/pagination.model.d.ts.map +1 -0
  316. package/lib/models/searchable-dropdown.model.d.ts +1 -0
  317. package/lib/models/searchable-dropdown.model.d.ts.map +1 -0
  318. package/lib/models/timeline.model.d.ts +1 -0
  319. package/lib/models/timeline.model.d.ts.map +1 -0
  320. package/lib/models/version.model.d.ts +1 -0
  321. package/lib/models/version.model.d.ts.map +1 -0
  322. package/package.json +25 -13
  323. package/public_api.d.ts +3 -0
  324. package/public_api.d.ts.map +1 -0
  325. package/valtimo-components.d.ts +2 -21
  326. package/valtimo-components.d.ts.map +1 -0
  327. package/bundles/valtimo-components.umd.js +0 -5367
  328. package/bundles/valtimo-components.umd.js.map +0 -1
  329. package/bundles/valtimo-components.umd.min.js +0 -17
  330. package/bundles/valtimo-components.umd.min.js.map +0 -1
  331. package/esm2015/lib/components/alert/alert.component.js +0 -140
  332. package/esm2015/lib/components/alert/alert.module.js +0 -28
  333. package/esm2015/lib/components/alert/alert.service.js +0 -81
  334. package/esm2015/lib/components/bpmn-js-diagram/bpmn-js-diagram.component.js +0 -160
  335. package/esm2015/lib/components/bpmn-js-diagram/bpmn-js-diagram.module.js +0 -28
  336. package/esm2015/lib/components/breadcrumb-navigation/breadcrumb-navigation.component.js +0 -93
  337. package/esm2015/lib/components/breadcrumb-navigation/breadcrumb-navigation.module.js +0 -30
  338. package/esm2015/lib/components/camunda/form/camunda-form.components.js +0 -37
  339. package/esm2015/lib/components/camunda/form/camunda-form.module.js +0 -30
  340. package/esm2015/lib/components/camunda/form/custom/camunda-custom-form.component.js +0 -42
  341. package/esm2015/lib/components/camunda/form/custom/camunda-custom-form.module.js +0 -28
  342. package/esm2015/lib/components/camunda/form/generated/camunda-generated-form.component.js +0 -69
  343. package/esm2015/lib/components/camunda/form/generated/camunda-generated-form.module.js +0 -58
  344. package/esm2015/lib/components/camunda/form/generated/formfield/boolean/camunda-boolean-formfield.component.js +0 -27
  345. package/esm2015/lib/components/camunda/form/generated/formfield/camunda-formfield-generator.directive.js +0 -64
  346. package/esm2015/lib/components/camunda/form/generated/formfield/camunda-formfield.service.js +0 -66
  347. package/esm2015/lib/components/camunda/form/generated/formfield/choicefield/camunda-choicefield-formfield.component.js +0 -40
  348. package/esm2015/lib/components/camunda/form/generated/formfield/date/camunda-date-formfield.component.js +0 -66
  349. package/esm2015/lib/components/camunda/form/generated/formfield/enum/camunda-enum-formfield.component.js +0 -30
  350. package/esm2015/lib/components/camunda/form/generated/formfield/formfield.model.js +0 -16
  351. package/esm2015/lib/components/camunda/form/generated/formfield/long/camunda-long-formfield.component.js +0 -27
  352. package/esm2015/lib/components/camunda/form/generated/formfield/string/camunda-string-formfield.component.js +0 -27
  353. package/esm2015/lib/components/camunda/form/generated/formfield/textarea/camunda-textarea-formfield.component.js +0 -27
  354. package/esm2015/lib/components/camunda/form/generated/formfield/validation/camunda-formfield-validation.component.js +0 -35
  355. package/esm2015/lib/components/camunda/form/generated/formfield/validation/date.validators.js +0 -60
  356. package/esm2015/lib/components/card/card.component.js +0 -36
  357. package/esm2015/lib/components/card/card.module.js +0 -28
  358. package/esm2015/lib/components/components.module.js +0 -22
  359. package/esm2015/lib/components/data-list/data-list.component.js +0 -33
  360. package/esm2015/lib/components/data-list/data-list.module.js +0 -28
  361. package/esm2015/lib/components/dropzone/dropzone.component.js +0 -142
  362. package/esm2015/lib/components/dropzone/dropzone.module.js +0 -32
  363. package/esm2015/lib/components/field-auto-focus/field-auto-focus.directive.js +0 -35
  364. package/esm2015/lib/components/field-auto-focus/field-auto-focus.module.js +0 -28
  365. package/esm2015/lib/components/file-size/file-size.module.js +0 -28
  366. package/esm2015/lib/components/file-size/file-size.pipe.js +0 -38
  367. package/esm2015/lib/components/filter-sidebar/filter-sidebar.component.js +0 -46
  368. package/esm2015/lib/components/filter-sidebar/filter-sidebar.module.js +0 -28
  369. package/esm2015/lib/components/form-io/form-io-builder.component.js +0 -38
  370. package/esm2015/lib/components/form-io/form-io-resource-selector/form-io-resource-selector.formio.js +0 -63
  371. package/esm2015/lib/components/form-io/form-io-uploader/form-io-uploader-edit-form.js +0 -90
  372. package/esm2015/lib/components/form-io/form-io-uploader/form-io-uploader.component.js +0 -74
  373. package/esm2015/lib/components/form-io/form-io-uploader/form-io-uploader.formio.js +0 -26
  374. package/esm2015/lib/components/form-io/form-io.component.js +0 -166
  375. package/esm2015/lib/components/form-io/form-io.module.js +0 -51
  376. package/esm2015/lib/components/form-io/formio-config.js +0 -22
  377. package/esm2015/lib/components/form-io/services/form-io-dom.service.js +0 -23
  378. package/esm2015/lib/components/form-io/services/form-io-state.service.js +0 -35
  379. package/esm2015/lib/components/left-sidebar/left-sidebar.component.js +0 -114
  380. package/esm2015/lib/components/left-sidebar/left-sidebar.module.js +0 -30
  381. package/esm2015/lib/components/list/ListFilterPipe.directive.js +0 -31
  382. package/esm2015/lib/components/list/list.component.js +0 -180
  383. package/esm2015/lib/components/list/list.module.js +0 -33
  384. package/esm2015/lib/components/menu/menu-item-text.component.js +0 -38
  385. package/esm2015/lib/components/menu/menu-routing.module.js +0 -27
  386. package/esm2015/lib/components/menu/menu.component.js +0 -67
  387. package/esm2015/lib/components/menu/menu.init.js +0 -34
  388. package/esm2015/lib/components/menu/menu.module.js +0 -34
  389. package/esm2015/lib/components/menu/menu.service.js +0 -134
  390. package/esm2015/lib/components/menu/submenu-item-text.component.js +0 -33
  391. package/esm2015/lib/components/modal/modal.component.js +0 -48
  392. package/esm2015/lib/components/modal/modal.module.js +0 -28
  393. package/esm2015/lib/components/multiselect-dropdown/multiselect-dropdown.component.js +0 -47
  394. package/esm2015/lib/components/multiselect-dropdown/multiselect-dropdown.module.js +0 -30
  395. package/esm2015/lib/components/page-header/page-header.component.js +0 -29
  396. package/esm2015/lib/components/page-header/page-header.module.js +0 -30
  397. package/esm2015/lib/components/page-title/page-title.component.js +0 -76
  398. package/esm2015/lib/components/page-title/page-title.module.js +0 -29
  399. package/esm2015/lib/components/progress-bar/progress-bar.component.js +0 -26
  400. package/esm2015/lib/components/progress-bar/progress-bar.module.js +0 -28
  401. package/esm2015/lib/components/right-sidebar/right-sidebar.component.js +0 -133
  402. package/esm2015/lib/components/right-sidebar/right-sidebar.module.js +0 -49
  403. package/esm2015/lib/components/searchable-dropdown/searchable-dropdown.component.js +0 -187
  404. package/esm2015/lib/components/searchable-dropdown/searchable-dropdown.module.js +0 -29
  405. package/esm2015/lib/components/searchable-dropdown-select/searchable-dropdown-select.component.js +0 -52
  406. package/esm2015/lib/components/searchable-dropdown-select/searchable-dropdown-select.module.js +0 -30
  407. package/esm2015/lib/components/spinner/spinner.component.js +0 -45
  408. package/esm2015/lib/components/spinner/spinner.module.js +0 -30
  409. package/esm2015/lib/components/timeline/timeline.component.js +0 -29
  410. package/esm2015/lib/components/timeline/timeline.module.js +0 -29
  411. package/esm2015/lib/components/topbar/topbar.component.js +0 -28
  412. package/esm2015/lib/components/topbar/topbar.module.js +0 -29
  413. package/esm2015/lib/components/uploader/uploader-drag-drop.directive.js +0 -49
  414. package/esm2015/lib/components/uploader/uploader.component.js +0 -68
  415. package/esm2015/lib/components/uploader/uploader.module.js +0 -30
  416. package/esm2015/lib/components/version/version.service.js +0 -38
  417. package/esm2015/lib/components/view-content/type-converters/booleanTypeConverter.js +0 -29
  418. package/esm2015/lib/components/view-content/type-converters/dateTypeConverter.js +0 -30
  419. package/esm2015/lib/components/view-content/type-converters/enumTypeConverter.js +0 -24
  420. package/esm2015/lib/components/view-content/type-converters/relatedFilesTypeConverter.js +0 -24
  421. package/esm2015/lib/components/view-content/type-converters/stringReplaceUnderscoreTypeConverter.js +0 -27
  422. package/esm2015/lib/components/view-content/type-converters/stringTypeConverter.js +0 -24
  423. package/esm2015/lib/components/view-content/type-converters/type-converters.model.js +0 -37
  424. package/esm2015/lib/components/view-content/view-content.service.js +0 -51
  425. package/esm2015/lib/components/webcam/webcam.component.js +0 -102
  426. package/esm2015/lib/components/webcam/webcam.module.js +0 -29
  427. package/esm2015/lib/components/widget/widget.component.js +0 -80
  428. package/esm2015/lib/components/widget/widget.module.js +0 -28
  429. package/esm2015/lib/models/alert.model.js +0 -30
  430. package/esm2015/lib/models/form-io.model.js +0 -30
  431. package/esm2015/lib/models/index.js +0 -24
  432. package/esm2015/lib/models/pagination.model.js +0 -1
  433. package/esm2015/lib/models/searchable-dropdown.model.js +0 -1
  434. package/esm2015/lib/models/timeline.model.js +0 -44
  435. package/esm2015/lib/models/version.model.js +0 -16
  436. package/esm2015/valtimo-components.js +0 -26
  437. package/fesm2015/valtimo-components.js +0 -4734
  438. package/fesm2015/valtimo-components.js.map +0 -1
  439. package/valtimo-components.metadata.json +0 -1
@@ -1,4734 +0,0 @@
1
- import { EventEmitter, Component, Input, Output, ComponentFactoryResolver, ViewChild, ViewContainerRef, NgModule, ɵɵdefineInjectable, Injectable, Directive, ɵɵinject, ElementRef, Renderer2, Pipe, HostListener, ViewChildren } from '@angular/core';
2
- import { CommonModule, Location } from '@angular/common';
3
- import { Validators, FormControl, FormBuilder, ReactiveFormsModule, FormsModule } from '@angular/forms';
4
- import * as momentImported from 'moment';
5
- import { ChoicefieldService } from '@valtimo/choicefield';
6
- import { RouterModule, NavigationEnd, Router, ActivatedRoute, PRIMARY_OUTLET, NavigationStart } from '@angular/router';
7
- import { ConfigService, MenuIncludeService, HttpLoaderFactory } from '@valtimo/config';
8
- import { NGXLogger } from 'ngx-logger';
9
- import { BehaviorSubject, Observable, combineLatest, fromEvent, Subscription, Subject, timer, from } from 'rxjs';
10
- import { DocumentService, DocumentModule } from '@valtimo/document';
11
- import { UserProviderService } from '@valtimo/security';
12
- import { NgbTooltipModule, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
13
- import { TranslateModule, TranslateService, TranslateLoader } from '@ngx-translate/core';
14
- import { HttpClient } from '@angular/common/http';
15
- import { ContextService } from '@valtimo/context';
16
- import { map, debounceTime, take, filter, switchMap } from 'rxjs/operators';
17
- import { Title } from '@angular/platform-browser';
18
- import * as BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';
19
- import { create } from 'heatmap.js-fixed/build/heatmap.js';
20
- import { S3Resource, S3Service, UploadProviderService, DownloadService, ResourceModule } from '@valtimo/resource';
21
- import { Formio, FormioModule, FormioAppConfig, createCustomFormioComponent, registerCustomFormioComponentWithClass, Components } from 'angular-formio';
22
- import jwt_decode from 'jwt-decode';
23
- import * as Dropzone from 'dropzone';
24
- import { NgxSpinnerModule } from 'ngx-spinner';
25
- import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
26
-
27
- /*
28
- * Copyright 2015-2020 Ritense BV, the Netherlands.
29
- *
30
- * Licensed under EUPL, Version 1.2 (the "License");
31
- * you may not use this file except in compliance with the License.
32
- * You may obtain a copy of the License at
33
- *
34
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
35
- *
36
- * Unless required by applicable law or agreed to in writing, software
37
- * distributed under the License is distributed on an "AS IS" basis,
38
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39
- * See the License for the specific language governing permissions and
40
- * limitations under the License.
41
- */
42
- class Alert {
43
- constructor(init) {
44
- Object.assign(this, init);
45
- }
46
- }
47
- var AlertType;
48
- (function (AlertType) {
49
- AlertType[AlertType["Success"] = 0] = "Success";
50
- AlertType[AlertType["Error"] = 1] = "Error";
51
- AlertType[AlertType["Info"] = 2] = "Info";
52
- AlertType[AlertType["Warning"] = 3] = "Warning";
53
- AlertType[AlertType["Notification"] = 4] = "Notification";
54
- AlertType[AlertType["ModalNotification"] = 5] = "ModalNotification";
55
- })(AlertType || (AlertType = {}));
56
-
57
- /*
58
- * Copyright 2015-2020 Ritense BV, the Netherlands.
59
- *
60
- * Licensed under EUPL, Version 1.2 (the "License");
61
- * you may not use this file except in compliance with the License.
62
- * You may obtain a copy of the License at
63
- *
64
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
65
- *
66
- * Unless required by applicable law or agreed to in writing, software
67
- * distributed under the License is distributed on an "AS IS" basis,
68
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
69
- * See the License for the specific language governing permissions and
70
- * limitations under the License.
71
- */
72
- class AlertsOptionsImpl {
73
- constructor(submitMessage) {
74
- this.submitMessage = submitMessage;
75
- }
76
- }
77
- class FormioOptionsImpl {
78
- constructor() { }
79
- setAlertMessage(submitMessage) {
80
- this.alerts = new AlertsOptionsImpl(submitMessage);
81
- }
82
- setHooks(beforeSubmit) {
83
- this.hooks = { beforeSubmit: beforeSubmit };
84
- }
85
- }
86
-
87
- /*
88
- * Copyright 2015-2020 Ritense BV, the Netherlands.
89
- *
90
- * Licensed under EUPL, Version 1.2 (the "License");
91
- * you may not use this file except in compliance with the License.
92
- * You may obtain a copy of the License at
93
- *
94
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
95
- *
96
- * Unless required by applicable law or agreed to in writing, software
97
- * distributed under the License is distributed on an "AS IS" basis,
98
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
- * See the License for the specific language governing permissions and
100
- * limitations under the License.
101
- */
102
- class TimelineItemImpl {
103
- constructor(date, time, user, activity, summaryTranslationKey, summaryTranslationParams) {
104
- this._date = date;
105
- this._time = time;
106
- this._user = user;
107
- this._activity = activity;
108
- this._summaryTranslationKey = summaryTranslationKey;
109
- this._summaryTranslationParams = summaryTranslationParams;
110
- }
111
- get date() {
112
- return this._date;
113
- }
114
- get time() {
115
- return this._time;
116
- }
117
- get user() {
118
- return this._user;
119
- }
120
- get activity() {
121
- return this._activity;
122
- }
123
- get summaryTranslationKey() {
124
- return this._summaryTranslationKey;
125
- }
126
- get summaryTranslationParams() {
127
- return this._summaryTranslationParams;
128
- }
129
- }
130
-
131
- /*
132
- * Copyright 2015-2020 Ritense BV, the Netherlands.
133
- *
134
- * Licensed under EUPL, Version 1.2 (the "License");
135
- * you may not use this file except in compliance with the License.
136
- * You may obtain a copy of the License at
137
- *
138
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
139
- *
140
- * Unless required by applicable law or agreed to in writing, software
141
- * distributed under the License is distributed on an "AS IS" basis,
142
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143
- * See the License for the specific language governing permissions and
144
- * limitations under the License.
145
- */
146
-
147
- /*
148
- *
149
- * * Copyright 2015-2020 Ritense BV, the Netherlands.
150
- * *
151
- * * Licensed under EUPL, Version 1.2 (the "License");
152
- * * you may not use this file except in compliance with the License.
153
- * * You may obtain a copy of the License at
154
- * *
155
- * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
156
- * *
157
- * * Unless required by applicable law or agreed to in writing, software
158
- * * distributed under the License is distributed on an "AS IS" basis,
159
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160
- * * See the License for the specific language governing permissions and
161
- * * limitations under the License.
162
- *
163
- */
164
-
165
- /*
166
- * Copyright 2015-2020 Ritense BV, the Netherlands.
167
- *
168
- * Licensed under EUPL, Version 1.2 (the "License");
169
- * you may not use this file except in compliance with the License.
170
- * You may obtain a copy of the License at
171
- *
172
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
173
- *
174
- * Unless required by applicable law or agreed to in writing, software
175
- * distributed under the License is distributed on an "AS IS" basis,
176
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
177
- * See the License for the specific language governing permissions and
178
- * limitations under the License.
179
- */
180
- class CamundaFormComponent {
181
- constructor() {
182
- this.submitted = new EventEmitter();
183
- }
184
- onSubmitted(event) {
185
- this.submitted.emit(event);
186
- }
187
- }
188
- CamundaFormComponent.decorators = [
189
- { type: Component, args: [{
190
- selector: 'valtimo-camunda-form',
191
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"!componentName && submitted\">\n <valtimo-camunda-generated-form\n *ngIf=\"formFields\"\n [formFields]=\"formFields\"\n (submitted)=\"onSubmitted($event)\"\n >\n </valtimo-camunda-generated-form>\n</ng-container>\n<ng-container *ngIf=\"componentName\">\n <valtimo-custom-form [componentName]=\"componentName\"></valtimo-custom-form>\n</ng-container>\n"
192
- },] }
193
- ];
194
- CamundaFormComponent.ctorParameters = () => [];
195
- CamundaFormComponent.propDecorators = {
196
- componentName: [{ type: Input }],
197
- formFields: [{ type: Input }],
198
- submitted: [{ type: Output }]
199
- };
200
-
201
- /*
202
- * Copyright 2015-2020 Ritense BV, the Netherlands.
203
- *
204
- * Licensed under EUPL, Version 1.2 (the "License");
205
- * you may not use this file except in compliance with the License.
206
- * You may obtain a copy of the License at
207
- *
208
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
209
- *
210
- * Unless required by applicable law or agreed to in writing, software
211
- * distributed under the License is distributed on an "AS IS" basis,
212
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
213
- * See the License for the specific language governing permissions and
214
- * limitations under the License.
215
- */
216
- class CamundaCustomFormComponent {
217
- constructor(resolver) {
218
- this.resolver = resolver;
219
- }
220
- ngOnInit() {
221
- const factories = Array.from(this.resolver['_factories'].keys());
222
- const factoryClass = factories.find((x) => x.name === this.componentName);
223
- const cmpFactory = this.resolver.resolveComponentFactory(factoryClass);
224
- this.viewContainerRef.createComponent(cmpFactory);
225
- }
226
- }
227
- CamundaCustomFormComponent.decorators = [
228
- { type: Component, args: [{
229
- selector: 'valtimo-custom-form',
230
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-template #customFormContainer></ng-template>\n",
231
- styles: [""]
232
- },] }
233
- ];
234
- CamundaCustomFormComponent.ctorParameters = () => [
235
- { type: ComponentFactoryResolver }
236
- ];
237
- CamundaCustomFormComponent.propDecorators = {
238
- componentName: [{ type: Input }],
239
- viewContainerRef: [{ type: ViewChild, args: ['customFormContainer', { read: ViewContainerRef, static: true },] }]
240
- };
241
-
242
- /*
243
- * Copyright 2015-2020 Ritense BV, the Netherlands.
244
- *
245
- * Licensed under EUPL, Version 1.2 (the "License");
246
- * you may not use this file except in compliance with the License.
247
- * You may obtain a copy of the License at
248
- *
249
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
250
- *
251
- * Unless required by applicable law or agreed to in writing, software
252
- * distributed under the License is distributed on an "AS IS" basis,
253
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
- * See the License for the specific language governing permissions and
255
- * limitations under the License.
256
- */
257
- class CamundaCustomFormModule {
258
- }
259
- CamundaCustomFormModule.decorators = [
260
- { type: NgModule, args: [{
261
- declarations: [CamundaCustomFormComponent],
262
- imports: [CommonModule],
263
- exports: [CamundaCustomFormComponent],
264
- },] }
265
- ];
266
-
267
- /*
268
- * Copyright 2015-2020 Ritense BV, the Netherlands.
269
- *
270
- * Licensed under EUPL, Version 1.2 (the "License");
271
- * you may not use this file except in compliance with the License.
272
- * You may obtain a copy of the License at
273
- *
274
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
275
- *
276
- * Unless required by applicable law or agreed to in writing, software
277
- * distributed under the License is distributed on an "AS IS" basis,
278
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
279
- * See the License for the specific language governing permissions and
280
- * limitations under the License.
281
- */
282
- const moment = momentImported;
283
- moment.locale(localStorage.getItem('langKey'));
284
- const DATE_FORMAT = 'DD-MM-YYYY';
285
- function minDate(minDateIn) {
286
- return (control) => {
287
- if (!control.value) {
288
- return null;
289
- }
290
- const controlDate = moment.utc(control.value).startOf('day');
291
- const momentMinDate = moment.utc(minDateIn, DATE_FORMAT, true);
292
- if (!controlDate.isSameOrAfter(momentMinDate)) {
293
- return {
294
- minDate: {
295
- minDate: momentMinDate.format(DATE_FORMAT),
296
- actual: controlDate.format(DATE_FORMAT),
297
- },
298
- };
299
- }
300
- else {
301
- return null;
302
- }
303
- };
304
- }
305
- function maxDate(maxDateIn) {
306
- return (control) => {
307
- if (!control.value) {
308
- return null;
309
- }
310
- const controlDate = moment.utc(control.value).startOf('day');
311
- const momentMaxDate = moment.utc(maxDateIn, DATE_FORMAT, true);
312
- if (!controlDate.isSameOrBefore(momentMaxDate)) {
313
- return {
314
- maxDate: {
315
- maxDate: momentMaxDate.format(DATE_FORMAT),
316
- actual: controlDate.format(DATE_FORMAT),
317
- },
318
- };
319
- }
320
- else {
321
- return null;
322
- }
323
- };
324
- }
325
-
326
- /*
327
- * Copyright 2015-2020 Ritense BV, the Netherlands.
328
- *
329
- * Licensed under EUPL, Version 1.2 (the "License");
330
- * you may not use this file except in compliance with the License.
331
- * You may obtain a copy of the License at
332
- *
333
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
334
- *
335
- * Unless required by applicable law or agreed to in writing, software
336
- * distributed under the License is distributed on an "AS IS" basis,
337
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
338
- * See the License for the specific language governing permissions and
339
- * limitations under the License.
340
- */
341
- class CamundaFormfieldService {
342
- constructor() { }
343
- isFormFieldDisabled(formField) {
344
- return formField.validationConstraints.filter(vc => vc.name === 'readonly').length > 0;
345
- }
346
- getMinDate(formField) {
347
- return formField.validationConstraints.filter(vc => vc.name === 'minDate' && vc.configuration)[0];
348
- }
349
- getMaxDate(formField) {
350
- return formField.validationConstraints.filter(vc => vc.name === 'maxDate' && vc.configuration)[0];
351
- }
352
- getValidatorTypes(formField) {
353
- const validatorTypes = [];
354
- formField.validationConstraints.forEach(validationConstraint => {
355
- if (validationConstraint.name === 'required') {
356
- validatorTypes.push(Validators.required);
357
- }
358
- if (validationConstraint.name === 'minlength') {
359
- validatorTypes.push(Validators.minLength(+validationConstraint.configuration));
360
- }
361
- if (validationConstraint.name === 'maxlength') {
362
- validatorTypes.push(Validators.maxLength(+validationConstraint.configuration));
363
- }
364
- if (validationConstraint.name === 'min') {
365
- validatorTypes.push(Validators.min(+validationConstraint.configuration));
366
- }
367
- if (validationConstraint.name === 'max') {
368
- validatorTypes.push(Validators.max(+validationConstraint.configuration));
369
- }
370
- if (validationConstraint.name === 'minDate') {
371
- validatorTypes.push(minDate(validationConstraint.configuration));
372
- }
373
- if (validationConstraint.name === 'maxDate') {
374
- validatorTypes.push(maxDate(validationConstraint.configuration));
375
- }
376
- });
377
- return validatorTypes;
378
- }
379
- }
380
- CamundaFormfieldService.ɵprov = ɵɵdefineInjectable({ factory: function CamundaFormfieldService_Factory() { return new CamundaFormfieldService(); }, token: CamundaFormfieldService, providedIn: "root" });
381
- CamundaFormfieldService.decorators = [
382
- { type: Injectable, args: [{
383
- providedIn: 'root',
384
- },] }
385
- ];
386
- CamundaFormfieldService.ctorParameters = () => [];
387
-
388
- /*
389
- * Copyright 2015-2020 Ritense BV, the Netherlands.
390
- *
391
- * Licensed under EUPL, Version 1.2 (the "License");
392
- * you may not use this file except in compliance with the License.
393
- * You may obtain a copy of the License at
394
- *
395
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
396
- *
397
- * Unless required by applicable law or agreed to in writing, software
398
- * distributed under the License is distributed on an "AS IS" basis,
399
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
400
- * See the License for the specific language governing permissions and
401
- * limitations under the License.
402
- */
403
- class CamundaGeneratedFormComponent {
404
- constructor(formBuilder, camundaFormFieldService, location) {
405
- this.formBuilder = formBuilder;
406
- this.camundaFormFieldService = camundaFormFieldService;
407
- this.location = location;
408
- this.submitted = new EventEmitter();
409
- this.formFields = [];
410
- }
411
- ngOnInit() {
412
- this.formGroup = this.createFormGroup();
413
- }
414
- createFormGroup() {
415
- const group = this.formBuilder.group({});
416
- this.formFields.forEach(formField => {
417
- const control = new FormControl({
418
- value: formField.defaultValue,
419
- disabled: this.camundaFormFieldService.isFormFieldDisabled(formField),
420
- }, this.camundaFormFieldService.getValidatorTypes(formField));
421
- group.addControl(formField.id, control);
422
- });
423
- return group;
424
- }
425
- reset() {
426
- this.formGroup.reset();
427
- }
428
- back() {
429
- this.location.back();
430
- }
431
- handleSubmit(event) {
432
- event.preventDefault();
433
- event.stopPropagation();
434
- this.submitted.emit(this.formGroup.value);
435
- }
436
- }
437
- CamundaGeneratedFormComponent.decorators = [
438
- { type: Component, args: [{
439
- selector: 'valtimo-camunda-generated-form',
440
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<form [formGroup]=\"formGroup\" (ngSubmit)=\"handleSubmit($event)\">\n <ng-container\n *ngFor=\"let formField of formFields\"\n valtimoCamundaFormfieldGenerator\n [formGroup]=\"formGroup\"\n [formField]=\"formField\"\n >\n <ng-content></ng-content>\n </ng-container>\n <div class=\"row pt-3 mt-1\">\n <div class=\"col-sm-12\">\n <div class=\"text-right\">\n <button\n class=\"btn btn-space btn-default float-left\"\n type=\"button\"\n (click)=\"back()\"\n id=\"back-button\"\n >\n Back\n </button>\n <button\n class=\"btn btn-space btn-secondary\"\n type=\"button\"\n (click)=\"reset()\"\n id=\"reset-button\"\n >\n Reset\n </button>\n <button\n class=\"btn btn-space btn-primary\"\n [disabled]=\"!formGroup.disabled && !formGroup.valid\"\n type=\"submit\"\n id=\"submit-button\"\n >\n Submit\n </button>\n </div>\n </div>\n </div>\n</form>\n"
441
- },] }
442
- ];
443
- CamundaGeneratedFormComponent.ctorParameters = () => [
444
- { type: FormBuilder },
445
- { type: CamundaFormfieldService },
446
- { type: Location }
447
- ];
448
- CamundaGeneratedFormComponent.propDecorators = {
449
- submitted: [{ type: Output }],
450
- formFields: [{ type: Input }]
451
- };
452
-
453
- /*
454
- * Copyright 2015-2020 Ritense BV, the Netherlands.
455
- *
456
- * Licensed under EUPL, Version 1.2 (the "License");
457
- * you may not use this file except in compliance with the License.
458
- * You may obtain a copy of the License at
459
- *
460
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
461
- *
462
- * Unless required by applicable law or agreed to in writing, software
463
- * distributed under the License is distributed on an "AS IS" basis,
464
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
465
- * See the License for the specific language governing permissions and
466
- * limitations under the License.
467
- */
468
- class CamundaStringFormfieldComponent {
469
- constructor() { }
470
- }
471
- CamundaStringFormfieldComponent.decorators = [
472
- { type: Component, args: [{
473
- selector: 'valtimo-camunda-string-formfield',
474
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n id=\"{{ formField.id }}\"\n class=\"form-control\"\n type=\"text\"\n [attr.placeholder]=\"formField.defaultValue\"\n [formControlName]=\"formField.id\"\n />\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
475
- },] }
476
- ];
477
- CamundaStringFormfieldComponent.ctorParameters = () => [];
478
-
479
- /*
480
- * Copyright 2015-2020 Ritense BV, the Netherlands.
481
- *
482
- * Licensed under EUPL, Version 1.2 (the "License");
483
- * you may not use this file except in compliance with the License.
484
- * You may obtain a copy of the License at
485
- *
486
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
487
- *
488
- * Unless required by applicable law or agreed to in writing, software
489
- * distributed under the License is distributed on an "AS IS" basis,
490
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
491
- * See the License for the specific language governing permissions and
492
- * limitations under the License.
493
- */
494
- class CamundaBooleanFormfieldComponent {
495
- constructor() { }
496
- }
497
- CamundaBooleanFormfieldComponent.decorators = [
498
- { type: Component, args: [{
499
- selector: 'valtimo-camunda-boolean-formfield',
500
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6 form-check mt-1\">\n <label for=\"yes_{{ formField.id }}\" class=\"custom-control custom-radio custom-control-inline\">\n <input\n class=\"custom-control-input\"\n id=\"yes_{{ formField.id }}\"\n type=\"radio\"\n [value]=\"true\"\n [formControlName]=\"formField.id\"\n />\n <span class=\"custom-control-label custom-control-color\">Yes</span>\n </label>\n <label for=\"no_{{ formField.id }}\" class=\"custom-control custom-radio custom-control-inline\">\n <input\n class=\"custom-control-input\"\n id=\"no_{{ formField.id }}\"\n type=\"radio\"\n [value]=\"false\"\n [formControlName]=\"formField.id\"\n />\n <span class=\"custom-control-label custom-control-color\">No</span>\n </label>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
501
- },] }
502
- ];
503
- CamundaBooleanFormfieldComponent.ctorParameters = () => [];
504
-
505
- /*
506
- * Copyright 2015-2020 Ritense BV, the Netherlands.
507
- *
508
- * Licensed under EUPL, Version 1.2 (the "License");
509
- * you may not use this file except in compliance with the License.
510
- * You may obtain a copy of the License at
511
- *
512
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
513
- *
514
- * Unless required by applicable law or agreed to in writing, software
515
- * distributed under the License is distributed on an "AS IS" basis,
516
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
517
- * See the License for the specific language governing permissions and
518
- * limitations under the License.
519
- */
520
- const moment$1 = momentImported;
521
- moment$1.locale(localStorage.getItem('langKey'));
522
- class CamundaDateFormfieldComponent {
523
- constructor(formFieldService) {
524
- this.formFieldService = formFieldService;
525
- this.datePickerOptions = {};
526
- }
527
- ngOnInit() {
528
- this.INPUT_SELECTOR = '#' + this.formField.id;
529
- this.datePickerOptions = {
530
- autoclose: true,
531
- componentIcon: '.mdi.mdi-calendar',
532
- navIcons: {
533
- rightIcon: 'mdi mdi-chevron-right',
534
- leftIcon: 'mdi mdi-chevron-left',
535
- },
536
- format: 'dd-mm-yyyy',
537
- };
538
- }
539
- ngAfterViewInit() {
540
- const formGroup = this.formGroup;
541
- const formField = this.formField;
542
- const maxDate = this.formFieldService.getMaxDate(this.formField);
543
- if (maxDate) {
544
- this.datePickerOptions.endDate = maxDate.configuration;
545
- }
546
- const minDate = this.formFieldService.getMinDate(this.formField);
547
- if (minDate) {
548
- this.datePickerOptions.startDate = minDate.configuration;
549
- }
550
- $(this.INPUT_SELECTOR).datetimepicker(this.datePickerOptions);
551
- $(this.INPUT_SELECTOR).on('changeDate', function (e) {
552
- formGroup.patchValue({
553
- [formField.id]: moment$1(e.date.valueOf()).format('DD/MM/YYYY'),
554
- });
555
- });
556
- }
557
- }
558
- CamundaDateFormfieldComponent.decorators = [
559
- { type: Component, args: [{
560
- selector: 'valtimo-camunda-date-formfield',
561
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6 pt1\">\n <input\n type=\"input\"\n class=\"form-control\"\n data-min-view=\"2\"\n id=\"{{ formField.id }}\"\n autocomplete=\"off\"\n [formControlName]=\"formField.id\"\n />\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
562
- },] }
563
- ];
564
- CamundaDateFormfieldComponent.ctorParameters = () => [
565
- { type: CamundaFormfieldService }
566
- ];
567
-
568
- /*
569
- * Copyright 2015-2020 Ritense BV, the Netherlands.
570
- *
571
- * Licensed under EUPL, Version 1.2 (the "License");
572
- * you may not use this file except in compliance with the License.
573
- * You may obtain a copy of the License at
574
- *
575
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
576
- *
577
- * Unless required by applicable law or agreed to in writing, software
578
- * distributed under the License is distributed on an "AS IS" basis,
579
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
580
- * See the License for the specific language governing permissions and
581
- * limitations under the License.
582
- */
583
- class CamundaLongFormfieldComponent {
584
- constructor() { }
585
- }
586
- CamundaLongFormfieldComponent.decorators = [
587
- { type: Component, args: [{
588
- selector: 'valtimo-camunda-long-formfield',
589
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <input\n id=\"{{ formField.id }}\"\n class=\"form-control\"\n type=\"number\"\n [attr.placeholder]=\"formField.defaultValue\"\n [formControlName]=\"formField.id\"\n />\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
590
- },] }
591
- ];
592
- CamundaLongFormfieldComponent.ctorParameters = () => [];
593
-
594
- /*
595
- * Copyright 2015-2020 Ritense BV, the Netherlands.
596
- *
597
- * Licensed under EUPL, Version 1.2 (the "License");
598
- * you may not use this file except in compliance with the License.
599
- * You may obtain a copy of the License at
600
- *
601
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
602
- *
603
- * Unless required by applicable law or agreed to in writing, software
604
- * distributed under the License is distributed on an "AS IS" basis,
605
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
606
- * See the License for the specific language governing permissions and
607
- * limitations under the License.
608
- */
609
- class CamundaEnumFormfieldComponent {
610
- constructor() { }
611
- ngOnInit() {
612
- this.valueKeys = Object.keys(this.formField.type.values);
613
- }
614
- }
615
- CamundaEnumFormfieldComponent.decorators = [
616
- { type: Component, args: [{
617
- selector: 'valtimo-camunda-enum-formfield',
618
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select class=\"form-control\" id=\"{{ formField.id }}\" [formControlName]=\"formField.id\">\n <option selected=\"selected\" value=\"\"></option>\n <option *ngFor=\"let key of valueKeys\" [value]=\"key\" id=\"option_{{ key }}\">\n {{ formField.type.values[key] }}\n </option>\n </select>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
619
- },] }
620
- ];
621
- CamundaEnumFormfieldComponent.ctorParameters = () => [];
622
-
623
- /*
624
- * Copyright 2015-2020 Ritense BV, the Netherlands.
625
- *
626
- * Licensed under EUPL, Version 1.2 (the "License");
627
- * you may not use this file except in compliance with the License.
628
- * You may obtain a copy of the License at
629
- *
630
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
631
- *
632
- * Unless required by applicable law or agreed to in writing, software
633
- * distributed under the License is distributed on an "AS IS" basis,
634
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
635
- * See the License for the specific language governing permissions and
636
- * limitations under the License.
637
- */
638
- class CamundaTextareaFormfieldComponent {
639
- constructor() { }
640
- }
641
- CamundaTextareaFormfieldComponent.decorators = [
642
- { type: Component, args: [{
643
- selector: 'valtimo-camunda-textarea-formfield',
644
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <textarea\n id=\"{{ formField.id }}\"\n class=\"form-control\"\n [attr.placeholder]=\"formField.defaultValue\"\n [formControlName]=\"formField.id\"\n ></textarea>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
645
- },] }
646
- ];
647
- CamundaTextareaFormfieldComponent.ctorParameters = () => [];
648
-
649
- /*
650
- * Copyright 2015-2020 Ritense BV, the Netherlands.
651
- *
652
- * Licensed under EUPL, Version 1.2 (the "License");
653
- * you may not use this file except in compliance with the License.
654
- * You may obtain a copy of the License at
655
- *
656
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
657
- *
658
- * Unless required by applicable law or agreed to in writing, software
659
- * distributed under the License is distributed on an "AS IS" basis,
660
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
661
- * See the License for the specific language governing permissions and
662
- * limitations under the License.
663
- */
664
- class CamundaChoicefieldFormfieldComponent {
665
- constructor(choicefieldService) {
666
- this.choicefieldService = choicefieldService;
667
- this.choicefieldValues = [];
668
- }
669
- ngOnInit() {
670
- this.choicefieldService
671
- .getChoiceFieldValuesByName(this.formField.properties['choicefield'])
672
- .subscribe(data => {
673
- this.choicefieldValues = data;
674
- });
675
- }
676
- }
677
- CamundaChoicefieldFormfieldComponent.decorators = [
678
- { type: Component, args: [{
679
- selector: 'valtimo-camunda-choicefield-formfield',
680
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"form-group row\" [formGroup]=\"formGroup\">\n <label for=\"{{ formField.id }}\" class=\"col-12 col-sm-3 col-form-label text-sm-right\">\n {{ formField.label }}\n </label>\n <div class=\"col-12 col-sm-8 col-lg-6\">\n <select class=\"form-control\" id=\"{{ formField.id }}\" [formControlName]=\"formField.id\">\n <option selected=\"selected\" value=\"\"></option>\n <ng-container *ngFor=\"let choicefieldValue of choicefieldValues\">\n <option\n *ngIf=\"!choicefieldValue.deprecated\"\n [value]=\"choicefieldValue.value\"\n id=\"option_{{ choicefieldValue.value }}\"\n >\n {{ choicefieldValue.name }}\n </option>\n </ng-container>\n </select>\n <valtimo-camunda-formfield-validation [formGroup]=\"formGroup\" [formField]=\"formField\">\n </valtimo-camunda-formfield-validation>\n </div>\n</div>\n"
681
- },] }
682
- ];
683
- CamundaChoicefieldFormfieldComponent.ctorParameters = () => [
684
- { type: ChoicefieldService }
685
- ];
686
-
687
- /*
688
- * Copyright 2015-2020 Ritense BV, the Netherlands.
689
- *
690
- * Licensed under EUPL, Version 1.2 (the "License");
691
- * you may not use this file except in compliance with the License.
692
- * You may obtain a copy of the License at
693
- *
694
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
695
- *
696
- * Unless required by applicable law or agreed to in writing, software
697
- * distributed under the License is distributed on an "AS IS" basis,
698
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
699
- * See the License for the specific language governing permissions and
700
- * limitations under the License.
701
- */
702
- class CamundaFormfieldGeneratorDirective {
703
- constructor(viewContainerRef, componentFactoryResolver) {
704
- this.viewContainerRef = viewContainerRef;
705
- this.componentFactoryResolver = componentFactoryResolver;
706
- this.COMPONENTS = {
707
- string: CamundaStringFormfieldComponent,
708
- boolean: CamundaBooleanFormfieldComponent,
709
- date: CamundaDateFormfieldComponent,
710
- long: CamundaLongFormfieldComponent,
711
- enum: CamundaEnumFormfieldComponent,
712
- textarea: CamundaTextareaFormfieldComponent,
713
- choicefield: CamundaChoicefieldFormfieldComponent,
714
- };
715
- }
716
- ngOnInit() {
717
- const typeName = this.formField.typeName.toLowerCase();
718
- if (!this.COMPONENTS[typeName]) {
719
- throw new Error('Could not find component for formfield type: ' + typeName);
720
- }
721
- const component = this.COMPONENTS[typeName];
722
- const factory = this.componentFactoryResolver.resolveComponentFactory(component);
723
- this.component = this.viewContainerRef.createComponent(factory);
724
- this.component.instance.formGroup = this.formGroup;
725
- this.component.instance.formField = this.formField;
726
- }
727
- }
728
- CamundaFormfieldGeneratorDirective.decorators = [
729
- { type: Directive, args: [{
730
- selector: '[valtimoCamundaFormfieldGenerator]',
731
- },] }
732
- ];
733
- CamundaFormfieldGeneratorDirective.ctorParameters = () => [
734
- { type: ViewContainerRef },
735
- { type: ComponentFactoryResolver }
736
- ];
737
- CamundaFormfieldGeneratorDirective.propDecorators = {
738
- formField: [{ type: Input }],
739
- formGroup: [{ type: Input }]
740
- };
741
-
742
- /*
743
- * Copyright 2015-2020 Ritense BV, the Netherlands.
744
- *
745
- * Licensed under EUPL, Version 1.2 (the "License");
746
- * you may not use this file except in compliance with the License.
747
- * You may obtain a copy of the License at
748
- *
749
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
750
- *
751
- * Unless required by applicable law or agreed to in writing, software
752
- * distributed under the License is distributed on an "AS IS" basis,
753
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
754
- * See the License for the specific language governing permissions and
755
- * limitations under the License.
756
- */
757
- class CamundaFormfieldValidationComponent {
758
- constructor() { }
759
- ngOnInit() {
760
- this.formControl = this.formGroup.get(this.formField.id);
761
- }
762
- }
763
- CamundaFormfieldValidationComponent.decorators = [
764
- { type: Component, args: [{
765
- selector: 'valtimo-camunda-formfield-validation',
766
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ul\n class=\"parsley-errors-list filled\"\n *ngIf=\"formControl.invalid && (formControl.dirty || formControl.touched)\"\n>\n <li *ngIf=\"formControl.errors.required\">This field is required.</li>\n <li *ngIf=\"formControl.errors.minlength\">\n This field should be more than {{ formControl.errors.minlength.requiredLength }} characters.\n </li>\n <li *ngIf=\"formControl.errors.maxlength\">\n This field cannot be more than {{ formControl.errors.maxlength.requiredLength }} characters.\n </li>\n <li *ngIf=\"formControl.errors.min\">\n This field should be more than {{ formControl.errors.min.min }}.\n </li>\n <li *ngIf=\"formControl.errors.max\">\n This field should be less or equal to {{ formControl.errors.max.max }}.\n </li>\n <li *ngIf=\"formControl.errors.minDate\">\n This field should be more than {{ formControl.errors.minDate.minDate }}.\n </li>\n <li *ngIf=\"formControl.errors.maxDate\">\n This field should be less or equal to {{ formControl.errors.maxDate.maxDate }}.\n </li>\n</ul>\n"
767
- },] }
768
- ];
769
- CamundaFormfieldValidationComponent.ctorParameters = () => [];
770
- CamundaFormfieldValidationComponent.propDecorators = {
771
- formGroup: [{ type: Input }],
772
- formField: [{ type: Input }]
773
- };
774
-
775
- /*
776
- * Copyright 2015-2020 Ritense BV, the Netherlands.
777
- *
778
- * Licensed under EUPL, Version 1.2 (the "License");
779
- * you may not use this file except in compliance with the License.
780
- * You may obtain a copy of the License at
781
- *
782
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
783
- *
784
- * Unless required by applicable law or agreed to in writing, software
785
- * distributed under the License is distributed on an "AS IS" basis,
786
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
787
- * See the License for the specific language governing permissions and
788
- * limitations under the License.
789
- */
790
- class CamundaGeneratedFormModule {
791
- }
792
- CamundaGeneratedFormModule.decorators = [
793
- { type: NgModule, args: [{
794
- declarations: [
795
- CamundaStringFormfieldComponent,
796
- CamundaBooleanFormfieldComponent,
797
- CamundaDateFormfieldComponent,
798
- CamundaFormfieldGeneratorDirective,
799
- CamundaLongFormfieldComponent,
800
- CamundaEnumFormfieldComponent,
801
- CamundaTextareaFormfieldComponent,
802
- CamundaChoicefieldFormfieldComponent,
803
- CamundaFormfieldValidationComponent,
804
- CamundaGeneratedFormComponent,
805
- ],
806
- imports: [CommonModule, ReactiveFormsModule],
807
- exports: [CamundaGeneratedFormComponent],
808
- entryComponents: [
809
- CamundaStringFormfieldComponent,
810
- CamundaBooleanFormfieldComponent,
811
- CamundaDateFormfieldComponent,
812
- CamundaLongFormfieldComponent,
813
- CamundaEnumFormfieldComponent,
814
- CamundaTextareaFormfieldComponent,
815
- CamundaChoicefieldFormfieldComponent,
816
- ],
817
- },] }
818
- ];
819
-
820
- /*
821
- * Copyright 2015-2020 Ritense BV, the Netherlands.
822
- *
823
- * Licensed under EUPL, Version 1.2 (the "License");
824
- * you may not use this file except in compliance with the License.
825
- * You may obtain a copy of the License at
826
- *
827
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
828
- *
829
- * Unless required by applicable law or agreed to in writing, software
830
- * distributed under the License is distributed on an "AS IS" basis,
831
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
832
- * See the License for the specific language governing permissions and
833
- * limitations under the License.
834
- */
835
- class CamundaFormModule {
836
- }
837
- CamundaFormModule.decorators = [
838
- { type: NgModule, args: [{
839
- declarations: [CamundaFormComponent],
840
- imports: [CommonModule, CamundaGeneratedFormModule, CamundaCustomFormModule],
841
- exports: [CamundaFormComponent],
842
- },] }
843
- ];
844
-
845
- /*
846
- * Copyright 2015-2020 Ritense BV, the Netherlands.
847
- *
848
- * Licensed under EUPL, Version 1.2 (the "License");
849
- * you may not use this file except in compliance with the License.
850
- * You may obtain a copy of the License at
851
- *
852
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
853
- *
854
- * Unless required by applicable law or agreed to in writing, software
855
- * distributed under the License is distributed on an "AS IS" basis,
856
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
857
- * See the License for the specific language governing permissions and
858
- * limitations under the License.
859
- */
860
- class TopbarComponent {
861
- constructor() { }
862
- }
863
- TopbarComponent.decorators = [
864
- { type: Component, args: [{
865
- selector: 'valtimo-topbar',
866
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<nav class=\"navbar navbar-expand fixed-top be-top-header\">\n <div class=\"container-fluid\">\n <div class=\"be-navbar-header\">\n <a class=\"navbar-brand\" [routerLink]=\"['/']\"></a>\n </div>\n <div class=\"be-right-navbar\">\n <!-- important empty div: in order to made float-right element works on mobile -->\n <div></div>\n <ul class=\"nav navbar-nav be-user-nav float-right be-icons-nav\">\n <li class=\"nav-item dropdown special\">\n <a class=\"nav-link be-toggle-right-sidebar\" href=\"#\" role=\"button\" aria-expanded=\"false\">\n <i class=\"mdi mdi-account-circle user-icon\"></i>\n </a>\n </li>\n </ul>\n </div>\n </div>\n</nav>\n",
867
- styles: [".user-icon{font-size:30px}.be-toggle-right-sidebar{display:flex}"]
868
- },] }
869
- ];
870
- TopbarComponent.ctorParameters = () => [];
871
-
872
- /*
873
- * Copyright 2015-2020 Ritense BV, the Netherlands.
874
- *
875
- * Licensed under EUPL, Version 1.2 (the "License");
876
- * you may not use this file except in compliance with the License.
877
- * You may obtain a copy of the License at
878
- *
879
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
880
- *
881
- * Unless required by applicable law or agreed to in writing, software
882
- * distributed under the License is distributed on an "AS IS" basis,
883
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
- * See the License for the specific language governing permissions and
885
- * limitations under the License.
886
- */
887
- class TopbarModule {
888
- }
889
- TopbarModule.decorators = [
890
- { type: NgModule, args: [{
891
- declarations: [TopbarComponent],
892
- imports: [CommonModule, RouterModule],
893
- exports: [TopbarComponent],
894
- },] }
895
- ];
896
-
897
- /*
898
- * Copyright 2015-2020 Ritense BV, the Netherlands.
899
- *
900
- * Licensed under EUPL, Version 1.2 (the "License");
901
- * you may not use this file except in compliance with the License.
902
- * You may obtain a copy of the License at
903
- *
904
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
905
- *
906
- * Unless required by applicable law or agreed to in writing, software
907
- * distributed under the License is distributed on an "AS IS" basis,
908
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
909
- * See the License for the specific language governing permissions and
910
- * limitations under the License.
911
- */
912
- class MenuService {
913
- constructor(configService, documentService, userProviderService, logger, menuIncludeService) {
914
- this.configService = configService;
915
- this.documentService = documentService;
916
- this.userProviderService = userProviderService;
917
- this.logger = logger;
918
- this.menuIncludeService = menuIncludeService;
919
- this.includeFunctionObservables = {};
920
- this._menuItems$ = new BehaviorSubject(undefined);
921
- this.menuConfig = configService.config.menu;
922
- }
923
- init() {
924
- this.reload();
925
- this.logger.debug('Menu initialized');
926
- }
927
- get menuItems$() {
928
- return this._menuItems$.asObservable();
929
- }
930
- reload() {
931
- return this._menuItems$.next(this.loadMenuItems());
932
- }
933
- loadMenuItems() {
934
- let menuItems = [];
935
- this.menuConfig.menuItems.forEach((menuItem) => {
936
- if (menuItem.includeFunction !== undefined) {
937
- this.includeFunctionObservables[menuItem.title] =
938
- this.menuIncludeService.getIncludeFunction(menuItem.includeFunction);
939
- }
940
- menuItem.show = true;
941
- menuItems.push(menuItem);
942
- });
943
- menuItems = this.sortMenuItems(menuItems);
944
- this.appendDossierSubMenuItems(menuItems).subscribe(value => (menuItems = this.applyMenuRoleSecurity(value)));
945
- return menuItems;
946
- }
947
- sortMenuItems(menuItems) {
948
- return menuItems.sort((a, b) => {
949
- return a.sequence - b.sequence;
950
- });
951
- }
952
- appendDossierSubMenuItems(menuItems) {
953
- return new Observable(subscriber => {
954
- this.logger.debug('appendDossierSubMenuItems');
955
- this.documentService.getAllDefinitions().subscribe(definitions => {
956
- const dossierMenuItems = definitions.content.map((definition, index) => ({
957
- link: ['/dossiers/' + definition.id.name],
958
- title: definition.schema.title,
959
- iconClass: 'icon mdi mdi-dot-circle',
960
- sequence: index,
961
- show: true,
962
- }));
963
- this.logger.debug('found dossierMenuItems', dossierMenuItems);
964
- const menuItemIndex = menuItems.findIndex(({ title }) => title === 'Dossiers');
965
- if (menuItemIndex > 0) {
966
- const dossierMenu = menuItems[menuItemIndex];
967
- this.logger.debug('updating dossierMenu', dossierMenu);
968
- dossierMenu.children = dossierMenuItems;
969
- menuItems[menuItemIndex] = dossierMenu;
970
- }
971
- subscriber.next(menuItems);
972
- this.logger.debug('appendDossierSubMenuItems finished');
973
- });
974
- });
975
- }
976
- applyMenuRoleSecurity(menuItems) {
977
- this.userProviderService.getUserSubject().subscribe(user => {
978
- if (user.roles != null) {
979
- this.logger.debug('applyMenuRoleSecurity');
980
- const userRoles = user.roles;
981
- menuItems.forEach((menuItem) => {
982
- const access = this.determineRoleAccess(menuItem, userRoles);
983
- this.logger.debug('Menu: check role access', menuItem.roles, access);
984
- if (menuItem.show !== access) {
985
- this.logger.debug('Menu: Change access', menuItem, access);
986
- menuItem.show = access;
987
- }
988
- });
989
- }
990
- });
991
- return menuItems;
992
- }
993
- determineRoleAccess(menuItem, roles) {
994
- if (!menuItem.roles) {
995
- return true;
996
- }
997
- else if (menuItem.roles.some(role => roles.includes(role))) {
998
- return true;
999
- }
1000
- else {
1001
- return false;
1002
- }
1003
- }
1004
- }
1005
- MenuService.ɵprov = ɵɵdefineInjectable({ factory: function MenuService_Factory() { return new MenuService(ɵɵinject(ConfigService), ɵɵinject(DocumentService), ɵɵinject(UserProviderService), ɵɵinject(NGXLogger), ɵɵinject(MenuIncludeService)); }, token: MenuService, providedIn: "root" });
1006
- MenuService.decorators = [
1007
- { type: Injectable, args: [{
1008
- providedIn: 'root',
1009
- },] }
1010
- ];
1011
- MenuService.ctorParameters = () => [
1012
- { type: ConfigService },
1013
- { type: DocumentService },
1014
- { type: UserProviderService },
1015
- { type: NGXLogger },
1016
- { type: MenuIncludeService }
1017
- ];
1018
-
1019
- /*
1020
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1021
- *
1022
- * Licensed under EUPL, Version 1.2 (the "License");
1023
- * you may not use this file except in compliance with the License.
1024
- * You may obtain a copy of the License at
1025
- *
1026
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1027
- *
1028
- * Unless required by applicable law or agreed to in writing, software
1029
- * distributed under the License is distributed on an "AS IS" basis,
1030
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1031
- * See the License for the specific language governing permissions and
1032
- * limitations under the License.
1033
- */
1034
- const routes = [];
1035
- class MenuRoutingModule {
1036
- }
1037
- MenuRoutingModule.decorators = [
1038
- { type: NgModule, args: [{
1039
- imports: [RouterModule.forChild(routes)],
1040
- exports: [RouterModule],
1041
- },] }
1042
- ];
1043
-
1044
- /*
1045
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1046
- *
1047
- * Licensed under EUPL, Version 1.2 (the "License");
1048
- * you may not use this file except in compliance with the License.
1049
- * You may obtain a copy of the License at
1050
- *
1051
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1052
- *
1053
- * Unless required by applicable law or agreed to in writing, software
1054
- * distributed under the License is distributed on an "AS IS" basis,
1055
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1056
- * See the License for the specific language governing permissions and
1057
- * limitations under the License.
1058
- */
1059
- class MenuComponent {
1060
- constructor(menuService, elRef, renderer, router) {
1061
- this.menuService = menuService;
1062
- this.elRef = elRef;
1063
- this.renderer = renderer;
1064
- this.router = router;
1065
- this.includeFunctionObservables = {};
1066
- this.includeFunctionObservables = this.menuService.includeFunctionObservables;
1067
- }
1068
- ngOnInit() {
1069
- this.openRouterSubscription();
1070
- this.menuItemSubscription = this.menuService.menuItems$.subscribe(value => (this.menuItems = value));
1071
- }
1072
- ngOnDestroy() {
1073
- this.routerSubscription.unsubscribe();
1074
- this.menuItemSubscription.unsubscribe();
1075
- }
1076
- openRouterSubscription() {
1077
- this.routerSubscription = this.router.events.subscribe((event) => {
1078
- if (event instanceof NavigationEnd) {
1079
- this.closeSubMenu();
1080
- }
1081
- });
1082
- }
1083
- closeSubMenu() {
1084
- const visibleSubMenuElm = this.elRef.nativeElement.querySelector('.sub-menu.visible');
1085
- if (visibleSubMenuElm) {
1086
- this.renderer.removeClass(visibleSubMenuElm, 'visible');
1087
- const topLevelMenuItem = this.elRef.nativeElement.querySelector('li.parent.open');
1088
- if (topLevelMenuItem) {
1089
- this.renderer.removeClass(topLevelMenuItem, 'open');
1090
- }
1091
- }
1092
- }
1093
- }
1094
- MenuComponent.decorators = [
1095
- { type: Component, args: [{
1096
- selector: 'valtimo-menu',
1097
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ul class=\"sidebar-elements\">\n <ng-container *ngFor=\"let menuItem of menuItems\">\n <li\n [class.parent]=\"menuItem.children\"\n [hidden]=\"!menuItem.show\"\n [routerLinkActive]=\"'active'\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n [ngClass]=\"{\n 'menu-item--hidden': menuItem.includeFunction !== undefined,\n 'menu-item--visible':\n menuItem.includeFunction !== undefined &&\n (includeFunctionObservables[menuItem.title] | async)\n }\"\n >\n <a *ngIf=\"menuItem.link\" [routerLink]=\"menuItem.link\" class=\"sub-item\">\n <valtimo-menu-item-text [menuItem]=\"menuItem\"></valtimo-menu-item-text>\n </a>\n <a *ngIf=\"!menuItem.link\" class=\"sub-item\">\n <valtimo-menu-item-text [menuItem]=\"menuItem\"></valtimo-menu-item-text>\n </a>\n <ng-container *ngIf=\"menuItem.children\">\n <ul class=\"sub-menu\">\n <li class=\"title\">{{ menuItem.title | translate }}</li>\n <li\n *ngFor=\"let subMenuItem of menuItem.children\"\n [routerLinkActive]=\"'active'\"\n [routerLinkActiveOptions]=\"{exact: true}\"\n >\n <a *ngIf=\"subMenuItem.link\" [routerLink]=\"subMenuItem.link\">\n <valtimo-submenu-item-text [submenuItem]=\"subMenuItem\"></valtimo-submenu-item-text>\n </a>\n <a *ngIf=\"!subMenuItem.link\">\n <valtimo-submenu-item-text [submenuItem]=\"subMenuItem\"></valtimo-submenu-item-text>\n </a>\n </li>\n </ul>\n </ng-container>\n </li>\n </ng-container>\n</ul>\n",
1098
- styles: [".c-default{cursor:default}.sub-item{cursor:pointer}.menu-item--hidden{display:none}.menu-item--visible{display:block}"]
1099
- },] }
1100
- ];
1101
- MenuComponent.ctorParameters = () => [
1102
- { type: MenuService },
1103
- { type: ElementRef },
1104
- { type: Renderer2 },
1105
- { type: Router }
1106
- ];
1107
-
1108
- /*
1109
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1110
- *
1111
- * Licensed under EUPL, Version 1.2 (the "License");
1112
- * you may not use this file except in compliance with the License.
1113
- * You may obtain a copy of the License at
1114
- *
1115
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1116
- *
1117
- * Unless required by applicable law or agreed to in writing, software
1118
- * distributed under the License is distributed on an "AS IS" basis,
1119
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1120
- * See the License for the specific language governing permissions and
1121
- * limitations under the License.
1122
- */
1123
- class MenuItemTextComponent {
1124
- }
1125
- MenuItemTextComponent.decorators = [
1126
- { type: Component, args: [{
1127
- selector: 'valtimo-menu-item-text',
1128
- template: `
1129
- <i
1130
- class="{{ menuItem.iconClass }}"
1131
- container="body"
1132
- placement="right"
1133
- ngbTooltip="{{ menuItem.title | translate }}"
1134
- autoClose="true"
1135
- >
1136
- </i>
1137
- <span>{{ menuItem.title | translate }}</span>
1138
- `
1139
- },] }
1140
- ];
1141
- MenuItemTextComponent.propDecorators = {
1142
- menuItem: [{ type: Input }]
1143
- };
1144
-
1145
- /*
1146
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1147
- *
1148
- * Licensed under EUPL, Version 1.2 (the "License");
1149
- * you may not use this file except in compliance with the License.
1150
- * You may obtain a copy of the License at
1151
- *
1152
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1153
- *
1154
- * Unless required by applicable law or agreed to in writing, software
1155
- * distributed under the License is distributed on an "AS IS" basis,
1156
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1157
- * See the License for the specific language governing permissions and
1158
- * limitations under the License.
1159
- */
1160
- class SubmenuItemTextComponent {
1161
- }
1162
- SubmenuItemTextComponent.decorators = [
1163
- { type: Component, args: [{
1164
- selector: 'valtimo-submenu-item-text',
1165
- template: `
1166
- <span [ngClass]="submenuItem.textClass">
1167
- {{ submenuItem.title | translate }}
1168
- <ng-container *ngIf="!submenuItem.link">&gt;</ng-container>
1169
- </span>
1170
- `
1171
- },] }
1172
- ];
1173
- SubmenuItemTextComponent.propDecorators = {
1174
- submenuItem: [{ type: Input }]
1175
- };
1176
-
1177
- /*
1178
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1179
- *
1180
- * Licensed under EUPL, Version 1.2 (the "License");
1181
- * you may not use this file except in compliance with the License.
1182
- * You may obtain a copy of the License at
1183
- *
1184
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1185
- *
1186
- * Unless required by applicable law or agreed to in writing, software
1187
- * distributed under the License is distributed on an "AS IS" basis,
1188
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1189
- * See the License for the specific language governing permissions and
1190
- * limitations under the License.
1191
- */
1192
- class MenuModule {
1193
- }
1194
- MenuModule.decorators = [
1195
- { type: NgModule, args: [{
1196
- declarations: [MenuComponent, MenuItemTextComponent, SubmenuItemTextComponent],
1197
- imports: [CommonModule, RouterModule, NgbTooltipModule, TranslateModule],
1198
- exports: [MenuComponent],
1199
- providers: [],
1200
- },] }
1201
- ];
1202
-
1203
- /*
1204
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1205
- *
1206
- * Licensed under EUPL, Version 1.2 (the "License");
1207
- * you may not use this file except in compliance with the License.
1208
- * You may obtain a copy of the License at
1209
- *
1210
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1211
- *
1212
- * Unless required by applicable law or agreed to in writing, software
1213
- * distributed under the License is distributed on an "AS IS" basis,
1214
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1215
- * See the License for the specific language governing permissions and
1216
- * limitations under the License.
1217
- */
1218
- function menuInitializer(injector, logger) {
1219
- const menuService = injector.get(MenuService);
1220
- return () => {
1221
- return new Promise((resolve, reject) => {
1222
- try {
1223
- logger.debug('menu initializer before init');
1224
- menuService.init();
1225
- logger.debug('menu initializer after init');
1226
- resolve();
1227
- }
1228
- catch (error) {
1229
- logger.debug('menu initializer error', error);
1230
- reject(error);
1231
- }
1232
- });
1233
- };
1234
- }
1235
-
1236
- /*
1237
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1238
- *
1239
- * Licensed under EUPL, Version 1.2 (the "License");
1240
- * you may not use this file except in compliance with the License.
1241
- * You may obtain a copy of the License at
1242
- *
1243
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1244
- *
1245
- * Unless required by applicable law or agreed to in writing, software
1246
- * distributed under the License is distributed on an "AS IS" basis,
1247
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1248
- * See the License for the specific language governing permissions and
1249
- * limitations under the License.
1250
- */
1251
- class VersionService {
1252
- constructor(http) {
1253
- this.http = http;
1254
- }
1255
- getVersion() {
1256
- // TODO: this hardcoded string should be taken care of with the introduction of a config service
1257
- return this.http.get(`/api/valtimo/version`);
1258
- }
1259
- }
1260
- VersionService.ɵprov = ɵɵdefineInjectable({ factory: function VersionService_Factory() { return new VersionService(ɵɵinject(HttpClient)); }, token: VersionService, providedIn: "root" });
1261
- VersionService.decorators = [
1262
- { type: Injectable, args: [{
1263
- providedIn: 'root',
1264
- },] }
1265
- ];
1266
- VersionService.ctorParameters = () => [
1267
- { type: HttpClient }
1268
- ];
1269
-
1270
- /*
1271
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1272
- *
1273
- * Licensed under EUPL, Version 1.2 (the "License");
1274
- * you may not use this file except in compliance with the License.
1275
- * You may obtain a copy of the License at
1276
- *
1277
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1278
- *
1279
- * Unless required by applicable law or agreed to in writing, software
1280
- * distributed under the License is distributed on an "AS IS" basis,
1281
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1282
- * See the License for the specific language governing permissions and
1283
- * limitations under the License.
1284
- */
1285
- class RightSidebarComponent {
1286
- constructor(userProviderService, formBuilder, versionService, translate, contextService, http, logger) {
1287
- this.userProviderService = userProviderService;
1288
- this.formBuilder = formBuilder;
1289
- this.versionService = versionService;
1290
- this.translate = translate;
1291
- this.contextService = contextService;
1292
- this.http = http;
1293
- this.logger = logger;
1294
- }
1295
- ngOnInit() {
1296
- this.frequencies = [
1297
- 'emailNotificationOnMonday',
1298
- 'emailNotificationOnTuesday',
1299
- 'emailNotificationOnWednesday',
1300
- 'emailNotificationOnThursday',
1301
- 'emailNotificationOnFriday',
1302
- 'emailNotificationOnSaturday',
1303
- 'emailNotificationOnSunday',
1304
- ];
1305
- this.settingsForm = this.formBuilder.group({
1306
- taskNotifications: new FormControl(false),
1307
- emailNotifications: new FormControl(false),
1308
- emailNotificationOnMonday: new FormControl(false),
1309
- emailNotificationOnTuesday: new FormControl(false),
1310
- emailNotificationOnWednesday: new FormControl(false),
1311
- emailNotificationOnThursday: new FormControl(false),
1312
- emailNotificationOnFriday: new FormControl(false),
1313
- emailNotificationOnSaturday: new FormControl(false),
1314
- emailNotificationOnSunday: new FormControl(false),
1315
- });
1316
- this.getUserSettings();
1317
- }
1318
- loadContextSwitch() {
1319
- combineLatest([
1320
- this.contextService.getUserContexts(),
1321
- this.contextService.getUserContextActive(),
1322
- ]).subscribe(([userContexts, userContextActive]) => {
1323
- this.userContextActive = userContextActive;
1324
- this.userContexts = userContexts;
1325
- });
1326
- }
1327
- setUserContext(contextId) {
1328
- this.contextService.setUserContext(contextId).subscribe();
1329
- location.href = '/';
1330
- }
1331
- loadUserSettingsTab() {
1332
- this.userProviderService.getEmailNotificationSettings().subscribe(results => {
1333
- if (results !== null) {
1334
- this.settingsForm.controls.taskNotifications.setValue(results.taskNotifications);
1335
- this.settingsForm.controls.emailNotifications.setValue(results.emailNotifications);
1336
- this.settingsForm.controls.emailNotificationOnMonday.setValue(results.emailNotificationOnMonday);
1337
- this.settingsForm.controls.emailNotificationOnTuesday.setValue(results.emailNotificationOnTuesday);
1338
- this.settingsForm.controls.emailNotificationOnWednesday.setValue(results.emailNotificationOnWednesday);
1339
- this.settingsForm.controls.emailNotificationOnThursday.setValue(results.emailNotificationOnThursday);
1340
- this.settingsForm.controls.emailNotificationOnFriday.setValue(results.emailNotificationOnFriday);
1341
- this.settingsForm.controls.emailNotificationOnSaturday.setValue(results.emailNotificationOnSaturday);
1342
- this.settingsForm.controls.emailNotificationOnSunday.setValue(results.emailNotificationOnSunday);
1343
- }
1344
- else {
1345
- // default is true in the database, even if api returns no content
1346
- this.settingsForm.controls.taskNotifications.setValue(true);
1347
- }
1348
- });
1349
- this.getVersion();
1350
- }
1351
- getUserSettings() {
1352
- this.userProviderService.getUserSubject().subscribe(userIdentity => {
1353
- this.logger.debug('user', userIdentity);
1354
- this.userIdentity = userIdentity;
1355
- this.loadContextSwitch();
1356
- });
1357
- }
1358
- getVersion() {
1359
- this.versionService.getVersion().subscribe((build) => {
1360
- this.build = build;
1361
- });
1362
- }
1363
- onSettingsSubmit() {
1364
- if (!this.settingsForm.pristine) {
1365
- this.userProviderService.updateEmailNotificationSettings(this.settingsForm.value).subscribe();
1366
- }
1367
- }
1368
- updateUserLanguage(langKey) {
1369
- this.translate.use(langKey).subscribe(() => {
1370
- localStorage.setItem('langKey', langKey);
1371
- });
1372
- }
1373
- logout() {
1374
- this.userProviderService.logout();
1375
- }
1376
- }
1377
- RightSidebarComponent.decorators = [
1378
- { type: Component, args: [{
1379
- selector: 'valtimo-right-sidebar',
1380
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<nav class=\"be-right-sidebar\">\n <div class=\"sb-content\">\n <div class=\"tab-navigation\">\n <ul class=\"nav nav-tabs nav-justified\" role=\"tablist\">\n <li class=\"nav-item\" role=\"presentation\">\n <a\n class=\"nav-link active\"\n href=\"#account\"\n aria-controls=\"account\"\n role=\"tab\"\n data-toggle=\"tab\"\n translate=\"account.title\"\n ></a>\n </li>\n <li class=\"nav-item\" role=\"presentation\">\n <a\n class=\"nav-link\"\n (click)=\"loadUserSettingsTab()\"\n href=\"#settings\"\n aria-controls=\"settings\"\n role=\"tab\"\n data-toggle=\"tab\"\n translate=\"settings.title\"\n ></a>\n </li>\n </ul>\n </div>\n <div class=\"tab-panel\">\n <div class=\"tab-content\">\n <!-- account -->\n <div class=\"tab-pane tab-account active\" id=\"account\" role=\"tabpanel\">\n <div class=\"p-3 be-scroller-settings\" *ngIf=\"userIdentity\">\n <div class=\"content\">\n <div class=\"category-title border-0 m-0\">\n <div class=\"p-0 text-muted\">\n <dl class=\"row mb-0\">\n <dt class=\"col-sm-3\">Email</dt>\n <dd class=\"col-sm-9 mb-0 text-bold\">{{ userIdentity.email }}</dd>\n <ng-container *ngIf=\"userIdentity.username\">\n <dt class=\"col-sm-3\">Username</dt>\n <dd class=\"col-sm-9 mb-0 text-bold\">{{ userIdentity.username }}</dd>\n </ng-container>\n <dt class=\"col-sm-3\">Name</dt>\n <dd class=\"col-sm-9 mb-0 text-bold\">\n {{ userIdentity.firstName + ' ' + userIdentity.lastName }}\n </dd>\n </dl>\n </div>\n </div>\n <!-- context switch -->\n <ul class=\"settings-list\" *ngIf=\"userContexts?.length > 1\">\n <li ngbTooltip=\"{{ 'settings.context.title' | translate }}\">\n <select\n class=\"form-control\"\n #contextSelect\n (change)=\"setUserContext(+contextSelect.value)\"\n >\n <option\n *ngFor=\"let context of userContexts\"\n [value]=\"context.id\"\n [selected]=\"context.id === userContextActive.id\"\n >\n {{ context.name }}\n </option>\n </select>\n </li>\n </ul>\n <ul class=\"list-group list-group-flush m-0\">\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"https://docs.valtimo.nl\"\n target=\"_blank\"\n class=\"d-block\"\n translate=\"account.links.help\"\n ></a>\n </li>\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"https://www.valtimo.nl/feedback/\"\n target=\"_blank\"\n class=\"d-block\"\n translate=\"account.links.feedback\"\n ></a>\n </li>\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"https://forum.valtimo.nl\"\n target=\"_blank\"\n class=\"d-block\"\n translate=\"account.links.forum\"\n ></a>\n </li>\n <li class=\"bg-transparent list-group-item px-0\">\n <a\n href=\"javascript:void(0)\"\n class=\"d-block\"\n (click)=\"logout()\"\n translate=\"account.links.signOut\"\n ></a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n\n <!-- settings -->\n <div class=\"tab-pane tab-settings\" id=\"settings\" role=\"tabpanel\">\n <div class=\"p-3 be-scroller-settings\">\n <div class=\"content\">\n <span class=\"category-title\" translate=\"settings.language.title\"></span>\n <ul class=\"settings-list\">\n <li>\n <select\n class=\"form-control\"\n #langSelect\n (change)=\"updateUserLanguage(langSelect.value)\"\n >\n <option\n *ngFor=\"let lang of translate.getLangs()\"\n [value]=\"lang\"\n [selected]=\"lang === translate.currentLang\"\n >\n {{ 'settings.language.options.' + lang | translate }}\n </option>\n </select>\n </li>\n </ul>\n\n <form [formGroup]=\"settingsForm\">\n <span class=\"category-title\" translate=\"settings.notification.title\"></span>\n <ul class=\"settings-list m-0\">\n <li>\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n formControlName=\"taskNotifications\"\n id=\"taskNotifications\"\n (ngModelChange)=\"onSettingsSubmit()\"\n /><span> <label for=\"taskNotifications\"></label></span>\n </div>\n <span class=\"name\" translate=\"settings.notification.taskNotifications\"></span>\n <div\n class=\"text-muted info-text\"\n translate=\"settings.notification.taskNotificationsIntro\"\n ></div>\n </li>\n\n <li>\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n formControlName=\"emailNotifications\"\n id=\"emailNotifications\"\n (ngModelChange)=\"onSettingsSubmit()\"\n /><span> <label for=\"emailNotifications\"></label></span>\n </div>\n <span class=\"name\" translate=\"settings.notification.emailNotifications\"></span>\n <div\n class=\"text-muted info-text\"\n translate=\"settings.notification.emailNotificationsIntro\"\n ></div>\n </li>\n </ul>\n\n <div *ngIf=\"settingsForm.value.emailNotifications\">\n <ul class=\"settings-list\">\n <li *ngFor=\"let frequency of frequencies\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n formControlName=\"{{ frequency }}\"\n id=\"{{ frequency }}\"\n (ngModelChange)=\"onSettingsSubmit()\"\n /><span> <label for=\"{{ frequency }}\"></label></span>\n </div>\n <span class=\"name\">{{\n 'settings.notification.' + frequency | translate\n }}</span>\n </li>\n </ul>\n </div>\n </form>\n\n <div class=\"version-holder\">\n <span class=\"category-title\" translate=\"settings.version.title\"></span>\n <ul class=\"settings-list\">\n <li *ngIf=\"build\">\n <div class=\"name\">{{ build.title }}</div>\n <div class=\"text-muted\">{{ build.version }}</div>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</nav>\n",
1381
- styles: [".be-scroller-settings{padding-bottom:150px!important}.version-holder{background-color:#f8f9fa;bottom:0;position:fixed;width:259px}.info-text{line-height:1em!important;margin-bottom:15px;padding-right:70px}"]
1382
- },] }
1383
- ];
1384
- RightSidebarComponent.ctorParameters = () => [
1385
- { type: UserProviderService },
1386
- { type: FormBuilder },
1387
- { type: VersionService },
1388
- { type: TranslateService },
1389
- { type: ContextService },
1390
- { type: HttpClient },
1391
- { type: NGXLogger }
1392
- ];
1393
-
1394
- /*
1395
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1396
- *
1397
- * Licensed under EUPL, Version 1.2 (the "License");
1398
- * you may not use this file except in compliance with the License.
1399
- * You may obtain a copy of the License at
1400
- *
1401
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1402
- *
1403
- * Unless required by applicable law or agreed to in writing, software
1404
- * distributed under the License is distributed on an "AS IS" basis,
1405
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1406
- * See the License for the specific language governing permissions and
1407
- * limitations under the License.
1408
- */
1409
- const ɵ0 = HttpLoaderFactory;
1410
- class RightSidebarModule {
1411
- }
1412
- RightSidebarModule.decorators = [
1413
- { type: NgModule, args: [{
1414
- declarations: [RightSidebarComponent],
1415
- imports: [
1416
- CommonModule,
1417
- FormsModule,
1418
- ReactiveFormsModule,
1419
- RouterModule,
1420
- TranslateModule.forRoot({
1421
- loader: {
1422
- provide: TranslateLoader,
1423
- useFactory: ɵ0,
1424
- deps: [HttpClient],
1425
- },
1426
- }),
1427
- NgbTooltipModule,
1428
- ],
1429
- exports: [RightSidebarComponent],
1430
- },] }
1431
- ];
1432
-
1433
- /*
1434
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1435
- *
1436
- * Licensed under EUPL, Version 1.2 (the "License");
1437
- * you may not use this file except in compliance with the License.
1438
- * You may obtain a copy of the License at
1439
- *
1440
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1441
- *
1442
- * Unless required by applicable law or agreed to in writing, software
1443
- * distributed under the License is distributed on an "AS IS" basis,
1444
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1445
- * See the License for the specific language governing permissions and
1446
- * limitations under the License.
1447
- */
1448
- class LeftSidebarComponent {
1449
- constructor(translateService, elementRef) {
1450
- this.translateService = translateService;
1451
- this.elementRef = elementRef;
1452
- this.menuWidthChanged = new EventEmitter();
1453
- this.menuTooltipText$ = this.translateService.stream('interface.mainMenu');
1454
- this.toggleMenuText$ = this.translateService.stream('interface.toggleMenu');
1455
- this.mouseIsOnResizeBorder$ = new BehaviorSubject(false);
1456
- this.menuWidth$ = new BehaviorSubject(undefined);
1457
- this.isResizing$ = new BehaviorSubject(false);
1458
- this.defaultMenuWidth = 230;
1459
- this.maxMenuWidth = 330;
1460
- this.minMenuWidth = 120;
1461
- this.mouseX$ = fromEvent(document.body, 'mousemove').pipe(map((e) => e.pageX));
1462
- this.bodyStyle = elementRef.nativeElement.ownerDocument.body.style;
1463
- }
1464
- ngOnInit() {
1465
- this.setMenuWidth(this.defaultMenuWidth);
1466
- }
1467
- ngAfterViewInit() {
1468
- this.mouseXSubscription = combineLatest([this.mouseX$, this.isResizing$])
1469
- .pipe(debounceTime(3))
1470
- .subscribe(([x, isResizing]) => {
1471
- const menuOpen = this.menuIsOpen;
1472
- if (isResizing) {
1473
- const offSetWidth = this.xOnClick - x;
1474
- const newMenuWidth = this.menuWidthOnClick - offSetWidth;
1475
- const snapMargin = 35;
1476
- const snapInside = newMenuWidth < this.minMenuWidth - snapMargin;
1477
- const snapOutside = !menuOpen && offSetWidth < -snapMargin;
1478
- if (menuOpen && newMenuWidth <= this.maxMenuWidth && newMenuWidth >= this.minMenuWidth) {
1479
- this.setMenuWidth(newMenuWidth);
1480
- }
1481
- else if (snapInside || snapOutside) {
1482
- this.snapMenu(snapInside ? this.menuWidthOnClick : this.defaultMenuWidth);
1483
- }
1484
- }
1485
- });
1486
- this.mouseUpSubscription = fromEvent(document, 'mouseup').subscribe(() => {
1487
- this.stopResizing();
1488
- });
1489
- }
1490
- ngOnDestroy() {
1491
- this.mouseXSubscription.unsubscribe();
1492
- this.mouseUpSubscription.unsubscribe();
1493
- }
1494
- enterBorder() {
1495
- this.mouseIsOnResizeBorder$.next(true);
1496
- }
1497
- leaveBorder() {
1498
- this.mouseIsOnResizeBorder$.next(false);
1499
- }
1500
- resizeBorderClick(e) {
1501
- this.menuWidth$.pipe(take(1)).subscribe(menuWidth => {
1502
- this.menuWidthOnClick = menuWidth;
1503
- this.xOnClick = e.pageX;
1504
- this.bodyStyle.userSelect = 'none';
1505
- this.bodyStyle.cursor = 'col-resize';
1506
- this.isResizing$.next(true);
1507
- });
1508
- }
1509
- snapMenu(snapTo) {
1510
- this.stopResizing();
1511
- this.setMenuWidth(snapTo);
1512
- setTimeout(() => {
1513
- this.toggleButtonRef.nativeElement.click();
1514
- });
1515
- }
1516
- stopResizing() {
1517
- this.bodyStyle.cursor = 'auto';
1518
- this.bodyStyle.userSelect = 'auto';
1519
- this.isResizing$.next(false);
1520
- }
1521
- setMenuWidth(width) {
1522
- this.menuWidth$.next(width);
1523
- this.menuWidthChanged.emit(width);
1524
- }
1525
- }
1526
- LeftSidebarComponent.decorators = [
1527
- { type: Component, args: [{
1528
- selector: 'valtimo-left-sidebar',
1529
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n<ng-container *ngIf=\"{isResizing: isResizing$ | async} as obs\">\n <div\n class=\"be-left-sidebar\"\n [style.width.px]=\"menuIsOpen ? (menuWidth$ | async) : null\"\n [ngClass]=\"{'no-transition': obs.isResizing}\"\n >\n <div class=\"left-sidebar-wrapper\">\n <a class=\"left-sidebar-toggle\" href=\"javascript:void(0);\"\n ><valtimo-page-title></valtimo-page-title\n ></a>\n <div class=\"progress-widget\" style=\"padding: 20px 0\">\n <ul class=\"sidebar-elements\">\n <li>\n <a\n #toggleButton\n class=\"be-toggle-left-sidebar\"\n href=\"javascript:void(0);\"\n [title]=\"menuTooltipText$ | async\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n width=\"1em\"\n height=\"1em\"\n style=\"-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg)\"\n viewBox=\"0 0 24 24\"\n transform=\"rotate(360)\"\n >\n <path [ngClass]=\"menuIsOpen ? 'd-1' : 'd-1-flipped'\" />\n <path [ngClass]=\"menuIsOpen ? 'd-2' : 'd-2-flipped'\" />\n <path [ngClass]=\"menuIsOpen ? 'd-3' : 'd-3-flipped'\" />\n <path [ngClass]=\"menuIsOpen ? 'd-4' : 'd-4-flipped'\" />\n </svg>\n <span>{{ toggleMenuText$ | async }}</span>\n </a>\n </li>\n </ul>\n </div>\n <div class=\"left-sidebar-spacer\">\n <div class=\"left-sidebar-scroll\">\n <div class=\"left-sidebar-content\">\n <valtimo-menu></valtimo-menu>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"resize-border\"\n (mouseenter)=\"enterBorder()\"\n (mouseleave)=\"leaveBorder()\"\n (mousedown)=\"resizeBorderClick($event)\"\n [ngClass]=\"{'resize-hover': (mouseIsOnResizeBorder$ | async) || obs.isResizing}\"\n ></div>\n </div>\n</ng-container>\n",
1530
- styles: ["@media screen and (max-width:767px){.be-left-sidebar{width:100%!important}}.be-left-sidebar .left-sidebar-toggle{padding:20px}.be-left-sidebar .left-sidebar-toggle:before{font-size:1.615rem}.be-left-sidebar .sidebar-elements>li>a.be-toggle-left-sidebar{align-items:center;display:flex;height:32px}.be-left-sidebar .left-sidebar-content{padding-top:20px}.be-toggle-left-sidebar svg{height:auto;margin-right:7px;min-width:21px;overflow:visible}.be-toggle-left-sidebar svg path{fill:#696969;transition:.27s ease}.resize-border{background-color:#ff5800;cursor:col-resize;height:100%;margin-right:-3px;opacity:0;position:absolute;right:0;top:0;transition:opacity .2s ease;width:3px}.resize-hover{opacity:.7}.no-transition{transition:none}.d-1{d:path(\"M3 18v-2h13v2z\")}.d-1-flipped{d:path(\"M3 18v-2h11v2z\")}.d-2{d:path(\"M3 13v-2h10v2H3\")}.d-2-flipped{d:path(\"M3 13v-2h12v2H3\")}.d-3{d:path(\"M3 6h13v2H3V6\")}.d-3-flipped{d:path(\"M3 6h11v2H3V6\")}.d-4{d:path(\"M21 15.61L19.59 17l-5.01-5 5.01-5L21 8.39 17.44 12 21 15.61\")}.d-4-flipped{d:path(\"M15.58 15.61L16.99 17 22 12l-5.01-5-1.41 1.39L19.14 12l-3.56 3.61\")}"]
1531
- },] }
1532
- ];
1533
- LeftSidebarComponent.ctorParameters = () => [
1534
- { type: TranslateService },
1535
- { type: ElementRef }
1536
- ];
1537
- LeftSidebarComponent.propDecorators = {
1538
- toggleButtonRef: [{ type: ViewChild, args: ['toggleButton',] }],
1539
- menuIsOpen: [{ type: Input }],
1540
- menuWidthChanged: [{ type: Output }]
1541
- };
1542
-
1543
- /*
1544
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1545
- *
1546
- * Licensed under EUPL, Version 1.2 (the "License");
1547
- * you may not use this file except in compliance with the License.
1548
- * You may obtain a copy of the License at
1549
- *
1550
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1551
- *
1552
- * Unless required by applicable law or agreed to in writing, software
1553
- * distributed under the License is distributed on an "AS IS" basis,
1554
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1555
- * See the License for the specific language governing permissions and
1556
- * limitations under the License.
1557
- */
1558
- class PageTitleComponent {
1559
- constructor(router, activatedRoute, titleService, translateService, logger) {
1560
- this.router = router;
1561
- this.activatedRoute = activatedRoute;
1562
- this.titleService = titleService;
1563
- this.translateService = translateService;
1564
- this.logger = logger;
1565
- this.appTitle = 'Valtimo';
1566
- this.routerSub = Subscription.EMPTY;
1567
- }
1568
- setTitle() {
1569
- this.title = this.activatedRoute.snapshot.firstChild.data.title;
1570
- // When loading lazy title is nested
1571
- if (!this.title) {
1572
- this.title = this.activatedRoute.snapshot.firstChild.children[0].data.title;
1573
- }
1574
- if (this.title) {
1575
- this.translateService.stream(this.title).subscribe((title) => {
1576
- this.logger.debug('PageTitle: setTitle translated async', title);
1577
- this.titleService.setTitle(this.appTitle + ' - ' + title);
1578
- });
1579
- }
1580
- else {
1581
- this.logger.debug('PageTitle: setTitle default', this.appTitle);
1582
- this.titleService.setTitle(this.appTitle);
1583
- }
1584
- }
1585
- ngOnInit() {
1586
- this.setTitle();
1587
- this.routerSub = this.router.events
1588
- .pipe(filter(event => event instanceof NavigationEnd))
1589
- .subscribe(event => {
1590
- this.setTitle();
1591
- });
1592
- }
1593
- ngOnDestroy() {
1594
- this.routerSub.unsubscribe();
1595
- }
1596
- }
1597
- PageTitleComponent.decorators = [
1598
- { type: Component, args: [{
1599
- selector: 'valtimo-page-title',
1600
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<h2 class=\"page-head-title\" *ngIf=\"title !== ''\"><span [innerHTML]=\"title | translate\"></span></h2>\n",
1601
- styles: [""]
1602
- },] }
1603
- ];
1604
- PageTitleComponent.ctorParameters = () => [
1605
- { type: Router },
1606
- { type: ActivatedRoute },
1607
- { type: Title },
1608
- { type: TranslateService },
1609
- { type: NGXLogger }
1610
- ];
1611
-
1612
- /*
1613
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1614
- *
1615
- * Licensed under EUPL, Version 1.2 (the "License");
1616
- * you may not use this file except in compliance with the License.
1617
- * You may obtain a copy of the License at
1618
- *
1619
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1620
- *
1621
- * Unless required by applicable law or agreed to in writing, software
1622
- * distributed under the License is distributed on an "AS IS" basis,
1623
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1624
- * See the License for the specific language governing permissions and
1625
- * limitations under the License.
1626
- */
1627
- class PageTitleModule {
1628
- }
1629
- PageTitleModule.decorators = [
1630
- { type: NgModule, args: [{
1631
- declarations: [PageTitleComponent],
1632
- imports: [CommonModule, TranslateModule],
1633
- exports: [PageTitleComponent],
1634
- },] }
1635
- ];
1636
-
1637
- /*
1638
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1639
- *
1640
- * Licensed under EUPL, Version 1.2 (the "License");
1641
- * you may not use this file except in compliance with the License.
1642
- * You may obtain a copy of the License at
1643
- *
1644
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1645
- *
1646
- * Unless required by applicable law or agreed to in writing, software
1647
- * distributed under the License is distributed on an "AS IS" basis,
1648
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1649
- * See the License for the specific language governing permissions and
1650
- * limitations under the License.
1651
- */
1652
- class LeftSidebarModule {
1653
- }
1654
- LeftSidebarModule.decorators = [
1655
- { type: NgModule, args: [{
1656
- declarations: [LeftSidebarComponent],
1657
- imports: [CommonModule, MenuModule, PageTitleModule],
1658
- exports: [LeftSidebarComponent],
1659
- },] }
1660
- ];
1661
-
1662
- /*
1663
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1664
- *
1665
- * Licensed under EUPL, Version 1.2 (the "License");
1666
- * you may not use this file except in compliance with the License.
1667
- * You may obtain a copy of the License at
1668
- *
1669
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1670
- *
1671
- * Unless required by applicable law or agreed to in writing, software
1672
- * distributed under the License is distributed on an "AS IS" basis,
1673
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1674
- * See the License for the specific language governing permissions and
1675
- * limitations under the License.
1676
- */
1677
- class StringTypeConverter {
1678
- getTypeString() {
1679
- return 'string';
1680
- }
1681
- convert(value, definition) {
1682
- return value;
1683
- }
1684
- }
1685
-
1686
- /*
1687
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1688
- *
1689
- * Licensed under EUPL, Version 1.2 (the "License");
1690
- * you may not use this file except in compliance with the License.
1691
- * You may obtain a copy of the License at
1692
- *
1693
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1694
- *
1695
- * Unless required by applicable law or agreed to in writing, software
1696
- * distributed under the License is distributed on an "AS IS" basis,
1697
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1698
- * See the License for the specific language governing permissions and
1699
- * limitations under the License.
1700
- */
1701
- class BooleanTypeConverter {
1702
- getTypeString() {
1703
- return 'boolean';
1704
- }
1705
- convert(value, definition) {
1706
- if (!definition.enum) {
1707
- return value ? 'Yes' : 'No';
1708
- }
1709
- else {
1710
- return value ? definition.enum[0] || 'Yes' : definition.enum[1] || 'No';
1711
- }
1712
- }
1713
- }
1714
-
1715
- /*
1716
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1717
- *
1718
- * Licensed under EUPL, Version 1.2 (the "License");
1719
- * you may not use this file except in compliance with the License.
1720
- * You may obtain a copy of the License at
1721
- *
1722
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1723
- *
1724
- * Unless required by applicable law or agreed to in writing, software
1725
- * distributed under the License is distributed on an "AS IS" basis,
1726
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1727
- * See the License for the specific language governing permissions and
1728
- * limitations under the License.
1729
- */
1730
- const moment$2 = momentImported;
1731
- moment$2.locale(localStorage.getItem('langKey'));
1732
- class DateTypeConverter {
1733
- getTypeString() {
1734
- return 'date';
1735
- }
1736
- convert(value, definition) {
1737
- if (!value) {
1738
- return '-';
1739
- }
1740
- return moment$2(value).format('DD-MM-YYYY, hh:mm A');
1741
- }
1742
- }
1743
-
1744
- /*
1745
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1746
- *
1747
- * Licensed under EUPL, Version 1.2 (the "License");
1748
- * you may not use this file except in compliance with the License.
1749
- * You may obtain a copy of the License at
1750
- *
1751
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1752
- *
1753
- * Unless required by applicable law or agreed to in writing, software
1754
- * distributed under the License is distributed on an "AS IS" basis,
1755
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1756
- * See the License for the specific language governing permissions and
1757
- * limitations under the License.
1758
- */
1759
- class EnumTypeConverter {
1760
- getTypeString() {
1761
- return 'enum';
1762
- }
1763
- convert(value, definition) {
1764
- return definition.enum[value];
1765
- }
1766
- }
1767
-
1768
- /*
1769
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1770
- *
1771
- * Licensed under EUPL, Version 1.2 (the "License");
1772
- * you may not use this file except in compliance with the License.
1773
- * You may obtain a copy of the License at
1774
- *
1775
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1776
- *
1777
- * Unless required by applicable law or agreed to in writing, software
1778
- * distributed under the License is distributed on an "AS IS" basis,
1779
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1780
- * See the License for the specific language governing permissions and
1781
- * limitations under the License.
1782
- */
1783
- class StringReplaceUnderscoreTypeConverter {
1784
- constructor() {
1785
- this.regExpStringRemoveUnderscore = /_/g;
1786
- }
1787
- getTypeString() {
1788
- return 'stringReplaceUnderscore';
1789
- }
1790
- convert(value, definition) {
1791
- return value.replace(this.regExpStringRemoveUnderscore, ' ');
1792
- }
1793
- }
1794
-
1795
- /*
1796
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1797
- *
1798
- * Licensed under EUPL, Version 1.2 (the "License");
1799
- * you may not use this file except in compliance with the License.
1800
- * You may obtain a copy of the License at
1801
- *
1802
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1803
- *
1804
- * Unless required by applicable law or agreed to in writing, software
1805
- * distributed under the License is distributed on an "AS IS" basis,
1806
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1807
- * See the License for the specific language governing permissions and
1808
- * limitations under the License.
1809
- */
1810
- class RelatedFilesTypeConverter {
1811
- getTypeString() {
1812
- return 'relatedFiles';
1813
- }
1814
- convert(value, definition) {
1815
- return value.length || '-';
1816
- }
1817
- }
1818
-
1819
- /*
1820
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1821
- *
1822
- * Licensed under EUPL, Version 1.2 (the "License");
1823
- * you may not use this file except in compliance with the License.
1824
- * You may obtain a copy of the License at
1825
- *
1826
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1827
- *
1828
- * Unless required by applicable law or agreed to in writing, software
1829
- * distributed under the License is distributed on an "AS IS" basis,
1830
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1831
- * See the License for the specific language governing permissions and
1832
- * limitations under the License.
1833
- */
1834
- const stringTypeConverter = new StringTypeConverter();
1835
- const booleanTypeConverter = new BooleanTypeConverter();
1836
- const dateTypeConverter = new DateTypeConverter();
1837
- const enumTypeConverter = new EnumTypeConverter();
1838
- const stringReplaceUnderscoreTypeConverter = new StringReplaceUnderscoreTypeConverter();
1839
- const relatedFilesTypeConverter = new RelatedFilesTypeConverter();
1840
- // TODO: Via injection
1841
- const TYPE_CONVERTERS = [
1842
- stringTypeConverter,
1843
- booleanTypeConverter,
1844
- dateTypeConverter,
1845
- enumTypeConverter,
1846
- stringReplaceUnderscoreTypeConverter,
1847
- relatedFilesTypeConverter,
1848
- ];
1849
-
1850
- /*
1851
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1852
- *
1853
- * Licensed under EUPL, Version 1.2 (the "License");
1854
- * you may not use this file except in compliance with the License.
1855
- * You may obtain a copy of the License at
1856
- *
1857
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1858
- *
1859
- * Unless required by applicable law or agreed to in writing, software
1860
- * distributed under the License is distributed on an "AS IS" basis,
1861
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1862
- * See the License for the specific language governing permissions and
1863
- * limitations under the License.
1864
- */
1865
- class ViewContentService {
1866
- constructor() {
1867
- this.converters = {};
1868
- this.defaultConverter = new StringTypeConverter();
1869
- TYPE_CONVERTERS.forEach(converter => this.addConverter(converter));
1870
- }
1871
- get(value, definition) {
1872
- if (!definition.viewType) {
1873
- definition.viewType = typeof value;
1874
- }
1875
- if (typeof this.converters[definition.viewType] !== 'undefined') {
1876
- return this.converters[definition.viewType].convert(value, definition);
1877
- }
1878
- else {
1879
- return this.defaultConverter.convert(value, definition);
1880
- }
1881
- }
1882
- addConverter(converter) {
1883
- if (typeof this.converters[converter.getTypeString()] !== 'undefined') {
1884
- throw new Error('Converter with name ' + converter.getTypeString() + ' already exists');
1885
- }
1886
- this.converters[converter.getTypeString()] = converter;
1887
- }
1888
- }
1889
- ViewContentService.ɵprov = ɵɵdefineInjectable({ factory: function ViewContentService_Factory() { return new ViewContentService(); }, token: ViewContentService, providedIn: "root" });
1890
- ViewContentService.decorators = [
1891
- { type: Injectable, args: [{
1892
- providedIn: 'root',
1893
- },] }
1894
- ];
1895
- ViewContentService.ctorParameters = () => [];
1896
-
1897
- /*
1898
- * Copyright 2015-2020 Ritense BV, the Netherlands.
1899
- *
1900
- * Licensed under EUPL, Version 1.2 (the "License");
1901
- * you may not use this file except in compliance with the License.
1902
- * You may obtain a copy of the License at
1903
- *
1904
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
1905
- *
1906
- * Unless required by applicable law or agreed to in writing, software
1907
- * distributed under the License is distributed on an "AS IS" basis,
1908
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1909
- * See the License for the specific language governing permissions and
1910
- * limitations under the License.
1911
- */
1912
- class ListComponent {
1913
- constructor(viewContentService, logger) {
1914
- this.viewContentService = viewContentService;
1915
- this.logger = logger;
1916
- this.actions = [];
1917
- this.rowClicked = new EventEmitter();
1918
- this.paginationClicked = new EventEmitter();
1919
- this.paginationSet = new EventEmitter();
1920
- this.search = new EventEmitter();
1921
- this.sortChanged = new EventEmitter();
1922
- this.headerProvided = false;
1923
- this.regExpStringRemoveUnderscore = /_/g;
1924
- this.sort$ = new BehaviorSubject({
1925
- state: { name: '', direction: 'DESC' },
1926
- isSorting: false,
1927
- });
1928
- this.viewListAs = localStorage.getItem('viewListAs') || 'table';
1929
- }
1930
- loadPaginationSize() {
1931
- const entries = localStorage.getItem(`${this.paginationIdentifier}${ListComponent.PAGINATION_SIZE}`);
1932
- if (entries !== null) {
1933
- this.pagination.size = +entries;
1934
- this.paginationSet.emit(+entries);
1935
- this.logger.debug('Pagination loaded from local storage for this list. Current: ', entries);
1936
- }
1937
- else {
1938
- this.logger.debug('Pagination does NOT exist in local storage for this list. Will use default. Change it to create an entry.');
1939
- }
1940
- this.paginationSet.emit();
1941
- }
1942
- setPaginationSize(numberOfEntries) {
1943
- localStorage.setItem(`${this.paginationIdentifier}${ListComponent.PAGINATION_SIZE}`, numberOfEntries);
1944
- this.pagination.size = numberOfEntries;
1945
- this.logger.debug('Pagination set in local storage for this list: ', numberOfEntries);
1946
- this.paginationSet.emit(numberOfEntries);
1947
- }
1948
- ngOnInit() {
1949
- if (this.pagination) {
1950
- this.loadPaginationSize();
1951
- }
1952
- if (this.initialSortState) {
1953
- this.sort$.next(this.initialSortState);
1954
- }
1955
- }
1956
- ngOnChanges(changes) {
1957
- if (changes.items && changes.items.currentValue) {
1958
- this.transformListItemsMatchFields();
1959
- }
1960
- }
1961
- ngAfterViewInit() {
1962
- if (this.isSearchable) {
1963
- fromEvent(this.searchBox.nativeElement, 'keyup')
1964
- .pipe(debounceTime(500))
1965
- .subscribe(() => {
1966
- const value = this.searchBox.nativeElement.value;
1967
- if (this.search.observers.length > 0) {
1968
- // custom search callbak is specified, perhaps to query on the server side
1969
- this.search.emit(value);
1970
- }
1971
- else {
1972
- this.searchModel = value;
1973
- }
1974
- });
1975
- }
1976
- }
1977
- transformListItemsMatchFields() {
1978
- if (this.items && this.fields) {
1979
- this.items.forEach(item => {
1980
- item.listItemFields = this.fields.map(field => ({
1981
- key: field.key,
1982
- label: field.label,
1983
- type: field.type || '',
1984
- value: this.resolveObject(field, item),
1985
- }));
1986
- });
1987
- }
1988
- }
1989
- onClickRow(item) {
1990
- this.rowClicked.emit(item);
1991
- }
1992
- resolveObject(definition, obj) {
1993
- const definitionKey = definition.key;
1994
- const customPropString = '$.';
1995
- const key = definitionKey.includes(customPropString)
1996
- ? definitionKey.split(customPropString)[1]
1997
- : definitionKey;
1998
- const resolvedObjValue = key.split('.').reduce(function (prev, curr) {
1999
- return prev ? prev[curr] : null;
2000
- }, obj || self);
2001
- return this.viewContentService.get(resolvedObjValue, definition);
2002
- }
2003
- switchView(type) {
2004
- localStorage.setItem('viewListAs', type);
2005
- this.viewListAs = type;
2006
- }
2007
- getTotalPageCount() {
2008
- return Math.ceil(this.pagination.collectionSize / this.pagination.size);
2009
- }
2010
- onClickPagination(page) {
2011
- this.paginationClicked.emit(page);
2012
- }
2013
- handleFieldClick(key, sortable) {
2014
- const desc = 'DESC';
2015
- const asc = 'ASC';
2016
- if (!sortable) {
2017
- return;
2018
- }
2019
- this.sort$.pipe(take(1)).subscribe(sort => {
2020
- let newState;
2021
- if (sort.state.name === key) {
2022
- if (!sort.isSorting) {
2023
- newState = { state: Object.assign(Object.assign({}, sort.state), { direction: desc }), isSorting: true };
2024
- }
2025
- else {
2026
- if (sort.state.direction === desc) {
2027
- newState = Object.assign(Object.assign({}, sort), { state: Object.assign(Object.assign({}, sort.state), { direction: asc }) });
2028
- }
2029
- else {
2030
- newState = { state: Object.assign(Object.assign({}, sort.state), { direction: desc }), isSorting: false };
2031
- }
2032
- }
2033
- }
2034
- else {
2035
- newState = { state: { name: key, direction: desc }, isSorting: true };
2036
- }
2037
- this.sort$.next(newState);
2038
- this.sortChanged.emit(newState);
2039
- });
2040
- }
2041
- }
2042
- ListComponent.PAGINATION_SIZE = 'PaginationSize';
2043
- ListComponent.decorators = [
2044
- { type: Component, args: [{
2045
- selector: 'valtimo-list',
2046
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div *ngIf=\"(items?.length > 0 && fields?.length > 0) || header\">\n <div\n class=\"d-flex align-items-center search-holder bg-light\"\n [ngClass]=\"{'pb-4 pt-4': !header}\"\n *ngIf=\"isSearchable || viewMode || header\"\n >\n <div class=\"align-self-start\">\n <ng-content select=\"[header]\"></ng-content>\n </div>\n\n <div class=\"ml-auto row\">\n <input\n *ngIf=\"isSearchable\"\n class=\"form-control col-sm-8\"\n type=\"text\"\n placeholder=\"Search...\"\n #searchBox\n />\n\n <div\n class=\"switch-view-holder btn-group col-sm-4 mt-1 mt-sm-0\"\n role=\"group\"\n *ngIf=\"viewMode\"\n >\n <button\n class=\"btn\"\n [ngClass]=\"viewListAs === 'table' ? 'btn-primary' : 'btn-default'\"\n (click)=\"switchView('table')\"\n >\n <i class=\"mdi mdi-view-headline\"></i>\n </button>\n <button\n class=\"btn\"\n [ngClass]=\"viewListAs === 'tile' ? 'btn-primary' : 'btn-default'\"\n (click)=\"switchView('tile')\"\n >\n <i class=\"mdi mdi-view-module\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n\n <ng-content select=\"[tabs]\"></ng-content>\n\n <div *ngIf=\"items?.length > 0 && fields?.length > 0\">\n <div class=\"table-responsive noSwipe\" *ngIf=\"!viewMode || viewListAs === 'table'\">\n <table class=\"table table-striped table-hover m-0\" *ngIf=\"sort$ | async as sort\">\n <thead>\n <tr>\n <th\n *ngFor=\"let field of fields\"\n (click)=\"handleFieldClick(field.key, field.sortable)\"\n [ngClass]=\"{\n sortable: field.sortable,\n 'is-being-sorted': field.key === sort.state.name && sort.isSorting,\n ascending: sort.state.direction === 'ASC'\n }\"\n >\n {{ field.label }}\n </th>\n <th *ngFor=\"let action of actions\">\n {{ action.columnName }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n [ngClass]=\"{'click-able': this.rowClicked.observers.length > 0}\"\n *ngFor=\"let item of items | listFilter: searchModel\"\n (click)=\"onClickRow(item)\"\n >\n <td class=\"align-top\" *ngFor=\"let listItemField of item.listItemFields\">\n <ng-container *ngIf=\"listItemField.type === ''\">\n {{ listItemField.value || '-' }}\n </ng-container>\n\n <ng-container\n *ngIf=\"listItemField.type === 'dropdownActions'\"\n [ngTemplateOutlet]=\"dropdownActions\"\n [ngTemplateOutletContext]=\"{listItemField: listItemField, item: item}\"\n ></ng-container>\n </td>\n <td class=\"align-top\" *ngFor=\"let action of actions\">\n <i\n class=\"action-icon\"\n style=\"cursor: pointer\"\n [ngClass]=\"action.iconClass\"\n (click)=\"action.callback(item)\"\n ></i>\n </td>\n </tr>\n <tr>\n <td *ngIf=\"(items | listFilter: searchModel).length === 0\" [colSpan]=\"fields.length\">\n {{ 'list.noMatchingItems' | translate }}<i>\"{{ searchModel }}\"</i>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <div class=\"container-fluid\" *ngIf=\"viewMode && viewListAs === 'tile'\">\n <div class=\"row p-2\">\n <div\n class=\"col-12 col-sm-6 col-xl-4 p-2\"\n *ngFor=\"let item of items | listFilter: searchModel\"\n (click)=\"onClickRow(item)\"\n >\n <div class=\"click-able tile-holder p-4\">\n <dl class=\"row mb-0\" *ngFor=\"let listItemField of item.listItemFields\">\n <dt class=\"col-12 col-md-5 text-xl-right\">{{ listItemField.label }}</dt>\n <dd class=\"col-12 col-md-7\">{{ listItemField.value || '-' }}</dd>\n </dl>\n </div>\n </div>\n <div class=\"col-12\" *ngIf=\"(items | listFilter: searchModel).length === 0\">\n {{ 'list.noMatchingItems' | translate }}<i>\"{{ searchModel }}\"</i>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"pagination-holder bg-light px-4 pt-4 pb-2 overflow-auto row mr-0 ml-0\"\n *ngIf=\"pagination && items?.length > 0 && fields?.length > 0\"\n >\n <div class=\"float-left page-count col-4\">\n <strong>{{\n 'list.currentPage' | translate: {current: pagination.page, total: getTotalPageCount()}\n }}</strong>\n <br />\n {{\n pagination.collectionSize === 1\n ? ('list.showingResult' | translate: {number: (items | listFilter: searchModel).length})\n : ('list.showingResults'\n | translate\n : {\n number: (items | listFilter: searchModel).length,\n total: pagination.collectionSize\n })\n }}\n </div>\n <div class=\"col-4 text-center\">\n {{ 'list.show' | translate }}\n <select [(ngModel)]=\"pagination.size\" (ngModelChange)=\"setPaginationSize($event)\">\n <option [ngValue]=\"10\">10</option>\n <option [ngValue]=\"25\">25</option>\n <option [ngValue]=\"50\">50</option>\n <option [ngValue]=\"100\">100</option>\n </select>\n {{ 'list.entries' | translate }}\n </div>\n <div class=\"col-4\">\n <ngb-pagination\n *ngIf=\"pagination.collectionSize > pagination.size\"\n class=\"float-right\"\n [collectionSize]=\"pagination.collectionSize\"\n [(page)]=\"pagination.page\"\n [pageSize]=\"pagination.size\"\n [maxSize]=\"pagination.maxPaginationItemSize\"\n [rotate]=\"true\"\n (pageChange)=\"onClickPagination(pagination.page)\"\n ></ngb-pagination>\n </div>\n </div>\n\n <div id=\"no-results\" class=\"p-5\" *ngIf=\"items?.length === 0\">\n {{ 'list.noResults' | translate }}\n </div>\n\n <div id=\"no-field-definitions\" class=\"p-5\" *ngIf=\"items?.length > 0 && fields?.length === 0\">\n {{ 'list.noFieldDefinitions' | translate }}\n </div>\n</div>\n\n<ng-template #dropdownActions let-listItemField=\"listItemField\" let-item=\"item\">\n <div class=\"dropdown\" *ngIf=\"listItemField?.value.length > 0\">\n <a\n style=\"cursor: pointer\"\n class=\"dropdown-toggle d-block\"\n id=\"dropdownMenu\"\n data-toggle=\"dropdown\"\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n <i class=\"action-icon icon mdi mdi-more-vert\"></i>\n </a>\n <div class=\"dropdown-menu\" aria-labelledby=\"dropdownMenu\">\n <a\n (click)=\"action.callback(item)\"\n class=\"dropdown-item p-2\"\n *ngFor=\"let action of listItemField.value\"\n >\n <ng-container *ngIf=\"action.iconClass != null\">\n <i [ngClass]=\"action.iconClass\"></i>\n </ng-container>\n {{ action?.label || '-' }}\n </a>\n </div>\n </div>\n</ng-template>\n",
2047
- styles: ["@charset \"UTF-8\";\n/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.table{table-layout:fixed}.table-responsive{overflow-x:visible}.click-able{cursor:pointer}.pagination-holder{border-top:1px solid #dee2e6}.search-holder{border-bottom:1px solid #dee2e6;height:80px;padding-left:18px;padding-right:18px}.switch-view-holder i{font-size:1.8rem;line-height:1.2rem;margin-top:9px}.tile-holder{background-color:#f5f5f5;border:1px solid transparent}.tile-holder:hover{background-color:#eee;border:1px solid #dee2e6}.page-count{margin-bottom:1rem}td:first-child,th:first-child{padding-left:25px}th.sortable{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:pointer;user-select:none}th.sortable:after{content:\" \uF0DD\";font-family:Font Awesome\\ 5 Free;margin:auto 0 auto 5px;opacity:0;position:absolute;transition:all .15s ease}th.sortable.is-being-sorted.ascending:after{transform:rotate(-180deg)}th.sortable:hover:after{opacity:.5}th.sortable.is-being-sorted:after{opacity:1}.action-icon{font-size:16px}"]
2048
- },] }
2049
- ];
2050
- ListComponent.ctorParameters = () => [
2051
- { type: ViewContentService },
2052
- { type: NGXLogger }
2053
- ];
2054
- ListComponent.propDecorators = {
2055
- items: [{ type: Input }],
2056
- fields: [{ type: Input }],
2057
- pagination: [{ type: Input }],
2058
- viewMode: [{ type: Input }],
2059
- isSearchable: [{ type: Input }],
2060
- header: [{ type: Input }],
2061
- actions: [{ type: Input }],
2062
- paginationIdentifier: [{ type: Input }],
2063
- initialSortState: [{ type: Input }],
2064
- rowClicked: [{ type: Output }],
2065
- paginationClicked: [{ type: Output }],
2066
- paginationSet: [{ type: Output }],
2067
- search: [{ type: Output }],
2068
- sortChanged: [{ type: Output }],
2069
- searchBox: [{ type: ViewChild, args: ['searchBox',] }]
2070
- };
2071
-
2072
- /*
2073
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2074
- *
2075
- * Licensed under EUPL, Version 1.2 (the "License");
2076
- * you may not use this file except in compliance with the License.
2077
- * You may obtain a copy of the License at
2078
- *
2079
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2080
- *
2081
- * Unless required by applicable law or agreed to in writing, software
2082
- * distributed under the License is distributed on an "AS IS" basis,
2083
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2084
- * See the License for the specific language governing permissions and
2085
- * limitations under the License.
2086
- */
2087
- class ListFilterPipe {
2088
- transform(list, filterText) {
2089
- list = list || [];
2090
- if (!filterText) {
2091
- return list;
2092
- }
2093
- return list.filter(item => Object.keys(item).some(k => item[k] != null && item[k].toString().toLowerCase().includes(filterText.toLowerCase())));
2094
- }
2095
- }
2096
- ListFilterPipe.decorators = [
2097
- { type: Pipe, args: [{
2098
- name: 'listFilter',
2099
- },] }
2100
- ];
2101
-
2102
- /*
2103
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2104
- *
2105
- * Licensed under EUPL, Version 1.2 (the "License");
2106
- * you may not use this file except in compliance with the License.
2107
- * You may obtain a copy of the License at
2108
- *
2109
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2110
- *
2111
- * Unless required by applicable law or agreed to in writing, software
2112
- * distributed under the License is distributed on an "AS IS" basis,
2113
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2114
- * See the License for the specific language governing permissions and
2115
- * limitations under the License.
2116
- */
2117
- /**
2118
- * Component used to display a card element
2119
- */
2120
- class CardComponent {
2121
- constructor() { }
2122
- ngOnInit() { }
2123
- }
2124
- CardComponent.decorators = [
2125
- { type: Component, args: [{
2126
- selector: 'valtimo-card',
2127
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"card card-border-color card-border-color-primary\">\n <div *ngIf=\"title || subtitle\" class=\"card-header card-header-divider\">\n <span *ngIf=\"title\">{{ title }}</span>\n <span *ngIf=\"subtitle\" class=\"card-subtitle\">{{ subtitle }}</span>\n </div>\n <div class=\"card-body\">\n <ng-content></ng-content>\n </div>\n</div>\n",
2128
- styles: [""]
2129
- },] }
2130
- ];
2131
- CardComponent.ctorParameters = () => [];
2132
- CardComponent.propDecorators = {
2133
- title: [{ type: Input }],
2134
- subtitle: [{ type: Input }]
2135
- };
2136
-
2137
- /*
2138
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2139
- *
2140
- * Licensed under EUPL, Version 1.2 (the "License");
2141
- * you may not use this file except in compliance with the License.
2142
- * You may obtain a copy of the License at
2143
- *
2144
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2145
- *
2146
- * Unless required by applicable law or agreed to in writing, software
2147
- * distributed under the License is distributed on an "AS IS" basis,
2148
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2149
- * See the License for the specific language governing permissions and
2150
- * limitations under the License.
2151
- */
2152
- class CardModule {
2153
- }
2154
- CardModule.decorators = [
2155
- { type: NgModule, args: [{
2156
- declarations: [CardComponent],
2157
- imports: [CommonModule],
2158
- exports: [CardComponent],
2159
- },] }
2160
- ];
2161
-
2162
- /*
2163
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2164
- *
2165
- * Licensed under EUPL, Version 1.2 (the "License");
2166
- * you may not use this file except in compliance with the License.
2167
- * You may obtain a copy of the License at
2168
- *
2169
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2170
- *
2171
- * Unless required by applicable law or agreed to in writing, software
2172
- * distributed under the License is distributed on an "AS IS" basis,
2173
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2174
- * See the License for the specific language governing permissions and
2175
- * limitations under the License.
2176
- */
2177
- class ListModule {
2178
- }
2179
- ListModule.decorators = [
2180
- { type: NgModule, args: [{
2181
- declarations: [ListComponent, ListFilterPipe],
2182
- imports: [CommonModule, CardModule, NgbPaginationModule, FormsModule, TranslateModule],
2183
- exports: [ListComponent, ListFilterPipe],
2184
- },] }
2185
- ];
2186
-
2187
- /*
2188
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2189
- *
2190
- * Licensed under EUPL, Version 1.2 (the "License");
2191
- * you may not use this file except in compliance with the License.
2192
- * You may obtain a copy of the License at
2193
- *
2194
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2195
- *
2196
- * Unless required by applicable law or agreed to in writing, software
2197
- * distributed under the License is distributed on an "AS IS" basis,
2198
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2199
- * See the License for the specific language governing permissions and
2200
- * limitations under the License.
2201
- */
2202
- class PageHeaderComponent {
2203
- constructor() { }
2204
- ngOnInit() { }
2205
- }
2206
- PageHeaderComponent.decorators = [
2207
- { type: Component, args: [{
2208
- selector: 'valtimo-page-header',
2209
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"page-head\">\n <valtimo-page-title></valtimo-page-title>\n <valtimo-breadcrumb-navigation></valtimo-breadcrumb-navigation>\n</div>\n",
2210
- styles: [""]
2211
- },] }
2212
- ];
2213
- PageHeaderComponent.ctorParameters = () => [];
2214
-
2215
- /*
2216
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2217
- *
2218
- * Licensed under EUPL, Version 1.2 (the "License");
2219
- * you may not use this file except in compliance with the License.
2220
- * You may obtain a copy of the License at
2221
- *
2222
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2223
- *
2224
- * Unless required by applicable law or agreed to in writing, software
2225
- * distributed under the License is distributed on an "AS IS" basis,
2226
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2227
- * See the License for the specific language governing permissions and
2228
- * limitations under the License.
2229
- */
2230
- class BreadcrumbNavigationComponent {
2231
- constructor(router, route) {
2232
- this.router = router;
2233
- this.route = route;
2234
- this.breadcrumbs = [];
2235
- this.appTitle = 'Valtimo';
2236
- this.routerSub = Subscription.EMPTY;
2237
- }
2238
- ngOnInit() {
2239
- this.setBreadcrumbs(this.route);
2240
- this.routerSub = this.router.events
2241
- .pipe(filter(event => event instanceof NavigationEnd))
2242
- .pipe(map(() => this.route))
2243
- .pipe(map(route => {
2244
- while (route.firstChild) {
2245
- route = route.firstChild;
2246
- }
2247
- return route;
2248
- }))
2249
- .pipe(filter(route => route.outlet === PRIMARY_OUTLET))
2250
- .subscribe(route => {
2251
- this.setBreadcrumbs(route);
2252
- });
2253
- }
2254
- setBreadcrumbs(route) {
2255
- while (route.firstChild) {
2256
- route = route.firstChild;
2257
- }
2258
- if (route.outlet === PRIMARY_OUTLET) {
2259
- const snapshot = route.snapshot;
2260
- const activeRoute = {
2261
- url: snapshot.url.join('/'),
2262
- path: snapshot.routeConfig.path,
2263
- label: snapshot.data['title'],
2264
- params: snapshot.params,
2265
- };
2266
- this.generateBreadcrumbs(activeRoute);
2267
- }
2268
- }
2269
- generateBreadcrumbs(activeBreadcrumb) {
2270
- this.breadcrumbs = [];
2271
- this.router.config.map(routerConfig => {
2272
- if (activeBreadcrumb.path.indexOf(routerConfig.path + '/') === 0 &&
2273
- activeBreadcrumb.path !== routerConfig.path &&
2274
- routerConfig.path !== '') {
2275
- const parentRoute = {
2276
- url: routerConfig.path.replace(/:(.+?)\b/g, (_, p1) => activeBreadcrumb.params[p1]),
2277
- path: routerConfig.path,
2278
- label: routerConfig.data['title'],
2279
- params: activeBreadcrumb.params,
2280
- };
2281
- const exist = this.breadcrumbs.findIndex(item => item.url === parentRoute.url);
2282
- if (exist === -1) {
2283
- this.breadcrumbs.push(parentRoute);
2284
- }
2285
- }
2286
- });
2287
- }
2288
- ngOnDestroy() {
2289
- this.routerSub.unsubscribe();
2290
- }
2291
- }
2292
- BreadcrumbNavigationComponent.decorators = [
2293
- { type: Component, args: [{
2294
- selector: 'valtimo-breadcrumb-navigation',
2295
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<nav aria-label=\"breadcrumb\" role=\"navigation\">\n <ol class=\"breadcrumb page-head-nav\">\n <li class=\"breadcrumb-item\">\n <a [routerLink]=\"['/']\">{{ appTitle }}</a>\n </li>\n <li class=\"breadcrumb-item\" *ngFor=\"let item of breadcrumbs\">\n <a [routerLink]=\"[item.url]\">{{ item.label | translate }}</a>\n </li>\n </ol>\n</nav>\n",
2296
- styles: [""]
2297
- },] }
2298
- ];
2299
- BreadcrumbNavigationComponent.ctorParameters = () => [
2300
- { type: Router },
2301
- { type: ActivatedRoute }
2302
- ];
2303
-
2304
- /*
2305
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2306
- *
2307
- * Licensed under EUPL, Version 1.2 (the "License");
2308
- * you may not use this file except in compliance with the License.
2309
- * You may obtain a copy of the License at
2310
- *
2311
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2312
- *
2313
- * Unless required by applicable law or agreed to in writing, software
2314
- * distributed under the License is distributed on an "AS IS" basis,
2315
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2316
- * See the License for the specific language governing permissions and
2317
- * limitations under the License.
2318
- */
2319
- class BreadcrumbNavigationModule {
2320
- }
2321
- BreadcrumbNavigationModule.decorators = [
2322
- { type: NgModule, args: [{
2323
- declarations: [BreadcrumbNavigationComponent],
2324
- imports: [CommonModule, RouterModule, TranslateModule],
2325
- exports: [BreadcrumbNavigationComponent],
2326
- },] }
2327
- ];
2328
-
2329
- /*
2330
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2331
- *
2332
- * Licensed under EUPL, Version 1.2 (the "License");
2333
- * you may not use this file except in compliance with the License.
2334
- * You may obtain a copy of the License at
2335
- *
2336
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2337
- *
2338
- * Unless required by applicable law or agreed to in writing, software
2339
- * distributed under the License is distributed on an "AS IS" basis,
2340
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2341
- * See the License for the specific language governing permissions and
2342
- * limitations under the License.
2343
- */
2344
- class PageHeaderModule {
2345
- }
2346
- PageHeaderModule.decorators = [
2347
- { type: NgModule, args: [{
2348
- declarations: [PageHeaderComponent],
2349
- imports: [CommonModule, PageTitleModule, BreadcrumbNavigationModule],
2350
- exports: [PageHeaderComponent],
2351
- },] }
2352
- ];
2353
-
2354
- /*
2355
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2356
- *
2357
- * Licensed under EUPL, Version 1.2 (the "License");
2358
- * you may not use this file except in compliance with the License.
2359
- * You may obtain a copy of the License at
2360
- *
2361
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2362
- *
2363
- * Unless required by applicable law or agreed to in writing, software
2364
- * distributed under the License is distributed on an "AS IS" basis,
2365
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2366
- * See the License for the specific language governing permissions and
2367
- * limitations under the License.
2368
- */
2369
- /**
2370
- * Component used to display a widget element
2371
- */
2372
- class WidgetComponent {
2373
- ngOnInit() {
2374
- this.setCardClassName();
2375
- this.setType();
2376
- this.setAdditionalClasses();
2377
- this.setContrast();
2378
- this.setDivider();
2379
- this.setCollapse();
2380
- }
2381
- toggleContent() {
2382
- if (this.collapseAble) {
2383
- this.isCollapsed = !this.isCollapsed;
2384
- }
2385
- }
2386
- setCardClassName() {
2387
- this.cardClassName = 'card-full-default';
2388
- }
2389
- setType() {
2390
- if (this.type) {
2391
- this.cardClassName = `card-full-${this.type}`;
2392
- }
2393
- }
2394
- setAdditionalClasses() {
2395
- if (this.additionalClasses) {
2396
- this.cardClassName = `${this.cardClassName} ${this.additionalClasses}`;
2397
- }
2398
- }
2399
- setContrast() {
2400
- if (this.contrast) {
2401
- this.contrastClass = 'card-header-contrast';
2402
- }
2403
- }
2404
- setDivider() {
2405
- if (this.divider) {
2406
- this.dividerClass = 'card-header-divider';
2407
- }
2408
- }
2409
- setCollapse() {
2410
- this.isCollapsed = !(this.collapseAble && this.collapse === 'hide');
2411
- }
2412
- }
2413
- WidgetComponent.decorators = [
2414
- { type: Component, args: [{
2415
- selector: 'valtimo-widget',
2416
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"card card-border card-contrast {{ cardClassName }}\">\n <div class=\"card-header {{ contrastClass }} {{ dividerClass }}\" *ngIf=\"title || subtitle\">\n <div class=\"row\">\n <div class=\"col-7\" [ngClass]=\"{clickable: collapseAble}\" (click)=\"toggleContent()\">\n <!-- Title -->\n <div *ngIf=\"title\" class=\"text-truncate\">{{ title }}</div>\n <!-- Sub title -->\n <div *ngIf=\"subtitle\" class=\"card-subtitle text-truncate\">{{ subtitle }}</div>\n </div>\n\n <!-- Tools-->\n <div class=\"tools col-5 text-right\">\n <!-- Collapse content -->\n <a\n class=\"icon mdi\"\n *ngIf=\"collapseAble\"\n [ngClass]=\"{'mdi-chevron-up': isCollapsed, 'mdi-chevron-down': !isCollapsed}\"\n (click)=\"toggleContent()\"\n ></a>\n </div>\n </div>\n </div>\n <!-- content -->\n <div [hidden]=\"!isCollapsed\">\n <ng-content></ng-content>\n </div>\n</div>\n",
2417
- styles: [".card-contrast .card-header{padding:20px!important}.card-subtitle{margin-bottom:0}.card-full,.card-full .card-subtitle,.card-full .tools .icon{color:#6b6b6b!important}.card-full-warning,.card-full-warning .card-subtitle,.card-full-warning .tools .icon{color:#343a40!important}.card-full-danger,.card-full-danger .card-subtitle,.card-full-danger .tools .icon,.card-full-dark,.card-full-dark .card-subtitle,.card-full-dark .tools .icon,.card-full-info,.card-full-info .card-subtitle,.card-full-info .tools .icon,.card-full-primary,.card-full-primary .card-subtitle,.card-full-primary .tools .icon,.card-full-success,.card-full-success .card-subtitle,.card-full-success .tools .icon{color:#fff!important}.card-contrast .card-body{padding-top:15px}.card-body{padding:15px 20px}.pie-label{font-size:16px!important}.widget.widget-tile svg.ngx-charts{margin-left:-1.5rem!important}svg.ngx-charts{margin:0;padding:0}"]
2418
- },] }
2419
- ];
2420
- WidgetComponent.propDecorators = {
2421
- type: [{ type: Input }],
2422
- name: [{ type: Input }],
2423
- icon: [{ type: Input }],
2424
- contrast: [{ type: Input }],
2425
- divider: [{ type: Input }],
2426
- title: [{ type: Input }],
2427
- subtitle: [{ type: Input }],
2428
- collapseAble: [{ type: Input }],
2429
- collapse: [{ type: Input }],
2430
- additionalClasses: [{ type: Input }]
2431
- };
2432
-
2433
- /*
2434
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2435
- *
2436
- * Licensed under EUPL, Version 1.2 (the "License");
2437
- * you may not use this file except in compliance with the License.
2438
- * You may obtain a copy of the License at
2439
- *
2440
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2441
- *
2442
- * Unless required by applicable law or agreed to in writing, software
2443
- * distributed under the License is distributed on an "AS IS" basis,
2444
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2445
- * See the License for the specific language governing permissions and
2446
- * limitations under the License.
2447
- */
2448
- class WidgetModule {
2449
- }
2450
- WidgetModule.decorators = [
2451
- { type: NgModule, args: [{
2452
- declarations: [WidgetComponent],
2453
- imports: [CommonModule],
2454
- exports: [WidgetComponent],
2455
- },] }
2456
- ];
2457
-
2458
- /*
2459
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2460
- *
2461
- * Licensed under EUPL, Version 1.2 (the "License");
2462
- * you may not use this file except in compliance with the License.
2463
- * You may obtain a copy of the License at
2464
- *
2465
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2466
- *
2467
- * Unless required by applicable law or agreed to in writing, software
2468
- * distributed under the License is distributed on an "AS IS" basis,
2469
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2470
- * See the License for the specific language governing permissions and
2471
- * limitations under the License.
2472
- */
2473
- class FieldAutoFocusDirective {
2474
- constructor(el) {
2475
- this.el = el;
2476
- }
2477
- ngAfterContentInit() {
2478
- setTimeout(() => {
2479
- this.el.nativeElement.focus();
2480
- }, 300);
2481
- }
2482
- }
2483
- FieldAutoFocusDirective.decorators = [
2484
- { type: Directive, args: [{
2485
- selector: '[valtimoFieldAutoFocus]',
2486
- },] }
2487
- ];
2488
- FieldAutoFocusDirective.ctorParameters = () => [
2489
- { type: ElementRef }
2490
- ];
2491
-
2492
- /*
2493
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2494
- *
2495
- * Licensed under EUPL, Version 1.2 (the "License");
2496
- * you may not use this file except in compliance with the License.
2497
- * You may obtain a copy of the License at
2498
- *
2499
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2500
- *
2501
- * Unless required by applicable law or agreed to in writing, software
2502
- * distributed under the License is distributed on an "AS IS" basis,
2503
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2504
- * See the License for the specific language governing permissions and
2505
- * limitations under the License.
2506
- */
2507
- class FieldAutoFocusModule {
2508
- }
2509
- FieldAutoFocusModule.decorators = [
2510
- { type: NgModule, args: [{
2511
- declarations: [FieldAutoFocusDirective],
2512
- exports: [FieldAutoFocusDirective],
2513
- imports: [CommonModule],
2514
- },] }
2515
- ];
2516
-
2517
- /*
2518
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2519
- *
2520
- * Licensed under EUPL, Version 1.2 (the "License");
2521
- * you may not use this file except in compliance with the License.
2522
- * You may obtain a copy of the License at
2523
- *
2524
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2525
- *
2526
- * Unless required by applicable law or agreed to in writing, software
2527
- * distributed under the License is distributed on an "AS IS" basis,
2528
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2529
- * See the License for the specific language governing permissions and
2530
- * limitations under the License.
2531
- */
2532
- class BpmnJsDiagramComponent {
2533
- constructor() {
2534
- this.importDone = new EventEmitter();
2535
- this.heatPoints = { data: [] };
2536
- }
2537
- ngOnInit() {
2538
- this.bpmnJS = new BpmnJS();
2539
- this.bpmnJS.on('import.done', ({ error }) => {
2540
- if (!error) {
2541
- const canvas = this.bpmnJS.get('canvas'), eventBus = this.bpmnJS.get('eventBus');
2542
- if (this.historicActivityInstances) {
2543
- this.historicActivityInstances.forEach(instance => {
2544
- canvas.addMarker(instance.activityId, instance.endTime ? 'highlight-overlay-past' : 'highlight-overlay-current');
2545
- });
2546
- }
2547
- canvas.zoom('fit-viewport', 'auto');
2548
- if (this.heatmapDuration || this.heatmapCount) {
2549
- eventBus.on('canvas.init', () => {
2550
- if (this.heatmapMode) {
2551
- this.clearHeatmap();
2552
- }
2553
- this.getHeatmapData();
2554
- });
2555
- eventBus.on('canvas.viewbox.changing', () => {
2556
- if (this.heatmapMode) {
2557
- this.clearHeatmap();
2558
- }
2559
- });
2560
- eventBus.on('canvas.viewbox.changed', () => {
2561
- this.getHeatmapData();
2562
- });
2563
- }
2564
- }
2565
- });
2566
- }
2567
- ngAfterContentInit() {
2568
- this.bpmnJS.importXML(this.bpmn20Xml);
2569
- this.bpmnJS.attachTo(this.el.nativeElement);
2570
- }
2571
- getHeatmapData() {
2572
- let inputData, valueKey;
2573
- this.heatPoints = { data: [] };
2574
- this.min = 0;
2575
- this.max = 0;
2576
- if (this.heatmapDuration) {
2577
- inputData = this.heatmapDuration;
2578
- valueKey = 'averageDurationInMilliseconds';
2579
- }
2580
- else if (this.heatmapCount) {
2581
- inputData = this.heatmapCount;
2582
- valueKey = 'totalCount';
2583
- }
2584
- if (inputData) {
2585
- Object.keys(inputData).forEach(key => {
2586
- const diagramContainer = this.el.nativeElement.querySelector('svg').getBoundingClientRect(), diagramElm = this.el.nativeElement
2587
- .querySelector(`g[data-element-id=${key}]`)
2588
- .getBoundingClientRect();
2589
- this.setMax(key);
2590
- this.heatPoints.data.push({
2591
- x: Math.round(diagramElm.x - diagramContainer.x + diagramElm.width / 2),
2592
- y: Math.round(diagramElm.y - diagramContainer.y + diagramElm.height / 2),
2593
- value: inputData[key][valueKey],
2594
- radius: diagramElm.width / 2,
2595
- });
2596
- if (inputData[key].count > 0) {
2597
- this.addCounterActiveOverlays(key, inputData);
2598
- }
2599
- });
2600
- if (this.heatmapMode) {
2601
- this.showHeatmap();
2602
- }
2603
- }
2604
- }
2605
- setMax(key) {
2606
- if (this.heatmapDuration) {
2607
- this.max = Math.max(this.heatmapDuration[key].averageDurationInMilliseconds, this.max);
2608
- }
2609
- else if (this.heatmapCount) {
2610
- this.max = Math.max(this.heatmapCount[key].totalCount + this.heatmapCount[key].count, this.max);
2611
- }
2612
- }
2613
- addCounterActiveOverlays(key, inputData) {
2614
- const overlays = this.bpmnJS.get('overlays');
2615
- overlays.add(key, {
2616
- position: {
2617
- bottom: -10,
2618
- left: 0,
2619
- },
2620
- show: {
2621
- minZoom: 0,
2622
- maxZoom: 5.0,
2623
- },
2624
- html: `<span class="badge badge-pill badge-primary">${inputData[key].count}</span>`,
2625
- });
2626
- }
2627
- showHeatmap() {
2628
- this.heatMapInstance = create({
2629
- radius: 54,
2630
- blur: 0.7,
2631
- maxOpacity: 0.4,
2632
- minOpacity: 0,
2633
- container: this.el.nativeElement,
2634
- });
2635
- this.heatMapInstance.setData({
2636
- min: this.min,
2637
- max: this.max,
2638
- data: this.heatPoints.data,
2639
- });
2640
- }
2641
- clearHeatmap() {
2642
- this.heatMapInstance.setData({ data: [] });
2643
- }
2644
- toggleHeatmap() {
2645
- this.heatmapMode = !this.heatmapMode;
2646
- if (this.heatmapMode) {
2647
- this.showHeatmap();
2648
- }
2649
- else {
2650
- this.clearHeatmap();
2651
- }
2652
- }
2653
- ngOnDestroy() {
2654
- this.bpmnJS.destroy();
2655
- }
2656
- }
2657
- BpmnJsDiagramComponent.decorators = [
2658
- { type: Component, args: [{
2659
- selector: 'valtimo-bpmn-js-diagram',
2660
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"p-4\" *ngIf=\"heatmapDuration || heatmapCount\">\n <div class=\"switch-button switch-button-sm switch-button-success\">\n <input\n type=\"checkbox\"\n id=\"toggleHeatmap\"\n [checked]=\"heatmapMode\"\n (click)=\"toggleHeatmap()\"\n /><span> <label for=\"toggleHeatmap\"></label></span>\n </div>\n</div>\n\n<div #ref class=\"diagram-container\"></div>\n\n<div *ngIf=\"historicActivityInstances\" class=\"p-4 text-center legenda-holder\">\n <span\n ><div class=\"legenda highlight-overlay-past\"></div>\n Executed tasks</span\n >\n <span class=\"ml-3\"\n ><div class=\"legenda highlight-overlay-current\"></div>\n Current tasks</span\n >\n</div>\n\n<div *ngIf=\"heatmapDuration || heatmapCount\" class=\"p-4 text-center legenda-holder\">\n <span\n ><span class=\"badge badge-pill badge-primary\">N</span>&nbsp;&nbsp;Amount of currently active\n instances of this task.</span\n >\n <span\n >&nbsp;&nbsp;|&nbsp;&nbsp;Red/yellow/green orbs: The amount of times the task is executed in\n comparison to the other tasks.</span\n >\n</div>\n",
2661
- styles: [""]
2662
- },] }
2663
- ];
2664
- BpmnJsDiagramComponent.ctorParameters = () => [];
2665
- BpmnJsDiagramComponent.propDecorators = {
2666
- el: [{ type: ViewChild, args: ['ref', { static: true },] }],
2667
- importDone: [{ type: Output }],
2668
- bpmn20Xml: [{ type: Input }],
2669
- heatmapDuration: [{ type: Input }],
2670
- heatmapCount: [{ type: Input }],
2671
- historicActivityInstances: [{ type: Input }]
2672
- };
2673
-
2674
- /*
2675
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2676
- *
2677
- * Licensed under EUPL, Version 1.2 (the "License");
2678
- * you may not use this file except in compliance with the License.
2679
- * You may obtain a copy of the License at
2680
- *
2681
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2682
- *
2683
- * Unless required by applicable law or agreed to in writing, software
2684
- * distributed under the License is distributed on an "AS IS" basis,
2685
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2686
- * See the License for the specific language governing permissions and
2687
- * limitations under the License.
2688
- */
2689
- class BpmnJsDiagramModule {
2690
- }
2691
- BpmnJsDiagramModule.decorators = [
2692
- { type: NgModule, args: [{
2693
- declarations: [BpmnJsDiagramComponent],
2694
- imports: [CommonModule],
2695
- exports: [BpmnJsDiagramComponent],
2696
- },] }
2697
- ];
2698
-
2699
- /*
2700
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2701
- *
2702
- * Licensed under EUPL, Version 1.2 (the "License");
2703
- * you may not use this file except in compliance with the License.
2704
- * You may obtain a copy of the License at
2705
- *
2706
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2707
- *
2708
- * Unless required by applicable law or agreed to in writing, software
2709
- * distributed under the License is distributed on an "AS IS" basis,
2710
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2711
- * See the License for the specific language governing permissions and
2712
- * limitations under the License.
2713
- */
2714
- class TimelineComponent {
2715
- }
2716
- TimelineComponent.decorators = [
2717
- { type: Component, args: [{
2718
- selector: 'valtimo-timeline',
2719
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div id=\"no-results\" class=\"p-5\" *ngIf=\"items?.length === 0\">No result found</div>\n <div class=\"pb-5\" *ngIf=\"items?.length > 0\">\n <ul class=\"timeline mb-0 py-5\">\n <li class=\"timeline-item status-done\" *ngFor=\"let item of items\">\n <div class=\"timeline-date\">\n <span>{{ item.date }}</span>\n </div>\n <div class=\"timeline-content mt-1\">\n <div class=\"timeline-header p-0\">\n <span class=\"timeline-time\">{{ item.time }}</span>\n <span class=\"timeline-author\">{{ item.user }}</span>\n <br />\n <p class=\"timeline-activity\">{{ item.activity }}</p>\n <div class=\"timeline-summary\">\n <p\n [innerHTML]=\"item.summaryTranslationKey | translate: item.summaryTranslationParams\"\n ></p>\n </div>\n </div>\n </div>\n </li>\n </ul>\n </div>\n</div>\n",
2720
- styles: [""]
2721
- },] }
2722
- ];
2723
- TimelineComponent.propDecorators = {
2724
- items: [{ type: Input }]
2725
- };
2726
-
2727
- /*
2728
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2729
- *
2730
- * Licensed under EUPL, Version 1.2 (the "License");
2731
- * you may not use this file except in compliance with the License.
2732
- * You may obtain a copy of the License at
2733
- *
2734
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2735
- *
2736
- * Unless required by applicable law or agreed to in writing, software
2737
- * distributed under the License is distributed on an "AS IS" basis,
2738
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2739
- * See the License for the specific language governing permissions and
2740
- * limitations under the License.
2741
- */
2742
- class TimelineModule {
2743
- }
2744
- TimelineModule.decorators = [
2745
- { type: NgModule, args: [{
2746
- declarations: [TimelineComponent],
2747
- imports: [CommonModule, TranslateModule],
2748
- exports: [TimelineComponent],
2749
- },] }
2750
- ];
2751
-
2752
- /*
2753
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2754
- *
2755
- * Licensed under EUPL, Version 1.2 (the "License");
2756
- * you may not use this file except in compliance with the License.
2757
- * You may obtain a copy of the License at
2758
- *
2759
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2760
- *
2761
- * Unless required by applicable law or agreed to in writing, software
2762
- * distributed under the License is distributed on an "AS IS" basis,
2763
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2764
- * See the License for the specific language governing permissions and
2765
- * limitations under the License.
2766
- */
2767
- class ComponentsModule {
2768
- }
2769
- ComponentsModule.decorators = [
2770
- { type: NgModule }
2771
- ];
2772
-
2773
- /*
2774
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2775
- *
2776
- * Licensed under EUPL, Version 1.2 (the "License");
2777
- * you may not use this file except in compliance with the License.
2778
- * You may obtain a copy of the License at
2779
- *
2780
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2781
- *
2782
- * Unless required by applicable law or agreed to in writing, software
2783
- * distributed under the License is distributed on an "AS IS" basis,
2784
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2785
- * See the License for the specific language governing permissions and
2786
- * limitations under the License.
2787
- */
2788
- class FilterSidebarComponent {
2789
- constructor() {
2790
- this.filterSidebar = localStorage.getItem('filterSidebar') || 'show';
2791
- }
2792
- ngOnInit() {
2793
- if (this.filterSidebar === 'show') {
2794
- localStorage.setItem('filterSidebar', 'show');
2795
- $('.be-content').addClass('be-aside');
2796
- }
2797
- $('[data-toggle="tooltip"]').tooltip();
2798
- }
2799
- ngOnDestroy() {
2800
- $('.be-content').removeClass('be-aside');
2801
- }
2802
- toggleFilterSidebar() {
2803
- const beContent = $('.be-content');
2804
- beContent.toggleClass('be-aside');
2805
- this.filterSidebar = beContent.hasClass('be-aside') ? 'show' : 'hide';
2806
- localStorage.setItem('filterSidebar', this.filterSidebar);
2807
- }
2808
- }
2809
- FilterSidebarComponent.decorators = [
2810
- { type: Component, args: [{
2811
- selector: 'valtimo-filter-sidebar',
2812
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <a\n class=\"toggle-filter-sidebar\"\n data-toggle=\"tooltip\"\n data-trigger=\"hover\"\n data-placement=\"right\"\n title=\"Show / hide\"\n href=\"javascript:void(0)\"\n (click)=\"toggleFilterSidebar()\"\n [ngClass]=\"this.filterSidebar === 'show' && 'toggle-expanded'\"\n >\n <div class=\"icon-container p-0 bg-transparent\">\n <i class=\"click-able icon shadow mdi mdi-filter-list\"></i>\n </div>\n </a>\n <aside class=\"page-aside p-4 mb-4 bg-light filter-holder\" *ngIf=\"this.filterSidebar === 'show'\">\n <ng-content></ng-content>\n </aside>\n</div>\n",
2813
- styles: [".filter-holder{border:0 solid transparent}.toggle-filter-sidebar{cursor:pointer;font-size:2rem;margin-left:-50px;position:absolute;top:25px;z-index:1}.icon-container .icon{background-color:#fff;color:#6b6b6b}.toggle-filter-sidebar:hover .icon-container .icon{color:#ff5800}@media screen and (min-width:768px){.toggle-filter-sidebar{margin-left:-25px}.page-aside{height:calc(100vh - 61px);left:0;margin-top:0;position:absolute}.toggle-expanded{margin-left:255px}}"]
2814
- },] }
2815
- ];
2816
- FilterSidebarComponent.ctorParameters = () => [];
2817
-
2818
- /*
2819
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2820
- *
2821
- * Licensed under EUPL, Version 1.2 (the "License");
2822
- * you may not use this file except in compliance with the License.
2823
- * You may obtain a copy of the License at
2824
- *
2825
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2826
- *
2827
- * Unless required by applicable law or agreed to in writing, software
2828
- * distributed under the License is distributed on an "AS IS" basis,
2829
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2830
- * See the License for the specific language governing permissions and
2831
- * limitations under the License.
2832
- */
2833
- class FilterSidebarModule {
2834
- }
2835
- FilterSidebarModule.decorators = [
2836
- { type: NgModule, args: [{
2837
- declarations: [FilterSidebarComponent],
2838
- imports: [CommonModule],
2839
- exports: [FilterSidebarComponent],
2840
- },] }
2841
- ];
2842
-
2843
- /*
2844
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2845
- *
2846
- * Licensed under EUPL, Version 1.2 (the "License");
2847
- * you may not use this file except in compliance with the License.
2848
- * You may obtain a copy of the License at
2849
- *
2850
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2851
- *
2852
- * Unless required by applicable law or agreed to in writing, software
2853
- * distributed under the License is distributed on an "AS IS" basis,
2854
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2855
- * See the License for the specific language governing permissions and
2856
- * limitations under the License.
2857
- */
2858
- class UploaderComponent {
2859
- constructor(s3Service) {
2860
- this.s3Service = s3Service;
2861
- this.resources = [];
2862
- this.resourcesChanged = new EventEmitter();
2863
- this.resourceRegistered = new EventEmitter();
2864
- this.showFileList = true;
2865
- }
2866
- ngOnInit() { }
2867
- onFileFieldChange(files) {
2868
- for (const file of files) {
2869
- this.uploadFile(file);
2870
- }
2871
- }
2872
- uploadFile(file) {
2873
- this.s3Service.getPreSignedUrl(file.name).subscribe(value => {
2874
- const preSignedUrl = new URL(value);
2875
- this.s3Service.upload(preSignedUrl, file).subscribe(result => {
2876
- const s3ResourceDTO = new S3Resource(file, preSignedUrl);
2877
- this.s3Service.registerResource(s3ResourceDTO).subscribe(resource => {
2878
- this.resources.push(resource);
2879
- this.resourceRegistered.emit(resource);
2880
- this.resourcesChanged.emit(this.resources);
2881
- });
2882
- });
2883
- });
2884
- }
2885
- deleteResource(resource) {
2886
- this.s3Service.delete(resource.id).subscribe(result => {
2887
- const index = this.resources.findIndex(res => res.id === resource.id);
2888
- this.resources.splice(index, 1);
2889
- this.resourcesChanged.emit(this.resources);
2890
- });
2891
- }
2892
- }
2893
- UploaderComponent.decorators = [
2894
- { type: Component, args: [{
2895
- selector: 'valtimo-uploader',
2896
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div\n class=\"upload-file-container p-5\"\n (click)=\"fileInput.click()\"\n valtimoUploaderDragDrop\n (fileDropped)=\"onFileFieldChange($event)\"\n>\n <span class=\"align-middle\"><i class=\"mdi mdi-cloud-upload\"></i></span>\n <input hidden type=\"file\" #fileInput (change)=\"onFileFieldChange($event.target.files)\" multiple />\n</div>\n<div *ngIf=\"showFileList\">\n <div class=\"files-list px-3 py-2\" *ngFor=\"let resource of resources\">\n <p class=\"m-0\">\n <strong>{{ resource.name }}</strong\n ><br />\n {{ resource.sizeInBytes | filesize }}\n </p>\n <button class=\"delete-file\" (click)=\"deleteResource(resource)\">\n <i class=\"icon mdi mdi-delete text-danger\"></i>\n </button>\n </div>\n</div>\n",
2897
- styles: [".upload-file-container{background-color:#fff;background-position:50%;background-repeat:no-repeat;background-size:100px;border:2px dashed #d5d8de;color:#d5d8de;margin:0 0 1rem;text-align:center}.upload-file-container i.mdi-cloud-upload{font-size:5em}.upload-file-container:hover{cursor:pointer;opacity:.8}.files-list{background:#fff;border:1px solid #bdc0c7;display:flex;font-size:1em;justify-content:space-between;margin:1rem auto;padding:5px}.files-list .delete-file{background:transparent;border:none;cursor:pointer}.files-list .delete-file i{font-size:1.5em}"]
2898
- },] }
2899
- ];
2900
- UploaderComponent.ctorParameters = () => [
2901
- { type: S3Service }
2902
- ];
2903
- UploaderComponent.propDecorators = {
2904
- resourcesChanged: [{ type: Output }],
2905
- resourceRegistered: [{ type: Output }],
2906
- showFileList: [{ type: Input }]
2907
- };
2908
-
2909
- /*
2910
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2911
- *
2912
- * Licensed under EUPL, Version 1.2 (the "License");
2913
- * you may not use this file except in compliance with the License.
2914
- * You may obtain a copy of the License at
2915
- *
2916
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2917
- *
2918
- * Unless required by applicable law or agreed to in writing, software
2919
- * distributed under the License is distributed on an "AS IS" basis,
2920
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2921
- * See the License for the specific language governing permissions and
2922
- * limitations under the License.
2923
- */
2924
- class UploaderDragDropDirective {
2925
- constructor() {
2926
- this.fileDropped = new EventEmitter();
2927
- }
2928
- onDragOver(evt) {
2929
- evt.preventDefault();
2930
- evt.stopPropagation();
2931
- }
2932
- onDragLeave(evt) {
2933
- evt.preventDefault();
2934
- evt.stopPropagation();
2935
- }
2936
- ondrop(evt) {
2937
- evt.preventDefault();
2938
- evt.stopPropagation();
2939
- const files = evt.dataTransfer.files;
2940
- if (files.length > 0) {
2941
- this.fileDropped.emit(files);
2942
- }
2943
- }
2944
- }
2945
- UploaderDragDropDirective.decorators = [
2946
- { type: Directive, args: [{
2947
- selector: '[valtimoUploaderDragDrop]',
2948
- },] }
2949
- ];
2950
- UploaderDragDropDirective.propDecorators = {
2951
- fileDropped: [{ type: Output }],
2952
- onDragOver: [{ type: HostListener, args: ['dragover', ['$event'],] }],
2953
- onDragLeave: [{ type: HostListener, args: ['dragleave', ['$event'],] }],
2954
- ondrop: [{ type: HostListener, args: ['drop', ['$event'],] }]
2955
- };
2956
-
2957
- /*
2958
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2959
- *
2960
- * Licensed under EUPL, Version 1.2 (the "License");
2961
- * you may not use this file except in compliance with the License.
2962
- * You may obtain a copy of the License at
2963
- *
2964
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
2965
- *
2966
- * Unless required by applicable law or agreed to in writing, software
2967
- * distributed under the License is distributed on an "AS IS" basis,
2968
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2969
- * See the License for the specific language governing permissions and
2970
- * limitations under the License.
2971
- */
2972
- class FileSizePipe {
2973
- constructor() {
2974
- this.units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
2975
- }
2976
- transform(bytes = 0, precision = 2) {
2977
- if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes)) {
2978
- return '?';
2979
- }
2980
- let unit = 0;
2981
- while (bytes >= 1024) {
2982
- bytes /= 1024;
2983
- unit++;
2984
- }
2985
- return bytes.toFixed(+precision) + ' ' + this.units[unit];
2986
- }
2987
- }
2988
- FileSizePipe.decorators = [
2989
- { type: Pipe, args: [{
2990
- name: 'filesize',
2991
- },] }
2992
- ];
2993
-
2994
- /*
2995
- * Copyright 2015-2020 Ritense BV, the Netherlands.
2996
- *
2997
- * Licensed under EUPL, Version 1.2 (the "License");
2998
- * you may not use this file except in compliance with the License.
2999
- * You may obtain a copy of the License at
3000
- *
3001
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3002
- *
3003
- * Unless required by applicable law or agreed to in writing, software
3004
- * distributed under the License is distributed on an "AS IS" basis,
3005
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3006
- * See the License for the specific language governing permissions and
3007
- * limitations under the License.
3008
- */
3009
- class FileSizeModule {
3010
- }
3011
- FileSizeModule.decorators = [
3012
- { type: NgModule, args: [{
3013
- declarations: [FileSizePipe],
3014
- imports: [CommonModule],
3015
- exports: [FileSizePipe],
3016
- },] }
3017
- ];
3018
-
3019
- /*
3020
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3021
- *
3022
- * Licensed under EUPL, Version 1.2 (the "License");
3023
- * you may not use this file except in compliance with the License.
3024
- * You may obtain a copy of the License at
3025
- *
3026
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3027
- *
3028
- * Unless required by applicable law or agreed to in writing, software
3029
- * distributed under the License is distributed on an "AS IS" basis,
3030
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3031
- * See the License for the specific language governing permissions and
3032
- * limitations under the License.
3033
- */
3034
- class UploaderModule {
3035
- }
3036
- UploaderModule.decorators = [
3037
- { type: NgModule, args: [{
3038
- declarations: [UploaderComponent, UploaderDragDropDirective],
3039
- imports: [CommonModule, FileSizeModule],
3040
- exports: [UploaderComponent, UploaderDragDropDirective],
3041
- },] }
3042
- ];
3043
-
3044
- /*
3045
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3046
- *
3047
- * Licensed under EUPL, Version 1.2 (the "License");
3048
- * you may not use this file except in compliance with the License.
3049
- * You may obtain a copy of the License at
3050
- *
3051
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3052
- *
3053
- * Unless required by applicable law or agreed to in writing, software
3054
- * distributed under the License is distributed on an "AS IS" basis,
3055
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3056
- * See the License for the specific language governing permissions and
3057
- * limitations under the License.
3058
- */
3059
- class AlertService {
3060
- constructor(router) {
3061
- this.router = router;
3062
- this.confirmed = new EventEmitter();
3063
- this.subject = new Subject();
3064
- // clear alert messages on route change unless 'keepAfterRouteChange' flag is true
3065
- this.router.events.subscribe(event => {
3066
- if (event instanceof NavigationStart) {
3067
- // clear alert messages
3068
- this.clear();
3069
- }
3070
- });
3071
- }
3072
- // enable subscribing to alerts observable
3073
- onAlert() {
3074
- return this.subject.asObservable();
3075
- }
3076
- // convenience methods
3077
- success(message, confirmations, iconClass) {
3078
- this.alert(new Alert({ message, type: AlertType.Success, confirmations, iconClass }));
3079
- }
3080
- error(message, confirmations, iconClass) {
3081
- this.alert(new Alert({ message, type: AlertType.Error, confirmations, iconClass }));
3082
- }
3083
- info(message, confirmations, iconClass) {
3084
- this.alert(new Alert({ message, type: AlertType.Info, confirmations, iconClass }));
3085
- }
3086
- warning(message, confirmations, iconClass) {
3087
- this.alert(new Alert({ message, type: AlertType.Warning, confirmations, iconClass }));
3088
- }
3089
- notification(message, confirmations, iconClass) {
3090
- this.alert(new Alert({ message, type: AlertType.Notification, confirmations, iconClass }));
3091
- }
3092
- modalNotification(message, confirmations, iconClass) {
3093
- this.alert(new Alert({ message, type: AlertType.ModalNotification, confirmations, iconClass }));
3094
- }
3095
- // main alert method
3096
- alert(alert) {
3097
- this.subject.next(alert);
3098
- }
3099
- // clear alerts
3100
- clear() {
3101
- this.subject.next(new Alert({}));
3102
- }
3103
- // emit confirm
3104
- emitAlertConfirmEvent(alert) {
3105
- this.confirmed.emit(alert);
3106
- }
3107
- getAlertConfirmChangeEmitter() {
3108
- return this.confirmed;
3109
- }
3110
- }
3111
- AlertService.ɵprov = ɵɵdefineInjectable({ factory: function AlertService_Factory() { return new AlertService(ɵɵinject(Router)); }, token: AlertService, providedIn: "root" });
3112
- AlertService.decorators = [
3113
- { type: Injectable, args: [{ providedIn: 'root' },] }
3114
- ];
3115
- AlertService.ctorParameters = () => [
3116
- { type: Router }
3117
- ];
3118
-
3119
- /*
3120
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3121
- *
3122
- * Licensed under EUPL, Version 1.2 (the "License");
3123
- * you may not use this file except in compliance with the License.
3124
- * You may obtain a copy of the License at
3125
- *
3126
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3127
- *
3128
- * Unless required by applicable law or agreed to in writing, software
3129
- * distributed under the License is distributed on an "AS IS" basis,
3130
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3131
- * See the License for the specific language governing permissions and
3132
- * limitations under the License.
3133
- */
3134
- class AlertComponent {
3135
- constructor(alertService) {
3136
- this.alertService = alertService;
3137
- this.alerts = [];
3138
- this.autoCloseInMS = 5000;
3139
- }
3140
- ngOnInit() { }
3141
- ngAfterContentInit() {
3142
- this.subscription = this.alertService.onAlert().subscribe(alert => {
3143
- if (!alert.message) {
3144
- // clear alerts when an empty alert is received
3145
- this.alerts = [];
3146
- return;
3147
- }
3148
- // set empty array when an empty alert confirmations is received
3149
- if (!alert.confirmations) {
3150
- alert.confirmations = [];
3151
- }
3152
- // add alert to array if not exist
3153
- const alertExist = this.alerts.filter(x => x.message === alert.message);
3154
- if (alertExist.length === 0) {
3155
- this.alerts.push(alert);
3156
- }
3157
- if (this.inModal(alert)) {
3158
- setTimeout(() => {
3159
- this.openModal();
3160
- }, 300);
3161
- }
3162
- // auto close except alert confirmations not empty
3163
- if (this.autoCloseInMS > 0 && alert.confirmations.length === 0) {
3164
- setTimeout(() => {
3165
- this.removeAlert(alert);
3166
- }, this.autoCloseInMS);
3167
- }
3168
- });
3169
- }
3170
- closeModal() {
3171
- $('#modalNotification').modal('hide');
3172
- }
3173
- openModal() {
3174
- $('#modalNotification').modal('show');
3175
- }
3176
- alertConfirm(alert, confirm) {
3177
- alert.confirm = confirm;
3178
- this.alertService.emitAlertConfirmEvent(alert);
3179
- this.removeAlert(alert);
3180
- }
3181
- ngOnDestroy() {
3182
- // unsubscribe to avoid memory leaks
3183
- this.subscription.unsubscribe();
3184
- }
3185
- removeAlert(alert) {
3186
- if (this.inModal(alert)) {
3187
- this.closeModal();
3188
- }
3189
- // remove specified alert from array
3190
- this.alerts = this.alerts.filter(x => x.message !== alert.message);
3191
- }
3192
- inModal(alert) {
3193
- if (!alert) {
3194
- return;
3195
- }
3196
- // return true based on AlertType.ModalNotification
3197
- switch (alert.type) {
3198
- case AlertType.ModalNotification:
3199
- return true;
3200
- default:
3201
- return false;
3202
- }
3203
- }
3204
- cssClass(alert) {
3205
- if (!alert) {
3206
- return;
3207
- }
3208
- // return css class based on alert type
3209
- switch (alert.type) {
3210
- case AlertType.Success:
3211
- return 'alert alert-success';
3212
- case AlertType.Error:
3213
- return 'alert alert-danger';
3214
- case AlertType.Info:
3215
- return 'alert alert-info';
3216
- case AlertType.Warning:
3217
- return 'alert alert-warning';
3218
- case AlertType.Notification:
3219
- return 'alert alert-light';
3220
- case AlertType.ModalNotification:
3221
- return 'alert alert-light';
3222
- }
3223
- }
3224
- cssIconClass(alert) {
3225
- if (!alert) {
3226
- return;
3227
- }
3228
- // return css class based on alert type
3229
- switch (alert.type) {
3230
- case AlertType.Success:
3231
- return 'mdi mdi-check';
3232
- case AlertType.Error:
3233
- return 'mdi mdi-close-circle-o';
3234
- case AlertType.Info:
3235
- return 'mdi mdi-info-outline';
3236
- case AlertType.Warning:
3237
- return 'mdi mdi-alert-triangle';
3238
- case AlertType.Notification:
3239
- return 'mdi mdi-notifications';
3240
- case AlertType.ModalNotification:
3241
- return 'mdi mdi-notifications';
3242
- }
3243
- }
3244
- }
3245
- AlertComponent.decorators = [
3246
- { type: Component, args: [{
3247
- selector: 'valtimo-alert',
3248
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngFor=\"let alert of alerts\" class=\"{{ cssClass(alert) }} rounded-0 m-0 alert-dismissable\">\n <div *ngIf=\"inModal(alert)\">\n <!-- Modal -->\n <div class=\"modal fade\" id=\"modalNotification\" tabindex=\"-1\" role=\"dialog\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body p-0\">\n <button class=\"close\" type=\"button\" (click)=\"removeAlert(alert)\">\n <span class=\"mdi mdi-close\" aria-hidden=\"true\"></span>\n </button>\n <div class=\"icon\">\n <span class=\"{{ alert.iconClass || cssIconClass(alert) }}\"></span>\n </div>\n <div class=\"message\">\n <div [innerHTML]=\"alert.message\"></div>\n </div>\n </div>\n <div class=\"modal-footer pt-0\" *ngIf=\"alert.confirmations?.length\">\n <button\n class=\"{{ confirmation.class }} mr-2\"\n *ngFor=\"let confirmation of alert.confirmations\"\n (click)=\"alertConfirm(alert, confirmation.value)\"\n >\n {{ confirmation.label }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div *ngIf=\"!inModal(alert)\" class=\"alert-block\">\n <div class=\"icon\"><span class=\"{{ alert.iconClass || cssIconClass(alert) }}\"></span></div>\n <div class=\"message\">\n <div [innerHTML]=\"alert.message\"></div>\n <div class=\"mt-3\" *ngIf=\"alert.confirmations?.length\">\n <button\n class=\"{{ confirmation.class }} mr-2\"\n *ngFor=\"let confirmation of alert.confirmations\"\n (click)=\"alertConfirm(alert, confirmation.value)\"\n >\n {{ confirmation.label }}\n </button>\n </div>\n </div>\n <button class=\"close\" type=\"button\" (click)=\"removeAlert(alert)\">\n <span class=\"mdi mdi-close\" aria-hidden=\"true\"></span>\n </button>\n </div>\n</div>\n",
3249
- styles: [".alert-block{display:flex;flex-direction:row;justify-content:space-between}.alert-block .message{width:100%}.alert-block .icon{align-items:center;display:flex}.alert .message{font-size:1.1rem!important;line-height:1.5rem!important;padding:2rem 5rem 2rem 2rem!important}.alert .close{color:#fff!important;opacity:1!important;padding:2rem 2rem 0 0!important;right:0!important}.alert .icon{padding-left:2rem!important}.alert-warning{color:#404040!important}.alert-light .close,.alert-warning .close{color:#404040!important;opacity:1!important}"]
3250
- },] }
3251
- ];
3252
- AlertComponent.ctorParameters = () => [
3253
- { type: AlertService }
3254
- ];
3255
-
3256
- /*
3257
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3258
- *
3259
- * Licensed under EUPL, Version 1.2 (the "License");
3260
- * you may not use this file except in compliance with the License.
3261
- * You may obtain a copy of the License at
3262
- *
3263
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3264
- *
3265
- * Unless required by applicable law or agreed to in writing, software
3266
- * distributed under the License is distributed on an "AS IS" basis,
3267
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3268
- * See the License for the specific language governing permissions and
3269
- * limitations under the License.
3270
- */
3271
- class AlertModule {
3272
- }
3273
- AlertModule.decorators = [
3274
- { type: NgModule, args: [{
3275
- imports: [CommonModule],
3276
- declarations: [AlertComponent],
3277
- exports: [AlertComponent],
3278
- },] }
3279
- ];
3280
-
3281
- /*
3282
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3283
- *
3284
- * Licensed under EUPL, Version 1.2 (the "License");
3285
- * you may not use this file except in compliance with the License.
3286
- * You may obtain a copy of the License at
3287
- *
3288
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3289
- *
3290
- * Unless required by applicable law or agreed to in writing, software
3291
- * distributed under the License is distributed on an "AS IS" basis,
3292
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3293
- * See the License for the specific language governing permissions and
3294
- * limitations under the License.
3295
- */
3296
- class DataListComponent {
3297
- constructor() { }
3298
- ngOnInit() { }
3299
- }
3300
- DataListComponent.decorators = [
3301
- { type: Component, args: [{
3302
- selector: 'valtimo-data-list',
3303
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div *ngIf=\"collection\">\n <dl class=\"row mb-0\" *ngFor=\"let item of collection\">\n <dd class=\"col-12 col-md-4 col-lg-3\">{{ item.label }}</dd>\n <dt class=\"col-12 col-md-8 col-lg-9\" [innerHTML]=\"item.value || '-'\"></dt>\n </dl>\n</div>\n\n<div *ngIf=\"object\">\n <dl class=\"row mb-0\" *ngFor=\"let item of object | keyvalue\">\n <dd class=\"col-12 col-md-4 col-lg-3\">{{ item.key }}</dd>\n <dt class=\"col-12 col-md-8 col-lg-9\" [innerHTML]=\"item.value || '-'\"></dt>\n </dl>\n</div>\n",
3304
- styles: [""]
3305
- },] }
3306
- ];
3307
- DataListComponent.ctorParameters = () => [];
3308
- DataListComponent.propDecorators = {
3309
- collection: [{ type: Input }],
3310
- object: [{ type: Input }]
3311
- };
3312
-
3313
- /*
3314
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3315
- *
3316
- * Licensed under EUPL, Version 1.2 (the "License");
3317
- * you may not use this file except in compliance with the License.
3318
- * You may obtain a copy of the License at
3319
- *
3320
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3321
- *
3322
- * Unless required by applicable law or agreed to in writing, software
3323
- * distributed under the License is distributed on an "AS IS" basis,
3324
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3325
- * See the License for the specific language governing permissions and
3326
- * limitations under the License.
3327
- */
3328
- class DataListModule {
3329
- }
3330
- DataListModule.decorators = [
3331
- { type: NgModule, args: [{
3332
- declarations: [DataListComponent],
3333
- imports: [CommonModule],
3334
- exports: [DataListComponent],
3335
- },] }
3336
- ];
3337
-
3338
- class FormIoStateService {
3339
- constructor() {
3340
- this._documentDefinitionName$ = new BehaviorSubject(undefined);
3341
- this._documentId$ = new BehaviorSubject(undefined);
3342
- this._currentForm$ = new BehaviorSubject(undefined);
3343
- }
3344
- get documentDefinitionName$() {
3345
- return this._documentDefinitionName$.asObservable();
3346
- }
3347
- setDocumentDefinitionName(documentDefinitionName) {
3348
- this._documentDefinitionName$.next(documentDefinitionName);
3349
- }
3350
- get documentId$() {
3351
- return this._documentId$.asObservable();
3352
- }
3353
- setDocumentId(documentId) {
3354
- this._documentId$.next(documentId);
3355
- }
3356
- get currentForm$() {
3357
- return this._currentForm$.asObservable();
3358
- }
3359
- set currentForm(form) {
3360
- this._currentForm$.next(form);
3361
- }
3362
- }
3363
- FormIoStateService.ɵprov = ɵɵdefineInjectable({ factory: function FormIoStateService_Factory() { return new FormIoStateService(); }, token: FormIoStateService, providedIn: "root" });
3364
- FormIoStateService.decorators = [
3365
- { type: Injectable, args: [{
3366
- providedIn: 'root',
3367
- },] }
3368
- ];
3369
-
3370
- /*
3371
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3372
- *
3373
- * Licensed under EUPL, Version 1.2 (the "License");
3374
- * you may not use this file except in compliance with the License.
3375
- * You may obtain a copy of the License at
3376
- *
3377
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3378
- *
3379
- * Unless required by applicable law or agreed to in writing, software
3380
- * distributed under the License is distributed on an "AS IS" basis,
3381
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3382
- * See the License for the specific language governing permissions and
3383
- * limitations under the License.
3384
- */
3385
- class FormioComponent {
3386
- constructor(userProviderService, logger, stateService, route, translateService) {
3387
- this.userProviderService = userProviderService;
3388
- this.logger = logger;
3389
- this.stateService = stateService;
3390
- this.route = route;
3391
- this.translateService = translateService;
3392
- this.submission = {};
3393
- this.submit = new EventEmitter();
3394
- this.change = new EventEmitter();
3395
- this.refreshForm = new EventEmitter();
3396
- this.errors = [];
3397
- this.currentLanguage$ = new BehaviorSubject(this.translateService.currentLang);
3398
- }
3399
- ngOnInit() {
3400
- const documentDefinitionName = this.route.snapshot.paramMap.get('documentDefinitionName');
3401
- const documentId = this.route.snapshot.paramMap.get('documentId');
3402
- const formDefinition = this.form;
3403
- this.formDefinition = formDefinition;
3404
- this.errors = [];
3405
- this.setInitialToken();
3406
- if (documentDefinitionName) {
3407
- this.stateService.setDocumentDefinitionName(documentDefinitionName);
3408
- }
3409
- if (documentId) {
3410
- this.stateService.setDocumentId(documentId);
3411
- }
3412
- this.subscribeFormRefresh();
3413
- this.openLanguageSubscription();
3414
- }
3415
- ngOnChanges(changes) {
3416
- const currentForm = changes.form.currentValue;
3417
- this.formDefinition = currentForm;
3418
- this.reloadForm();
3419
- this.setInitialToken();
3420
- if (changes.formDefinitionRefresh$) {
3421
- this.unsubscribeFormRefresh();
3422
- this.subscribeFormRefresh();
3423
- }
3424
- }
3425
- ngOnDestroy() {
3426
- var _a, _b;
3427
- this.unsubscribeFormRefresh();
3428
- (_a = this.tokenRefreshTimerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3429
- (_b = this.languageSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
3430
- }
3431
- reloadForm() {
3432
- this.refreshForm.emit({
3433
- form: this.formDefinition,
3434
- });
3435
- }
3436
- showErrors(errors) {
3437
- this.errors = errors;
3438
- }
3439
- onSubmit(submission) {
3440
- this.errors = [];
3441
- this.submit.emit(submission);
3442
- }
3443
- formReady(form) {
3444
- this.reloadForm();
3445
- this.stateService.currentForm = form;
3446
- }
3447
- onChange(object) {
3448
- this.change.emit(object);
3449
- }
3450
- formHasLegacyUpload(formDefinition) {
3451
- const stringifiedFormDefinition = JSON.stringify(formDefinition);
3452
- const legacyUploadString = '"type":"file"';
3453
- return stringifiedFormDefinition.includes(legacyUploadString);
3454
- }
3455
- setInitialToken() {
3456
- this.userProviderService.getToken().then((token) => {
3457
- this.setToken(token);
3458
- });
3459
- }
3460
- setToken(token) {
3461
- Formio.setToken(token);
3462
- localStorage.setItem('formioToken', token);
3463
- this.setTimerForTokenRefresh(token);
3464
- this.logger.debug('New token set for form.io.');
3465
- }
3466
- setTimerForTokenRefresh(token) {
3467
- const tokenExp = jwt_decode(token).exp * 1000;
3468
- const expiryTime = tokenExp - Date.now() - 1000;
3469
- if (!this.tokenRefreshTimerSubscription) {
3470
- this.tokenRefreshTimerSubscription = timer(expiryTime).subscribe(() => {
3471
- this.refreshToken();
3472
- });
3473
- }
3474
- this.logger.debug(`Timer for form.io token refresh set for: ${expiryTime}ms.`);
3475
- }
3476
- refreshToken() {
3477
- from(this.userProviderService.updateToken(-1))
3478
- .pipe(switchMap(() => this.userProviderService.getToken()), take(1))
3479
- .subscribe(token => {
3480
- this.setToken(token);
3481
- });
3482
- }
3483
- subscribeFormRefresh() {
3484
- if (this.formRefresh$) {
3485
- this.formRefreshSubscription = this.formRefresh$.subscribe(refreshValue => {
3486
- if (refreshValue) {
3487
- this.refreshForm.emit(refreshValue);
3488
- }
3489
- });
3490
- }
3491
- }
3492
- unsubscribeFormRefresh() {
3493
- if (this.formRefreshSubscription) {
3494
- this.formRefreshSubscription.unsubscribe();
3495
- }
3496
- }
3497
- openLanguageSubscription() {
3498
- this.languageSubscription = this.translateService.stream('key').subscribe(() => {
3499
- this.currentLanguage$.next(this.translateService.currentLang);
3500
- });
3501
- }
3502
- }
3503
- FormioComponent.decorators = [
3504
- { type: Component, args: [{
3505
- selector: 'valtimo-form-io',
3506
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <div *ngIf=\"errors.length > 0\" class=\"alert alert-danger pt-5 pb-5 mb-2\">\n <ol>\n <li *ngFor=\"let error of errors\">\n {{ error }}\n </li>\n </ol>\n </div>\n <formio\n [submission]=\"submission\"\n [form]=\"formDefinition\"\n [refresh]=\"refreshForm\"\n [options]=\"options\"\n [language]=\"currentLanguage$ | async\"\n (submit)=\"onSubmit($event)\"\n (ready)=\"formReady($event)\"\n (change)=\"onChange($event)\"\n ></formio>\n</div>\n",
3507
- styles: [""]
3508
- },] }
3509
- ];
3510
- FormioComponent.ctorParameters = () => [
3511
- { type: UserProviderService },
3512
- { type: NGXLogger },
3513
- { type: FormIoStateService },
3514
- { type: ActivatedRoute },
3515
- { type: TranslateService }
3516
- ];
3517
- FormioComponent.propDecorators = {
3518
- form: [{ type: Input }],
3519
- options: [{ type: Input }],
3520
- submission: [{ type: Input }],
3521
- formRefresh$: [{ type: Input }],
3522
- submit: [{ type: Output }],
3523
- change: [{ type: Output }]
3524
- };
3525
-
3526
- /*
3527
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3528
- *
3529
- * Licensed under EUPL, Version 1.2 (the "License");
3530
- * you may not use this file except in compliance with the License.
3531
- * You may obtain a copy of the License at
3532
- *
3533
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3534
- *
3535
- * Unless required by applicable law or agreed to in writing, software
3536
- * distributed under the License is distributed on an "AS IS" basis,
3537
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3538
- * See the License for the specific language governing permissions and
3539
- * limitations under the License.
3540
- */
3541
- class FormioBuilderComponent {
3542
- constructor() {
3543
- this.change = new EventEmitter();
3544
- }
3545
- ngOnInit() { }
3546
- onChange(event) {
3547
- this.change.emit(event);
3548
- }
3549
- }
3550
- FormioBuilderComponent.decorators = [
3551
- { type: Component, args: [{
3552
- selector: 'valtimo-form-io-builder',
3553
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div>\n <form-builder [form]=\"form\" (change)=\"onChange($event)\"></form-builder>\n</div>\n",
3554
- styles: [""]
3555
- },] }
3556
- ];
3557
- FormioBuilderComponent.ctorParameters = () => [];
3558
- FormioBuilderComponent.propDecorators = {
3559
- form: [{ type: Input }],
3560
- change: [{ type: Output }]
3561
- };
3562
-
3563
- /*
3564
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3565
- *
3566
- * Licensed under EUPL, Version 1.2 (the "License");
3567
- * you may not use this file except in compliance with the License.
3568
- * You may obtain a copy of the License at
3569
- *
3570
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3571
- *
3572
- * Unless required by applicable law or agreed to in writing, software
3573
- * distributed under the License is distributed on an "AS IS" basis,
3574
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3575
- * See the License for the specific language governing permissions and
3576
- * limitations under the License.
3577
- */
3578
- const AppConfig = {
3579
- appUrl: 'http://localhost:4200',
3580
- apiUrl: 'http://localhost:4200',
3581
- icons: 'fontawesome',
3582
- formOnly: false,
3583
- };
3584
-
3585
- class FormIoDomService {
3586
- constructor(stateService) {
3587
- this.stateService = stateService;
3588
- }
3589
- toggleSubmitButton(disabled) {
3590
- this.stateService.currentForm$.pipe(take(1)).subscribe(form => {
3591
- const button = form.formioElement.nativeElement
3592
- .getElementsByClassName('formio-component-submit')[0]
3593
- .getElementsByClassName('btn-primary')[0];
3594
- button.disabled = disabled;
3595
- });
3596
- }
3597
- }
3598
- FormIoDomService.decorators = [
3599
- { type: Injectable }
3600
- ];
3601
- FormIoDomService.ctorParameters = () => [
3602
- { type: FormIoStateService }
3603
- ];
3604
-
3605
- class FormIoUploaderComponent {
3606
- constructor(uploadProviderService, stateService, domService, downloadService) {
3607
- this.uploadProviderService = uploadProviderService;
3608
- this.stateService = stateService;
3609
- this.domService = domService;
3610
- this.downloadService = downloadService;
3611
- this.valueChange = new EventEmitter();
3612
- this.uploading$ = new BehaviorSubject(false);
3613
- this._value = [];
3614
- }
3615
- get value() {
3616
- return this._value;
3617
- }
3618
- set value(value) {
3619
- if (Array.isArray(value)) {
3620
- this._value = value;
3621
- }
3622
- }
3623
- downloadFile(resourceFile) {
3624
- this.uploadProviderService
3625
- .getResource(resourceFile.data.resourceId)
3626
- .subscribe((resource) => {
3627
- this.downloadService.downloadFile(resource.url, resource.resource.name);
3628
- });
3629
- }
3630
- fileSelected(file) {
3631
- this.domService.toggleSubmitButton(true);
3632
- this.uploading$.next(true);
3633
- this.stateService.documentDefinitionName$.pipe(take(1)).subscribe(name => {
3634
- this.uploadProviderService.uploadFile(file, name).subscribe(result => {
3635
- this.domService.toggleSubmitButton(false);
3636
- this.uploading$.next(false);
3637
- this._value.push(result);
3638
- this.valueChange.emit(this._value);
3639
- });
3640
- });
3641
- }
3642
- deleteFile(resourceId) {
3643
- this.domService.toggleSubmitButton(true);
3644
- this._value = this._value.filter((file) => { var _a; return (file === null || file === void 0 ? void 0 : file.data) ? ((_a = file === null || file === void 0 ? void 0 : file.data) === null || _a === void 0 ? void 0 : _a.resourceId) !== resourceId : true; });
3645
- this.valueChange.emit(this._value);
3646
- }
3647
- }
3648
- FormIoUploaderComponent.decorators = [
3649
- { type: Component, args: [{
3650
- selector: 'valtimo-formio-uploader',
3651
- template: "<valtimo-dropzone\n (fileSelected)=\"fileSelected($event)\"\n [acceptedFiles]=\"null\"\n [disabled]=\"disabled\"\n [hideFilePreview]=\"true\"\n [hideTitle]=\"hideTitle\"\n [maxFileSize]=\"maxFileSize\"\n [showMaxFileSize]=\"!hideMaxFileSize\"\n [subtitle]=\"subtitle\"\n [title]=\"title\"\n [camera]=\"camera\"\n [uploading]=\"uploading$ | async\"\n></valtimo-dropzone>\n\n<div class=\"file-preview\" *ngFor=\"let resource of _value\">\n <div class=\"file-preview-name\">\n <a href=\"#\" (click)=\"downloadFile(resource)\">\n {{ resource.originalName }}\n </a>\n </div>\n <div class=\"file-preview-size\">\n <span>\n {{ resource.size | filesize }}\n </span>\n </div>\n <div class=\"file-preview-delete\" *ngIf=\"!disabled\">\n <a (click)=\"deleteFile(resource.data.resourceId)\">\n <i class=\"icon mdi mdi-delete\"></i>\n </a>\n </div>\n</div>\n",
3652
- styles: [".progress-bar-container{padding:15px 20px}::ng-deep .formio-component-valtimo-file .btn-secondary,::ng-deep .formio-component-valtimo-file .formio-button-add-another{display:none}::ng-deep .formio-component-valtimo-file td{border:none;padding:0!important}::ng-deep .formio-component-valtimo-file .table{border:none;border-collapse:collapse;margin:10px 0}.dropzone-container{margin-bottom:12px}.file-preview{border:1px solid #dee2e6;display:flex;margin-top:-1px}.file-preview div{padding:12px 10px}.file-preview .file-preview-name{width:65%}.file-preview .file-preview-size{width:35%}.file-preview .icon{color:#a1a1a1;cursor:pointer;font-size:1.3846rem;line-height:18px}.file-preview .icon:hover{color:grey}"]
3653
- },] }
3654
- ];
3655
- FormIoUploaderComponent.ctorParameters = () => [
3656
- { type: UploadProviderService },
3657
- { type: FormIoStateService },
3658
- { type: FormIoDomService },
3659
- { type: DownloadService }
3660
- ];
3661
- FormIoUploaderComponent.propDecorators = {
3662
- disabled: [{ type: Input }],
3663
- title: [{ type: Input }],
3664
- hideTitle: [{ type: Input }],
3665
- subtitle: [{ type: Input }],
3666
- maxFileSize: [{ type: Input }],
3667
- hideMaxFileSize: [{ type: Input }],
3668
- camera: [{ type: Input }],
3669
- valueChange: [{ type: Output }],
3670
- value: [{ type: Input }]
3671
- };
3672
-
3673
- /*
3674
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3675
- *
3676
- * Licensed under EUPL, Version 1.2 (the "License");
3677
- * you may not use this file except in compliance with the License.
3678
- * You may obtain a copy of the License at
3679
- *
3680
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3681
- *
3682
- * Unless required by applicable law or agreed to in writing, software
3683
- * distributed under the License is distributed on an "AS IS" basis,
3684
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3685
- * See the License for the specific language governing permissions and
3686
- * limitations under the License.
3687
- */
3688
- class DropzoneComponent {
3689
- constructor(translateService) {
3690
- this.translateService = translateService;
3691
- this.externalError$ = new BehaviorSubject('');
3692
- this.maxFileSize = 5;
3693
- this.showMaxFileSize = true;
3694
- this.acceptedFiles = '.json';
3695
- this.clear$ = new Subject();
3696
- this.camera = false;
3697
- this.fileSelected = new EventEmitter();
3698
- this.file$ = new BehaviorSubject(undefined);
3699
- this.showingCamera$ = new BehaviorSubject(false);
3700
- this.error$ = new BehaviorSubject('');
3701
- this.errorMessagesStrings = {
3702
- tooBig: 'too big',
3703
- wrongType: 'this type',
3704
- };
3705
- this.errorMessage$ = combineLatest([
3706
- this.error$,
3707
- this.translateService.stream('dropzone.error.generic'),
3708
- this.translateService.stream('dropzone.error.tooBig'),
3709
- this.translateService.stream('dropzone.error.wrongType'),
3710
- ]).pipe(map(([dropzoneError, generic, tooBig, wrongType]) => {
3711
- const strings = this.errorMessagesStrings;
3712
- if (dropzoneError) {
3713
- if (dropzoneError.includes(strings.tooBig)) {
3714
- return tooBig;
3715
- }
3716
- else if (dropzoneError.includes(strings.wrongType)) {
3717
- return wrongType;
3718
- }
3719
- else {
3720
- return generic;
3721
- }
3722
- }
3723
- else {
3724
- return '';
3725
- }
3726
- }));
3727
- }
3728
- ngOnInit() {
3729
- this.clearSubscription = this.clear$.subscribe(() => {
3730
- this.clearFile();
3731
- this.clearError();
3732
- });
3733
- }
3734
- ngAfterViewInit() {
3735
- this.initDropzone();
3736
- }
3737
- ngOnDestroy() {
3738
- this.clearSubscription.unsubscribe();
3739
- }
3740
- showCamera() {
3741
- this.showingCamera$.next(true);
3742
- }
3743
- webcamImageSaved(image) {
3744
- if (image) {
3745
- this.setFile(image);
3746
- }
3747
- this.showingCamera$.next(false);
3748
- }
3749
- initDropzone() {
3750
- this.dropzone = new Dropzone(this.dropzoneRef.nativeElement, {
3751
- url: '/',
3752
- maxFilesize: this.maxFileSize,
3753
- clickable: this.dropzoneRef.nativeElement,
3754
- autoProcessQueue: false,
3755
- createImageThumbnails: false,
3756
- acceptedFiles: this.acceptedFiles,
3757
- previewTemplate: `<p style='display:none'></p>`,
3758
- accept: file => {
3759
- this.dropzone.removeAllFiles();
3760
- this.setFile(file);
3761
- },
3762
- });
3763
- this.setDropzoneEvents();
3764
- }
3765
- setDropzoneEvents() {
3766
- this.dropzone.on('error', (file, message) => {
3767
- this.clearFile();
3768
- this.error$.next(message.toString());
3769
- });
3770
- }
3771
- clearFile() {
3772
- this.file$.next(undefined);
3773
- }
3774
- clearError() {
3775
- this.error$.next('');
3776
- }
3777
- setFile(file) {
3778
- this.file$.next(file);
3779
- this.clearError();
3780
- this.fileSelected.emit(file);
3781
- }
3782
- }
3783
- DropzoneComponent.decorators = [
3784
- { type: Component, args: [{
3785
- selector: 'valtimo-dropzone',
3786
- template: "<form #dropzone [ngClass]=\"{disabled: disabled || uploading}\" class=\"dropzone dz-clickable\">\n <div class=\"dz-message\">\n <div class=\"icon\"><span class=\"mdi mdi-cloud-upload\"></span></div>\n <ng-container *ngTemplateOutlet=\"body\"></ng-container>\n <ng-container *ngIf=\"uploading\">\n <ng-container *ngTemplateOutlet=\"progressBar\"></ng-container>\n </ng-container>\n <div class=\"dropzone-mobile-trigger needsclick\"></div>\n </div>\n <button\n (click)=\"showCamera()\"\n *ngIf=\"camera\"\n type=\"button\"\n class=\"btn btn-primary px-3 webcam-button\"\n >\n <i class=\"icon mdi mdi-camera\" aria-hidden=\"true\"></i>\n </button>\n <ng-container *ngIf=\"showingCamera$ | async\">\n <ng-container *ngTemplateOutlet=\"webcam\"></ng-container>\n </ng-container>\n</form>\n\n<ng-template #body>\n <h2 *ngIf=\"!hideTitle\" class=\"mb-4 mt-2\">{{ title || ('dropzone.drop' | translate) }}</h2>\n <span *ngIf=\"subtitle\" class=\"note mb-3\">{{ subtitle }}</span>\n <span *ngIf=\"showMaxFileSize\" class=\"note mb-3 small-font\"\n >{{ 'dropzone.maxFileSize' | translate }}<b>{{ maxFileSize }}mb</b></span\n >\n <ng-container *ngTemplateOutlet=\"preview\"></ng-container>\n</ng-template>\n\n<ng-template #preview>\n <ng-container\n *ngIf=\"{\n errorMessage: errorMessage$ | async,\n externalError: externalError$ | async,\n file: file$ | async\n } as obs\"\n >\n <ng-container *ngIf=\"obs.externalError || obs.errorMessage\">\n <div class=\"alert alert-danger mt-2 mb-0\">\n <div class=\"message\">\n {{ obs.externalError || obs.errorMessage }}\n </div>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!hideFilePreview && obs.file && !obs.externalError && !obs.errorMessage\">\n <div class=\"file\">\n <i class=\"icon mdi mdi-file-text mr-2\"></i>\n <span class=\"note\">{{ obs.file.name }}</span>\n <span class=\"note file-size\">- {{ obs.file.size | filesize: 2 }}</span>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #progressBar>\n <div class=\"progress-bar-container\">\n <valtimo-progress-bar></valtimo-progress-bar>\n </div>\n</ng-template>\n\n<ng-template #webcam>\n <valtimo-webcam (imageSaved)=\"webcamImageSaved($event)\"></valtimo-webcam>\n</ng-template>\n",
3787
- styles: ["form.dropzone{padding:30px 20px}form.dropzone h2{font-size:2rem;text-align:center}form.dropzone.disabled{cursor:default;opacity:.7;pointer-events:none}form.dropzone.preview{border:none;padding:15px 20px}.dz-message{align-items:center;display:flex;flex-direction:column}.dropzone-mobile-trigger{cursor:pointer}.alert-light{align-items:center;display:flex}form.dropzone .mdi{background-color:transparent;border-radius:0;display:inline-block;height:auto;margin-bottom:0;padding:0;width:auto}form.dropzone .message{padding:1.385rem 2.1542rem}.file{align-items:center;display:flex;flex-direction:row;font-size:1.5rem}.small-font{color:#959595;font-size:1rem}.file-size{margin-left:5px}.progress-bar-container{bottom:0;height:auto;position:absolute;width:100%}.webcam-button{position:absolute;right:10px;top:10px}"]
3788
- },] }
3789
- ];
3790
- DropzoneComponent.ctorParameters = () => [
3791
- { type: TranslateService }
3792
- ];
3793
- DropzoneComponent.propDecorators = {
3794
- dropzoneRef: [{ type: ViewChild, args: ['dropzone',] }],
3795
- title: [{ type: Input }],
3796
- hideTitle: [{ type: Input }],
3797
- subtitle: [{ type: Input }],
3798
- externalError$: [{ type: Input }],
3799
- maxFileSize: [{ type: Input }],
3800
- showMaxFileSize: [{ type: Input }],
3801
- acceptedFiles: [{ type: Input }],
3802
- clear$: [{ type: Input }],
3803
- disabled: [{ type: Input }],
3804
- hideFilePreview: [{ type: Input }],
3805
- uploading: [{ type: Input }],
3806
- camera: [{ type: Input }],
3807
- fileSelected: [{ type: Output }]
3808
- };
3809
-
3810
- /*
3811
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3812
- *
3813
- * Licensed under EUPL, Version 1.2 (the "License");
3814
- * you may not use this file except in compliance with the License.
3815
- * You may obtain a copy of the License at
3816
- *
3817
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3818
- *
3819
- * Unless required by applicable law or agreed to in writing, software
3820
- * distributed under the License is distributed on an "AS IS" basis,
3821
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3822
- * See the License for the specific language governing permissions and
3823
- * limitations under the License.
3824
- */
3825
- class ProgressBarComponent {
3826
- }
3827
- ProgressBarComponent.decorators = [
3828
- { type: Component, args: [{
3829
- selector: 'valtimo-progress-bar',
3830
- template: "<div class=\"progress\" style=\"position: relative\">\n <div class=\"progress-bar progress-bar-striped indeterminate\"></div>\n</div>\n",
3831
- styles: [".progress-bar.indeterminate{-webkit-animation:progress-indeterminate 3s linear infinite;animation:progress-indeterminate 3s linear infinite;position:relative}@-webkit-keyframes progress-indeterminate{0%{left:-25%;width:25%}to{left:100%;width:25%}}@keyframes progress-indeterminate{0%{left:-25%;width:25%}to{left:100%;width:25%}}"]
3832
- },] }
3833
- ];
3834
-
3835
- /*
3836
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3837
- *
3838
- * Licensed under EUPL, Version 1.2 (the "License");
3839
- * you may not use this file except in compliance with the License.
3840
- * You may obtain a copy of the License at
3841
- *
3842
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3843
- *
3844
- * Unless required by applicable law or agreed to in writing, software
3845
- * distributed under the License is distributed on an "AS IS" basis,
3846
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3847
- * See the License for the specific language governing permissions and
3848
- * limitations under the License.
3849
- */
3850
- class ProgressBarModule {
3851
- }
3852
- ProgressBarModule.decorators = [
3853
- { type: NgModule, args: [{
3854
- declarations: [ProgressBarComponent],
3855
- imports: [CommonModule],
3856
- exports: [ProgressBarComponent],
3857
- },] }
3858
- ];
3859
-
3860
- /*
3861
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3862
- *
3863
- * Licensed under EUPL, Version 1.2 (the "License");
3864
- * you may not use this file except in compliance with the License.
3865
- * You may obtain a copy of the License at
3866
- *
3867
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3868
- *
3869
- * Unless required by applicable law or agreed to in writing, software
3870
- * distributed under the License is distributed on an "AS IS" basis,
3871
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3872
- * See the License for the specific language governing permissions and
3873
- * limitations under the License.
3874
- */
3875
- class WebcamComponent {
3876
- constructor() {
3877
- this.imageSaved = new EventEmitter();
3878
- this.showing$ = new BehaviorSubject(false);
3879
- this.stream$ = new BehaviorSubject(undefined);
3880
- this.picture$ = new BehaviorSubject(undefined);
3881
- }
3882
- ngAfterViewInit() {
3883
- const video = this.getVideoElement();
3884
- setTimeout(() => {
3885
- this.toggleFade();
3886
- });
3887
- if (navigator.mediaDevices.getUserMedia) {
3888
- navigator.mediaDevices.getUserMedia({ video: true }).then(stream => {
3889
- video.srcObject = stream;
3890
- this.stream$.next(stream);
3891
- });
3892
- }
3893
- }
3894
- captureImage() {
3895
- const video = this.getVideoElement();
3896
- const canvas = document.querySelector('#canvas');
3897
- canvas.width = 640;
3898
- canvas.height = 480;
3899
- const ctx = canvas.getContext('2d');
3900
- ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
3901
- const dataURI = canvas.toDataURL('image/jpeg');
3902
- this.picture$.next({ file: this.dataURItoFile(dataURI), uri: dataURI });
3903
- return false;
3904
- }
3905
- clearImage() {
3906
- this.picture$.next(undefined);
3907
- return false;
3908
- }
3909
- close(emitImage = true) {
3910
- if (!emitImage) {
3911
- this.clearImage();
3912
- }
3913
- this.toggleFade();
3914
- this.emitOnTimeOut();
3915
- return false;
3916
- }
3917
- stopStream() {
3918
- this.stream$.pipe(take(1)).subscribe(mediaStream => {
3919
- if (mediaStream) {
3920
- mediaStream.getTracks().forEach(stream => stream.stop());
3921
- }
3922
- });
3923
- }
3924
- getVideoElement() {
3925
- return document.querySelector('#videoElement');
3926
- }
3927
- emitOnTimeOut() {
3928
- setTimeout(() => {
3929
- var _a;
3930
- this.stopStream();
3931
- this.imageSaved.emit((_a = this.picture$.getValue()) === null || _a === void 0 ? void 0 : _a.file);
3932
- }, 250);
3933
- }
3934
- toggleFade() {
3935
- this.showing$.next(!this.showing$.getValue());
3936
- }
3937
- dataURItoFile(dataURI) {
3938
- const binary = atob(dataURI.split(',')[1]);
3939
- const array = [];
3940
- for (let i = 0; i < binary.length; i++) {
3941
- array.push(binary.charCodeAt(i));
3942
- }
3943
- const blob = new Blob([new Uint8Array(array)], { type: 'image/jpeg' });
3944
- const imgFileName = `IMG_${new Date().toISOString().replace(/[-:.]/g, '')}.jpg`;
3945
- return new File([blob], imgFileName);
3946
- }
3947
- }
3948
- WebcamComponent.decorators = [
3949
- { type: Component, args: [{
3950
- selector: 'valtimo-webcam',
3951
- template: "<div\n (click)=\"close(false)\"\n *ngIf=\"{picture: picture$ | async, stream: stream$ | async} as obs\"\n [ngClass]=\"{showing: showing$ | async}\"\n class=\"webcam-overlay\"\n>\n <div (click)=\"(false); $event.stopPropagation()\" class=\"inner-container\">\n <div class=\"webcam-container modal-content\">\n <div class=\"video-container\">\n <video autoplay=\"true\" id=\"videoElement\"></video>\n <canvas id=\"canvas\"></canvas>\n <img *ngIf=\"obs.picture?.uri\" [src]=\"obs.picture?.uri\" />\n </div>\n <div class=\"button-container\">\n <div class=\"picture-btn\">\n <button\n (click)=\"captureImage()\"\n [disabled]=\"obs.picture?.file || !obs.stream\"\n class=\"btn btn-primary btn-lg\"\n >\n <i class=\"icon mdi mdi-camera mr-1\"></i>{{ 'webcam.takePicture' | translate }}\n </button>\n </div>\n <div class=\"new-btn\">\n <button (click)=\"clearImage()\" [disabled]=\"!obs.picture?.file\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-redo mr-1\"></i>{{ 'webcam.redo' | translate }}\n </button>\n </div>\n <div class=\"save-btn\">\n <button (click)=\"close()\" [disabled]=\"!obs.picture?.file\" class=\"btn btn-primary\">\n <i class=\"icon mdi mdi-save mr-1\"></i>{{ 'webcam.save' | translate }}\n </button>\n </div>\n </div>\n </div>\n <div class=\"modal-header\">\n <button (click)=\"close(false)\" aria-label=\"Close\" class=\"close\"><span>\u00D7</span></button>\n </div>\n </div>\n</div>\n",
3952
- styles: [".webcam-overlay{align-items:center;background-color:rgba(0,0,0,.65);display:flex;height:100%;justify-content:center;left:0;opacity:0;position:fixed;top:0;transition:opacity .15s linear;width:100%;z-index:9999}.showing{opacity:1}.webcam-container{padding:20px}.button-container{align-items:center;display:flex;height:30px;justify-content:space-evenly;margin-bottom:10px;margin-top:20px}.button-container i{margin-right:5px}.new-btn,.picture-btn,.save-btn{display:flex;justify-content:center;position:absolute}.new-btn .icon,.picture-btn .icon,.save-btn .icon{background-color:unset;border-radius:unset;display:inline-block;height:unset;margin-bottom:0;padding:0;width:unset}.new-btn,.save-btn{width:calc(50% - 65px)}.picture-btn{left:0;width:100%}.new-btn{left:0}.save-btn{right:0}.modal-header{color:grey;margin-top:35px;padding:0;position:absolute;right:-18px;top:0}.close{color:grey}.inner-container{position:relative}.video-container{height:495px;overflow:hidden}.video-container img,.video-container video{height:495px;position:absolute;width:660px}.video-container img{-o-object-fit:cover;object-fit:cover}#canvas{display:none}"]
3953
- },] }
3954
- ];
3955
- WebcamComponent.propDecorators = {
3956
- imageSaved: [{ type: Output }]
3957
- };
3958
-
3959
- /*
3960
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3961
- *
3962
- * Licensed under EUPL, Version 1.2 (the "License");
3963
- * you may not use this file except in compliance with the License.
3964
- * You may obtain a copy of the License at
3965
- *
3966
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3967
- *
3968
- * Unless required by applicable law or agreed to in writing, software
3969
- * distributed under the License is distributed on an "AS IS" basis,
3970
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3971
- * See the License for the specific language governing permissions and
3972
- * limitations under the License.
3973
- */
3974
- class WebcamModule {
3975
- }
3976
- WebcamModule.decorators = [
3977
- { type: NgModule, args: [{
3978
- declarations: [WebcamComponent],
3979
- imports: [CommonModule, TranslateModule],
3980
- exports: [WebcamComponent],
3981
- },] }
3982
- ];
3983
-
3984
- /*
3985
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3986
- *
3987
- * Licensed under EUPL, Version 1.2 (the "License");
3988
- * you may not use this file except in compliance with the License.
3989
- * You may obtain a copy of the License at
3990
- *
3991
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
3992
- *
3993
- * Unless required by applicable law or agreed to in writing, software
3994
- * distributed under the License is distributed on an "AS IS" basis,
3995
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3996
- * See the License for the specific language governing permissions and
3997
- * limitations under the License.
3998
- */
3999
- class DropzoneModule {
4000
- }
4001
- DropzoneModule.decorators = [
4002
- { type: NgModule, args: [{
4003
- declarations: [DropzoneComponent],
4004
- imports: [CommonModule, TranslateModule, FileSizeModule, ProgressBarModule, WebcamModule],
4005
- exports: [DropzoneComponent],
4006
- },] }
4007
- ];
4008
-
4009
- /*
4010
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4011
- *
4012
- * Licensed under EUPL, Version 1.2 (the "License");
4013
- * you may not use this file except in compliance with the License.
4014
- * You may obtain a copy of the License at
4015
- *
4016
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4017
- *
4018
- * Unless required by applicable law or agreed to in writing, software
4019
- * distributed under the License is distributed on an "AS IS" basis,
4020
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4021
- * See the License for the specific language governing permissions and
4022
- * limitations under the License.
4023
- */
4024
- const ɵ0$1 = AppConfig;
4025
- class FormIoModule {
4026
- }
4027
- FormIoModule.decorators = [
4028
- { type: NgModule, args: [{
4029
- imports: [
4030
- CommonModule,
4031
- FormioModule,
4032
- DropzoneModule,
4033
- TranslateModule,
4034
- DocumentModule,
4035
- FileSizeModule,
4036
- ResourceModule,
4037
- RouterModule,
4038
- ],
4039
- declarations: [FormioComponent, FormioBuilderComponent, FormIoUploaderComponent],
4040
- exports: [FormioComponent, FormioBuilderComponent, FormIoUploaderComponent],
4041
- providers: [FormIoDomService, { provide: FormioAppConfig, useValue: ɵ0$1 }],
4042
- },] }
4043
- ];
4044
-
4045
- /*
4046
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4047
- *
4048
- * Licensed under EUPL, Version 1.2 (the "License");
4049
- * you may not use this file except in compliance with the License.
4050
- * You may obtain a copy of the License at
4051
- *
4052
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4053
- *
4054
- * Unless required by applicable law or agreed to in writing, software
4055
- * distributed under the License is distributed on an "AS IS" basis,
4056
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4057
- * See the License for the specific language governing permissions and
4058
- * limitations under the License.
4059
- */
4060
- class ModalComponent {
4061
- constructor() {
4062
- this.title = '';
4063
- this.subtitle = '';
4064
- this.showFooter = false;
4065
- }
4066
- ngAfterViewInit() {
4067
- $(`#${this.elementId}`).modal({ show: false });
4068
- }
4069
- show() {
4070
- $(`#${this.elementId}`).modal('show');
4071
- }
4072
- hide() {
4073
- $(`#${this.elementId}`).modal('hide');
4074
- }
4075
- }
4076
- ModalComponent.decorators = [
4077
- { type: Component, args: [{
4078
- selector: 'valtimo-modal',
4079
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<div class=\"modal fade custom-width\" [id]=\"elementId\" role=\"dialog\" aria-modal=\"true\">\n <div class=\"modal-dialog modal-lg\">\n <div class=\"modal-content\">\n <div class=\"modal-header modal-header-colored colored-header-grey\">\n <div class=\"modal-title\">\n <h4 class=\"title-text mb-2\">{{ title }}</h4>\n <h5 class=\"subtitle-text\">{{ subtitle }}</h5>\n <ng-container *ngIf=\"templateBelowSubtitle\">\n <ng-container *ngTemplateOutlet=\"templateBelowSubtitle\"></ng-container>\n </ng-container>\n </div>\n <div class=\"text-right\">\n <img src=\"assets/modal/header-image.png\" class=\"modal-header-image\" />\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n </div>\n <div class=\"modal-body\">\n <ng-content select=\"[body]\"></ng-content>\n </div>\n <div class=\"modal-footer\" *ngIf=\"showFooter\">\n <ng-content select=\"[footer]\"></ng-content>\n </div>\n </div>\n </div>\n</div>\n",
4080
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.colored-header-grey{background-color:#f3f4f7}.title-text{color:#585555}.subtitle-text{color:#959595}.modal-header-image{height:auto;width:50%}.modal-header{border-bottom:1px solid #c5c6c9;padding-bottom:.66rem}@media (min-width:768px){.close{left:25px;margin-top:-20px!important;padding:0!important;position:relative}.close span{color:#fff}.modal-content{overflow:visible}}"]
4081
- },] }
4082
- ];
4083
- ModalComponent.ctorParameters = () => [];
4084
- ModalComponent.propDecorators = {
4085
- elementId: [{ type: Input }],
4086
- title: [{ type: Input }],
4087
- subtitle: [{ type: Input }],
4088
- templateBelowSubtitle: [{ type: Input }],
4089
- showFooter: [{ type: Input }]
4090
- };
4091
-
4092
- /*
4093
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4094
- *
4095
- * Licensed under EUPL, Version 1.2 (the "License");
4096
- * you may not use this file except in compliance with the License.
4097
- * You may obtain a copy of the License at
4098
- *
4099
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4100
- *
4101
- * Unless required by applicable law or agreed to in writing, software
4102
- * distributed under the License is distributed on an "AS IS" basis,
4103
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4104
- * See the License for the specific language governing permissions and
4105
- * limitations under the License.
4106
- */
4107
- class ModalModule {
4108
- }
4109
- ModalModule.decorators = [
4110
- { type: NgModule, args: [{
4111
- declarations: [ModalComponent],
4112
- imports: [CommonModule],
4113
- exports: [ModalComponent],
4114
- },] }
4115
- ];
4116
-
4117
- /*
4118
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4119
- *
4120
- * Licensed under EUPL, Version 1.2 (the "License");
4121
- * you may not use this file except in compliance with the License.
4122
- * You may obtain a copy of the License at
4123
- *
4124
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4125
- *
4126
- * Unless required by applicable law or agreed to in writing, software
4127
- * distributed under the License is distributed on an "AS IS" basis,
4128
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4129
- * See the License for the specific language governing permissions and
4130
- * limitations under the License.
4131
- */
4132
- class SpinnerComponent {
4133
- constructor() {
4134
- this.useBootstrapSpinner = true;
4135
- this.type = 'ball-clip-rotate';
4136
- this.size = 'medium';
4137
- this.color = 'currentColor';
4138
- this.bdColor = 'rgba(0,0,0,0)';
4139
- this.fullScreen = false;
4140
- this.noMarginTop = false;
4141
- }
4142
- }
4143
- SpinnerComponent.decorators = [
4144
- { type: Component, args: [{
4145
- selector: 'valtimo-spinner',
4146
- template: "<!--\n ~ Copyright 2015-2020 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-container *ngIf=\"useBootstrapSpinner; else ngxSpinner\">\n <div class=\"spinner-container\" [ngClass]=\"{'no-margin-top': noMarginTop}\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"sr-only\">{{ 'interface.loading' | translate }}</span>\n </div>\n </div>\n</ng-container>\n\n<ng-template #ngxSpinner>\n <ngx-spinner\n [bdColor]=\"bdColor\"\n [fullScreen]=\"fullScreen\"\n [name]=\"name\"\n [color]=\"color\"\n [size]=\"size\"\n [type]=\"type\"\n >\n </ngx-spinner>\n</ng-template>\n",
4147
- styles: ["/*!\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */.spinner-container{display:flex;justify-content:center;margin-top:30px;width:100%}.spinner-container.no-margin-top{margin-top:0}"]
4148
- },] }
4149
- ];
4150
- SpinnerComponent.propDecorators = {
4151
- useBootstrapSpinner: [{ type: Input }],
4152
- name: [{ type: Input }],
4153
- type: [{ type: Input }],
4154
- size: [{ type: Input }],
4155
- color: [{ type: Input }],
4156
- bdColor: [{ type: Input }],
4157
- fullScreen: [{ type: Input }],
4158
- noMarginTop: [{ type: Input }]
4159
- };
4160
-
4161
- /*
4162
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4163
- *
4164
- * Licensed under EUPL, Version 1.2 (the "License");
4165
- * you may not use this file except in compliance with the License.
4166
- * You may obtain a copy of the License at
4167
- *
4168
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4169
- *
4170
- * Unless required by applicable law or agreed to in writing, software
4171
- * distributed under the License is distributed on an "AS IS" basis,
4172
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4173
- * See the License for the specific language governing permissions and
4174
- * limitations under the License.
4175
- */
4176
- class SpinnerModule {
4177
- }
4178
- SpinnerModule.decorators = [
4179
- { type: NgModule, args: [{
4180
- declarations: [SpinnerComponent],
4181
- exports: [SpinnerComponent],
4182
- imports: [CommonModule, NgxSpinnerModule, TranslateModule],
4183
- },] }
4184
- ];
4185
-
4186
- /*
4187
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4188
- *
4189
- * Licensed under EUPL, Version 1.2 (the "License");
4190
- * you may not use this file except in compliance with the License.
4191
- * You may obtain a copy of the License at
4192
- *
4193
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4194
- *
4195
- * Unless required by applicable law or agreed to in writing, software
4196
- * distributed under the License is distributed on an "AS IS" basis,
4197
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4198
- * See the License for the specific language governing permissions and
4199
- * limitations under the License.
4200
- */
4201
- class SearchableDropdownComponent {
4202
- constructor() {
4203
- this.width = 250;
4204
- this.itemSelected = new EventEmitter();
4205
- this.searchId = 'search';
4206
- this.searchTerm = new FormControl('');
4207
- this.focusedItemId$ = new BehaviorSubject(this.searchId);
4208
- this.open$ = new BehaviorSubject(false);
4209
- this.filteredItems$ = new BehaviorSubject(undefined);
4210
- this.wasInside = false;
4211
- this.mouseOnList$ = new BehaviorSubject(false);
4212
- }
4213
- clickInside() {
4214
- this.wasInside = true;
4215
- }
4216
- clickout() {
4217
- if (!this.wasInside) {
4218
- this.closeDropdown();
4219
- }
4220
- this.wasInside = false;
4221
- }
4222
- ngOnInit() {
4223
- this.openKeysSubscription();
4224
- this.openSearchSubscription();
4225
- }
4226
- ngOnChanges(changes) {
4227
- const itemChanges = changes.items;
4228
- const currenItems = itemChanges.currentValue;
4229
- if (itemChanges && !itemChanges.previousValue && currenItems) {
4230
- this.filteredItems$.next(currenItems);
4231
- }
4232
- }
4233
- ngOnDestroy() {
4234
- this.keySubscription.unsubscribe();
4235
- this.searchSubscription.unsubscribe();
4236
- }
4237
- openDropdown() {
4238
- this.open$.next(true);
4239
- }
4240
- hoverOverButton(id) {
4241
- this.focusedItemId$.next(id);
4242
- }
4243
- mouseEnterList() {
4244
- this.mouseOnList$.next(true);
4245
- }
4246
- mouseLeaveList() {
4247
- this.mouseOnList$.next(false);
4248
- }
4249
- resetFocus() {
4250
- this.focusedItemId$.next(this.searchId);
4251
- }
4252
- submit(id) {
4253
- this.itemSelected.emit(id);
4254
- }
4255
- closeDropdown() {
4256
- this.searchTerm.setValue('');
4257
- this.resetFocus();
4258
- this.open$.next(false);
4259
- }
4260
- openKeysSubscription() {
4261
- this.keySubscription = fromEvent(document, 'keyup')
4262
- .pipe(debounceTime(50))
4263
- .subscribe((event) => {
4264
- combineLatest([this.mouseOnList$, this.filteredItems$, this.focusedItemId$])
4265
- .pipe(take(1))
4266
- .subscribe(([mouseOnList, items, focusedId]) => {
4267
- const length = items.length;
4268
- const focusedIndex = items.findIndex(item => item.id === focusedId);
4269
- const code = event.code;
4270
- const shiftKey = event.shiftKey;
4271
- const down = 'ArrowDown';
4272
- const tab = 'Tab';
4273
- const up = 'ArrowUp';
4274
- const enter = 'Enter';
4275
- const escape = 'Escape';
4276
- // close dropdown on pressing escape
4277
- if (code === escape) {
4278
- this.closeDropdown();
4279
- }
4280
- // submit item when focus is on an item in the list and enter is pressed
4281
- if (code === enter && focusedId !== this.searchId) {
4282
- this.submit(focusedId);
4283
- }
4284
- // only handle tab or arrow keypresses when items are shown and the mouse is not on the list
4285
- if (length > 0 && !mouseOnList) {
4286
- // handle moving down in the list with arrow down or tab
4287
- if (code === down || (code === tab && !shiftKey)) {
4288
- // move focus to first item in the list when focus is on search box
4289
- if (focusedId === this.searchId) {
4290
- this.focusedItemId$.next(items[0].id);
4291
- this.scrollButtonIntoView(focusedId);
4292
- // move focus to next item in the list if focus is not on last item
4293
- }
4294
- else if (focusedIndex + 1 < length) {
4295
- this.focusedItemId$.next(items[focusedIndex + 1].id);
4296
- this.scrollButtonIntoView(focusedId);
4297
- }
4298
- // handle moving up in the list with up arrow up or shift+tab
4299
- }
4300
- else if ((code === up || (code === tab && shiftKey)) &&
4301
- focusedId !== this.searchId) {
4302
- // move to previous item if focus is not on the first item in the list
4303
- if (focusedIndex > 0) {
4304
- this.focusedItemId$.next(items[focusedIndex - 1].id);
4305
- this.scrollButtonIntoView(focusedId);
4306
- // move focus to search box if focus is on first item in the list
4307
- }
4308
- else {
4309
- this.resetFocus();
4310
- }
4311
- }
4312
- }
4313
- });
4314
- });
4315
- }
4316
- openSearchSubscription() {
4317
- this.searchSubscription = this.searchTerm.valueChanges.subscribe(searchTerm => {
4318
- this.focusedItemId$.pipe(take(1)).subscribe(focusedItemId => {
4319
- if (!searchTerm) {
4320
- this.filteredItems$.next(this.items);
4321
- }
4322
- else {
4323
- const filteredItems = this.items.filter(item => item.text.toUpperCase().includes(searchTerm.toUpperCase()));
4324
- this.filteredItems$.next(filteredItems);
4325
- // move focus to search box if filtered list length is 0 or previously focused item is not in filtered list anymore
4326
- if (filteredItems.length === 0 ||
4327
- !filteredItems.some(item => item.id === focusedItemId)) {
4328
- this.resetFocus();
4329
- }
4330
- }
4331
- // move scrolling button into view to end of queue, so that DOM can be updated first
4332
- setTimeout(() => {
4333
- this.scrollButtonIntoView(focusedItemId);
4334
- });
4335
- });
4336
- });
4337
- }
4338
- scrollButtonIntoView(id) {
4339
- this.filteredItems$.pipe(take(1)).subscribe(items => {
4340
- const focusItemIndex = items.findIndex(item => item.id === id);
4341
- const focusedButton = this.buttons.toArray()[focusItemIndex];
4342
- if (focusedButton) {
4343
- focusedButton.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
4344
- }
4345
- });
4346
- }
4347
- }
4348
- SearchableDropdownComponent.decorators = [
4349
- { type: Component, args: [{
4350
- selector: 'valtimo-searchable-dropdown',
4351
- template: "<ng-container *ngIf=\"buttonText && items\">\n <ng-container [ngTemplateOutlet]=\"(open$ | async) ? opened : closed\"> </ng-container>\n</ng-container>\n\n<ng-template #closed>\n <ng-container *ngIf=\"style === 'button' || !style\">\n <button\n class=\"btn btn-primary btn-sm dropdown-size\"\n (click)=\"openDropdown()\"\n [style.width.px]=\"width\"\n >\n {{ buttonText }}\n </button>\n </ng-container>\n <ng-container *ngIf=\"style === 'underlinedText'\">\n <h5 class=\"underline-button\" (click)=\"openDropdown()\" [style.width.px]=\"width\">\n <b>\n {{ buttonText }}\n </b>\n </h5>\n </ng-container>\n</ng-template>\n\n<ng-template #opened>\n <div class=\"dropdown-container\" [style.width.px]=\"width\">\n <div class=\"dropdown-size search\" [style.width.px]=\"width\">\n <input\n #search\n [ngClass]=\"{disabled: disabled}\"\n [placeholder]=\"searchText\"\n [formControl]=\"searchTerm\"\n />\n {{ search.focus() }}\n </div>\n <div class=\"dropdown-list\" (mouseenter)=\"mouseEnterList()\" (mouseleave)=\"mouseLeaveList()\">\n <ng-container *ngIf=\"filteredItems$ | async as filteredItems\">\n <ng-container\n *ngIf=\"\n filteredItems.length > 0 && focusedItemId$ | async as focusedItemId;\n else noResults\n \"\n >\n <button\n #button\n *ngFor=\"let item of filteredItems\"\n [ngClass]=\"{focus: focusedItemId === item.id, disabled: disabled}\"\n class=\"dropdown-button dropdown-size\"\n (click)=\"submit(item.id)\"\n (mouseenter)=\"hoverOverButton(item.id)\"\n (mouseleave)=\"resetFocus()\"\n [style.width.px]=\"width\"\n >\n <span class=\"dropdown-button-text\">\n {{ item.text }}\n </span>\n </button>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <ng-container [ngTemplateOutlet]=\"space\"> </ng-container>\n</ng-template>\n\n<ng-template #noResults>\n <div class=\"dropdown-button dropdown-size disabled\" [style.width.px]=\"width\">\n <span class=\"dropdown-button-text\">{{ noResultsText }}</span>\n </div>\n</ng-template>\n\n<ng-template #space>\n <div *ngIf=\"style === 'button' || !style\" class=\"dropdown-size\" [style.width.px]=\"width\"></div>\n <h5 *ngIf=\"style === 'underlinedText'\" class=\"underline-button\"><b>-</b></h5>\n</ng-template>\n",
4352
- styles: [".dropdown-size{height:34px;width:250px}.underline-button{cursor:pointer;text-decoration:underline;width:250px}.dropdown-container{background-color:#fff;border:1px solid #e3e3e3;border-radius:3px;box-shadow:0 0 6px 0 rgba(0,0,0,.12);display:flex;flex-direction:column;max-height:300px;overflow:hidden;padding:7px 0;position:fixed;width:250px;z-index:999}.dropdown-list{list-style:none;margin:0;overflow:auto;overflow-x:hidden;padding:0;z-index:9999}.search{align-items:center;border-bottom:1px solid #dee2e6;display:flex;flex-shrink:0;height:44px;padding:8px 24px}.search input{padding:0;width:100%}.dropdown-button,.search input,.search input:focus{border:none;outline:none}.dropdown-button{align-items:center;background-color:#fff;color:#504e4e;cursor:pointer;display:flex;font-size:1rem;font-weight:400;padding:8px 24px}.dropdown-button.focus{background-color:#f5f5f5}.dropdown-button-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disabled{color:#959595;cursor:default;pointer-events:none}"]
4353
- },] }
4354
- ];
4355
- SearchableDropdownComponent.propDecorators = {
4356
- style: [{ type: Input }],
4357
- items: [{ type: Input }],
4358
- buttonText: [{ type: Input }],
4359
- searchText: [{ type: Input }],
4360
- noResultsText: [{ type: Input }],
4361
- disabled: [{ type: Input }],
4362
- width: [{ type: Input }],
4363
- itemSelected: [{ type: Output }],
4364
- buttons: [{ type: ViewChildren, args: ['button',] }],
4365
- clickInside: [{ type: HostListener, args: ['click',] }],
4366
- clickout: [{ type: HostListener, args: ['document:click',] }]
4367
- };
4368
-
4369
- /*
4370
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4371
- *
4372
- * Licensed under EUPL, Version 1.2 (the "License");
4373
- * you may not use this file except in compliance with the License.
4374
- * You may obtain a copy of the License at
4375
- *
4376
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4377
- *
4378
- * Unless required by applicable law or agreed to in writing, software
4379
- * distributed under the License is distributed on an "AS IS" basis,
4380
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4381
- * See the License for the specific language governing permissions and
4382
- * limitations under the License.
4383
- */
4384
- class SearchableDropdownModule {
4385
- }
4386
- SearchableDropdownModule.decorators = [
4387
- { type: NgModule, args: [{
4388
- declarations: [SearchableDropdownComponent],
4389
- imports: [CommonModule, ReactiveFormsModule],
4390
- exports: [SearchableDropdownComponent],
4391
- },] }
4392
- ];
4393
-
4394
- const formIoUploaderEditForm = () => ({
4395
- components: [
4396
- { key: 'type', type: 'hidden' },
4397
- {
4398
- type: 'textfield',
4399
- input: true,
4400
- key: 'label',
4401
- label: 'Label',
4402
- placeholder: 'Label',
4403
- validate: {
4404
- required: true,
4405
- },
4406
- },
4407
- {
4408
- type: 'textfield',
4409
- input: true,
4410
- key: 'key',
4411
- label: 'Property Name',
4412
- placeholder: 'Property Name',
4413
- tooltip: 'The name of this field in the API endpoint.',
4414
- validate: {
4415
- required: true,
4416
- },
4417
- },
4418
- {
4419
- type: 'textfield',
4420
- input: true,
4421
- key: 'customOptions.title',
4422
- label: 'Title',
4423
- placeholder: 'Title',
4424
- tooltip: 'Leave empty to use the default title',
4425
- validate: {
4426
- required: false,
4427
- },
4428
- },
4429
- {
4430
- type: 'checkbox',
4431
- input: true,
4432
- inputType: 'checkbox',
4433
- key: 'customOptions.hideTitle',
4434
- label: 'Hide title',
4435
- validate: {
4436
- required: false,
4437
- },
4438
- },
4439
- {
4440
- type: 'textfield',
4441
- input: true,
4442
- key: 'customOptions.subtitle',
4443
- label: 'Subtitle',
4444
- placeholder: 'Title',
4445
- tooltip: 'Leave empty to hide subtitle',
4446
- validate: {
4447
- required: false,
4448
- },
4449
- },
4450
- {
4451
- type: 'number',
4452
- input: true,
4453
- key: 'customOptions.maxFileSize',
4454
- label: 'Maximum file size',
4455
- placeholder: 'Maximum file size',
4456
- defaultValue: 5,
4457
- validate: {
4458
- required: true,
4459
- },
4460
- },
4461
- {
4462
- type: 'checkbox',
4463
- input: true,
4464
- inputType: 'checkbox',
4465
- key: 'customOptions.hideMaxFileSize',
4466
- label: 'Hide maximum file size',
4467
- validate: {
4468
- required: false,
4469
- },
4470
- },
4471
- {
4472
- type: 'checkbox',
4473
- input: true,
4474
- inputType: 'checkbox',
4475
- key: 'customOptions.camera',
4476
- label: 'Allow camera uploads',
4477
- validate: {
4478
- required: false,
4479
- },
4480
- },
4481
- ],
4482
- });
4483
-
4484
- const customUploaderType = 'valtimo-file';
4485
- const COMPONENT_OPTIONS = {
4486
- type: customUploaderType,
4487
- selector: 'valtimo-form-io-uploader',
4488
- title: 'Valtimo File Upload',
4489
- group: 'basic',
4490
- icon: 'upload',
4491
- // set empty value to force formio to accept arrays as valid input value for this field type
4492
- emptyValue: [],
4493
- editForm: formIoUploaderEditForm,
4494
- };
4495
- function registerFormioUploadComponent(injector) {
4496
- const originalUploadComponent = createCustomFormioComponent(COMPONENT_OPTIONS);
4497
- // override setValue function to allow for setting an array value
4498
- class UploaderComponent extends originalUploadComponent {
4499
- setValue(value) {
4500
- this._customAngularElement.value = value;
4501
- return true;
4502
- }
4503
- }
4504
- registerCustomFormioComponentWithClass(COMPONENT_OPTIONS, FormIoUploaderComponent, UploaderComponent, injector);
4505
- }
4506
-
4507
- const SelectComponent = Components.components.select;
4508
- function registerFormioFileSelectorComponent(injector) {
4509
- const documentService = injector.get(DocumentService);
4510
- const stateService = injector.get(FormIoStateService);
4511
- const unavailableMessage = {
4512
- label: 'could not retrieve documents',
4513
- value: null,
4514
- };
4515
- function getDocumentResources(documentId) {
4516
- if (!documentId) {
4517
- return new Promise(resolve => {
4518
- resolve([unavailableMessage]);
4519
- });
4520
- }
4521
- return documentService
4522
- .getDocument(documentId)
4523
- .toPromise()
4524
- .then(document => document.relatedFiles.map(relatedFile => {
4525
- return {
4526
- label: relatedFile.fileName,
4527
- value: relatedFile.fileId,
4528
- };
4529
- }))
4530
- .catch(() => {
4531
- return new Promise(resolve => {
4532
- resolve([unavailableMessage]);
4533
- });
4534
- });
4535
- }
4536
- class ResourceSelectorComponent extends SelectComponent {
4537
- static schema(...extend) {
4538
- return SelectComponent.schema(Object.assign({ type: 'resource-selector', label: 'Resource selector', key: 'resource-selector', dataSrc: 'custom', dataType: 'string', valueProperty: 'value', asyncValues: true, data: {
4539
- custom: 'values = instance.getResources()',
4540
- } }, extend));
4541
- }
4542
- getResources() {
4543
- return stateService.documentId$
4544
- .pipe(take(1))
4545
- .toPromise()
4546
- .then(documentId => getDocumentResources(documentId));
4547
- }
4548
- static get builderInfo() {
4549
- return {
4550
- title: 'Document picker',
4551
- icon: 'th-list',
4552
- group: 'basic',
4553
- documentation: '/userguide/#textfield',
4554
- weight: 0,
4555
- schema: ResourceSelectorComponent.schema(),
4556
- };
4557
- }
4558
- }
4559
- Formio.use({
4560
- components: {
4561
- 'resource-selector': ResourceSelectorComponent,
4562
- },
4563
- });
4564
- }
4565
-
4566
- /*
4567
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4568
- *
4569
- * Licensed under EUPL, Version 1.2 (the "License");
4570
- * you may not use this file except in compliance with the License.
4571
- * You may obtain a copy of the License at
4572
- *
4573
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4574
- *
4575
- * Unless required by applicable law or agreed to in writing, software
4576
- * distributed under the License is distributed on an "AS IS" basis,
4577
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4578
- * See the License for the specific language governing permissions and
4579
- * limitations under the License.
4580
- */
4581
- class SearchableDropdownSelectComponent {
4582
- constructor() {
4583
- this.width = 250;
4584
- this.itemSelected = new EventEmitter();
4585
- this.clearSelection = new EventEmitter();
4586
- }
4587
- onSelect(id) {
4588
- this.itemSelected.emit(id);
4589
- }
4590
- onClearSelection() {
4591
- this.clearSelection.emit();
4592
- }
4593
- }
4594
- SearchableDropdownSelectComponent.decorators = [
4595
- { type: Component, args: [{
4596
- selector: 'valtimo-searchable-dropdown-select',
4597
- template: "<valtimo-searchable-dropdown\n *ngIf=\"!hasSelection; else selection\"\n [style]=\"style\"\n [items]=\"items\"\n [buttonText]=\"buttonText\"\n [searchText]=\"searchText\"\n [noResultsText]=\"noResultsText\"\n [disabled]=\"disabled\"\n [width]=\"width\"\n (itemSelected)=\"onSelect($event)\"\n>\n</valtimo-searchable-dropdown>\n\n<ng-template #selection>\n <div\n class=\"d-flex flex-row align-items-center\"\n [style.height.px]=\"style === 'button' ? 34 : null\"\n >\n <h5 class=\"selected-text\">\n {{ selectedText }} <b>{{ selectedTextValue }}</b>\n </h5>\n <button\n type=\"button\"\n class=\"close p-0 m-0 ml-2 d-flex text-danger\"\n aria-label=\"Close\"\n (click)=\"onClearSelection()\"\n [title]=\"clearSelectionButtonTitle\"\n >\n <i class=\"clear-icon mdi mdi-close text-danger\"></i>\n </button>\n </div>\n</ng-template>\n",
4598
- styles: [".selected-text{margin:0}.clear-icon{font-size:16px}"]
4599
- },] }
4600
- ];
4601
- SearchableDropdownSelectComponent.propDecorators = {
4602
- style: [{ type: Input }],
4603
- items: [{ type: Input }],
4604
- buttonText: [{ type: Input }],
4605
- searchText: [{ type: Input }],
4606
- noResultsText: [{ type: Input }],
4607
- disabled: [{ type: Input }],
4608
- selectedText: [{ type: Input }],
4609
- selectedTextValue: [{ type: Input }],
4610
- clearSelectionButtonTitle: [{ type: Input }],
4611
- hasSelection: [{ type: Input }],
4612
- width: [{ type: Input }],
4613
- itemSelected: [{ type: Output }],
4614
- clearSelection: [{ type: Output }]
4615
- };
4616
-
4617
- /*
4618
- * Copyright 2015-2020 Ritense BV, the Netherlands.
4619
- *
4620
- * Licensed under EUPL, Version 1.2 (the "License");
4621
- * you may not use this file except in compliance with the License.
4622
- * You may obtain a copy of the License at
4623
- *
4624
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4625
- *
4626
- * Unless required by applicable law or agreed to in writing, software
4627
- * distributed under the License is distributed on an "AS IS" basis,
4628
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4629
- * See the License for the specific language governing permissions and
4630
- * limitations under the License.
4631
- */
4632
- class SearchableDropdownSelectModule {
4633
- }
4634
- SearchableDropdownSelectModule.decorators = [
4635
- { type: NgModule, args: [{
4636
- declarations: [SearchableDropdownSelectComponent],
4637
- imports: [CommonModule, ReactiveFormsModule, SearchableDropdownModule],
4638
- exports: [SearchableDropdownSelectComponent],
4639
- },] }
4640
- ];
4641
-
4642
- /*
4643
- * Copyright 2015-2022 Ritense BV, the Netherlands.
4644
- *
4645
- * Licensed under EUPL, Version 1.2 (the "License");
4646
- * you may not use this file except in compliance with the License.
4647
- * You may obtain a copy of the License at
4648
- *
4649
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4650
- *
4651
- * Unless required by applicable law or agreed to in writing, software
4652
- * distributed under the License is distributed on an "AS IS" basis,
4653
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4654
- * See the License for the specific language governing permissions and
4655
- * limitations under the License.
4656
- */
4657
- class MultiselectDropdownComponent {
4658
- constructor() {
4659
- this.items = [];
4660
- this.dropdownSettings = {
4661
- singleSelection: false,
4662
- selectAllText: 'Select All',
4663
- unSelectAllText: 'UnSelect All',
4664
- itemsShowLimit: 3,
4665
- allowSearchFilter: true,
4666
- };
4667
- this.itemsSelected = new EventEmitter();
4668
- }
4669
- onItemsSelected() {
4670
- this.itemsSelected.emit(this.selectedItems);
4671
- }
4672
- }
4673
- MultiselectDropdownComponent.decorators = [
4674
- { type: Component, args: [{
4675
- selector: 'valtimo-multiselect-dropdown',
4676
- template: "<!--\n ~ Copyright 2015-2022 Ritense BV, the Netherlands.\n ~\n ~ Licensed under EUPL, Version 1.2 (the \"License\");\n ~ you may not use this file except in compliance with the License.\n ~ You may obtain a copy of the License at\n ~\n ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n ~\n ~ Unless required by applicable law or agreed to in writing, software\n ~ distributed under the License is distributed on an \"AS IS\" basis,\n ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n ~ See the License for the specific language governing permissions and\n ~ limitations under the License.\n -->\n\n<ng-multiselect-dropdown\n [placeholder]=\"placeHolder\"\n [data]=\"items\"\n [(ngModel)]=\"selectedItems\"\n [settings]=\"dropdownSettings\"\n (onDropDownClose)=\"onItemsSelected()\"\n></ng-multiselect-dropdown>\n",
4677
- styles: [""]
4678
- },] }
4679
- ];
4680
- MultiselectDropdownComponent.propDecorators = {
4681
- selectedItems: [{ type: Input }],
4682
- items: [{ type: Input }],
4683
- placeHolder: [{ type: Input }],
4684
- dropdownSettings: [{ type: Input }],
4685
- itemsSelected: [{ type: Output }]
4686
- };
4687
-
4688
- /*
4689
- * Copyright 2015-2022 Ritense BV, the Netherlands.
4690
- *
4691
- * Licensed under EUPL, Version 1.2 (the "License");
4692
- * you may not use this file except in compliance with the License.
4693
- * You may obtain a copy of the License at
4694
- *
4695
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4696
- *
4697
- * Unless required by applicable law or agreed to in writing, software
4698
- * distributed under the License is distributed on an "AS IS" basis,
4699
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4700
- * See the License for the specific language governing permissions and
4701
- * limitations under the License.
4702
- */
4703
- class MultiselectDropdownModule {
4704
- }
4705
- MultiselectDropdownModule.decorators = [
4706
- { type: NgModule, args: [{
4707
- declarations: [MultiselectDropdownComponent],
4708
- imports: [CommonModule, ReactiveFormsModule, NgMultiSelectDropDownModule, FormsModule],
4709
- exports: [MultiselectDropdownComponent],
4710
- },] }
4711
- ];
4712
-
4713
- /*
4714
- * Copyright 2015-2022 Ritense BV, the Netherlands.
4715
- *
4716
- * Licensed under EUPL, Version 1.2 (the "License");
4717
- * you may not use this file except in compliance with the License.
4718
- * You may obtain a copy of the License at
4719
- *
4720
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
4721
- *
4722
- * Unless required by applicable law or agreed to in writing, software
4723
- * distributed under the License is distributed on an "AS IS" basis,
4724
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4725
- * See the License for the specific language governing permissions and
4726
- * limitations under the License.
4727
- */
4728
-
4729
- /**
4730
- * Generated bundle index. Do not edit.
4731
- */
4732
-
4733
- export { Alert, AlertComponent, AlertModule, AlertService, AlertType, AlertsOptionsImpl, BpmnJsDiagramComponent, BpmnJsDiagramModule, BreadcrumbNavigationComponent, BreadcrumbNavigationModule, CamundaFormComponent, CamundaFormModule, CardComponent, CardModule, ComponentsModule, DataListComponent, DataListModule, DropzoneComponent, DropzoneModule, FieldAutoFocusDirective, FieldAutoFocusModule, FileSizeModule, FileSizePipe, FilterSidebarComponent, FilterSidebarModule, FormIoModule, FormIoStateService, FormIoUploaderComponent, FormioBuilderComponent, FormioComponent, FormioOptionsImpl, LeftSidebarComponent, LeftSidebarModule, ListComponent, ListFilterPipe, ListModule, MenuModule, MenuRoutingModule, MenuService, ModalComponent, ModalModule, MultiselectDropdownComponent, MultiselectDropdownModule, PageHeaderComponent, PageHeaderModule, PageTitleComponent, PageTitleModule, ProgressBarComponent, ProgressBarModule, RightSidebarComponent, RightSidebarModule, SearchableDropdownComponent, SearchableDropdownModule, SearchableDropdownSelectComponent, SearchableDropdownSelectModule, SpinnerModule, TimelineComponent, TimelineItemImpl, TimelineModule, TopbarComponent, TopbarModule, UploaderComponent, UploaderDragDropDirective, UploaderModule, ViewContentService, WebcamComponent, WebcamModule, WidgetComponent, WidgetModule, customUploaderType, menuInitializer, registerFormioFileSelectorComponent, registerFormioUploadComponent, ɵ0, CamundaGeneratedFormModule as ɵa, CamundaStringFormfieldComponent as ɵb, CamundaBooleanFormfieldComponent as ɵc, CamundaDateFormfieldComponent as ɵd, CamundaFormfieldService as ɵe, CamundaFormfieldGeneratorDirective as ɵf, CamundaLongFormfieldComponent as ɵg, CamundaEnumFormfieldComponent as ɵh, CamundaTextareaFormfieldComponent as ɵi, CamundaChoicefieldFormfieldComponent as ɵj, CamundaFormfieldValidationComponent as ɵk, CamundaGeneratedFormComponent as ɵl, CamundaCustomFormModule as ɵm, CamundaCustomFormComponent as ɵn, MenuComponent as ɵo, MenuItemTextComponent as ɵp, SubmenuItemTextComponent as ɵq, VersionService as ɵr, FormIoDomService as ɵs, AppConfig as ɵt, SpinnerComponent as ɵu };
4734
- //# sourceMappingURL=valtimo-components.js.map