ngx-edu-sharing-ui 0.7.0 → 9.0.1

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 +23 -9
  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,43 +0,0 @@
1
- import { CdkDrag } from '@angular/cdk/drag-drop';
2
- import { Directive } from '@angular/core';
3
- import { Node } from 'ngx-edu-sharing-api';
4
- import { NodesDragDropService } from '../../services/nodes-drag-drop.service';
5
-
6
- /**
7
- * A draggable node.
8
- *
9
- * Use in combination with `cdkDrag`, setting `cdkDragData` to the array of nodes to be dragged.
10
- */
11
- @Directive({
12
- selector: '[esNodesDrag]',
13
- })
14
- export class NodesDragDirective {
15
- constructor(private cdkDrag: CdkDrag<Node[]>, private nodesDragDrop: NodesDragDropService) {
16
- this.cdkDrag.started.subscribe((event) => {
17
- this.nodesDragDrop.draggedNodes = event.source.data;
18
- // Position the preview element (the one being dragged around) next to the cursor to
19
- // avoid covering possible drop targets with the preview.
20
- event.source._dragRef['_pickupPositionInElement'] = { x: 0, y: 0 };
21
- });
22
- this.cdkDrag.released.subscribe(() => {
23
- if (this.nodesDragDrop.canDrop?.accept) {
24
- this.inhibitPreviewAnimation();
25
- }
26
- });
27
- this.cdkDrag.dropped.subscribe(() => {
28
- this.nodesDragDrop.onDropped(this.cdkDrag.data);
29
- this.nodesDragDrop.draggedNodes = null;
30
- });
31
- }
32
-
33
- private inhibitPreviewAnimation() {
34
- const style = document.createElement('style');
35
- document.body.appendChild(style);
36
- style.innerHTML = `.cdk-drag-preview { transition: none !important; }`;
37
- // Don't need to go outside ng zone because `cdkDrag.released` already runs outside the
38
- // zone.
39
- setTimeout(() => {
40
- document.body.removeChild(style);
41
- });
42
- }
43
- }
@@ -1,116 +0,0 @@
1
- import {
2
- Directive,
3
- ElementRef,
4
- EventEmitter,
5
- Input,
6
- NgZone,
7
- OnDestroy,
8
- Output,
9
- } from '@angular/core';
10
- import { BehaviorSubject, Observable, Subject } from 'rxjs';
11
- import { takeUntil } from 'rxjs/operators';
12
- import { CanDrop, DragData, DropTargetState } from '../../types/drag-drop';
13
- import { NodesDragDropService } from '../../services/nodes-drag-drop.service';
14
-
15
- const ACTIVE_DROP_TARGET_ACCEPT_CLASS = 'es-nodes-active-drop-target-accept';
16
- const ACTIVE_DROP_TARGET_DENY_CLASS = 'es-nodes-active-drop-target-deny';
17
-
18
- @Directive({
19
- selector: '[esNodesDropTarget]',
20
- exportAs: 'esNodesDropTarget',
21
- })
22
- export class NodesDropTargetDirective<T = unknown> implements OnDestroy {
23
- @Input('esNodesDropTarget') target: T;
24
- @Input() canDropNodes: (dragData: DragData<T>) => CanDrop;
25
- @Output() nodeDropped = new EventEmitter<DragData<T>>();
26
-
27
- get active() {
28
- return this.activeDropTargetSubject.value;
29
- }
30
-
31
- private activeDropTargetSubject = new BehaviorSubject<DropTargetState | null>(null);
32
- private destroyed = new Subject<void>();
33
-
34
- constructor(
35
- private ngZone: NgZone,
36
- private elementRef: ElementRef<HTMLElement>,
37
- private nodesDragDrop: NodesDragDropService,
38
- ) {
39
- this.registerMouseEnterLeave();
40
- this.registerActiveDropTarget();
41
- }
42
-
43
- ngOnDestroy(): void {
44
- this.destroyed.next();
45
- this.destroyed.complete();
46
- }
47
-
48
- _setActiveDropTarget(value: DropTargetState | null) {
49
- this.activeDropTargetSubject.next(value);
50
- }
51
-
52
- private registerMouseEnterLeave() {
53
- this.ngZone.runOutsideAngular(() => {
54
- this.elementRef.nativeElement.addEventListener('mouseenter', () =>
55
- this.nodesDragDrop.onMouseEnter(this),
56
- );
57
- this.elementRef.nativeElement.addEventListener('mouseleave', () =>
58
- this.nodesDragDrop.onMouseLeave(this),
59
- );
60
- // Firefox does not fire a mouseleave event when the element is removed from the DOM
61
- // while being hovered. When an element is dragged, it will be replaced with a
62
- // placeholder. If the element was also a drop target, we would think that we are still
63
- // hovering the element.
64
- observeRemovedFromParent(this.elementRef.nativeElement)
65
- .pipe(takeUntil(this.destroyed))
66
- .subscribe(() => this.nodesDragDrop.onMouseLeave(this));
67
- });
68
- }
69
-
70
- private registerActiveDropTarget() {
71
- this.activeDropTargetSubject
72
- .pipe(takeUntil(this.destroyed))
73
- .subscribe((dropTargetState) => {
74
- const canDrop = dropTargetState?.canDrop;
75
- const classList = this.elementRef.nativeElement.classList;
76
- classList.remove(ACTIVE_DROP_TARGET_ACCEPT_CLASS, ACTIVE_DROP_TARGET_DENY_CLASS);
77
- if (canDrop?.accept) {
78
- classList.add(ACTIVE_DROP_TARGET_ACCEPT_CLASS);
79
- } else if (canDrop?.denyExplicit) {
80
- classList.add(ACTIVE_DROP_TARGET_DENY_CLASS);
81
- }
82
- });
83
- }
84
- }
85
-
86
- function observeRemovedFromParent(element: HTMLElement): Observable<void> {
87
- return new Observable((subscriber) => {
88
- const observer = new MutationObserver((event) => {
89
- for (const mutation of event) {
90
- // @ts-ignore
91
- if ([...mutation.removedNodes].includes(element)) {
92
- subscriber.next();
93
- }
94
- }
95
- });
96
- // Wait for `element` to be attached to the DOM.
97
- let timeout = setTimeout(() => {
98
- timeout = null;
99
- observer.observe(element.parentNode, { childList: true, subtree: false });
100
- });
101
- return () => {
102
- // In case the element was destroyed before we attached the mutation observer, we cancel
103
- // the observable returned by this function and don't attach the mutation observer.
104
- if (timeout !== null) {
105
- // TODO: Investigate elements that trigger the following warning.
106
- //
107
- // console.warn(
108
- // 'Possible performance leak: the element got destroyed before it could be added to the DOM.',
109
- // element,
110
- // );
111
- clearTimeout(timeout);
112
- }
113
- observer.disconnect();
114
- };
115
- });
116
- }
@@ -1,34 +0,0 @@
1
- import { Directive, HostListener } from '@angular/core';
2
-
3
- @Directive({
4
- selector: '[esFocusState]',
5
- exportAs: 'esFocusState',
6
- })
7
- export class FocusStateDirective {
8
- /** Either the element or one of its descendants has focus. */
9
- hasFocus = false;
10
- /** The element is being hovered with the cursor. */
11
- hovering = false;
12
-
13
- constructor() {}
14
-
15
- @HostListener('focusin')
16
- onFocusIn() {
17
- this.hasFocus = true;
18
- }
19
-
20
- @HostListener('focusout')
21
- onFocusOut() {
22
- this.hasFocus = false;
23
- }
24
-
25
- @HostListener('mouseenter')
26
- onMouseOver() {
27
- this.hovering = true;
28
- }
29
-
30
- @HostListener('mouseleave')
31
- onMouseOut() {
32
- this.hovering = false;
33
- }
34
- }
@@ -1,142 +0,0 @@
1
- /**
2
- * Created by Torsten on 13.01.2017.
3
- */
4
-
5
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
6
- import { Directive, ElementRef, Input, OnInit, OnDestroy } from '@angular/core';
7
- import { TranslateService } from '@ngx-translate/core';
8
- import { ConfigService } from 'ngx-edu-sharing-api';
9
- import { take } from 'rxjs/operators';
10
-
11
- /**
12
- * Replaces the element's content with an icon.
13
- *
14
- * Example: `<i esIcon="save"></i>`
15
- *
16
- * Optionally, a translated `aria-label` can be attached by setting `aria` to a truthy value: `<i
17
- * esIcon="save" aria="true"></i>`. Otherwise, `aria-hidden` will be set.
18
- *
19
- * For backwards compatibility, the directive is also activated on elements that set
20
- * `class="material-icons"`. This is mainly to set the `aria-hidden` attribute. Occurrences should
21
- * be updated to the syntax above.
22
- */
23
- @Directive({
24
- selector: 'i[esIcon], i.material-icons',
25
- })
26
- export class IconDirective implements OnInit, OnDestroy {
27
- private _id: string;
28
- private _aria: boolean;
29
- private iconsConfig: Array<{ original: string; replace?: string; cssClass?: string }>;
30
- private altTextSpan: HTMLElement;
31
- private isReady = false;
32
-
33
- /**
34
- * An alt text to show to screen readers.
35
- *
36
- * If omitted, the icon will be invisible to screen readers.
37
- *
38
- * @see https://material.angular.io/components/icon/overview#indicator-icons
39
- */
40
- @Input() set altText(altText: string) {
41
- this.setAltText(altText);
42
- }
43
-
44
- /** If true, an alt text (see above) will be set based on the icon. */
45
- @Input() set aria(aria: boolean) {
46
- aria = coerceBooleanProperty(aria);
47
- if (aria !== this._aria) {
48
- this._aria = aria;
49
- if (this.isReady) {
50
- this.updateAria();
51
- }
52
- }
53
- }
54
-
55
- @Input() set esIcon(id: string) {
56
- this.setIcon(id);
57
- }
58
-
59
- constructor(
60
- private element: ElementRef<HTMLElement>,
61
- private translate: TranslateService,
62
- private config: ConfigService,
63
- ) {}
64
-
65
- async ngOnInit() {
66
- this.isReady = true;
67
- this.element.nativeElement.setAttribute('aria-hidden', 'true');
68
- this.updateAria();
69
-
70
- // FIXME: This might resolve after `setIcon` was called and mappings might be ignored.
71
- await this.config.observeConfig().pipe(take(1)).toPromise();
72
- this.iconsConfig = this.config.instant('icons', null);
73
- }
74
-
75
- ngOnDestroy(): void {
76
- if (this.altTextSpan) {
77
- this.altTextSpan.remove();
78
- }
79
- }
80
-
81
- private setIcon(id: string) {
82
- if (this._id) {
83
- this.element.nativeElement.classList.remove(
84
- 'edu-icons',
85
- 'custom-icons',
86
- 'material-icons',
87
- );
88
- }
89
- let customClass: string = null;
90
- const mapping = this.iconsConfig?.filter((i) => i.original === id);
91
- if (mapping?.length === 1) {
92
- id = mapping[0].replace || '';
93
- customClass = mapping[0].cssClass;
94
- }
95
- this._id = id;
96
- if (this._aria) {
97
- this.updateAria();
98
- }
99
- let cssClass: string;
100
- if (id?.startsWith('edu-') && !customClass) {
101
- cssClass = 'edu-icons';
102
- id = id.substr(4);
103
- } else if (id?.startsWith('custom-') || customClass) {
104
- cssClass = 'custom-icons';
105
- id = id.substr(7);
106
- } else {
107
- cssClass = 'material-icons';
108
- }
109
- this.element.nativeElement.classList.add(cssClass);
110
- if (customClass) {
111
- this.element.nativeElement.classList.add(customClass);
112
- }
113
- this.element.nativeElement.innerText = id;
114
- }
115
-
116
- private updateAria() {
117
- if (this._aria !== undefined) {
118
- if (this._aria && this._id) {
119
- this.translate.get('ICON_LABELS.' + this._id).subscribe((lang) => {
120
- this.setAltText(lang);
121
- });
122
- } else {
123
- this.setAltText(null);
124
- }
125
- }
126
- }
127
-
128
- private setAltText(altText: string): void {
129
- if (altText && !this.altTextSpan) {
130
- this.insertAltTextSpan();
131
- }
132
- if (this.altTextSpan) {
133
- this.altTextSpan.innerText = altText;
134
- }
135
- }
136
-
137
- private insertAltTextSpan(): void {
138
- this.altTextSpan = document.createElement('span');
139
- this.altTextSpan.classList.add('cdk-visually-hidden');
140
- this.element.nativeElement.insertAdjacentElement('afterend', this.altTextSpan);
141
- }
142
- }
@@ -1,155 +0,0 @@
1
- import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core';
2
- import {
3
- DragDataLegacy,
4
- dragNodesTransferType,
5
- DropActionLegacy,
6
- readDraggedNodes,
7
- } from './drag-nodes/drag-nodes';
8
-
9
- /**
10
- * Handle dragging and dropping of nodes onto an element.
11
- *
12
- * Use in combination with `NodesDragSourceDirective`.
13
- *
14
- * When an element that sets `NodesDragSourceDirective` is dragged onto an
15
- * element that sets this directive, drag events are passed as output events.
16
- * Some of these output events provide data about the dragged nodes. Passed
17
- * events are filtered to not trigger unnecessarily.
18
- */
19
- @Directive({
20
- selector: '[esLegacyNodesDropTarget]',
21
- })
22
- export class NodesDropTargetLegacyDirective {
23
- /**
24
- * The last node that some (other) node(s) were dragged over.
25
- *
26
- * One of two mechanisms to determine if we entered the element, i.e., if
27
- * the cursor -- while dragging node(s) -- is moved from outside onto this
28
- * node.
29
- *
30
- * If the cursor was over another node before, we know it just entered this
31
- * one.
32
- *
33
- * This fails when the cursor is moved from this node to a place other than
34
- * a node and back again.
35
- */
36
- private static last: NodesDropTargetLegacyDirective;
37
-
38
- /**
39
- * A function to determine whether this element is a valid drop target for
40
- * the dragged nodes.
41
- *
42
- * Output events are *only* fired, when this function evaluates to `true`.
43
- */
44
- @Input('esLegacyNodesDropTarget') canDrop: boolean | ((dragData: DragDataLegacy) => boolean);
45
- @Input() nodesDragAllowedActions: DropActionLegacy[] = ['move', 'copy'];
46
-
47
- @Output() nodesDragEnter = new EventEmitter<DragEvent>();
48
- @Output() nodesDragLeave = new EventEmitter<DragEvent>();
49
- /**
50
- * Indicates whether the cursor is hovering over the element, holding one or more nodes.
51
- */
52
- @Output() nodesHoveringChange = new EventEmitter<boolean>();
53
- /**
54
- * Triggered when one or more nodes are dropped onto the element.
55
- */
56
- @Output() nodesDrop = new EventEmitter<DragDataLegacy>();
57
-
58
- /**
59
- * Difference of enter- and leave events.
60
- *
61
- * One of two mechanisms to determine if we entered the element, i.e., if
62
- * the cursor -- while dragging node(s) -- is moved from outside onto this
63
- * node.
64
- *
65
- * If we enter this node a second time without having left it once, we
66
- * probably just stayed on it.
67
- *
68
- * This fails when a leave event fails to fire, e.g., when the DOM element
69
- * was repositioned while the curser was dragged over it.
70
- */
71
- private enterCount = 0;
72
- private canDropCurrent: boolean;
73
- private dropAction: DropActionLegacy;
74
-
75
- constructor() {}
76
-
77
- @HostListener('dragenter', ['$event']) onDragEnter(event: DragEvent) {
78
- if (!event.dataTransfer.types.includes(dragNodesTransferType)) {
79
- return;
80
- }
81
- if (this.enterCount === 0 || NodesDropTargetLegacyDirective.last !== this) {
82
- NodesDropTargetLegacyDirective.last = this;
83
- this.enterCount = 0;
84
- this.canDropCurrent = this.getCanDrop(event);
85
- if (this.canDropCurrent) {
86
- this.nodesHoveringChange.emit(true);
87
- this.nodesDragEnter.emit(event);
88
- }
89
- }
90
- if (this.canDropCurrent) {
91
- event.preventDefault();
92
- }
93
- this.enterCount++;
94
- }
95
-
96
- @HostListener('dragleave', ['$event']) onDragLeave(event: DragEvent) {
97
- if (!event.dataTransfer.types.includes(dragNodesTransferType)) {
98
- return;
99
- }
100
- this.enterCount--;
101
- if (this.canDropCurrent) {
102
- if (this.enterCount === 0) {
103
- this.nodesDragLeave.emit(event);
104
- this.nodesHoveringChange.emit(false);
105
- }
106
- }
107
- }
108
-
109
- @HostListener('dragover', ['$event']) onDragOver(event: DragEvent) {
110
- if (!event.dataTransfer.types.includes(dragNodesTransferType)) {
111
- return;
112
- }
113
- if (this.canDropCurrent) {
114
- event.preventDefault();
115
- this.dropAction = this.getDropAction(event);
116
- event.dataTransfer.dropEffect = this.dropAction;
117
- }
118
- }
119
-
120
- @HostListener('drop', ['$event']) onDrop(event: DragEvent) {
121
- if (!event.dataTransfer.types.includes(dragNodesTransferType)) {
122
- return;
123
- }
124
- if (this.canDropCurrent) {
125
- event.preventDefault();
126
- const nodes = readDraggedNodes();
127
- this.nodesDrop.emit({
128
- event,
129
- nodes,
130
- dropAction: this.getDropAction(event),
131
- });
132
- this.nodesHoveringChange.emit(false);
133
- }
134
- this.enterCount = 0;
135
- NodesDropTargetLegacyDirective.last = null;
136
- }
137
-
138
- private getCanDrop(event: DragEvent): boolean {
139
- if (typeof this.canDrop === 'function') {
140
- const nodes = readDraggedNodes();
141
- return this.canDrop({ event, nodes, dropAction: this.getDropAction(event) });
142
- }
143
- return this.canDrop;
144
- }
145
-
146
- private getDropAction(event: DragEvent): DropActionLegacy {
147
- if (this.nodesDragAllowedActions.includes('copy') && event.ctrlKey) {
148
- return 'copy';
149
- } else if (this.nodesDragAllowedActions.includes('link') && event.altKey) {
150
- return 'link';
151
- } else {
152
- return 'move';
153
- }
154
- }
155
- }
@@ -1,32 +0,0 @@
1
- <mat-menu
2
- #dropdown="matMenu"
3
- class="mat-dropdown-menu"
4
- [class]="menuClass"
5
- backdropClass="mat-dropdown-menu"
6
- [xPosition]="position === 'right' ? 'after' : 'before'"
7
- >
8
- <!-- MatMenu has role="menu", so the only meaningful role of descendants is "menuitem" -->
9
- <ul role="none">
10
- <ng-container *ngFor="let option of _options; let i = index">
11
- <li *ngIf="option.isEnabled || showDisabled" role="none">
12
- <button
13
- mat-menu-item
14
- class="mat-menu-item collection-item-{{
15
- option.name | replaceChars : { search: '.', replace: '-' }
16
- }}"
17
- matTooltip="{{ option | optionTooltip }}"
18
- matTooltipPosition="right"
19
- matTooltipTouchGestures="off"
20
- [class.mat-menu-item-separate]="option.isSeparate || isNewGroup(i)"
21
- [class.mat-menu-item-selected]="option.isSelected"
22
- [disabled]="!option.isEnabled"
23
- (click)="click(option)"
24
- attr.data-test="menu-item-{{ option.name }}"
25
- >
26
- <i [esIcon]="option.icon"></i> {{ option.name | translate }}
27
- </button>
28
- </li>
29
- </ng-container>
30
- </ul>
31
- </mat-menu>
32
- <div #menuTrigger="matMenuTrigger" [matMenuTriggerFor]="menu" class="display-none"></div>
@@ -1,67 +0,0 @@
1
- @import '../../../assets/scss/mixins';
2
-
3
- // We cannot use `:host` here, since the `mat-menu` elements are rearranged
4
- // outside of the original container. Hence we rely on the `.mat-dropdown-menu`
5
- // selector to not bleed into other components.
6
- ::ng-deep .mat-dropdown-menu {
7
- .mat-mdc-menu-content {
8
- min-width: 200px;
9
- > ul > li > button {
10
- &:not(:disabled) > span {
11
- color: var(--primary);
12
- }
13
- display: flex;
14
- align-items: center;
15
- > i {
16
- width: 35px;
17
- }
18
- }
19
- &:not(:empty) {
20
- padding: 0 !important;
21
- }
22
- }
23
-
24
- ul {
25
- margin: 0;
26
- list-style: none;
27
- padding-left: 0;
28
- li {
29
- .mat-mdc-menu-item {
30
- .mat-mdc-menu-item-text {
31
- display: flex;
32
- align-items: center;
33
- i {
34
- margin-right: 10px;
35
- }
36
- }
37
- &:hover:not([disabled]),
38
- &.cdk-focused {
39
- color: var(--itemSelectedTextColor);
40
- background-color: var(--listItemSelectedBackground);
41
- }
42
- &.cdk-keyboard-focused {
43
- @include setGlobalKeyboardFocus('border');
44
- }
45
- }
46
-
47
- .mat-menu-item-separate {
48
- border-top: 1px solid #ccc;
49
- }
50
-
51
- // Mobile menus at bottom
52
- @media screen and (max-width: (calc(var(--mobileWidth) - var(--mobileStage) * 1))) {
53
- &.cdk-overlay-backdrop {
54
- background: rgba(0, 0, 0, 0.8);
55
- }
56
- &.mat-menu-panel {
57
- position: fixed;
58
- bottom: 0;
59
- left: 0;
60
- max-width: 100%;
61
- width: 100%;
62
- border-radius: 0;
63
- }
64
- }
65
- }
66
- }
67
- }
@@ -1,71 +0,0 @@
1
- import { Component, Input, ViewChild } from '@angular/core';
2
- import { MatMenu, MatMenuContent, MatMenuTrigger } from '@angular/material/menu';
3
- import { OptionItem } from '../types/option-item';
4
- import { Helper } from '../util/helper';
5
- import { UIService } from '../services/ui.service';
6
-
7
- /**
8
- * The dropdown is one base component of the action bar (showing more actions),
9
- * but can also be used standalone.
10
- */
11
- @Component({
12
- selector: 'es-dropdown',
13
- templateUrl: 'dropdown.component.html',
14
- styleUrls: ['dropdown.component.scss'],
15
- })
16
- export class DropdownComponent {
17
- @ViewChild('dropdown', { static: true }) menu: MatMenu;
18
- @ViewChild('menuTrigger') menuTrigger: MatMenuTrigger;
19
-
20
- @Input() position: 'left' | 'right' = 'left';
21
-
22
- @Input() set options(options: OptionItem[]) {
23
- this._options = this.ui.filterValidOptions(Helper.deepCopyArray(options));
24
- }
25
-
26
- /**
27
- * The object that should be returned via the option's callback.
28
- *
29
- * Can be null
30
- */
31
- @Input() callbackObject: any;
32
-
33
- /**
34
- * Should disabled ("greyed out") options be shown or hidden?
35
- */
36
- @Input() showDisabled = true;
37
-
38
- /**
39
- * An additional class to add to the `mat-menu` instance.
40
- *
41
- * This is needed to customize the menu styling since the menu contents are
42
- * taken out of the host container by angular.
43
- */
44
- @Input() menuClass: string;
45
-
46
- _options: OptionItem[];
47
-
48
- constructor(private ui: UIService) {}
49
-
50
- click(option: OptionItem) {
51
- if (!option.isEnabled) {
52
- return;
53
- }
54
- setTimeout(() => option.callback(this.callbackObject));
55
- }
56
-
57
- isNewGroup(i: number) {
58
- if (i > 0) {
59
- return this._options[i].group !== this._options[i - 1].group;
60
- }
61
- return false;
62
- }
63
-
64
- /** Whether there are any enabled options so we can open the menu. */
65
- canShowDropdown(): boolean {
66
- // We can only open the dropdown menu, when there is at least one enabled option. Even when
67
- // there are options with `showDisabled: true`, showing a menu with no selectable option
68
- // causes a11y issues.
69
- return this._options?.some((o) => o.isEnabled);
70
- }
71
- }