ngx-edu-sharing-ui 0.7.0 → 9.0.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 (367) hide show
  1. package/assets/scss/mixins.scss +4 -1
  2. package/assets/scss/variables.scss +3 -0
  3. package/esm2022/lib/actionbar/actionbar.component.mjs +188 -0
  4. package/esm2022/lib/common/edu-sharing-ui-common.module.mjs +134 -0
  5. package/esm2022/lib/directives/border-box-observer.directive.mjs +71 -0
  6. package/esm2022/lib/directives/check-text-overflow.directive.mjs +65 -0
  7. package/esm2022/lib/directives/drag-nodes/drag-nodes.mjs +14 -0
  8. package/esm2022/lib/directives/drag-nodes/nodes-drag-source.directive.mjs +79 -0
  9. package/esm2022/lib/directives/drag-nodes/nodes-drag.directive.mjs +49 -0
  10. package/esm2022/lib/directives/drag-nodes/nodes-drop-target.directive.mjs +105 -0
  11. package/esm2022/lib/directives/focus-state.directive.mjs +44 -0
  12. package/esm2022/lib/directives/icon.directive.mjs +139 -0
  13. package/esm2022/lib/dropdown/dropdown.component.mjs +70 -0
  14. package/esm2022/lib/edu-sharing-ui-configuration.mjs +41 -0
  15. package/esm2022/lib/edu-sharing-ui.module.mjs +78 -0
  16. package/esm2022/lib/list-items/available-widgets.mjs +27 -0
  17. package/esm2022/lib/list-items/format-duration.pipe.mjs +20 -0
  18. package/esm2022/lib/list-items/list-base/list-base.component.mjs +46 -0
  19. package/esm2022/lib/list-items/list-collection-info/list-collection-info.component.mjs +29 -0
  20. package/esm2022/lib/list-items/list-counts/list-counts.component.mjs +54 -0
  21. package/esm2022/lib/list-items/list-items.module.mjs +50 -0
  22. package/esm2022/lib/list-items/list-node-license/list-node-license.component.mjs +41 -0
  23. package/esm2022/lib/list-items/list-node-replication-source/list-node-replication-source.component.mjs +47 -0
  24. package/esm2022/lib/list-items/list-node-workflow/list-node-workflow.component.mjs +24 -0
  25. package/esm2022/lib/list-items/list-text/list-text.component.mjs +106 -0
  26. package/esm2022/lib/list-items/list-widget.mjs +49 -0
  27. package/esm2022/lib/list-items/node-row/node-row.component.mjs +24 -0
  28. package/esm2022/lib/list-items/node-source.pipe.mjs +49 -0
  29. package/esm2022/lib/node-entries/combined-data-source.mjs +41 -0
  30. package/esm2022/lib/node-entries/custom-templates-data-source.mjs +7 -0
  31. package/esm2022/lib/node-entries/drag-preview/drag-preview.component.mjs +21 -0
  32. package/esm2022/lib/node-entries/entries-model.mjs +23 -0
  33. package/esm2022/lib/node-entries/items-cap.mjs +47 -0
  34. package/esm2022/lib/node-entries/list-item-label.pipe.mjs +34 -0
  35. package/esm2022/lib/node-entries/node-cache.mjs +65 -0
  36. package/esm2022/lib/node-entries/node-data-source-remote.mjs +4 -0
  37. package/esm2022/lib/node-entries/node-data-source.mjs +115 -0
  38. package/esm2022/lib/node-entries/node-entries-card/node-entries-card.component.mjs +131 -0
  39. package/esm2022/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.mjs +307 -0
  40. package/esm2022/lib/node-entries/node-entries-card-small/node-entries-card-small.component.mjs +45 -0
  41. package/esm2022/lib/node-entries/node-entries-global-options/node-entries-global-options.component.mjs +23 -0
  42. package/esm2022/lib/node-entries/node-entries-global.service.mjs +58 -0
  43. package/esm2022/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.mjs +42 -0
  44. package/esm2022/lib/node-entries/node-entries-table/node-entries-table.component.mjs +290 -0
  45. package/esm2022/lib/node-entries/node-entries-templates.service.mjs +11 -0
  46. package/esm2022/lib/node-entries/node-entries-wrapper.component.mjs +324 -0
  47. package/esm2022/lib/node-entries/node-entries.component.mjs +131 -0
  48. package/esm2022/lib/node-entries/node-entries.module.mjs +161 -0
  49. package/esm2022/lib/node-entries/node-rating/node-rating.component.mjs +102 -0
  50. package/esm2022/lib/node-entries/node-stats-badges/node-stats-badges.component.mjs +48 -0
  51. package/esm2022/lib/node-entries/node-type-badge/node-type-badge.component.mjs +36 -0
  52. package/esm2022/lib/node-entries/option-button/option-button.component.mjs +62 -0
  53. package/esm2022/lib/node-entries/preview-image/preview-image.component.mjs +53 -0
  54. package/esm2022/lib/node-entries/sort-select-panel/sort-select-panel.component.mjs +41 -0
  55. package/esm2022/lib/node-url/node-url.component.mjs +128 -0
  56. package/esm2022/lib/pipes/file-size.pipe.mjs +31 -0
  57. package/esm2022/lib/pipes/format-date.pipe.mjs +38 -0
  58. package/esm2022/lib/pipes/node-icon.pipe.mjs +18 -0
  59. package/esm2022/lib/pipes/node-image-size.pipe.mjs +24 -0
  60. package/esm2022/lib/pipes/node-image.pipe.mjs +55 -0
  61. package/esm2022/lib/pipes/node-person-name.pipe.mjs +50 -0
  62. package/esm2022/lib/pipes/node-title.pipe.mjs +19 -0
  63. package/esm2022/lib/pipes/option-tooltip.pipe.mjs +33 -0
  64. package/esm2022/lib/pipes/replace-chars.pipe.mjs +29 -0
  65. package/esm2022/lib/pipes/vcard-name.pipe.mjs +19 -0
  66. package/esm2022/lib/services/abstract/app.service.mjs +3 -0
  67. package/esm2022/lib/services/abstract/keyboard-shortcuts.service.mjs +10 -0
  68. package/esm2022/lib/services/abstract/options-helper.service.mjs +3 -0
  69. package/esm2022/lib/services/abstract/toast.service.mjs +3 -0
  70. package/esm2022/lib/services/accessibility.service.mjs +73 -0
  71. package/esm2022/lib/services/local-events.service.mjs +36 -0
  72. package/esm2022/lib/services/node-entries.service.mjs +137 -0
  73. package/esm2022/lib/services/node-helper.service.mjs +234 -0
  74. package/esm2022/lib/services/nodes-drag-drop.service.mjs +155 -0
  75. package/esm2022/lib/services/options-helper-data.service.mjs +134 -0
  76. package/esm2022/lib/services/repo-url.service.mjs +49 -0
  77. package/esm2022/lib/services/temporary-storage.service.mjs +48 -0
  78. package/esm2022/lib/services/ui.service.mjs +162 -0
  79. package/esm2022/lib/sort-dropdown/sort-dropdown.component.mjs +50 -0
  80. package/esm2022/lib/spinner/spinner.component.mjs +18 -0
  81. package/esm2022/lib/translations/fallback-translation-handler.mjs +6 -0
  82. package/esm2022/lib/translations/languages.mjs +5 -0
  83. package/esm2022/lib/translations/translation-loader.mjs +149 -0
  84. package/esm2022/lib/translations/translation-source.mjs +11 -0
  85. package/esm2022/lib/translations/translations.module.mjs +67 -0
  86. package/esm2022/lib/translations/translations.service.mjs +171 -0
  87. package/esm2022/lib/types/accessibillity.mjs +19 -0
  88. package/esm2022/lib/types/api-models.mjs +2 -0
  89. package/esm2022/lib/types/drag-drop.mjs +2 -0
  90. package/esm2022/lib/types/keyboard-shortcuts.mjs +11 -0
  91. package/esm2022/lib/types/list-item.mjs +41 -0
  92. package/esm2022/lib/types/option-item.mjs +174 -0
  93. package/esm2022/lib/types/workflow.mjs +25 -0
  94. package/esm2022/lib/util/DateHelper.mjs +200 -0
  95. package/esm2022/lib/util/VCard.mjs +278 -0
  96. package/esm2022/lib/util/color-helper.mjs +124 -0
  97. package/esm2022/lib/util/duration-helper.mjs +102 -0
  98. package/esm2022/lib/util/functions.mjs +13 -0
  99. package/esm2022/lib/util/helper.mjs +64 -0
  100. package/esm2022/lib/util/isNumeric.mjs +11 -0
  101. package/esm2022/lib/util/rest-helper.mjs +33 -0
  102. package/esm2022/lib/util/ui-animation.mjs +146 -0
  103. package/esm2022/lib/util/ui-constants.mjs +21 -0
  104. package/esm2022/module.mjs +76 -0
  105. package/esm2022/ngx-edu-sharing-ui.mjs +5 -0
  106. package/fesm2022/ngx-edu-sharing-ui.mjs +6509 -0
  107. package/fesm2022/ngx-edu-sharing-ui.mjs.map +1 -0
  108. package/index.d.ts +5 -0
  109. package/lib/actionbar/actionbar.component.d.ts +74 -0
  110. package/lib/common/edu-sharing-ui-common.module.d.ts +32 -0
  111. package/lib/directives/border-box-observer.directive.d.ts +31 -0
  112. package/lib/directives/check-text-overflow.directive.d.ts +20 -0
  113. package/lib/directives/drag-nodes/drag-nodes.d.ts +16 -0
  114. package/lib/directives/drag-nodes/nodes-drag-source.directive.d.ts +37 -0
  115. package/lib/directives/drag-nodes/nodes-drag.directive.d.ts +17 -0
  116. package/lib/directives/drag-nodes/nodes-drop-target.directive.d.ts +22 -0
  117. package/lib/directives/focus-state.directive.d.ts +14 -0
  118. package/lib/directives/icon.directive.d.ts +46 -0
  119. package/lib/dropdown/dropdown.component.d.ts +40 -0
  120. package/lib/edu-sharing-ui-configuration.d.ts +11 -0
  121. package/lib/edu-sharing-ui.module.d.ts +19 -0
  122. package/lib/list-items/available-widgets.d.ts +13 -0
  123. package/lib/list-items/format-duration.pipe.d.ts +10 -0
  124. package/lib/list-items/list-base/list-base.component.d.ts +18 -0
  125. package/lib/list-items/list-collection-info/list-collection-info.component.d.ts +14 -0
  126. package/lib/list-items/list-counts/list-counts.component.d.ts +13 -0
  127. package/lib/list-items/list-items.module.d.ts +20 -0
  128. package/lib/list-items/list-node-license/list-node-license.component.d.ts +20 -0
  129. package/lib/list-items/list-node-replication-source/list-node-replication-source.component.d.ts +22 -0
  130. package/lib/list-items/list-node-workflow/list-node-workflow.component.d.ts +12 -0
  131. package/lib/list-items/list-text/list-text.component.d.ts +28 -0
  132. package/lib/list-items/list-widget.d.ts +32 -0
  133. package/lib/list-items/node-row/node-row.component.d.ts +12 -0
  134. package/lib/list-items/node-source.pipe.d.ts +16 -0
  135. package/lib/node-entries/combined-data-source.d.ts +19 -0
  136. package/{src/lib/node-entries/custom-templates-data-source.ts → lib/node-entries/custom-templates-data-source.d.ts} +2 -2
  137. package/lib/node-entries/drag-preview/drag-preview.component.d.ts +11 -0
  138. package/{src/lib/node-entries/entries-model.ts → lib/node-entries/entries-model.d.ts} +19 -47
  139. package/lib/node-entries/items-cap.d.ts +17 -0
  140. package/lib/node-entries/list-item-label.pipe.d.ts +14 -0
  141. package/lib/node-entries/node-cache.d.ts +17 -0
  142. package/{src/lib/node-entries/node-data-source-remote.ts → lib/node-entries/node-data-source-remote.d.ts} +2 -12
  143. package/lib/node-entries/node-data-source.d.ts +42 -0
  144. package/lib/node-entries/node-entries-card/node-entries-card.component.d.ts +45 -0
  145. package/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.d.ts +92 -0
  146. package/lib/node-entries/node-entries-card-small/node-entries-card-small.component.d.ts +23 -0
  147. package/lib/node-entries/node-entries-global-options/node-entries-global-options.component.d.ts +12 -0
  148. package/lib/node-entries/node-entries-global.service.d.ts +50 -0
  149. package/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.d.ts +17 -0
  150. package/lib/node-entries/node-entries-table/node-entries-table.component.d.ts +76 -0
  151. package/{src/lib/node-entries/node-entries-templates.service.ts → lib/node-entries/node-entries-templates.service.d.ts} +6 -9
  152. package/lib/node-entries/node-entries-wrapper.component.d.ts +129 -0
  153. package/lib/node-entries/node-entries.component.d.ts +32 -0
  154. package/lib/node-entries/node-entries.module.d.ts +43 -0
  155. package/lib/node-entries/node-rating/node-rating.component.d.ts +26 -0
  156. package/lib/node-entries/node-stats-badges/node-stats-badges.component.d.ts +17 -0
  157. package/lib/node-entries/node-type-badge/node-type-badge.component.d.ts +21 -0
  158. package/lib/node-entries/option-button/option-button.component.d.ts +11 -0
  159. package/lib/node-entries/preview-image/preview-image.component.d.ts +22 -0
  160. package/lib/node-entries/sort-select-panel/sort-select-panel.component.d.ts +16 -0
  161. package/lib/node-url/node-url.component.d.ts +51 -0
  162. package/lib/pipes/file-size.pipe.d.ts +10 -0
  163. package/lib/pipes/format-date.pipe.d.ts +21 -0
  164. package/lib/pipes/node-icon.pipe.d.ts +11 -0
  165. package/lib/pipes/node-image-size.pipe.d.ts +8 -0
  166. package/lib/pipes/node-image.pipe.d.ts +28 -0
  167. package/lib/pipes/node-person-name.pipe.d.ts +10 -0
  168. package/lib/pipes/node-title.pipe.d.ts +11 -0
  169. package/lib/pipes/option-tooltip.pipe.d.ts +12 -0
  170. package/lib/pipes/replace-chars.pipe.d.ts +10 -0
  171. package/lib/pipes/vcard-name.pipe.d.ts +10 -0
  172. package/{src/lib/services/abstract/app.service.ts → lib/services/abstract/app.service.d.ts} +1 -1
  173. package/lib/services/abstract/keyboard-shortcuts.service.d.ts +11 -0
  174. package/lib/services/abstract/options-helper.service.d.ts +10 -0
  175. package/{src/lib/services/abstract/toast.service.ts → lib/services/abstract/toast.service.d.ts} +1 -2
  176. package/lib/services/accessibility.service.d.ts +18 -0
  177. package/{src/lib/services/local-events.service.ts → lib/services/local-events.service.d.ts} +7 -10
  178. package/lib/services/node-entries.service.d.ts +69 -0
  179. package/lib/services/node-helper.service.d.ts +56 -0
  180. package/lib/services/nodes-drag-drop.service.d.ts +41 -0
  181. package/lib/services/options-helper-data.service.d.ts +75 -0
  182. package/lib/services/repo-url.service.d.ts +25 -0
  183. package/lib/services/temporary-storage.service.d.ts +35 -0
  184. package/lib/services/ui.service.d.ts +41 -0
  185. package/lib/sort-dropdown/sort-dropdown.component.d.ts +15 -0
  186. package/lib/spinner/spinner.component.d.ts +7 -0
  187. package/lib/translations/fallback-translation-handler.d.ts +4 -0
  188. package/lib/translations/languages.d.ts +4 -0
  189. package/lib/translations/translation-loader.d.ts +51 -0
  190. package/{src/lib/translations/translation-source.ts → lib/translations/translation-source.d.ts} +4 -4
  191. package/lib/translations/translations.module.d.ts +15 -0
  192. package/lib/translations/translations.service.d.ts +30 -0
  193. package/lib/types/accessibillity.d.ts +15 -0
  194. package/{src/lib/types/drag-drop.ts → lib/types/drag-drop.d.ts} +0 -3
  195. package/lib/types/keyboard-shortcuts.d.ts +10 -0
  196. package/lib/types/list-item.d.ts +55 -0
  197. package/lib/types/option-item.d.ts +236 -0
  198. package/lib/types/workflow.d.ts +14 -0
  199. package/lib/util/DateHelper.d.ts +44 -0
  200. package/lib/util/VCard.d.ts +66 -0
  201. package/lib/util/color-helper.d.ts +25 -0
  202. package/lib/util/duration-helper.d.ts +14 -0
  203. package/lib/util/functions.d.ts +4 -0
  204. package/lib/util/helper.d.ts +20 -0
  205. package/lib/util/isNumeric.d.ts +5 -0
  206. package/lib/util/rest-helper.d.ts +10 -0
  207. package/lib/util/ui-animation.d.ts +39 -0
  208. package/lib/util/ui-constants.d.ts +18 -0
  209. package/{src/module.ts → module.d.ts} +0 -4
  210. package/package.json +22 -8
  211. package/.browserslistrc +0 -16
  212. package/.eslintrc.json +0 -44
  213. package/karma.conf.js +0 -42
  214. package/ng-package.json +0 -10
  215. package/src/lib/actionbar/actionbar.component.html +0 -59
  216. package/src/lib/actionbar/actionbar.component.scss +0 -123
  217. package/src/lib/actionbar/actionbar.component.ts +0 -174
  218. package/src/lib/common/edu-sharing-ui-common.module.ts +0 -80
  219. package/src/lib/directives/border-box-observer.directive.ts +0 -75
  220. package/src/lib/directives/check-text-overflow.directive.ts +0 -61
  221. package/src/lib/directives/drag-nodes/drag-nodes.ts +0 -32
  222. package/src/lib/directives/drag-nodes/nodes-drag-source.directive.ts +0 -79
  223. package/src/lib/directives/drag-nodes/nodes-drag.directive.ts +0 -43
  224. package/src/lib/directives/drag-nodes/nodes-drop-target.directive.ts +0 -116
  225. package/src/lib/directives/focus-state.directive.ts +0 -34
  226. package/src/lib/directives/icon.directive.ts +0 -142
  227. package/src/lib/directives/nodes-drop-target-legacy.directive.ts +0 -155
  228. package/src/lib/dropdown/dropdown.component.html +0 -32
  229. package/src/lib/dropdown/dropdown.component.scss +0 -67
  230. package/src/lib/dropdown/dropdown.component.ts +0 -71
  231. package/src/lib/edu-sharing-ui-configuration.ts +0 -47
  232. package/src/lib/edu-sharing-ui.module.ts +0 -49
  233. package/src/lib/list-items/available-widgets.ts +0 -30
  234. package/src/lib/list-items/format-duration.pipe.ts +0 -17
  235. package/src/lib/list-items/list-base/list-base.component.html +0 -52
  236. package/src/lib/list-items/list-base/list-base.component.ts +0 -44
  237. package/src/lib/list-items/list-collection-info/list-collection-info.component.html +0 -48
  238. package/src/lib/list-items/list-collection-info/list-collection-info.component.scss +0 -8
  239. package/src/lib/list-items/list-collection-info/list-collection-info.component.ts +0 -24
  240. package/src/lib/list-items/list-counts/list-counts.component.html +0 -1
  241. package/src/lib/list-items/list-counts/list-counts.component.scss +0 -3
  242. package/src/lib/list-items/list-counts/list-counts.component.ts +0 -59
  243. package/src/lib/list-items/list-items.module.ts +0 -33
  244. package/src/lib/list-items/list-node-license/list-node-license.component.html +0 -8
  245. package/src/lib/list-items/list-node-license/list-node-license.component.ts +0 -47
  246. package/src/lib/list-items/list-node-replication-source/list-node-replication-source.component.html +0 -11
  247. package/src/lib/list-items/list-node-replication-source/list-node-replication-source.component.ts +0 -60
  248. package/src/lib/list-items/list-node-workflow/list-node-workflow.component.html +0 -3
  249. package/src/lib/list-items/list-node-workflow/list-node-workflow.component.ts +0 -21
  250. package/src/lib/list-items/list-text/list-text.component.html +0 -176
  251. package/src/lib/list-items/list-text/list-text.component.scss +0 -3
  252. package/src/lib/list-items/list-text/list-text.component.ts +0 -107
  253. package/src/lib/list-items/list-widget.ts +0 -52
  254. package/src/lib/list-items/node-row/node-row.component.html +0 -31
  255. package/src/lib/list-items/node-row/node-row.component.scss +0 -50
  256. package/src/lib/list-items/node-row/node-row.component.ts +0 -16
  257. package/src/lib/list-items/node-source.pipe.ts +0 -48
  258. package/src/lib/node-entries/combined-data-source.ts +0 -51
  259. package/src/lib/node-entries/drag-preview/drag-preview.component.html +0 -6
  260. package/src/lib/node-entries/drag-preview/drag-preview.component.scss +0 -35
  261. package/src/lib/node-entries/drag-preview/drag-preview.component.ts +0 -15
  262. package/src/lib/node-entries/items-cap.ts +0 -54
  263. package/src/lib/node-entries/list-item-label.pipe.ts +0 -28
  264. package/src/lib/node-entries/mixins.scss +0 -23
  265. package/src/lib/node-entries/node-cache.spec.ts +0 -199
  266. package/src/lib/node-entries/node-cache.ts +0 -81
  267. package/src/lib/node-entries/node-data-source.ts +0 -148
  268. package/src/lib/node-entries/node-entries-card/node-entries-card.component.html +0 -167
  269. package/src/lib/node-entries/node-entries-card/node-entries-card.component.scss +0 -28
  270. package/src/lib/node-entries/node-entries-card/node-entries-card.component.ts +0 -132
  271. package/src/lib/node-entries/node-entries-card/node-entries-card.main.scss +0 -261
  272. package/src/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.html +0 -205
  273. package/src/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.scss +0 -181
  274. package/src/lib/node-entries/node-entries-card-grid/node-entries-card-grid.component.ts +0 -361
  275. package/src/lib/node-entries/node-entries-card-small/node-entries-card-small.component.html +0 -100
  276. package/src/lib/node-entries/node-entries-card-small/node-entries-card-small.component.scss +0 -46
  277. package/src/lib/node-entries/node-entries-card-small/node-entries-card-small.component.ts +0 -40
  278. package/src/lib/node-entries/node-entries-global-options/node-entries-global-options.component.html +0 -23
  279. package/src/lib/node-entries/node-entries-global-options/node-entries-global-options.component.scss +0 -58
  280. package/src/lib/node-entries/node-entries-global-options/node-entries-global-options.component.ts +0 -16
  281. package/src/lib/node-entries/node-entries-global.service.ts +0 -79
  282. package/src/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.html +0 -25
  283. package/src/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.scss +0 -32
  284. package/src/lib/node-entries/node-entries-table/column-chooser/column-chooser.component.ts +0 -31
  285. package/src/lib/node-entries/node-entries-table/node-entries-table.component.html +0 -270
  286. package/src/lib/node-entries/node-entries-table/node-entries-table.component.scss +0 -169
  287. package/src/lib/node-entries/node-entries-table/node-entries-table.component.ts +0 -333
  288. package/src/lib/node-entries/node-entries-wrapper.component.ts +0 -363
  289. package/src/lib/node-entries/node-entries.component.html +0 -33
  290. package/src/lib/node-entries/node-entries.component.scss +0 -13
  291. package/src/lib/node-entries/node-entries.component.ts +0 -151
  292. package/src/lib/node-entries/node-entries.module.ts +0 -93
  293. package/src/lib/node-entries/node-rating/node-rating.component.html +0 -53
  294. package/src/lib/node-entries/node-rating/node-rating.component.scss +0 -31
  295. package/src/lib/node-entries/node-rating/node-rating.component.ts +0 -105
  296. package/src/lib/node-entries/node-stats-badges/node-stats-badges.component.html +0 -39
  297. package/src/lib/node-entries/node-stats-badges/node-stats-badges.component.scss +0 -44
  298. package/src/lib/node-entries/node-stats-badges/node-stats-badges.component.ts +0 -43
  299. package/src/lib/node-entries/node-type-badge/node-type-badge.component.html +0 -31
  300. package/src/lib/node-entries/node-type-badge/node-type-badge.component.scss +0 -5
  301. package/src/lib/node-entries/node-type-badge/node-type-badge.component.ts +0 -36
  302. package/src/lib/node-entries/option-button/option-button.component.ts +0 -42
  303. package/src/lib/node-entries/preview-image/preview-image.component.html +0 -19
  304. package/src/lib/node-entries/preview-image/preview-image.component.scss +0 -31
  305. package/src/lib/node-entries/preview-image/preview-image.component.ts +0 -47
  306. package/src/lib/node-entries/sort-select-panel/sort-select-panel.component.html +0 -27
  307. package/src/lib/node-entries/sort-select-panel/sort-select-panel.component.scss +0 -9
  308. package/src/lib/node-entries/sort-select-panel/sort-select-panel.component.ts +0 -26
  309. package/src/lib/node-url/node-url.component.html +0 -66
  310. package/src/lib/node-url/node-url.component.scss +0 -32
  311. package/src/lib/node-url/node-url.component.ts +0 -136
  312. package/src/lib/pipes/file-size.pipe.ts +0 -24
  313. package/src/lib/pipes/format-date.pipe.ts +0 -39
  314. package/src/lib/pipes/node-icon.pipe.ts +0 -11
  315. package/src/lib/pipes/node-image-size.pipe.ts +0 -18
  316. package/src/lib/pipes/node-image.pipe.ts +0 -71
  317. package/src/lib/pipes/node-person-name.pipe.ts +0 -41
  318. package/src/lib/pipes/node-title.pipe.ts +0 -12
  319. package/src/lib/pipes/option-tooltip.pipe.ts +0 -32
  320. package/src/lib/pipes/replace-chars.pipe.ts +0 -21
  321. package/src/lib/pipes/vcard-name.pipe.ts +0 -11
  322. package/src/lib/services/abstract/keyboard-shortcuts.service.ts +0 -10
  323. package/src/lib/services/abstract/options-helper.service.ts +0 -29
  324. package/src/lib/services/accessibility.service.ts +0 -101
  325. package/src/lib/services/node-entries.service.ts +0 -172
  326. package/src/lib/services/node-helper.service.ts +0 -239
  327. package/src/lib/services/nodes-drag-drop.service.ts +0 -165
  328. package/src/lib/services/options-helper-data.service.ts +0 -186
  329. package/src/lib/services/repo-url.service.ts +0 -46
  330. package/src/lib/services/temporary-storage.service.ts +0 -58
  331. package/src/lib/services/ui.service.ts +0 -182
  332. package/src/lib/sort-dropdown/sort-dropdown.component.html +0 -22
  333. package/src/lib/sort-dropdown/sort-dropdown.component.scss +0 -47
  334. package/src/lib/sort-dropdown/sort-dropdown.component.ts +0 -42
  335. package/src/lib/spinner/spinner.component.html +0 -14
  336. package/src/lib/spinner/spinner.component.scss +0 -141
  337. package/src/lib/spinner/spinner.component.ts +0 -12
  338. package/src/lib/translations/README.md +0 -44
  339. package/src/lib/translations/fallback-translation-handler.ts +0 -7
  340. package/src/lib/translations/languages.ts +0 -6
  341. package/src/lib/translations/translation-loader.spec.ts +0 -352
  342. package/src/lib/translations/translation-loader.ts +0 -189
  343. package/src/lib/translations/translations.module.ts +0 -49
  344. package/src/lib/translations/translations.service.spec.ts +0 -152
  345. package/src/lib/translations/translations.service.ts +0 -188
  346. package/src/lib/types/accessibillity.ts +0 -15
  347. package/src/lib/types/keyboard-shortcuts.ts +0 -29
  348. package/src/lib/types/list-item.ts +0 -67
  349. package/src/lib/types/option-item.ts +0 -247
  350. package/src/lib/types/workflow.ts +0 -35
  351. package/src/lib/util/DateHelper.spec.ts +0 -112
  352. package/src/lib/util/DateHelper.ts +0 -197
  353. package/src/lib/util/VCard.ts +0 -277
  354. package/src/lib/util/color-helper.ts +0 -125
  355. package/src/lib/util/duration-helper.spec.ts +0 -35
  356. package/src/lib/util/duration-helper.ts +0 -98
  357. package/src/lib/util/functions.ts +0 -15
  358. package/src/lib/util/helper.ts +0 -60
  359. package/src/lib/util/isNumeric.ts +0 -13
  360. package/src/lib/util/rest-helper.ts +0 -28
  361. package/src/lib/util/ui-animation.ts +0 -154
  362. package/src/lib/util/ui-constants.ts +0 -20
  363. package/src/test.ts +0 -28
  364. package/tsconfig.lib.json +0 -15
  365. package/tsconfig.lib.prod.json +0 -10
  366. package/tsconfig.spec.json +0 -17
  367. /package/{src/lib/types/api-models.ts → lib/types/api-models.d.ts} +0 -0
