cedar-embeddable-editor 0.9.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 (256) hide show
  1. package/.browserslistrc +18 -0
  2. package/.editorconfig +16 -0
  3. package/README.md +302 -0
  4. package/angular.json +153 -0
  5. package/cedar-embeddable-editor-0.9.0.tgz +0 -0
  6. package/e2e/protractor.conf.js +36 -0
  7. package/e2e/src/app.e2e-spec.ts +23 -0
  8. package/e2e/src/app.po.ts +11 -0
  9. package/e2e/tsconfig.json +14 -0
  10. package/karma.conf.js +32 -0
  11. package/license.txt +26 -0
  12. package/package.json +61 -0
  13. package/src/app/app.component.dev.ts +74 -0
  14. package/src/app/app.component.html +5 -0
  15. package/src/app/app.component.prod.ts +76 -0
  16. package/src/app/app.component.scss +1 -0
  17. package/src/app/app.module.dev.ts +58 -0
  18. package/src/app/app.module.prod.ts +56 -0
  19. package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.html +0 -0
  20. package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.scss +0 -0
  21. package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.spec.ts +24 -0
  22. package/src/app/modules/input-types/components/cedar-foo-bar/cedar-foo-bar.component.ts +39 -0
  23. package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.html +25 -0
  24. package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.scss +0 -0
  25. package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.spec.ts +25 -0
  26. package/src/app/modules/input-types/components/cedar-input-attribute-value/cedar-input-attribute-value.component.ts +91 -0
  27. package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.html +8 -0
  28. package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.scss +0 -0
  29. package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.spec.ts +25 -0
  30. package/src/app/modules/input-types/components/cedar-input-checkbox/cedar-input-checkbox.component.ts +104 -0
  31. package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.html +22 -0
  32. package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.scss +0 -0
  33. package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.spec.ts +24 -0
  34. package/src/app/modules/input-types/components/cedar-input-controlled/cedar-input-controlled.component.ts +135 -0
  35. package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.html +44 -0
  36. package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.scss +0 -0
  37. package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.spec.ts +25 -0
  38. package/src/app/modules/input-types/components/cedar-input-datetime/cedar-input-datetime.component.ts +451 -0
  39. package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.html +16 -0
  40. package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.scss +0 -0
  41. package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.spec.ts +25 -0
  42. package/src/app/modules/input-types/components/cedar-input-email/cedar-input-email.component.ts +91 -0
  43. package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.html +16 -0
  44. package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.scss +0 -0
  45. package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.spec.ts +25 -0
  46. package/src/app/modules/input-types/components/cedar-input-link/cedar-input-link.component.ts +92 -0
  47. package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.html +18 -0
  48. package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.scss +5 -0
  49. package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.spec.ts +25 -0
  50. package/src/app/modules/input-types/components/cedar-input-multiple-choice/cedar-input-multiple-choice.component.ts +78 -0
  51. package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.html +15 -0
  52. package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.scss +0 -0
  53. package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.spec.ts +25 -0
  54. package/src/app/modules/input-types/components/cedar-input-numeric/cedar-input-numeric.component.ts +169 -0
  55. package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.html +15 -0
  56. package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.scss +0 -0
  57. package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.spec.ts +25 -0
  58. package/src/app/modules/input-types/components/cedar-input-phone/cedar-input-phone.component.ts +94 -0
  59. package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.html +19 -0
  60. package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.scss +0 -0
  61. package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.spec.ts +25 -0
  62. package/src/app/modules/input-types/components/cedar-input-select/cedar-input-select.component.ts +108 -0
  63. package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.html +25 -0
  64. package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.scss +0 -0
  65. package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.spec.ts +25 -0
  66. package/src/app/modules/input-types/components/cedar-input-text/cedar-input-text.component.ts +125 -0
  67. package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.html +8 -0
  68. package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.scss +0 -0
  69. package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.spec.ts +24 -0
  70. package/src/app/modules/input-types/components/cedar-static-image/cedar-static-image.component.ts +40 -0
  71. package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.html +20 -0
  72. package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.scss +24 -0
  73. package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.spec.ts +25 -0
  74. package/src/app/modules/input-types/components/cedar-static-page-break/cedar-static-page-break.component.ts +36 -0
  75. package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.html +2 -0
  76. package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.scss +0 -0
  77. package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.spec.ts +25 -0
  78. package/src/app/modules/input-types/components/cedar-static-rich-text/cedar-static-rich-text.component.ts +35 -0
  79. package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.html +8 -0
  80. package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.scss +0 -0
  81. package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.spec.ts +24 -0
  82. package/src/app/modules/input-types/components/cedar-static-section-break/cedar-static-section-break.component.ts +39 -0
  83. package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.html +6 -0
  84. package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.scss +0 -0
  85. package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.spec.ts +24 -0
  86. package/src/app/modules/input-types/components/cedar-static-youtube/cedar-static-youtube.component.ts +42 -0
  87. package/src/app/modules/input-types/input-types.module.ts +139 -0
  88. package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.html +13 -0
  89. package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.scss +12 -0
  90. package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.spec.ts +25 -0
  91. package/src/app/modules/shared/components/cedar-component-header/cedar-component-header.component.ts +42 -0
  92. package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.html +117 -0
  93. package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.scss +5 -0
  94. package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.spec.ts +25 -0
  95. package/src/app/modules/shared/components/cedar-component-renderer/cedar-component-renderer.component.ts +101 -0
  96. package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.html +22 -0
  97. package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.scss +23 -0
  98. package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.spec.ts +24 -0
  99. package/src/app/modules/shared/components/cedar-data-saver/cedar-data-saver.component.ts +139 -0
  100. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.html +56 -0
  101. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.scss +13 -0
  102. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.spec.ts +25 -0
  103. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor/cedar-embeddable-metadata-editor.component.ts +184 -0
  104. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.html +15 -0
  105. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.scss +2 -0
  106. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.spec.ts +25 -0
  107. package/src/app/modules/shared/components/cedar-embeddable-metadata-editor-wrapper/cedar-embeddable-metadata-editor-wrapper.component.ts +240 -0
  108. package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.html +35 -0
  109. package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.scss +41 -0
  110. package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.spec.ts +25 -0
  111. package/src/app/modules/shared/components/cedar-multi-pager/cedar-multi-pager.component.ts +282 -0
  112. package/src/app/modules/shared/components/date-picker/date-picker.component.html +46 -0
  113. package/src/app/modules/shared/components/date-picker/date-picker.component.scss +7 -0
  114. package/src/app/modules/shared/components/date-picker/date-picker.component.spec.ts +25 -0
  115. package/src/app/modules/shared/components/date-picker/date-picker.component.ts +100 -0
  116. package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.spec.ts +33 -0
  117. package/src/app/modules/shared/components/file-uploader/bytes/bytes.pipe.ts +16 -0
  118. package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.spec.ts +54 -0
  119. package/src/app/modules/shared/components/file-uploader/file-upload-input-for/file-upload-input-for.directive.ts +67 -0
  120. package/src/app/modules/shared/components/file-uploader/file-uploader.component.html +26 -0
  121. package/src/app/modules/shared/components/file-uploader/file-uploader.component.scss +55 -0
  122. package/src/app/modules/shared/components/file-uploader/file-uploader.component.spec.ts +25 -0
  123. package/src/app/modules/shared/components/file-uploader/file-uploader.component.ts +67 -0
  124. package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.html +42 -0
  125. package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.scss +31 -0
  126. package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.spec.ts +177 -0
  127. package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.component.ts +145 -0
  128. package/src/app/modules/shared/components/file-uploader/mat-file-upload/mat-file-upload.service.ts +21 -0
  129. package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.html +1 -0
  130. package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.scss +0 -0
  131. package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.spec.ts +59 -0
  132. package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.component.ts +139 -0
  133. package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.spec.ts +33 -0
  134. package/src/app/modules/shared/components/file-uploader/mat-file-upload-queue/mat-file-upload-queue.service.ts +17 -0
  135. package/src/app/modules/shared/components/file-uploader/mat-file-upload.module.ts +35 -0
  136. package/src/app/modules/shared/components/file-uploader/mat-file-upload.type.ts +24 -0
  137. package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.html +18 -0
  138. package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.scss +0 -0
  139. package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.spec.ts +23 -0
  140. package/src/app/modules/shared/components/preferences-menu/preferences-menu.component.ts +10 -0
  141. package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.html +16 -0
  142. package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.scss +0 -0
  143. package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.spec.ts +25 -0
  144. package/src/app/modules/shared/components/sample-templates/sample-template-select/sample-template-select.component.ts +89 -0
  145. package/src/app/modules/shared/components/sample-templates/sample-templates.component.html +19 -0
  146. package/src/app/modules/shared/components/sample-templates/sample-templates.component.scss +0 -0
  147. package/src/app/modules/shared/components/sample-templates/sample-templates.component.spec.ts +25 -0
  148. package/src/app/modules/shared/components/sample-templates/sample-templates.component.ts +66 -0
  149. package/src/app/modules/shared/components/sample-templates/sample-templates.service.ts +175 -0
  150. package/src/app/modules/shared/components/source-panels/source-panels.component.html +98 -0
  151. package/src/app/modules/shared/components/source-panels/source-panels.component.scss +0 -0
  152. package/src/app/modules/shared/components/source-panels/source-panels.component.spec.ts +25 -0
  153. package/src/app/modules/shared/components/source-panels/source-panels.component.ts +36 -0
  154. package/src/app/modules/shared/components/static-footer/static-footer.component.html +17 -0
  155. package/src/app/modules/shared/components/static-footer/static-footer.component.scss +110 -0
  156. package/src/app/modules/shared/components/static-footer/static-footer.component.spec.ts +25 -0
  157. package/src/app/modules/shared/components/static-footer/static-footer.component.ts +16 -0
  158. package/src/app/modules/shared/components/static-header/static-header.component.html +10 -0
  159. package/src/app/modules/shared/components/static-header/static-header.component.scss +13 -0
  160. package/src/app/modules/shared/components/static-header/static-header.component.spec.ts +25 -0
  161. package/src/app/modules/shared/components/static-header/static-header.component.ts +21 -0
  162. package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.html +16 -0
  163. package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.scss +0 -0
  164. package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.spec.ts +25 -0
  165. package/src/app/modules/shared/components/timezone-picker/timezone-picker.component.ts +251 -0
  166. package/src/app/modules/shared/factory/template-representation.factory.ts +323 -0
  167. package/src/app/modules/shared/handler/component-type.handler.ts +51 -0
  168. package/src/app/modules/shared/handler/data-object-builder.handler.ts +159 -0
  169. package/src/app/modules/shared/handler/data-object-data-value.handler.ts +270 -0
  170. package/src/app/modules/shared/handler/data-object-structure.handler.ts +145 -0
  171. package/src/app/modules/shared/handler/multi-instance-object.handler.ts +317 -0
  172. package/src/app/modules/shared/models/cedar-input-template.model.ts +3 -0
  173. package/src/app/modules/shared/models/cedar-model.model.ts +48 -0
  174. package/src/app/modules/shared/models/component/cedar-component.model.ts +16 -0
  175. package/src/app/modules/shared/models/component/component-representation.model.ts +30 -0
  176. package/src/app/modules/shared/models/component/element-component.model.ts +11 -0
  177. package/src/app/modules/shared/models/component/field-component.model.ts +23 -0
  178. package/src/app/modules/shared/models/component/multi-component.model.ts +10 -0
  179. package/src/app/modules/shared/models/component/null-component.model.ts +20 -0
  180. package/src/app/modules/shared/models/component/single-component.model.ts +6 -0
  181. package/src/app/modules/shared/models/element/abstract-element-component.model.ts +26 -0
  182. package/src/app/modules/shared/models/element/multi-element-component.model.ts +19 -0
  183. package/src/app/modules/shared/models/element/single-element-component.model.ts +16 -0
  184. package/src/app/modules/shared/models/enum/data-object-building-mode.model.ts +6 -0
  185. package/src/app/modules/shared/models/field/abstract-field-component.model.ts +28 -0
  186. package/src/app/modules/shared/models/field/multi-field-component.model.ts +21 -0
  187. package/src/app/modules/shared/models/field/single-field-component.model.ts +18 -0
  188. package/src/app/modules/shared/models/info/basic-info.model.ts +8 -0
  189. package/src/app/modules/shared/models/info/choice-info.model.ts +9 -0
  190. package/src/app/modules/shared/models/info/choice-option.model.ts +6 -0
  191. package/src/app/modules/shared/models/info/content-info.model.ts +5 -0
  192. package/src/app/modules/shared/models/info/controlled-info.model.ts +8 -0
  193. package/src/app/modules/shared/models/info/current-multi-info.model.ts +7 -0
  194. package/src/app/modules/shared/models/info/label-info.model.ts +7 -0
  195. package/src/app/modules/shared/models/info/multi-info.model.ts +10 -0
  196. package/src/app/modules/shared/models/info/multi-instance-info.model.ts +20 -0
  197. package/src/app/modules/shared/models/info/multi-instance-object-info.model.ts +30 -0
  198. package/src/app/modules/shared/models/info/number-info.model.ts +9 -0
  199. package/src/app/modules/shared/models/info/value-info.model.ts +9 -0
  200. package/src/app/modules/shared/models/input-type.model.ts +21 -0
  201. package/src/app/modules/shared/models/instance-extract-data.model.ts +3 -0
  202. package/src/app/modules/shared/models/instance-full-data.model.ts +5 -0
  203. package/src/app/modules/shared/models/javascript-types.model.ts +7 -0
  204. package/src/app/modules/shared/models/json-schema.model.ts +39 -0
  205. package/src/app/modules/shared/models/numbers.model.ts +10 -0
  206. package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-parameter-object.ts +8 -0
  207. package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request-value-constraints.ts +8 -0
  208. package/src/app/modules/shared/models/rest/integrated-search/integrated-search-request.ts +9 -0
  209. package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response-item.ts +10 -0
  210. package/src/app/modules/shared/models/rest/integrated-search/integrated-search-response.ts +13 -0
  211. package/src/app/modules/shared/models/static/static-field-component.model.ts +24 -0
  212. package/src/app/modules/shared/models/template/cedar-template.model.ts +24 -0
  213. package/src/app/modules/shared/models/template/empty-template.model.ts +5 -0
  214. package/src/app/modules/shared/models/template/null-template.model.ts +23 -0
  215. package/src/app/modules/shared/models/template/template-component.model.ts +12 -0
  216. package/src/app/modules/shared/models/temporal.model.ts +13 -0
  217. package/src/app/modules/shared/models/ui/cedar-ui-component.model.ts +17 -0
  218. package/src/app/modules/shared/models/xsd.model.ts +11 -0
  219. package/src/app/modules/shared/pipe/keep-html.pipe.ts +13 -0
  220. package/src/app/modules/shared/pipe/rdf.pipe.ts +10 -0
  221. package/src/app/modules/shared/service/active-component-registry.service.ts +134 -0
  222. package/src/app/modules/shared/service/component-data.service.ts +25 -0
  223. package/src/app/modules/shared/service/controlled-field-data.service.ts +37 -0
  224. package/src/app/modules/shared/service/date-time/custom-date-adapter.ts +19 -0
  225. package/src/app/modules/shared/service/date-time/date-time.service.ts +30 -0
  226. package/src/app/modules/shared/service/local-settings.service.ts +22 -0
  227. package/src/app/modules/shared/service/message-handler.service.ts +35 -0
  228. package/src/app/modules/shared/service/page-break-paginator.service.ts +78 -0
  229. package/src/app/modules/shared/shared.module.ts +97 -0
  230. package/src/app/modules/shared/util/data-context.ts +42 -0
  231. package/src/app/modules/shared/util/data-object-util.ts +102 -0
  232. package/src/app/modules/shared/util/handler-context.ts +81 -0
  233. package/src/app/modules/shared/util/template-object-util.ts +21 -0
  234. package/src/assets/.gitkeep +0 -0
  235. package/src/assets/fonts/MaterialIcons-Regular.eot +0 -0
  236. package/src/assets/fonts/MaterialIcons-Regular.ttf +0 -0
  237. package/src/assets/fonts/MaterialIcons-Regular.woff +0 -0
  238. package/src/assets/fonts/MaterialIcons-Regular.woff2 +0 -0
  239. package/src/assets/i18n-cee/en.json +86 -0
  240. package/src/assets/i18n-cee/hu.json +86 -0
  241. package/src/assets/images/bmir-logo.png +0 -0
  242. package/src/assets/images/cedar-logo-80x80.png +0 -0
  243. package/src/environments/environment.prod.ts +5 -0
  244. package/src/environments/environment.ts +18 -0
  245. package/src/favicon.ico +0 -0
  246. package/src/index.html +16 -0
  247. package/src/main.ts +28 -0
  248. package/src/polyfills.ts +65 -0
  249. package/src/styles-own.scss +352 -0
  250. package/src/styles.scss +116 -0
  251. package/src/test.ts +25 -0
  252. package/tsconfig.app.json +16 -0
  253. package/tsconfig.base.json +20 -0
  254. package/tsconfig.json +20 -0
  255. package/tsconfig.spec.json +18 -0
  256. package/tslint.json +152 -0
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed} from '@angular/core/testing';
2
+
3
+ import {DatePickerComponent} from './date-picker.component';
4
+
5
+ describe('DatePickerComponent', () => {
6
+ let component: DatePickerComponent;
7
+ let fixture: ComponentFixture<DatePickerComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [DatePickerComponent]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(DatePickerComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,100 @@
1
+ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
2
+ import {FormControl, Validators} from '@angular/forms';
3
+ import {DateAdapter} from '@angular/material/core';
4
+ import {MatDatepicker} from '@angular/material/datepicker';
5
+
6
+ // Depending on whether rollup is used, moment needs to be imported differently.
7
+ // Since Moment.js doesn't have a default export, we normally need to import using the `* as`
8
+ // syntax. However, rollup creates a synthetic default module and we thus need to import it using
9
+ // the `default as` syntax.
10
+ import * as _moment from 'moment';
11
+ // tslint:disable-next-line:no-duplicate-imports
12
+ import {default as _rollupMoment, Moment} from 'moment';
13
+ import {CustomDateAdapter} from '../../service/date-time/custom-date-adapter';
14
+ import {DateTimeService} from '../../service/date-time/date-time.service';
15
+
16
+ const moment = _rollupMoment || _moment;
17
+
18
+ @Component({
19
+ selector: 'app-date-picker',
20
+ templateUrl: './date-picker.component.html',
21
+ styleUrls: ['./date-picker.component.scss'],
22
+ providers: [
23
+ // DateTimeService is added as a provider to allow it
24
+ // to be injected as a new instance per component, rather
25
+ // than a Singleton instance
26
+ DateTimeService,
27
+ CustomDateAdapter, // so we could inject services to 'CustomDateAdapter'
28
+ {provide: DateAdapter, useClass: CustomDateAdapter} // Parse MatDatePicker format
29
+ ]
30
+ })
31
+
32
+ export class DatePickerComponent implements OnInit {
33
+ static readonly YEAR_FORMAT = 'YYYY';
34
+ static readonly YEAR_MONTH_FORMAT = 'MM/YYYY';
35
+ static readonly YEAR_MONTH_DAY_FORMAT = 'MM/DD/YYYY';
36
+ yearFormat = DatePickerComponent.YEAR_FORMAT;
37
+ yearMonthFormat = DatePickerComponent.YEAR_MONTH_FORMAT;
38
+ yearMonthDayFormat = DatePickerComponent.YEAR_MONTH_DAY_FORMAT;
39
+
40
+ @Input() dateMonthYear: FormControl;
41
+ @Input() dateFormat = DatePickerComponent.YEAR_FORMAT;
42
+ @Input() required: boolean;
43
+ @Output() dateChangedEvent = new EventEmitter<Moment>();
44
+
45
+
46
+ public constructor(private _dateTimeService: DateTimeService) {
47
+ }
48
+
49
+ public ngOnInit(): void {
50
+ const validators: any[] = [];
51
+ this._dateTimeService.format = this.dateFormat;
52
+ const m = moment();
53
+
54
+ switch (this.dateFormat) {
55
+ case this.yearMonthFormat:
56
+ m.set('date', 1);
57
+ break;
58
+ case this.yearFormat:
59
+ m.set('date', 1);
60
+ m.set('month', 0);
61
+ break;
62
+ }
63
+ if (this.required) {
64
+ validators.push(Validators.required);
65
+ }
66
+ this.dateMonthYear = new FormControl(null, validators);
67
+ this.dateChangedEvent.emit(this.dateMonthYear.value);
68
+ }
69
+
70
+ chosenYearHandler(normalizedYear: Moment, datepicker: MatDatepicker<Moment>): void {
71
+ if (this.dateMonthYear.value == null){
72
+ this.dateMonthYear.setValue(moment());
73
+ }
74
+ const ctrlValue = this.dateMonthYear.value;
75
+ ctrlValue.year(normalizedYear.year());
76
+ this.dateMonthYear.setValue(ctrlValue);
77
+ if (this.dateFormat === this.yearFormat) {
78
+ datepicker.close();
79
+ this.dateChangedEvent.emit(this.dateMonthYear.value);
80
+ }
81
+ }
82
+
83
+ chosenMonthHandler(normalizedMonth: Moment, datepicker: MatDatepicker<Moment>): void {
84
+ const ctrlValue = this.dateMonthYear.value;
85
+ ctrlValue.month(normalizedMonth.month());
86
+ this.dateMonthYear.setValue(ctrlValue);
87
+
88
+ if (this.dateFormat === this.yearMonthFormat) {
89
+ datepicker.close();
90
+ }
91
+ this.dateChangedEvent.emit(this.dateMonthYear.value);
92
+ }
93
+
94
+ chosenDateHandler(event): void {
95
+ if (event) {
96
+ this.dateChangedEvent.emit(event.value);
97
+ }
98
+ }
99
+
100
+ }
@@ -0,0 +1,33 @@
1
+ import { BytesPipe } from './bytes.pipe';
2
+
3
+ describe('BytesPipe', () => {
4
+ const pipe = new BytesPipe();
5
+
6
+ it('transforms NAN to -', () => {
7
+ expect(pipe.transform(NaN)).toBe('-');
8
+ });
9
+
10
+ it('transforms 0 to 0', () => {
11
+ expect(pipe.transform(0)).toBe('0');
12
+ });
13
+
14
+ it('transforms 1024 to 1.0 KB', () => {
15
+ expect(pipe.transform(1024)).toBe('1.0 KB');
16
+ });
17
+
18
+ it('transforms 1024*1024 to 1.0 MB', () => {
19
+ expect(pipe.transform(1024 * 1024)).toBe('1.0 MB');
20
+ });
21
+
22
+ it('transforms 1024*1024*1024 to 1.0 GB', () => {
23
+ expect(pipe.transform(1024 * 1024 * 1024)).toBe('1.0 GB');
24
+ });
25
+
26
+ it('transforms 1024*1024*1024*1024 to 1.0 TB', () => {
27
+ expect(pipe.transform(1024 * 1024 * 1024 * 1024)).toBe('1.0 TB');
28
+ });
29
+
30
+ it('transforms 1024*1024*1024*1024*1024 to 1.0 PB', () => {
31
+ expect(pipe.transform(1024 * 1024 * 1024 * 1024 * 1024)).toBe('1.0 PB');
32
+ });
33
+ });
@@ -0,0 +1,16 @@
1
+ import {Pipe, PipeTransform} from '@angular/core';
2
+
3
+ @Pipe({name: 'bytes'})
4
+ export class BytesPipe implements PipeTransform {
5
+ public transform(bytes: number): string {
6
+ if (isNaN(parseFloat('' + bytes)) || !isFinite(bytes)) {
7
+ return '-';
8
+ }
9
+ if (bytes <= 0) {
10
+ return '0';
11
+ }
12
+ const units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
13
+ const num = Math.floor(Math.log(bytes) / Math.log(1024));
14
+ return (bytes / Math.pow(1024, Math.floor(num))).toFixed(1) + ' ' + units[num];
15
+ }
16
+ }
@@ -0,0 +1,54 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { BehaviorSubject } from 'rxjs';
4
+ import { IInput } from '../mat-file-upload.type';
5
+ import { CommonModule } from '@angular/common';
6
+
7
+ import { FileUploadInputForDirective } from './file-upload-input-for.directive';
8
+ import { Component } from '@angular/core';
9
+ @Component({
10
+ template: ` <div
11
+ [fileUploadInputFor]="fileUploadQueue"
12
+ class="upload-drop-zone"
13
+ >
14
+ Just drag and drop files here
15
+ </div>`,
16
+ })
17
+ class FileDropComponent {}
18
+ export class StubMatFileUploadQueueService {
19
+ inputValueSubject = new BehaviorSubject<IInput>(null);
20
+ inputValue$ = this.inputValueSubject.asObservable();
21
+
22
+ initialize(input: IInput): void {
23
+ this.inputValueSubject.next(input);
24
+ }
25
+
26
+ getInputValue(): IInput {
27
+ return this.inputValueSubject.getValue();
28
+ }
29
+ }
30
+
31
+ export class StubFile {
32
+ name = 'testName';
33
+ size = 1024;
34
+ }
35
+
36
+ describe('FileUploadInputForDirective', () => {
37
+ let component: FileDropComponent;
38
+ let fixture;
39
+
40
+ beforeEach(async () => {
41
+ await TestBed.configureTestingModule({
42
+ imports: [CommonModule],
43
+ declarations: [FileUploadInputForDirective, FileDropComponent],
44
+ }).compileComponents();
45
+ fixture = TestBed.createComponent(FileDropComponent);
46
+ component = fixture.componentInstance;
47
+ });
48
+
49
+ describe('', () => {
50
+ it('should create', () => {
51
+ expect(component).toBeTruthy();
52
+ });
53
+ });
54
+ });
@@ -0,0 +1,67 @@
1
+ import {Directive, ElementRef, EventEmitter, HostBinding, HostListener, Input, Output} from '@angular/core';
2
+
3
+ /**
4
+ * A material design file upload queue component.
5
+ */
6
+ @Directive({
7
+ selector: 'input[fileUploadInputFor], div[fileUploadInputFor], mat-card[fileUploadInputFor]',
8
+ })
9
+ export class FileUploadInputForDirective {
10
+
11
+ private _queue: any = null;
12
+ private _element: HTMLElement;
13
+ @Output() public onFileSelected: EventEmitter<File[]> = new EventEmitter<File[]>();
14
+ @HostBinding('class.fileover') fileOver: boolean;
15
+
16
+
17
+ constructor(private element: ElementRef) {
18
+ this._element = this.element.nativeElement;
19
+ }
20
+
21
+ @Input('fileUploadInputFor')
22
+ set fileUploadQueue(value: any) {
23
+ if (value) {
24
+ this._queue = value;
25
+ }
26
+ }
27
+
28
+ @HostListener('change')
29
+ public onChange(): any {
30
+ const files = this.element.nativeElement.files;
31
+ this.onFileSelected.emit(files);
32
+
33
+ for (let i = 0; i < files.length; i++) {
34
+ this._queue.add(files[i]);
35
+ }
36
+ this.element.nativeElement.value = '';
37
+ }
38
+
39
+ @HostListener('drop', ['$event'])
40
+ public onDrop(event: any): any {
41
+ const files = event.dataTransfer.files;
42
+ this.onFileSelected.emit(files);
43
+
44
+ for (let i = 0; i < files.length; i++) {
45
+ this._queue.add(files[i]);
46
+ }
47
+ event.preventDefault();
48
+ event.stopPropagation();
49
+ this.element.nativeElement.value = '';
50
+ this.fileOver = false;
51
+ }
52
+
53
+ @HostListener('dragover', ['$event'])
54
+ public onDropOver(event: any): any {
55
+ event.preventDefault();
56
+ event.stopPropagation();
57
+ this.fileOver = true;
58
+ }
59
+
60
+ @HostListener('dragleave', ['$event'])
61
+ public onDragLeave(event): void {
62
+ event.preventDefault();
63
+ event.stopPropagation();
64
+ this.fileOver = false;
65
+ }
66
+
67
+ }
@@ -0,0 +1,26 @@
1
+ <input type="file" #singleFile id="singleFile"
2
+ [fileUploadInputFor]="fileUploadQueue"
3
+ [multiple]="false" [accept]="'.json'" style="display: none;"/>
4
+ <div *ngIf="showSuccess" class="notify-success template-card status-box">{{successMessage}}
5
+ <button type="button" class="close" (click)="clearSuccess()">
6
+ <span aria-hidden="true">&times;</span>
7
+ </button>
8
+ </div>
9
+ <div *ngIf="showError" class="notify-error template-card status-box">{{errorMessage}}
10
+ <button type="button" class="close" (click)="clearError()">
11
+ <span aria-hidden="true">&times;</span>
12
+ </button>
13
+ </div>
14
+ <mat-card class="template-card container" [fileUploadInputFor]="fileUploadQueue" appDnd>
15
+ <h3><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAABoElEQVRoge2YPU7DQBCFP/HT01DFEQ1Q01NxAw7BMSgoKZE4RWSlInABEnMELkCJJWJKpJjCtmSCDbvr2fXfPmnkaLUzb15mNLs2eHh4jBpLIK2wVWlPZGG9bEudhHdq1s9r1lPLv1Vy0ELxr7QFbf66ivQOgxGyV7P+AmxcJtIxfg9riPg563vL78dvW/BTy8MxVKdGAIRAQvUNVtISYA6c6AhRmRoBEDsQsG0xMJEUEuZ7HnQCN8AEWOScM1WniP9fbIp2ciGiwDTn/JAM2tahWck7mAOxTkjbdy0xqLTN6Fvr1iWZytQyrUgK3Bj4NeUVD1j4mVamc0JMxWjxqkwtCSEmbabFa3NqVd2fdCrTaSE6YjonZAO8ApfAGXAgmNuvzdu2qtijixR4Aq6AL+DIwF+Z95lqIeWzxVTIPbAL7ANvwJ2mf2fGbxnXwCfqbSXFKx7wELhogdduwCa8g38f6R2aCEnyZyCRiCKm+XMtGXRO1qsL3IgJgMecM5QMfAq8Y+fb1V8WA8eSQiD7FDQjK7VtAWuySoiL8PAYA74BrJ0x93i8VhIAAAAASUVORK5CYII=" style="vertical-align: middle"/>&nbsp;&nbsp; {{'Uploader.DragAndDrop' | translate}} &nbsp;&nbsp;<label for="singleFile" class="mat-focus-indicator mat-raised-button mat-button-base mat-primary">{{'Uploader.Browse' | translate}}</label></h3>
16
+ </mat-card>
17
+ <mat-file-upload-queue #fileUploadQueue [fileAlias]="fileAlias" [httpUrl]="httpUrl">
18
+ <mat-file-upload [file]="file" [id]="i" *ngFor="let file of fileUploadQueue.files; let i = index"
19
+ (onUpload)="onFileUploaded($event)"
20
+ ></mat-file-upload>
21
+ </mat-file-upload-queue>
22
+
23
+
24
+
25
+
26
+
@@ -0,0 +1,55 @@
1
+ .container {
2
+ width: 100%;
3
+ text-align: center;
4
+ border: dashed 1px #979797;
5
+ position: relative;
6
+ margin: 0 auto;
7
+ cursor: copy;
8
+
9
+ input {
10
+ opacity: 0;
11
+ position: absolute;
12
+ z-index: 2;
13
+ width: 100%;
14
+ height: 100%;
15
+ top: 0;
16
+ left: 0;
17
+ }
18
+
19
+ h3 {
20
+ font-size: 20px;
21
+ font-weight: 600;
22
+ color: #38424c;
23
+ margin: 0;
24
+ }
25
+ }
26
+
27
+ .fileover {
28
+ animation: shake 1s;
29
+ animation-iteration-count: infinite;
30
+ background-color: #ffffff;
31
+ }
32
+
33
+ /* Shake animation */
34
+ @keyframes shake {
35
+ 10%, 50%, 90% {
36
+ transform: translateY(-1px);
37
+ }
38
+
39
+ 20%, 80% {
40
+ transform: translateY(0px);
41
+ }
42
+
43
+ 30%, 70% {
44
+ transform: translateY(1px);
45
+ }
46
+
47
+ 40%, 60% {
48
+ transform: translateY(0px);
49
+ }
50
+ }
51
+
52
+ .status-box {
53
+ max-width: 90%;
54
+ margin: 0 auto;
55
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { FileUploaderComponent } from './file-uploader.component';
4
+
5
+ describe('FileUploaderComponent', () => {
6
+ let component: FileUploaderComponent;
7
+ let fixture: ComponentFixture<FileUploaderComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ FileUploaderComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(FileUploaderComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,67 @@
1
+ import {Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';
2
+ import {HttpErrorResponse, HttpResponse} from '@angular/common/http';
3
+ import {TranslateService} from '@ngx-translate/core';
4
+
5
+
6
+ @Component({
7
+ selector: 'app-file-uploader',
8
+ templateUrl: './file-uploader.component.html',
9
+ styleUrls: ['./file-uploader.component.scss'],
10
+ encapsulation: ViewEncapsulation.None
11
+ })
12
+ export class FileUploaderComponent implements OnInit {
13
+
14
+ // Number of milliseconds to display the file upload success message
15
+ private static readonly SUCCESS_MESSAGE_TIMEOUT = 5000;
16
+
17
+ @Input() fileAlias: string;
18
+ @Input() httpUrl: string;
19
+ @Output() fileUploaded = new EventEmitter<object>();
20
+ showSuccess = false;
21
+ showError = false;
22
+ successMessage = '';
23
+ errorMessage = '';
24
+
25
+ protected translateService: TranslateService;
26
+
27
+ constructor(translateService: TranslateService) {
28
+ this.translateService = translateService;
29
+ }
30
+
31
+ ngOnInit(): void {
32
+ }
33
+
34
+ onFileUploaded(event): void {
35
+ if (event && event.event instanceof HttpResponse) {
36
+ this.clearError();
37
+ const fileName = event.file.name;
38
+ this.successMessage = this.translateService.instant('Uploader.Success', {fileName});
39
+ this.showSuccess = true;
40
+ setTimeout(() => {
41
+ this.clearSuccess();
42
+ }, FileUploaderComponent.SUCCESS_MESSAGE_TIMEOUT);
43
+ } else if (typeof event === 'object' && event.event instanceof HttpErrorResponse) {
44
+ this.clearSuccess();
45
+ const fileName = event.file.name;
46
+ let responseMessage = '';
47
+ const response = event.event;
48
+ if (response.message && response.message.length > 0) {
49
+ responseMessage = response.message;
50
+ }
51
+ this.errorMessage = this.translateService.instant('Uploader.Error', {fileName, responseMessage});
52
+ this.showError = true;
53
+ }
54
+ this.fileUploaded.emit(event);
55
+ }
56
+
57
+ clearSuccess(): void {
58
+ this.showSuccess = false;
59
+ this.successMessage = '';
60
+ }
61
+
62
+ clearError(): void {
63
+ this.showError = false;
64
+ this.errorMessage = '';
65
+ }
66
+
67
+ }
@@ -0,0 +1,42 @@
1
+ <ng-container *ngIf="uploadProgress$ | async as uploadProgress">
2
+ <mat-card class="template-card upload-progress-card">
3
+ <div class="flex-container-file-upload">
4
+ <div class="flex-child1">
5
+ <div class="file-icon">
6
+ <svg id="fileIcon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 58 58"
7
+ style="enable-background:new 0 0 58 58;" xml:space="preserve">
8
+ <polygon style="fill:#EDEADA;" points="51.5,14 37.5,0 6.5,0 6.5,58 51.5,58 " />
9
+ <g>
10
+ <path style="fill:#CEC9AE;" d="M16.5,23h25c0.552,0,1-0.447,1-1s-0.448-1-1-1h-25c-0.552,0-1,0.447-1,1S15.948,23,16.5,23z" />
11
+ <path style="fill:#CEC9AE;" d="M16.5,15h10c0.552,0,1-0.447,1-1s-0.448-1-1-1h-10c-0.552,0-1,0.447-1,1S15.948,15,16.5,15z" />
12
+ <path style="fill:#CEC9AE;" d="M41.5,29h-25c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S42.052,29,41.5,29z" />
13
+ <path style="fill:#CEC9AE;" d="M41.5,37h-25c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S42.052,37,41.5,37z" />
14
+ <path style="fill:#CEC9AE;" d="M41.5,45h-25c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S42.052,45,41.5,45z" />
15
+ </g>
16
+ <polygon style="fill:#CEC9AE;" points="37.5,0 37.5,14 51.5,14 " />
17
+ </svg>
18
+ </div>
19
+ </div>
20
+ <div class="flex-child2">
21
+ <span class="file-summary">{{file.name}} ({{file.size | bytes}})</span>
22
+ <span class="upload-progress">
23
+ <mat-progress-bar
24
+ [value]="uploadProgress.progressPercentage"
25
+ ></mat-progress-bar>
26
+ <button style="margin-left: 15px;"
27
+ mat-icon-button
28
+ [attr.aria-label]="fileUploadAriaLabel"
29
+ (click)="upload()"
30
+ [disabled]="uploadInProgress$ | async"
31
+ ><mat-icon>upload_file</mat-icon></button>
32
+ <button
33
+ mat-icon-button
34
+ [attr.aria-label]="cancelAriaLabel"
35
+ (click)="remove()"
36
+ ><mat-icon>close</mat-icon></button>
37
+ </span>
38
+ <span class="file-summary">{{uploadProgress.progressPercentage}}% ({{uploadProgress.loaded | bytes}} of {{uploadProgress.total | bytes}})</span>
39
+ </div>
40
+ </div>
41
+ </mat-card>
42
+ </ng-container>
@@ -0,0 +1,31 @@
1
+ .file-summary {
2
+ font-size: 0.85rem;
3
+ }
4
+
5
+ .upload-progress {
6
+ display: flex;
7
+ align-content: center;
8
+ align-items: center;
9
+ height: 10px;
10
+
11
+ ::ng-deep .mat-progress-bar .mat-progress-bar-element {
12
+ transition: none;
13
+ }
14
+ }
15
+
16
+ .flex-container-file-upload {
17
+ display: flex;
18
+
19
+ .flex-child1 {
20
+ width: 50px;
21
+ margin-right: 15px;
22
+ }
23
+
24
+ .flex-child2 {
25
+ flex: 1 100%;
26
+ }
27
+ }
28
+
29
+ .upload-progress-card {
30
+ margin-bottom: 5px;
31
+ }