@@ -1,141 +0,0 @@
1
- /*SPINNER*/
2
- $path: '../../../../assets/spinner/';
3
- .spinner {
4
- margin: 0 auto;
5
- }
6
- .spinnercontainer {
7
- margin: auto;
8
- margin-top: 20px;
9
- height: 54px;
10
- color: rgba(0, 0, 0, 0); /*do not change*/
11
- text-align: center;
12
- float: left;
13
- width: 100%;
14
- }
15
-
16
- .inner {
17
- width: 30px;
18
- height: 50px;
19
- display: inline-block;
20
- }
21
-
22
- .spinner1 {
23
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDEyLjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgNTE0NDgpICAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiBbCgk8IUVOVElUWSBuc19zdmcgImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTwhRU5USVRZIG5zX3hsaW5rICJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KXT4KPHN2ZyAgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9IiZuc19zdmc7IiB4bWxuczp4bGluaz0iJm5zX3hsaW5rOyIgd2lkdGg9IjE1LjY1NyIgaGVpZ2h0PSIxMy41NTkiCgkgdmlld0JveD0iMCAwIDE1LjY1NyAxMy41NTkiIG92ZXJmbG93PSJ2aXNpYmxlIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxNS42NTcgMTMuNTU5IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHBvbHlnb24gb3BhY2l0eT0iMC42IiBmaWxsPSIjYzFjNmUzIiBwb2ludHM9IjMuOTE0LDEzLjU1OSAwLDYuNzggMy45MTQsMCAxMS43NDMsMCAxNS42NTcsNi43OCAxMS43NDMsMTMuNTU5ICIvPgo8L3N2Zz4K);
24
- background-repeat: no-repeat;
25
- background-position: center;
26
- background-size: 50px;
27
- width: 50px;
28
- height: 50px;
29
- -webkit-animation: spin 2s infinite ease-in;
30
- -moz-animation: spin 2s infinite ease-in;
31
- -ms-animation: spin 2s infinite ease-in;
32
- -o-animation: spin 2s infinite ease-in;
33
- animation: spin 2s infinite ease-in;
34
- -webkit-animation-delay: 0.1s;
35
- -moz-animation-delay: 0.1s;
36
- animation-delay: 0.1s;
37
- }
38
-
39
- .spinner2 {
40
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDEyLjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgNTE0NDgpICAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiBbCgk8IUVOVElUWSBuc19zdmcgImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTwhRU5USVRZIG5zX3hsaW5rICJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KXT4KPHN2ZyAgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9IiZuc19zdmc7IiB4bWxuczp4bGluaz0iJm5zX3hsaW5rOyIgd2lkdGg9IjE1LjY1NyIgaGVpZ2h0PSIxMy41NTkiCgkgdmlld0JveD0iMCAwIDE1LjY1NyAxMy41NTkiIG92ZXJmbG93PSJ2aXNpYmxlIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxNS42NTcgMTMuNTU5IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHBvbHlnb24gb3BhY2l0eT0iMC42IiBmaWxsPSIjN2Y5MWMzIiBwb2ludHM9IjMuOTE0LDEzLjU1OSAwLDYuNzggMy45MTQsMCAxMS43NDMsMCAxNS42NTcsNi43OCAxMS43NDMsMTMuNTU5ICIvPgo8L3N2Zz4K);
41
- background-repeat: no-repeat;
42
- background-position: center;
43
- background-size: 50px;
44
- width: 50px;
45
- height: 50px;
46
- -webkit-animation: spin 2s infinite ease-in;
47
- -moz-animation: spin 2s infinite ease-in;
48
- -ms-animation: spin 2s infinite ease-in;
49
- -o-animation: spin 2s infinite ease-in;
50
- animation: spin 2s infinite ease-in;
51
- -webkit-animation-delay: 0.25s;
52
- -moz-animation-delay: 0.25s;
53
- animation-delay: 0.25s;
54
- }
55
-
56
- .spinner3 {
57
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDEyLjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgNTE0NDgpICAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIiBbCgk8IUVOVElUWSBuc19zdmcgImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCTwhRU5USVRZIG5zX3hsaW5rICJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KXT4KPHN2ZyAgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9IiZuc19zdmc7IiB4bWxuczp4bGluaz0iJm5zX3hsaW5rOyIgd2lkdGg9IjE1LjY1NyIgaGVpZ2h0PSIxMy41NTkiCgkgdmlld0JveD0iMCAwIDE1LjY1NyAxMy41NTkiIG92ZXJmbG93PSJ2aXNpYmxlIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxNS42NTcgMTMuNTU5IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHBvbHlnb24gb3BhY2l0eT0iMC42IiBmaWxsPSIjMzE2MmE3IiBwb2ludHM9IjMuOTE0LDEzLjU1OSAwLDYuNzggMy45MTQsMCAxMS43NDMsMCAxNS42NTcsNi43OCAxMS43NDMsMTMuNTU5ICIvPgo8L3N2Zz4K);
58
- background-repeat: no-repeat;
59
- background-position: center;
60
- background-size: 50px;
61
- width: 50px;
62
- height: 50px;
63
- -webkit-animation: spin 2s infinite ease-in;
64
- -moz-animation: spin 2s infinite ease-in;
65
- -ms-animation: spin 2s infinite ease-in;
66
- -o-animation: spin 2s infinite ease-in;
67
- animation: spin 2s infinite ease-in;
68
- -webkit-animation-delay: 0.5s;
69
- -moz-animation-delay: 0.5s;
70
- animation-delay: 0.5s;
71
- }
72
-
73
- @-webkit-keyframes spin {
74
- 0% {
75
- transform: scale(1);
76
- }
77
-
78
- 50% {
79
- transform: scale(0.5);
80
- }
81
-
82
- 100% {
83
- transform: scale(1);
84
- }
85
- }
86
-
87
- @-moz-keyframes spin {
88
- 0% {
89
- transform: scale(1);
90
- }
91
-
92
- 50% {
93
- transform: scale(0.5);
94
- }
95
-
96
- 100% {
97
- transform: scale(1);
98
- }
99
- }
100
-
101
- @-ms-keyframes spin {
102
- 0% {
103
- transform: scale(1);
104
- }
105
-
106
- 50% {
107
- transform: scale(0.5);
108
- }
109
-
110
- 100% {
111
- transform: scale(1);
112
- }
113
- }
114
-
115
- @-o-keyframes spin {
116
- 0% {
117
- transform: scale(1);
118
- }
119
-
120
- 50% {
121
- transform: scale(0.5);
122
- }
123
-
124
- 100% {
125
- transform: scale(1);
126
- }
127
- }
128
-
129
- @keyframes spin {
130
- 0% {
131
- transform: scale(1);
132
- }
133
-
134
- 50% {
135
- transform: scale(0.5) rotate(90deg);
136
- }
137
-
138
- 100% {
139
- transform: scale(1);
140
- }
141
- }
@@ -1,12 +0,0 @@
1
- import { Component, HostBinding, OnInit } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'es-spinner',
5
- templateUrl: 'spinner.component.html',
6
- styleUrls: ['spinner.component.scss'],
7
- })
8
- export class SpinnerComponent {
9
- @HostBinding('attr.data-test') readonly dataTest = 'loading-spinner';
10
-
11
- constructor() {}
12
- }
@@ -1,44 +0,0 @@
1
- # Translations
2
-
3
- Depending on the application mode, translations are loaded locally or are provided by the backend.
4
-
5
- - In **development mode**, translations are loaded from `assets/i18n/<language>.json`)
6
- - In **production mode**, translations are provided by the backend.
7
-
8
- ## Usage
9
-
10
- If possible, use the `translate` directive:
11
-
12
- ```html
13
- <div translate [translateParams]="{value: 'world'}">HELLO</div>
14
- ```
15
-
16
- ... or the `translate` pipe:
17
-
18
- ```html
19
- <div>{{ 'HELLO' | translate:{value: 'world'} }}</div>
20
- ```
21
-
22
- You can also translate strings programmatically:
23
-
24
- ```ts
25
- import { TranslateService } from "@ngx-translate/core";
26
- import { TranslationsService } from '../translations/translations.service';
27
-
28
- constructor(
29
- private translate: TranslateService,
30
- private translations: TranslationsService,
31
- ) {
32
- // This is the preferred way of programmatically using translations.
33
- this.translate.get('HELLO', {value: 'world'}).subscribe((translatedString) => {
34
- // Do stuff.
35
- });
36
-
37
- // Do this only if you have to use `translate.instant()`.
38
- this.translations.waitForInit().subscribe(() => {
39
- // You can safely use `this.translate.instant()` here.
40
- });
41
- }
42
- ```
43
-
44
- See https://github.com/ngx-translate/core for more information.
@@ -1,7 +0,0 @@
1
- import { MissingTranslationHandler, MissingTranslationHandlerParams } from '@ngx-translate/core';
2
-
3
- export class FallbackTranslationHandler implements MissingTranslationHandler {
4
- handle(params: MissingTranslationHandlerParams) {
5
- return (params.interpolateParams as any)?.fallback ?? params.key;
6
- }
7
- }
@@ -1,6 +0,0 @@
1
- import { Locale } from 'ngx-edu-sharing-api';
2
-
3
- export const LANGUAGES: { [key: string]: Locale } = {
4
- de: 'de_DE',
5
- en: 'en_US',
6
- };
@@ -1,352 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { fakeAsync, tick } from '@angular/core/testing';
3
- import { ConfigService } from 'ngx-edu-sharing-api';
4
- import * as rxjs from 'rxjs';
5
- import { Observable } from 'rxjs';
6
- import { TRANSLATION_LIST, TranslationLoader } from './translation-loader';
7
- import { TranslationSource } from './translation-source';
8
- import { EduSharingUiConfiguration } from '../edu-sharing-ui-configuration';
9
-
10
- class HttpClientStub {
11
- get(url: string): Observable<any> {
12
- return rxjs.of(null);
13
- }
14
- }
15
- class EduSharingUiConfigurationStub {
16
- production = false;
17
- }
18
- class ConfigStub {
19
- observeTranslationOverrides(lang: string): Observable<any> {
20
- return rxjs.of(null);
21
- }
22
- observeDefaultTranslations(lang: string): Observable<any> {
23
- return rxjs.of(null);
24
- }
25
- setLocale(lang: string): void {}
26
- }
27
-
28
- describe('TranslationLoader', () => {
29
- let translationLoader: TranslationLoader;
30
- let httpClient: HttpClientStub;
31
- let config: ConfigStub;
32
- let uiConfig: EduSharingUiConfigurationStub;
33
-
34
- beforeEach(() => {
35
- httpClient = new HttpClientStub();
36
- config = new ConfigStub();
37
- uiConfig = new EduSharingUiConfigurationStub();
38
- translationLoader = TranslationLoader.create(
39
- httpClient as HttpClient,
40
- config as unknown as ConfigService,
41
- uiConfig as unknown as EduSharingUiConfiguration,
42
- );
43
- });
44
-
45
- describe('getTranslation', () => {
46
- function callGetTranslation(lang: string) {
47
- return new Promise((resolve) => {
48
- fakeAsync(() => {
49
- translationLoader
50
- .getTranslation(lang)
51
- .subscribe((result) => resolve(result), fail);
52
- tick(100);
53
- })();
54
- });
55
- }
56
-
57
- it('should run', async () => {
58
- const result = await callGetTranslation('de');
59
- expect(result).toEqual({});
60
- });
61
-
62
- describe('Source = Local', () => {
63
- beforeEach(() => {
64
- (translationLoader as any).source = TranslationSource.Local;
65
- });
66
-
67
- it('should call nothing for lang=none', async () => {
68
- const getSpy = spyOn(httpClient, 'get').and.callThrough();
69
- const getConfigLanguageSpy = spyOn(
70
- config,
71
- 'observeTranslationOverrides',
72
- ).and.callThrough();
73
- const getLanguageDefaultsSpy = spyOn(
74
- config,
75
- 'observeDefaultTranslations',
76
- ).and.callThrough();
77
- await callGetTranslation('none');
78
- expect(getSpy.calls.count()).toBe(0);
79
- expect(getConfigLanguageSpy.calls.count()).toBe(0);
80
- expect(getLanguageDefaultsSpy.calls.count()).toBe(0);
81
- });
82
-
83
- it('should call http get', async () => {
84
- const getSpy = spyOn(httpClient, 'get').and.callThrough();
85
- await callGetTranslation('de');
86
- expect(getSpy.calls.count()).toBe(TRANSLATION_LIST.length);
87
- expect(getSpy.calls.first().args).toEqual(['assets/i18n/common/de.json']);
88
- expect(getSpy.calls.mostRecent().args).toEqual(['assets/i18n/override/de.json']);
89
- });
90
-
91
- it('should call observeTranslationOverrides', async () => {
92
- const getConfigLanguageSpy = spyOn(
93
- config,
94
- 'observeTranslationOverrides',
95
- ).and.callThrough();
96
- await callGetTranslation('de');
97
- expect(getConfigLanguageSpy.calls.count()).toBe(1);
98
- });
99
-
100
- it('should call setLocale with correct locale', async () => {
101
- const setLocaleSpy = spyOn(config, 'setLocale').and.callThrough();
102
- await callGetTranslation('de');
103
- expect(setLocaleSpy.calls.mostRecent().args).toEqual(['de_DE']);
104
- });
105
-
106
- it('should not call observeDefaultTranslations', async () => {
107
- const getLanguageDefaultsSpy = spyOn(
108
- config,
109
- 'observeDefaultTranslations',
110
- ).and.callThrough();
111
- await callGetTranslation('de');
112
- expect(getLanguageDefaultsSpy.calls.count()).toBe(0);
113
- });
114
-
115
- it('should include translations via http', async () => {
116
- httpClient.get = (url) => {
117
- if (url === 'assets/i18n/common/de.json') {
118
- return rxjs.of({ foo: 'bar' });
119
- }
120
- return rxjs.of(null);
121
- };
122
- const result = await callGetTranslation('de');
123
- expect(result).toEqual({ foo: 'bar' });
124
- });
125
-
126
- it('should merge translations via http', async () => {
127
- httpClient.get = (url) => {
128
- if (url === 'assets/i18n/common/de.json') {
129
- return rxjs.of({ foo: 'bar' });
130
- } else if (url === 'assets/i18n/admin/de.json') {
131
- return rxjs.of({ bar: 'baz' });
132
- }
133
- return rxjs.of(null);
134
- };
135
- const result = await callGetTranslation('de');
136
- expect(result).toEqual({ foo: 'bar', bar: 'baz' });
137
- });
138
-
139
- it('should override nested translations via http', async () => {
140
- httpClient.get = (url) => {
141
- if (url === 'assets/i18n/common/de.json') {
142
- return rxjs.of({ prefix: { foo: 'bar' } });
143
- } else if (url === 'assets/i18n/admin/de.json') {
144
- return rxjs.of({ prefix: { bar: 'baz' } });
145
- }
146
- return rxjs.of(null);
147
- };
148
- const result = await callGetTranslation('de');
149
- expect(result).toEqual({ prefix: { bar: 'baz' } });
150
- });
151
-
152
- it('should include translations via observeTranslationOverrides', async () => {
153
- config.observeTranslationOverrides = (lang) => {
154
- return rxjs.of({ foo: 'bar' });
155
- };
156
- const result = await callGetTranslation('de');
157
- expect(result).toEqual({ foo: 'bar' });
158
- });
159
-
160
- it('should override translations via observeTranslationOverrides', async () => {
161
- httpClient.get = (url) => {
162
- if (url === 'assets/i18n/common/de.json') {
163
- return rxjs.of({ foo: 'bar' });
164
- }
165
- return rxjs.of(null);
166
- };
167
- config.observeTranslationOverrides = (lang) => {
168
- return rxjs.of({ foo: 'baz' });
169
- };
170
- const result = await callGetTranslation('de');
171
- expect(result).toEqual({ foo: 'baz' });
172
- });
173
-
174
- it('should merge translations via observeTranslationOverrides', async () => {
175
- httpClient.get = (url) => {
176
- if (url === 'assets/i18n/common/de.json') {
177
- return rxjs.of({ foo: 'bar' });
178
- }
179
- return rxjs.of(null);
180
- };
181
- config.observeTranslationOverrides = (lang) => {
182
- return rxjs.of({ bar: 'baz' });
183
- };
184
- const result = await callGetTranslation('de');
185
- expect(result).toEqual({ foo: 'bar', bar: 'baz' });
186
- });
187
-
188
- it('should override nested translations via observeTranslationOverrides', async () => {
189
- httpClient.get = (url) => {
190
- if (url === 'assets/i18n/common/de.json') {
191
- return rxjs.of({ prefix: { foo: 'bar' } });
192
- }
193
- return rxjs.of(null);
194
- };
195
- config.observeTranslationOverrides = (lang) => {
196
- return rxjs.of({ prefix: { bar: 'baz' } });
197
- };
198
- const result = await callGetTranslation('de');
199
- expect(result).toEqual({ prefix: { bar: 'baz' } });
200
- });
201
-
202
- it('should deep-merge translations via observeTranslationOverrides', async () => {
203
- httpClient.get = (url) => {
204
- if (url === 'assets/i18n/common/de.json') {
205
- return rxjs.of({ prefix: { foo: 'bar' } });
206
- }
207
- return rxjs.of(null);
208
- };
209
- config.observeTranslationOverrides = (lang) => {
210
- return rxjs.of({ 'prefix.bar': 'baz' });
211
- };
212
- const result = await callGetTranslation('de');
213
- expect(result).toEqual({ prefix: { foo: 'bar', bar: 'baz' } });
214
- });
215
-
216
- it('should deep-merge translations via observeTranslationOverrides (3 levels)', async () => {
217
- httpClient.get = (url) => {
218
- if (url === 'assets/i18n/common/de.json') {
219
- return rxjs.of({
220
- l1: { l2: { l3: { foo: 'bar' } } },
221
- });
222
- }
223
- return rxjs.of(null);
224
- };
225
- config.observeTranslationOverrides = (lang) => {
226
- return rxjs.of({ 'l1.l2.l3.bar': 'baz' });
227
- };
228
- const result = await callGetTranslation('de');
229
- expect(result).toEqual({
230
- l1: { l2: { l3: { foo: 'bar', bar: 'baz' } } },
231
- });
232
- });
233
-
234
- it('should create missing levels via observeTranslationOverrides', async () => {
235
- httpClient.get = (url) => {
236
- if (url === 'assets/i18n/common/de.json') {
237
- return rxjs.of({});
238
- }
239
- return rxjs.of(null);
240
- };
241
- config.observeTranslationOverrides = (lang) => {
242
- return rxjs.of({ 'l1.l2.l3.bar': 'baz' });
243
- };
244
- const result = await callGetTranslation('de');
245
- expect(result).toEqual({
246
- l1: { l2: { l3: { bar: 'baz' } } },
247
- });
248
- });
249
- });
250
-
251
- describe('Source = Repository', () => {
252
- beforeEach(() => {
253
- (translationLoader as any).source = TranslationSource.Repository;
254
- });
255
-
256
- it('should call nothing for lang=none', async () => {
257
- const getSpy = spyOn(httpClient, 'get').and.callThrough();
258
- const getConfigLanguageSpy = spyOn(
259
- config,
260
- 'observeTranslationOverrides',
261
- ).and.callThrough();
262
- const getLanguageDefaultsSpy = spyOn(
263
- config,
264
- 'observeDefaultTranslations',
265
- ).and.callThrough();
266
- await callGetTranslation('none');
267
- expect(getSpy.calls.count()).toBe(0);
268
- expect(getConfigLanguageSpy.calls.count()).toBe(0);
269
- expect(getLanguageDefaultsSpy.calls.count()).toBe(0);
270
- });
271
-
272
- it('should not call http get', async () => {
273
- const getSpy = spyOn(httpClient, 'get').and.callThrough();
274
- await callGetTranslation('de');
275
- expect(getSpy.calls.count()).toBe(0);
276
- });
277
-
278
- it('should call observeTranslationOverrides', async () => {
279
- const getConfigLanguageSpy = spyOn(
280
- config,
281
- 'observeTranslationOverrides',
282
- ).and.callThrough();
283
- await callGetTranslation('de');
284
- expect(getConfigLanguageSpy.calls.count()).toBe(1);
285
- });
286
-
287
- it('should call observeDefaultTranslations', async () => {
288
- const getLanguageDefaultsSpy = spyOn(
289
- config,
290
- 'observeDefaultTranslations',
291
- ).and.callThrough();
292
- await callGetTranslation('de');
293
- expect(getLanguageDefaultsSpy.calls.count()).toBe(1);
294
- });
295
-
296
- it('should call setLocale with correct locale', async () => {
297
- const setLocaleSpy = spyOn(config, 'setLocale').and.callThrough();
298
- await callGetTranslation('de');
299
- expect(setLocaleSpy.calls.mostRecent().args).toEqual(['de_DE']);
300
- });
301
-
302
- it('should include translations via observeDefaultTranslations', async () => {
303
- config.observeDefaultTranslations = (lang) => {
304
- return rxjs.of({ foo: 'bar' });
305
- };
306
- const result = await callGetTranslation('de');
307
- expect(result).toEqual({ foo: 'bar' });
308
- });
309
-
310
- it('should include translations via observeTranslationOverrides', async () => {
311
- config.observeTranslationOverrides = (lang) => {
312
- return rxjs.of({ foo: 'bar' });
313
- };
314
- const result = await callGetTranslation('de');
315
- expect(result).toEqual({ foo: 'bar' });
316
- });
317
-
318
- it('should merge translations via observeTranslationOverrides', async () => {
319
- config.observeDefaultTranslations = (lang) => {
320
- return rxjs.of({ foo: 'bar' });
321
- };
322
- config.observeTranslationOverrides = (lang) => {
323
- return rxjs.of({ bar: 'baz' });
324
- };
325
- const result = await callGetTranslation('de');
326
- expect(result).toEqual({ foo: 'bar', bar: 'baz' });
327
- });
328
-
329
- it('should override nested translations via observeTranslationOverrides', async () => {
330
- config.observeDefaultTranslations = (lang) => {
331
- return rxjs.of({ prefix: { foo: 'bar' } });
332
- };
333
- config.observeTranslationOverrides = (lang) => {
334
- return rxjs.of({ prefix: { bar: 'baz' } });
335
- };
336
- const result = await callGetTranslation('de');
337
- expect(result).toEqual({ prefix: { bar: 'baz' } });
338
- });
339
-
340
- it('should deep-merge translations via observeTranslationOverrides', async () => {
341
- config.observeDefaultTranslations = (lang) => {
342
- return rxjs.of({ prefix: { foo: 'bar' } });
343
- };
344
- config.observeTranslationOverrides = (lang) => {
345
- return rxjs.of({ 'prefix.bar': 'baz' });
346
- };
347
- const result = await callGetTranslation('de');
348
- expect(result).toEqual({ prefix: { foo: 'bar', bar: 'baz' } });
349
- });
350
- });
351
- });
352
- });