@yuuvis/client-framework 2.0.0-beta.0 → 2.0.0-beta.3

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 (389) hide show
  1. package/actions/lib/actions/delete-action/delete/delete.component.d.ts +3 -3
  2. package/actions/lib/actions/delete-action/delete-action.d.ts +1 -1
  3. package/actions/lib/actions.service.d.ts +7 -3
  4. package/actions/lib/components/contextmenu/contextmenu.component.d.ts +3 -1
  5. package/autocomplete/README.md +3 -0
  6. package/autocomplete/index.d.ts +3 -0
  7. package/autocomplete/lib/autocomplete.component.d.ts +72 -0
  8. package/autocomplete/lib/autocomplete.interface.d.ts +4 -0
  9. package/autocomplete/lib/autocomplete.module.d.ts +7 -0
  10. package/common/index.d.ts +4 -4
  11. package/common/lib/common.module.d.ts +19 -0
  12. package/common/lib/common.utils.d.ts +2 -0
  13. package/common/lib/components/confirm/confirm.component.d.ts +7 -0
  14. package/common/lib/components/confirm/confirm.interface.d.ts +7 -0
  15. package/common/lib/components/confirm/confirm.service.d.ts +9 -0
  16. package/common/lib/components/dialog/dialog.component.d.ts +6 -0
  17. package/common/lib/components/dialog/dialog.options.d.ts +7 -0
  18. package/common/lib/components/index.d.ts +5 -0
  19. package/common/lib/directives/autofocus-child.directive.d.ts +13 -0
  20. package/common/lib/directives/autofocus-delayed.directive.d.ts +18 -0
  21. package/common/lib/directives/drag-scroll.directive.d.ts +20 -0
  22. package/common/lib/directives/index.d.ts +8 -4
  23. package/common/lib/directives/noop-value-accessor.directive.d.ts +2 -2
  24. package/common/lib/mat-form-field.abstract.d.ts +41 -0
  25. package/common/lib/services/index.d.ts +1 -1
  26. package/common/lib/services/layout-settings/layout-settings.service.d.ts +18 -0
  27. package/datepicker/README.md +3 -0
  28. package/datepicker/index.d.ts +5 -0
  29. package/datepicker/lib/calendar/calendar.component.d.ts +72 -0
  30. package/datepicker/lib/date-input/date-input-element/date-input-element.component.d.ts +43 -0
  31. package/datepicker/lib/date-input/date-input-hour-element/date-input-hour-element.component.d.ts +11 -0
  32. package/datepicker/lib/date-input/date-input.component.d.ts +61 -0
  33. package/datepicker/lib/datepicker-calendar/datepicker-calendar-trigger.component.d.ts +7 -0
  34. package/datepicker/lib/datepicker-calendar/datepicker-calendar.component.d.ts +12 -0
  35. package/datepicker/lib/datepicker.component.d.ts +80 -0
  36. package/datepicker/lib/datepicker.interface.d.ts +34 -0
  37. package/datepicker/lib/datepicker.module.d.ts +9 -0
  38. package/datepicker/lib/datepicker.service.d.ts +46 -0
  39. package/datepicker/lib/datepicker.utils.d.ts +23 -0
  40. package/datepicker/lib/time-input/time-input.component.d.ts +36 -0
  41. package/datepicker/lib/time-input/time-input.interface.d.ts +6 -0
  42. package/fesm2022/yuuvis-client-framework-actions.mjs +147 -105
  43. package/fesm2022/yuuvis-client-framework-actions.mjs.map +1 -1
  44. package/fesm2022/yuuvis-client-framework-app-bar.mjs +7 -8
  45. package/fesm2022/yuuvis-client-framework-app-bar.mjs.map +1 -1
  46. package/fesm2022/yuuvis-client-framework-autocomplete.mjs +210 -0
  47. package/fesm2022/yuuvis-client-framework-autocomplete.mjs.map +1 -0
  48. package/fesm2022/yuuvis-client-framework-clipboard.mjs +9 -9
  49. package/fesm2022/yuuvis-client-framework-clipboard.mjs.map +1 -1
  50. package/fesm2022/yuuvis-client-framework-common.mjs +853 -780
  51. package/fesm2022/yuuvis-client-framework-common.mjs.map +1 -1
  52. package/fesm2022/yuuvis-client-framework-datepicker.mjs +1688 -0
  53. package/fesm2022/yuuvis-client-framework-datepicker.mjs.map +1 -0
  54. package/fesm2022/yuuvis-client-framework-forms.mjs +945 -1157
  55. package/fesm2022/yuuvis-client-framework-forms.mjs.map +1 -1
  56. package/fesm2022/yuuvis-client-framework-icons.mjs +85 -12
  57. package/fesm2022/yuuvis-client-framework-icons.mjs.map +1 -1
  58. package/fesm2022/yuuvis-client-framework-list.mjs +81 -45
  59. package/fesm2022/yuuvis-client-framework-list.mjs.map +1 -1
  60. package/fesm2022/yuuvis-client-framework-master-details.mjs +112 -0
  61. package/fesm2022/yuuvis-client-framework-master-details.mjs.map +1 -0
  62. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs +60 -0
  63. package/fesm2022/yuuvis-client-framework-metadata-form-defaults.mjs.map +1 -0
  64. package/fesm2022/yuuvis-client-framework-metadata-form.mjs +125 -100
  65. package/fesm2022/yuuvis-client-framework-metadata-form.mjs.map +1 -1
  66. package/fesm2022/yuuvis-client-framework-object-details.mjs +49 -59
  67. package/fesm2022/yuuvis-client-framework-object-details.mjs.map +1 -1
  68. package/fesm2022/yuuvis-client-framework-object-flavor.mjs +188 -77
  69. package/fesm2022/yuuvis-client-framework-object-flavor.mjs.map +1 -1
  70. package/fesm2022/yuuvis-client-framework-object-form.mjs +99 -184
  71. package/fesm2022/yuuvis-client-framework-object-form.mjs.map +1 -1
  72. package/fesm2022/yuuvis-client-framework-object-preview.mjs +11 -11
  73. package/fesm2022/yuuvis-client-framework-object-preview.mjs.map +1 -1
  74. package/fesm2022/yuuvis-client-framework-object-summary.mjs +46 -42
  75. package/fesm2022/yuuvis-client-framework-object-summary.mjs.map +1 -1
  76. package/fesm2022/yuuvis-client-framework-overflow-menu.mjs +126 -0
  77. package/fesm2022/yuuvis-client-framework-overflow-menu.mjs.map +1 -0
  78. package/fesm2022/yuuvis-client-framework-pagination.mjs +7 -9
  79. package/fesm2022/yuuvis-client-framework-pagination.mjs.map +1 -1
  80. package/fesm2022/yuuvis-client-framework-panel.mjs +8 -7
  81. package/fesm2022/yuuvis-client-framework-panel.mjs.map +1 -1
  82. package/fesm2022/yuuvis-client-framework-popout.mjs +212 -0
  83. package/fesm2022/yuuvis-client-framework-popout.mjs.map +1 -0
  84. package/fesm2022/yuuvis-client-framework-renderer.mjs +99 -72
  85. package/fesm2022/yuuvis-client-framework-renderer.mjs.map +1 -1
  86. package/fesm2022/yuuvis-client-framework-sequence-list.mjs +29 -112
  87. package/fesm2022/yuuvis-client-framework-sequence-list.mjs.map +1 -1
  88. package/fesm2022/yuuvis-client-framework-simple-search.mjs +40 -21
  89. package/fesm2022/yuuvis-client-framework-simple-search.mjs.map +1 -1
  90. package/fesm2022/yuuvis-client-framework-split-view.mjs +188 -0
  91. package/fesm2022/yuuvis-client-framework-split-view.mjs.map +1 -0
  92. package/fesm2022/yuuvis-client-framework-tile-list.mjs +100 -93
  93. package/fesm2022/yuuvis-client-framework-tile-list.mjs.map +1 -1
  94. package/fesm2022/yuuvis-client-framework-tree.mjs +15 -15
  95. package/fesm2022/yuuvis-client-framework-tree.mjs.map +1 -1
  96. package/fesm2022/yuuvis-client-framework-upload-progress.mjs +16 -21
  97. package/fesm2022/yuuvis-client-framework-upload-progress.mjs.map +1 -1
  98. package/fesm2022/yuuvis-client-framework.mjs +4 -4
  99. package/fesm2022/yuuvis-client-framework.mjs.map +1 -1
  100. package/forms/index.d.ts +7 -1
  101. package/forms/lib/elements/catalog/catalog.component.d.ts +17 -56
  102. package/forms/lib/elements/data-grid/edit-table-data/edit-data.component.d.ts +5 -4
  103. package/forms/lib/elements/datetime/datetime.component.d.ts +19 -10
  104. package/forms/lib/elements/datetime-range/datetime-range.component.d.ts +12 -27
  105. package/forms/lib/elements/index.d.ts +0 -1
  106. package/forms/lib/elements/number/number.component.d.ts +21 -30
  107. package/forms/lib/elements/number-range/number-range.component.d.ts +12 -7
  108. package/forms/lib/elements/organization/organization.component.d.ts +23 -51
  109. package/forms/lib/elements/range-select-date/range-select-date.component.d.ts +12 -7
  110. package/forms/lib/elements/range-select-filesize/range-select-filesize.component.d.ts +12 -7
  111. package/forms/lib/elements/string/string.component.d.ts +15 -20
  112. package/forms/lib/forms.module.d.ts +8 -11
  113. package/icons/index.d.ts +1 -0
  114. package/icons/lib/icon.component.d.ts +20 -0
  115. package/lib/assets/i18n/de.json +7 -23
  116. package/lib/assets/i18n/en.json +10 -26
  117. package/list/index.d.ts +1 -0
  118. package/list/lib/list-item.directive.d.ts +5 -4
  119. package/list/lib/list.component.d.ts +6 -3
  120. package/list/lib/list.module.d.ts +8 -0
  121. package/master-details/README.md +3 -0
  122. package/master-details/index.d.ts +2 -0
  123. package/master-details/lib/master-details.component.d.ts +58 -0
  124. package/master-details/lib/master-details.interface.d.ts +7 -0
  125. package/master-details/lib/master-details.module.d.ts +7 -0
  126. package/metadata-form/index.d.ts +4 -1
  127. package/metadata-form/lib/metadata-form-field/metadata-form-field.component.d.ts +4 -17
  128. package/metadata-form/lib/metadata-form-field/metadata-form-field.interface.d.ts +11 -0
  129. package/metadata-form/lib/object-metadata-element-error.directive.d.ts +13 -0
  130. package/metadata-form/lib/object-metadata-element-label.directive.d.ts +10 -0
  131. package/metadata-form/lib/object-metadata-element-template.directive.d.ts +3 -3
  132. package/metadata-form-defaults/README.md +3 -0
  133. package/metadata-form-defaults/index.d.ts +2 -0
  134. package/metadata-form-defaults/lib/metadata-form-defaults.module.d.ts +7 -0
  135. package/object-details/lib/object-audit/object-audit.component.d.ts +3 -9
  136. package/object-details/lib/object-details.component.d.ts +0 -2
  137. package/object-details/lib/object-metadata/object-metadata.component.d.ts +4 -3
  138. package/object-details/lib/retention-badge/retention-badge.component.d.ts +0 -3
  139. package/object-flavor/index.d.ts +1 -0
  140. package/object-flavor/lib/abstract-apply-create-flavor/abstract-apply-create-flavor.component.d.ts +1 -2
  141. package/object-flavor/lib/abstract-apply-object-flavor/abstract-apply-object-flavor.component.d.ts +3 -2
  142. package/object-flavor/lib/default-apply-flavor/default-apply-flavor.component.d.ts +19 -0
  143. package/object-flavor/lib/flavor-chip/flavor-chip.component.d.ts +1 -1
  144. package/object-flavor/lib/object-flavor/object-flavor.component.d.ts +3 -6
  145. package/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.d.ts +0 -1
  146. package/object-form/index.d.ts +1 -1
  147. package/object-form/lib/object-form-element/object-form-element.component.d.ts +2 -2
  148. package/object-form/lib/object-form-group/object-form-group.component.d.ts +1 -3
  149. package/object-form/lib/object-form.component.d.ts +2 -2
  150. package/object-form/lib/object-form.interface.d.ts +0 -44
  151. package/object-form/lib/object-form.module.d.ts +7 -0
  152. package/object-form/lib/object-form.service.d.ts +1 -2
  153. package/object-form/lib/object-form.utils.d.ts +1 -1
  154. package/object-summary/lib/object-summary/object-summary.component.d.ts +13 -15
  155. package/overflow-menu/README.md +3 -0
  156. package/overflow-menu/index.d.ts +3 -0
  157. package/overflow-menu/lib/overflow-menu.component.d.ts +31 -0
  158. package/overflow-menu/lib/overflow-menu.interface.d.ts +9 -0
  159. package/overflow-menu/lib/overflow-menu.module.d.ts +7 -0
  160. package/package.json +43 -69
  161. package/popout/README.md +3 -0
  162. package/popout/index.d.ts +3 -0
  163. package/popout/lib/popout.component.d.ts +58 -0
  164. package/popout/lib/popout.interface.d.ts +17 -0
  165. package/popout/lib/popout.module.d.ts +7 -0
  166. package/renderer/lib/property-renderer/abstract.renderer.d.ts +4 -4
  167. package/renderer/lib/property-renderer/icon.renderer.component.d.ts +2 -0
  168. package/renderer/lib/renderer.directive.d.ts +4 -3
  169. package/sequence-list/index.d.ts +0 -1
  170. package/sequence-list/lib/sequence-list.component.d.ts +0 -4
  171. package/simple-search/index.d.ts +0 -1
  172. package/simple-search/lib/simple-search/simple-search.component.d.ts +6 -10
  173. package/split-view/README.md +3 -0
  174. package/split-view/index.d.ts +4 -0
  175. package/split-view/lib/split-area.directive.d.ts +16 -0
  176. package/split-view/lib/split-view.component.d.ts +76 -0
  177. package/split-view/lib/split-view.interface.d.ts +10 -0
  178. package/split-view/lib/split-view.module.d.ts +8 -0
  179. package/styles/client-framework.scss +21 -67
  180. package/tile-list/lib/tile/tile.component.d.ts +1 -2
  181. package/tile-list/lib/tile-config/property-select/property-select.component.d.ts +0 -1
  182. package/tile-list/lib/tile-config/tile-config-trigger/tile-config-trigger.component.d.ts +1 -2
  183. package/tile-list/lib/tile-config/tile-config.component.d.ts +0 -3
  184. package/tile-list/lib/tile-list/tile-list.component.d.ts +5 -5
  185. package/upload-progress/lib/upload-progress/upload-progress-overlay/upload-progress-overlay.component.d.ts +0 -5
  186. package/upload-progress/lib/upload-progress/upload-progress.component.d.ts +0 -4
  187. package/common/lib/components/focus-indicator/focus-indicator.component.d.ts +0 -7
  188. package/common/lib/components/token-input/token-input.component.d.ts +0 -55
  189. package/common/lib/components/token-input/token-input.interface.d.ts +0 -8
  190. package/common/lib/services/error-messages/error-messages.service.d.ts +0 -7
  191. package/esm2022/actions/index.mjs +0 -7
  192. package/esm2022/actions/lib/actions/copy-action/copy-action.mjs +0 -31
  193. package/esm2022/actions/lib/actions/cut-action/cut-action.mjs +0 -30
  194. package/esm2022/actions/lib/actions/delete-action/delete/delete.component.mjs +0 -67
  195. package/esm2022/actions/lib/actions/delete-action/delete-action.mjs +0 -38
  196. package/esm2022/actions/lib/actions/download-action/download-action.mjs +0 -33
  197. package/esm2022/actions/lib/actions.icon.mjs +0 -8
  198. package/esm2022/actions/lib/actions.interface.mjs +0 -19
  199. package/esm2022/actions/lib/actions.module.mjs +0 -16
  200. package/esm2022/actions/lib/actions.service.mjs +0 -89
  201. package/esm2022/actions/lib/components/contextmenu/contextmenu.component.mjs +0 -27
  202. package/esm2022/actions/yuuvis-client-framework-actions.mjs +0 -5
  203. package/esm2022/app-bar/index.mjs +0 -2
  204. package/esm2022/app-bar/lib/app-bar.component.mjs +0 -89
  205. package/esm2022/app-bar/yuuvis-client-framework-app-bar.mjs +0 -5
  206. package/esm2022/clipboard/index.mjs +0 -2
  207. package/esm2022/clipboard/lib/clipboard.component.mjs +0 -48
  208. package/esm2022/clipboard/yuuvis-client-framework-clipboard.mjs +0 -5
  209. package/esm2022/common/index.mjs +0 -7
  210. package/esm2022/common/lib/components/focus-indicator/focus-indicator.component.mjs +0 -41
  211. package/esm2022/common/lib/components/token-input/token-input.component.mjs +0 -324
  212. package/esm2022/common/lib/components/token-input/token-input.interface.mjs +0 -2
  213. package/esm2022/common/lib/directives/busy-overlay.directive.mjs +0 -88
  214. package/esm2022/common/lib/directives/click-double.directive.mjs +0 -61
  215. package/esm2022/common/lib/directives/container-size.directive.mjs +0 -56
  216. package/esm2022/common/lib/directives/drag-select.directive.mjs +0 -114
  217. package/esm2022/common/lib/directives/file-drop-zone/file-drop-zone.directive.mjs +0 -153
  218. package/esm2022/common/lib/directives/file-drop-zone/file-drop-zone.interface.mjs +0 -2
  219. package/esm2022/common/lib/directives/focus-within.directive.mjs +0 -81
  220. package/esm2022/common/lib/directives/index.mjs +0 -9
  221. package/esm2022/common/lib/directives/light-dismiss.directive.mjs +0 -44
  222. package/esm2022/common/lib/directives/longpress.directive.mjs +0 -36
  223. package/esm2022/common/lib/directives/noop-value-accessor.directive.mjs +0 -42
  224. package/esm2022/common/lib/services/error-messages/error-messages.service.mjs +0 -68
  225. package/esm2022/common/lib/services/index.mjs +0 -2
  226. package/esm2022/common/yuuvis-client-framework-common.mjs +0 -5
  227. package/esm2022/forms/index.mjs +0 -24
  228. package/esm2022/forms/lib/elements/catalog/catalog.component.mjs +0 -118
  229. package/esm2022/forms/lib/elements/data-grid/data-grid/data-grid.component.mjs +0 -172
  230. package/esm2022/forms/lib/elements/data-grid/edit-table-data/edit-data.component.mjs +0 -95
  231. package/esm2022/forms/lib/elements/data-grid/model/data-grid.interface.mjs +0 -9
  232. package/esm2022/forms/lib/elements/datetime/datetime.component.mjs +0 -82
  233. package/esm2022/forms/lib/elements/datetime-range/datetime-range.component.mjs +0 -166
  234. package/esm2022/forms/lib/elements/index.mjs +0 -11
  235. package/esm2022/forms/lib/elements/number/number.component.mjs +0 -195
  236. package/esm2022/forms/lib/elements/number-range/number-range.component.mjs +0 -176
  237. package/esm2022/forms/lib/elements/organization/organization.component.mjs +0 -286
  238. package/esm2022/forms/lib/elements/range-select-date/date-range-picker/date-range-picker.component.mjs +0 -38
  239. package/esm2022/forms/lib/elements/range-select-date/range-select-date.component.mjs +0 -181
  240. package/esm2022/forms/lib/elements/range-select-date/range-select-date.interface.mjs +0 -2
  241. package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.component.mjs +0 -98
  242. package/esm2022/forms/lib/elements/range-select-filesize/range-select-filesize.interface.mjs +0 -2
  243. package/esm2022/forms/lib/elements/string/string.component.mjs +0 -261
  244. package/esm2022/forms/lib/form-input/form-input.component.mjs +0 -88
  245. package/esm2022/forms/lib/forms.module.mjs +0 -58
  246. package/esm2022/forms/yuuvis-client-framework-forms.mjs +0 -5
  247. package/esm2022/icons/index.mjs +0 -4
  248. package/esm2022/icons/lib/icon.service.mjs +0 -59
  249. package/esm2022/icons/lib/icons.mjs +0 -32
  250. package/esm2022/icons/lib/object-type-icon/object-type-icon.component.mjs +0 -29
  251. package/esm2022/icons/yuuvis-client-framework-icons.mjs +0 -5
  252. package/esm2022/index.mjs +0 -2
  253. package/esm2022/lib/yuuvis-client-framework.module.mjs +0 -15
  254. package/esm2022/list/index.mjs +0 -3
  255. package/esm2022/list/lib/list-item.directive.mjs +0 -72
  256. package/esm2022/list/lib/list.component.mjs +0 -135
  257. package/esm2022/list/yuuvis-client-framework-list.mjs +0 -5
  258. package/esm2022/metadata-form/index.mjs +0 -4
  259. package/esm2022/metadata-form/lib/metadata-default-templates/metadata-default-templates.component.mjs +0 -32
  260. package/esm2022/metadata-form/lib/metadata-form-element-registry.service.mjs +0 -99
  261. package/esm2022/metadata-form/lib/metadata-form-field/metadata-form-field.component.mjs +0 -83
  262. package/esm2022/metadata-form/lib/object-metadata-element-template.directive.mjs +0 -52
  263. package/esm2022/metadata-form/yuuvis-client-framework-metadata-form.mjs +0 -5
  264. package/esm2022/object-details/index.mjs +0 -8
  265. package/esm2022/object-details/lib/object-audit/object-audit.component.mjs +0 -195
  266. package/esm2022/object-details/lib/object-details-shell/object-details-shell.component.mjs +0 -127
  267. package/esm2022/object-details/lib/object-details.component.mjs +0 -61
  268. package/esm2022/object-details/lib/object-metadata/form-section-group.pipe.mjs +0 -17
  269. package/esm2022/object-details/lib/object-metadata/object-metadata.component.mjs +0 -202
  270. package/esm2022/object-details/lib/object-metadata/object-metadata.interface.mjs +0 -2
  271. package/esm2022/object-details/lib/retention-badge/retention-badge.component.mjs +0 -27
  272. package/esm2022/object-details/yuuvis-client-framework-object-details.mjs +0 -5
  273. package/esm2022/object-flavor/index.mjs +0 -6
  274. package/esm2022/object-flavor/lib/abstract-apply-create-flavor/abstract-apply-create-flavor.component.mjs +0 -25
  275. package/esm2022/object-flavor/lib/abstract-apply-object-flavor/abstract-apply-object-flavor.component.mjs +0 -21
  276. package/esm2022/object-flavor/lib/flavor-chip/flavor-chip.component.mjs +0 -35
  277. package/esm2022/object-flavor/lib/object-flavor/object-flavor.component.mjs +0 -93
  278. package/esm2022/object-flavor/lib/object-flavor-picker/object-flavor-picker.component.mjs +0 -43
  279. package/esm2022/object-flavor/yuuvis-client-framework-object-flavor.mjs +0 -5
  280. package/esm2022/object-form/index.mjs +0 -5
  281. package/esm2022/object-form/lib/form-scripting.api.interface.mjs +0 -2
  282. package/esm2022/object-form/lib/form-scripting.service.mjs +0 -160
  283. package/esm2022/object-form/lib/object-form-element/object-form-element.component.mjs +0 -87
  284. package/esm2022/object-form/lib/object-form-extension.interface.mjs +0 -36
  285. package/esm2022/object-form/lib/object-form-group/object-form-group.component.mjs +0 -85
  286. package/esm2022/object-form/lib/object-form-script/form-scripting-element-extension/form-scripting-element-extension.component.mjs +0 -23
  287. package/esm2022/object-form/lib/object-form-script/object-form-script.service.mjs +0 -115
  288. package/esm2022/object-form/lib/object-form-script/object-form-scripting-scope.mjs +0 -251
  289. package/esm2022/object-form/lib/object-form-translate.service.mjs +0 -73
  290. package/esm2022/object-form/lib/object-form.component.mjs +0 -628
  291. package/esm2022/object-form/lib/object-form.interface.mjs +0 -9
  292. package/esm2022/object-form/lib/object-form.model.mjs +0 -20
  293. package/esm2022/object-form/lib/object-form.service.mjs +0 -130
  294. package/esm2022/object-form/lib/object-form.utils.mjs +0 -55
  295. package/esm2022/object-form/lib/object-form.validation.mjs +0 -48
  296. package/esm2022/object-form/yuuvis-client-framework-object-form.mjs +0 -5
  297. package/esm2022/object-preview/index.mjs +0 -3
  298. package/esm2022/object-preview/lib/components/index.mjs +0 -3
  299. package/esm2022/object-preview/lib/components/object-email-preview/object-email-preview.component.mjs +0 -45
  300. package/esm2022/object-preview/lib/components/object-preview/object-preview.component.mjs +0 -78
  301. package/esm2022/object-preview/lib/services/object-preview.service.mjs +0 -119
  302. package/esm2022/object-preview/yuuvis-client-framework-object-preview.mjs +0 -5
  303. package/esm2022/object-summary/index.mjs +0 -5
  304. package/esm2022/object-summary/lib/multi-object-summary/multi-object-summary.component.mjs +0 -33
  305. package/esm2022/object-summary/lib/object-summary/object-summary.component.mjs +0 -275
  306. package/esm2022/object-summary/lib/object-summary-data/object-summary-data.component.mjs +0 -80
  307. package/esm2022/object-summary/lib/object-summary.module.mjs +0 -15
  308. package/esm2022/object-summary/yuuvis-client-framework-object-summary.mjs +0 -5
  309. package/esm2022/pagination/index.mjs +0 -3
  310. package/esm2022/pagination/lib/pagination.component.mjs +0 -46
  311. package/esm2022/pagination/lib/pagination.interface.mjs +0 -2
  312. package/esm2022/pagination/yuuvis-client-framework-pagination.mjs +0 -5
  313. package/esm2022/panel/index.mjs +0 -2
  314. package/esm2022/panel/lib/panel.component.mjs +0 -20
  315. package/esm2022/panel/yuuvis-client-framework-panel.mjs +0 -5
  316. package/esm2022/renderer/index.mjs +0 -11
  317. package/esm2022/renderer/lib/property-renderer/abstract.renderer.mjs +0 -29
  318. package/esm2022/renderer/lib/property-renderer/datetime.renderer.mjs +0 -13
  319. package/esm2022/renderer/lib/property-renderer/decimal.renderer.component.mjs +0 -12
  320. package/esm2022/renderer/lib/property-renderer/filesize.renderer.component.mjs +0 -28
  321. package/esm2022/renderer/lib/property-renderer/icon.renderer.component.mjs +0 -23
  322. package/esm2022/renderer/lib/property-renderer/integer.renderer.component.mjs +0 -12
  323. package/esm2022/renderer/lib/property-renderer/organization.renderer.mjs +0 -19
  324. package/esm2022/renderer/lib/property-renderer/string.renderer.component.mjs +0 -12
  325. package/esm2022/renderer/lib/property-renderer/unknown.renderer.mjs +0 -12
  326. package/esm2022/renderer/lib/renderer.directive.mjs +0 -51
  327. package/esm2022/renderer/lib/services/renderer/renderer.interface.mjs +0 -2
  328. package/esm2022/renderer/lib/services/renderer/renderer.service.mjs +0 -84
  329. package/esm2022/renderer/yuuvis-client-framework-renderer.mjs +0 -5
  330. package/esm2022/sequence-list/index.mjs +0 -4
  331. package/esm2022/sequence-list/lib/due-date-picker/due-date-picker.component.mjs +0 -99
  332. package/esm2022/sequence-list/lib/sequence-list.component.mjs +0 -141
  333. package/esm2022/sequence-list/lib/sequence-list.interface.mjs +0 -2
  334. package/esm2022/sequence-list/yuuvis-client-framework-sequence-list.mjs +0 -5
  335. package/esm2022/simple-search/index.mjs +0 -3
  336. package/esm2022/simple-search/lib/simple-search/simple-search.component.mjs +0 -111
  337. package/esm2022/simple-search/lib/simple-search/simple-search.interface.mjs +0 -2
  338. package/esm2022/simple-search/yuuvis-client-framework-simple-search.mjs +0 -5
  339. package/esm2022/tile-list/index.mjs +0 -11
  340. package/esm2022/tile-list/lib/tile/tile.component.mjs +0 -53
  341. package/esm2022/tile-list/lib/tile-config/action-select/action-select.component.mjs +0 -25
  342. package/esm2022/tile-list/lib/tile-config/icon-select/icon-select.component.mjs +0 -33
  343. package/esm2022/tile-list/lib/tile-config/property-select/property-select.component.mjs +0 -91
  344. package/esm2022/tile-list/lib/tile-config/tile-config-tile/tile-config-tile.component.mjs +0 -66
  345. package/esm2022/tile-list/lib/tile-config/tile-config-trigger/tile-config-trigger.component.mjs +0 -46
  346. package/esm2022/tile-list/lib/tile-config/tile-config.component.mjs +0 -156
  347. package/esm2022/tile-list/lib/tile-extension/directive/tile-extension.directive.mjs +0 -37
  348. package/esm2022/tile-list/lib/tile-extension/extensions/email.extension.mjs +0 -42
  349. package/esm2022/tile-list/lib/tile-extension/tile-extension.service.mjs +0 -35
  350. package/esm2022/tile-list/lib/tile-list/tile-list.component.mjs +0 -510
  351. package/esm2022/tile-list/lib/tile-list/tile-list.interface.mjs +0 -2
  352. package/esm2022/tile-list/yuuvis-client-framework-tile-list.mjs +0 -5
  353. package/esm2022/token-search/index.mjs +0 -3
  354. package/esm2022/token-search/token-search.component.mjs +0 -78
  355. package/esm2022/token-search/token-search.interface.mjs +0 -2
  356. package/esm2022/token-search/yuuvis-client-framework-token-search.mjs +0 -5
  357. package/esm2022/tree/index.mjs +0 -3
  358. package/esm2022/tree/lib/tree-node/tree-node.component.mjs +0 -65
  359. package/esm2022/tree/lib/tree.component.mjs +0 -148
  360. package/esm2022/tree/lib/tree.interface.mjs +0 -2
  361. package/esm2022/tree/lib/tree.service.mjs +0 -95
  362. package/esm2022/tree/yuuvis-client-framework-tree.mjs +0 -5
  363. package/esm2022/upload-progress/index.mjs +0 -2
  364. package/esm2022/upload-progress/lib/upload-progress/upload-progress-overlay/upload-progress-overlay.component.mjs +0 -49
  365. package/esm2022/upload-progress/lib/upload-progress/upload-progress.component.mjs +0 -37
  366. package/esm2022/upload-progress/yuuvis-client-framework-upload-progress.mjs +0 -5
  367. package/esm2022/user-avatar/index.mjs +0 -3
  368. package/esm2022/user-avatar/lib/user-avatar.component.mjs +0 -69
  369. package/esm2022/user-avatar/lib/user-avatar.module.mjs +0 -24
  370. package/esm2022/user-avatar/yuuvis-client-framework-user-avatar.mjs +0 -5
  371. package/esm2022/yuuvis-client-framework.mjs +0 -5
  372. package/fesm2022/yuuvis-client-framework-token-search.mjs +0 -85
  373. package/fesm2022/yuuvis-client-framework-token-search.mjs.map +0 -1
  374. package/fesm2022/yuuvis-client-framework-user-avatar.mjs +0 -96
  375. package/fesm2022/yuuvis-client-framework-user-avatar.mjs.map +0 -1
  376. package/forms/lib/form-input/form-input.component.d.ts +0 -48
  377. package/object-form/lib/object-form-translate.service.d.ts +0 -15
  378. package/object-form/lib/object-form.model.d.ts +0 -18
  379. package/sequence-list/lib/due-date-picker/due-date-picker.component.d.ts +0 -28
  380. package/simple-search/lib/simple-search/simple-search.interface.d.ts +0 -4
  381. package/token-search/README.md +0 -3
  382. package/token-search/index.d.ts +0 -2
  383. package/token-search/token-search.component.d.ts +0 -22
  384. package/token-search/token-search.interface.d.ts +0 -4
  385. package/user-avatar/README.md +0 -3
  386. package/user-avatar/index.d.ts +0 -2
  387. package/user-avatar/lib/user-avatar.component.d.ts +0 -44
  388. package/user-avatar/lib/user-avatar.module.d.ts +0 -8
  389. /package/{metadata-form → metadata-form-defaults}/lib/metadata-default-templates/metadata-default-templates.component.d.ts +0 -0
@@ -1,15 +1,143 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Directive, HostBinding, Input, EventEmitter, HostListener, Output, input, output, NgZone, contentChildren, computed, viewChild, contentChild, Component, forwardRef, Injectable } from '@angular/core';
3
- import { Utils, TranslateService } from '@yuuvis/client-core';
2
+ import { input, ChangeDetectionStrategy, Component, inject, ElementRef, Input, Directive, computed, EnvironmentInjector, ApplicationRef, createComponent, HostBinding, EventEmitter, HostListener, Output, NgZone, output, contentChildren, forwardRef, NgModule, Injectable, signal } from '@angular/core';
3
+ import { CommonModule, DOCUMENT } from '@angular/common';
4
+ import * as i1 from '@angular/material/button';
5
+ import { MatButtonModule } from '@angular/material/button';
6
+ import * as i2 from '@angular/material/dialog';
7
+ import { MatDialogActions, MatDialogTitle, MatDialogContent, MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
8
+ import { TranslateModule } from '@ngx-translate/core';
9
+ import { Utils } from '@yuuvis/client-core';
10
+ import { MatProgressSpinner } from '@angular/material/progress-spinner';
4
11
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { Subject, fromEvent, merge, timer, of, filter as filter$1 } from 'rxjs';
6
- import { debounceTime, filter, map, switchMap } from 'rxjs/operators';
7
- import * as i1 from '@angular/common';
8
- import { CommonModule } from '@angular/common';
9
- import { YvcOverlayService } from '@yuuvis/components/overlay';
10
- import * as i2 from '@yuuvis/components/autocomplete';
11
- import { YvcAutocompleteModule } from '@yuuvis/components/autocomplete';
12
+ import { Subject, fromEvent, merge, timer, of } from 'rxjs';
13
+ import { debounceTime, tap, filter, switchMap, map, takeUntil } from 'rxjs/operators';
12
14
  import { NG_VALUE_ACCESSOR, NgControl, FormControlDirective, FormControlName, NgModel } from '@angular/forms';
15
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
16
+
17
+ class DialogComponent {
18
+ constructor() {
19
+ this.headertitel = input(null);
20
+ }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
22
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: DialogComponent, isStandalone: true, selector: "yuv-dialog", inputs: { headertitel: { classPropertyName: "headertitel", publicName: "headertitel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
23
+ @let title = headertitel();
24
+ @if (title) {
25
+ <h2 mat-dialog-title>
26
+ {{ title }}
27
+ </h2>
28
+ }
29
+ <mat-dialog-content>
30
+ <ng-content select="main"></ng-content>
31
+ </mat-dialog-content>
32
+
33
+ <mat-dialog-actions align="end" class="footer">
34
+ <ng-content select="footer"></ng-content>
35
+ </mat-dialog-actions>
36
+ `, isInline: true, styles: [":host{display:contents}h2{border-bottom:1px solid var(--ymt-outline-variant);font-size:var(--yuv-font-size-headline);font-weight:500}.mat-mdc-dialog-container{height:100%}mat-dialog-content{display:var(--ymt-dialog-content-display)}.footer{border-top:1px solid var(--ymt-outline-variant);gap:calc(var(--ymt-font-body) / 2)}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
37
+ }
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DialogComponent, decorators: [{
39
+ type: Component,
40
+ args: [{ selector: 'yuv-dialog', imports: [TranslateModule, MatDialogActions, MatDialogTitle, MatDialogContent], template: `
41
+ @let title = headertitel();
42
+ @if (title) {
43
+ <h2 mat-dialog-title>
44
+ {{ title }}
45
+ </h2>
46
+ }
47
+ <mat-dialog-content>
48
+ <ng-content select="main"></ng-content>
49
+ </mat-dialog-content>
50
+
51
+ <mat-dialog-actions align="end" class="footer">
52
+ <ng-content select="footer"></ng-content>
53
+ </mat-dialog-actions>
54
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:contents}h2{border-bottom:1px solid var(--ymt-outline-variant);font-size:var(--yuv-font-size-headline);font-weight:500}.mat-mdc-dialog-container{height:100%}mat-dialog-content{display:var(--ymt-dialog-content-display)}.footer{border-top:1px solid var(--ymt-outline-variant);gap:calc(var(--ymt-font-body) / 2)}\n"] }]
55
+ }] });
56
+
57
+ class ConfirmComponent {
58
+ constructor() {
59
+ this.dialogData = inject(MAT_DIALOG_DATA);
60
+ }
61
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
62
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: ConfirmComponent, isStandalone: true, selector: "yuv-confirm", ngImport: i0, template: "<yuv-dialog [headertitel]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button mat-stroked-button mat-dialog-close class=\"secondary\" type=\"button\">\n {{ dialogData.cancelLabel || 'Cancel' }}\n </button>\n }\n <button mat-flat-button class=\"primary\" type=\"button\" [mat-dialog-close]=\"true\">{{ dialogData.confirmLabel || 'Confirm' }}</button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitel"] }] }); }
63
+ }
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmComponent, decorators: [{
65
+ type: Component,
66
+ args: [{ selector: 'yuv-confirm', imports: [CommonModule, MatButtonModule, MatDialogModule, DialogComponent], template: "<yuv-dialog [headertitel]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button mat-stroked-button mat-dialog-close class=\"secondary\" type=\"button\">\n {{ dialogData.cancelLabel || 'Cancel' }}\n </button>\n }\n <button mat-flat-button class=\"primary\" type=\"button\" [mat-dialog-close]=\"true\">{{ dialogData.confirmLabel || 'Confirm' }}</button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"] }]
67
+ }] });
68
+
69
+ /**
70
+ * Directive putting focus on a 'focusable' child element.
71
+ * By default the first focusable child will receive focus.
72
+ */
73
+ class AutofocusChildDirective {
74
+ #elRef = inject(ElementRef);
75
+ #targetIndex = 0;
76
+ set yuvAutofocusChild(s) {
77
+ const i = parseInt(s);
78
+ this.#targetIndex = !isNaN(i) ? i : 0;
79
+ }
80
+ #getFirstFocusableChild() {
81
+ const focusableElements = [
82
+ ...this.#elRef.nativeElement.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')
83
+ ].filter((el) => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden'));
84
+ return focusableElements[this.#targetIndex];
85
+ }
86
+ ngAfterViewInit() {
87
+ setTimeout(() => {
88
+ const focusEl = this.#getFirstFocusableChild();
89
+ if (focusEl)
90
+ focusEl.focus();
91
+ });
92
+ }
93
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusChildDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
94
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: AutofocusChildDirective, isStandalone: true, selector: "[yuvAutofocusChild]", inputs: { yuvAutofocusChild: "yuvAutofocusChild" }, ngImport: i0 }); }
95
+ }
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusChildDirective, decorators: [{
97
+ type: Directive,
98
+ args: [{
99
+ selector: '[yuvAutofocusChild]',
100
+ standalone: true
101
+ }]
102
+ }], propDecorators: { yuvAutofocusChild: [{
103
+ type: Input
104
+ }] } });
105
+
106
+ /**
107
+ * Directive putting delayed focus on an element. If no
108
+ * delay is set, the focus will be set immediately.
109
+ *
110
+ * You have to ensure that the element is focusable when adding this directive to it.
111
+ */
112
+ class AutofocusDelayedDirective {
113
+ constructor() {
114
+ this.#elRef = inject(ElementRef);
115
+ /**
116
+ * Sets the delay in milliseconds. If no delay is set, the focus will be set immediately.
117
+ */
118
+ this.yuvAutofocusDelayed = input(0);
119
+ this.#delay = computed(() => {
120
+ const d = this.yuvAutofocusDelayed();
121
+ return typeof d === 'string' ? parseInt(d) : d;
122
+ });
123
+ }
124
+ #elRef;
125
+ #delay;
126
+ ngAfterViewInit() {
127
+ setTimeout(() => {
128
+ this.#elRef.nativeElement.focus();
129
+ }, this.#delay());
130
+ }
131
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusDelayedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
132
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.1", type: AutofocusDelayedDirective, isStandalone: true, selector: "[yuvAutofocusDelayed]", inputs: { yuvAutofocusDelayed: { classPropertyName: "yuvAutofocusDelayed", publicName: "yuvAutofocusDelayed", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
133
+ }
134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AutofocusDelayedDirective, decorators: [{
135
+ type: Directive,
136
+ args: [{
137
+ selector: '[yuvAutofocusDelayed]',
138
+ standalone: true
139
+ }]
140
+ }] });
13
141
 
14
142
  /**
15
143
  * A directive that will overlay its host component with a translucent background
@@ -27,9 +155,13 @@ class BusyOverlayDirective {
27
155
  constructor() {
28
156
  this.stylePosition = 'initial';
29
157
  this.#elRef = inject(ElementRef);
158
+ this.#environmentInjector = inject(EnvironmentInjector);
159
+ this.#applicationRef = inject(ApplicationRef);
30
160
  this.#overlayId = null;
31
161
  }
32
162
  #elRef;
163
+ #environmentInjector;
164
+ #applicationRef;
33
165
  #overlayId;
34
166
  /**
35
167
  * The Boolean expression to evaluate as the condition for showing the busy overlay
@@ -42,6 +174,18 @@ class BusyOverlayDirective {
42
174
  this.#removeBusyOverlay();
43
175
  }
44
176
  }
177
+ #createSpinner(mode = 'indeterminate', value = 0, color) {
178
+ const componentRef = createComponent(MatProgressSpinner, {
179
+ environmentInjector: this.#environmentInjector,
180
+ });
181
+ this.#applicationRef.attachView(componentRef.hostView);
182
+ componentRef.changeDetectorRef.detectChanges();
183
+ componentRef.setInput('mode', mode);
184
+ componentRef.setInput('value', value);
185
+ componentRef.setInput('color', color);
186
+ componentRef.location.nativeElement.classList.add('ymt-progress-spinner--giant');
187
+ return componentRef;
188
+ }
45
189
  #addBusyOverlay() {
46
190
  this.stylePosition = 'relative';
47
191
  const overlay = document.createElement('div');
@@ -53,12 +197,13 @@ class BusyOverlayDirective {
53
197
  overlay.style.alignItems = 'center';
54
198
  overlay.style.justifyContent = 'center';
55
199
  overlay.style.zIndex = '5';
56
- overlay.style.backgroundColor = 'var(--busy-overlay-background)';
200
+ overlay.style.backgroundColor = 'var(--busy-overlay-background, rgba(0, 0, 0, 0.32))';
57
201
  this.#overlayId = `p${Utils.uuid()}`;
58
202
  overlay.setAttribute('id', this.#overlayId);
59
- const spinner = document.createElement('div');
60
- spinner.setAttribute('class', 'yuv-loader');
61
- overlay.append(spinner);
203
+ // const spinner = document.createElement('div');
204
+ // spinner.setAttribute('class', 'yuv-loader');
205
+ // overlay.append(spinner);
206
+ overlay.append(this.#createSpinner('indeterminate').location.nativeElement);
62
207
  const el = this.#elRef.nativeElement;
63
208
  el.setAttribute('inert', '');
64
209
  el.append(overlay);
@@ -80,10 +225,10 @@ class BusyOverlayDirective {
80
225
  ngOnInit() {
81
226
  this.stylePosition = getComputedStyle(this.#elRef.nativeElement).position;
82
227
  }
83
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BusyOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
84
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: BusyOverlayDirective, isStandalone: true, selector: "[yuvBusyOverlay]", inputs: { yuvBusyOverlay: "yuvBusyOverlay" }, host: { properties: { "style.position": "this.stylePosition" } }, ngImport: i0 }); }
228
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BusyOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
229
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: BusyOverlayDirective, isStandalone: true, selector: "[yuvBusyOverlay]", inputs: { yuvBusyOverlay: "yuvBusyOverlay" }, host: { properties: { "style.position": "this.stylePosition" } }, ngImport: i0 }); }
85
230
  }
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BusyOverlayDirective, decorators: [{
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: BusyOverlayDirective, decorators: [{
87
232
  type: Directive,
88
233
  args: [{
89
234
  selector: '[yuvBusyOverlay]',
@@ -97,416 +242,194 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
97
242
  }] } });
98
243
 
99
244
  /**
100
- * Directive keeping track of the focus beeing within a component. Once the component or
101
- * any of its child components gain focus, a class of `focusWithin` will be set on the
102
- * host component in order to allow styling it while beeing focused. Furthermore you can
103
- * register callbacks once the component gets or looses focus.
104
- *
105
- * @example
106
- * // just set the css class
107
- * <some-component yuvFocusWithin></some-component>
108
- * // set the css class and listen to focus changes
109
- * <some-component (yuvFocusWithin)="onFocusEnter()" (yuvFocusWithinBlur)="onFocusLeave()"></some-component>
245
+ * Fixes the issue of 'click' event beeing triggered on 'doubleclick' by defining new outputs that
246
+ * distinguish between single and double click.
110
247
  */
111
- class FocusWithinDirective {
112
- onFocusIn(evt) {
113
- const hadFocusWithin = this.hasFocusWithin;
114
- this.hasFocusWithin = this.matchesFocusWithin();
115
- if (!hadFocusWithin && this.hasFocusWithin) {
116
- this.yuvFocusWithin.emit();
117
- }
118
- }
119
- onFocusOut(evt) {
120
- const hadFocusWithin = this.hasFocusWithin;
121
- this.hasFocusWithin = this.matchesFocusWithin();
122
- if (hadFocusWithin && !this.hasFocusWithin) {
123
- this.yuvFocusWithinBlur.emit();
124
- }
248
+ class ClickDoubleDirective {
249
+ constructor() {
250
+ this.debounceTime = 200;
251
+ this.doubleClick = new EventEmitter();
252
+ this.singleClick = new EventEmitter();
253
+ this.clicksSubject = new Subject();
254
+ this.clicksSubject.pipe(takeUntilDestroyed(), debounceTime(this.debounceTime)).subscribe({
255
+ next: (event) => {
256
+ if (event.type === 'click') {
257
+ this.singleClick.emit(event);
258
+ }
259
+ else {
260
+ this.doubleClick.emit(event);
261
+ }
262
+ }
263
+ });
125
264
  }
126
- /**
127
- * @ignore
128
- */
129
- constructor(elRef) {
130
- this.elRef = elRef;
131
- this.eventCount = 0;
132
- this.hasFocusWithin = false;
133
- /**
134
- * Emitted once the component or any of its child components gains focus.
135
- */
136
- this.yuvFocusWithin = new EventEmitter();
137
- /**
138
- * Emitted once the component (incl. any of its child components) looses focus.
139
- */
140
- this.yuvFocusWithinBlur = new EventEmitter();
265
+ clickEvent(event) {
266
+ event.preventDefault();
267
+ event.stopPropagation();
268
+ this.clicksSubject.next(event);
141
269
  }
142
- // Determine if the given node matches the given selector.
143
- // @see: https://www.bennadel.com/blog/3476-checking-to-see-if-an-element-has-a-css-pseudo-class-in-javascript.htm
144
- matchesFocusWithin() {
145
- const node = this.elRef.nativeElement;
146
- var nativeMatches = node.matches || node.msMatchesSelector;
147
- try {
148
- return nativeMatches.call(node, ':focus-within');
149
- }
150
- catch (error) {
151
- return false;
152
- }
270
+ doubleClickEvent(event) {
271
+ event.preventDefault();
272
+ event.stopPropagation();
273
+ this.clicksSubject.next(event);
153
274
  }
154
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FocusWithinDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
155
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: FocusWithinDirective, isStandalone: true, selector: "[yuvFocusWithin]", outputs: { yuvFocusWithin: "yuvFocusWithin", yuvFocusWithinBlur: "yuvFocusWithinBlur" }, host: { listeners: { "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)" }, properties: { "class.focusWithin": "this.hasFocusWithin" } }, ngImport: i0 }); }
275
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ClickDoubleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
276
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: ClickDoubleDirective, isStandalone: true, selector: "[click.single],[click.double]", inputs: { debounceTime: "debounceTime" }, outputs: { doubleClick: "click.double", singleClick: "click.single" }, host: { listeners: { "click": "clickEvent($event)", "dblclick": "doubleClickEvent($event)" } }, ngImport: i0 }); }
156
277
  }
157
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FocusWithinDirective, decorators: [{
278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ClickDoubleDirective, decorators: [{
158
279
  type: Directive,
159
280
  args: [{
160
- selector: '[yuvFocusWithin]',
281
+ selector: '[click.single],[click.double]',
161
282
  standalone: true
162
283
  }]
163
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { hasFocusWithin: [{
164
- type: HostBinding,
165
- args: ['class.focusWithin']
166
- }], onFocusIn: [{
284
+ }], ctorParameters: () => [], propDecorators: { debounceTime: [{
285
+ type: Input
286
+ }], doubleClick: [{
287
+ type: Output,
288
+ args: ['click.double']
289
+ }], singleClick: [{
290
+ type: Output,
291
+ args: ['click.single']
292
+ }], clickEvent: [{
167
293
  type: HostListener,
168
- args: ['focusin', ['$event']]
169
- }], onFocusOut: [{
294
+ args: ['click', ['$event']]
295
+ }], doubleClickEvent: [{
170
296
  type: HostListener,
171
- args: ['focusout', ['$event']]
172
- }], yuvFocusWithin: [{
173
- type: Output
174
- }], yuvFocusWithinBlur: [{
175
- type: Output
297
+ args: ['dblclick', ['$event']]
176
298
  }] } });
177
299
 
178
- class FileDropZoneDirective {
300
+ /**
301
+ * Directive to watch the size of an element inside the DOM. Usefull for example to provide
302
+ * a different layout (different components) depending on the available screen estate. You
303
+ * should first try to use CSS container queries but somtimes you need a different set of
304
+ * components to be loaded for a certain component size.
305
+ *
306
+ * Let's say you have components designed for bigger screens. You do not want to load them
307
+ * if there is not enough space for them. So you rather load components that are designed to
308
+ * take less space by providing the best user experience on smaller devices.
309
+ *
310
+ * ```html
311
+ * <div yuvContainerSize (containerHeight)="onContainerResize($event)" (containerWidth)="onContainerResize($event)"></div>
312
+ * ```
313
+ *
314
+ */
315
+ class ContainerSizeDirective {
179
316
  constructor() {
180
- this.#elRef = inject(ElementRef);
181
- this.#fileOver = false;
182
- this.#defaultDragOverCoverStyles = {
183
- outline: '2px dashed var(--color-accent)',
184
- display: 'flex',
185
- transition: 'background-color .3s ease-in-out',
186
- 'z-index': '500',
187
- 'align-items': 'center',
188
- 'justify-content': 'center',
189
- 'outline-offset': '-2px',
190
- 'background-color': 'rgba(var(--color-accent-rgb), .5)'
191
- };
192
- this.#defaultDragOverCoverLabelStyles = {
193
- outline: '1px solid var(--color-accent)',
194
- padding: 'var(--app-pane-padding, 16px)',
195
- 'background-color': 'rgba(var(--color-accent-rgb), .9)',
196
- color: 'var(--color-accent-tone)'
197
- };
198
- this.yuvFileDropZone = input();
199
- this.fileDropDisabled = input(false);
200
- this.fileDrop = output();
201
- this.fileDropOver = output();
202
- }
203
- #elRef;
204
- #coverElement;
205
- #fileOver;
206
- set fileOver(fo) {
207
- if (fo !== this.#fileOver) {
208
- this.#fileOver = fo;
209
- this.fileDropOver.emit(fo);
210
- this.#toggleCover();
211
- }
212
- }
213
- get fileOver() {
214
- return this.#fileOver;
215
- }
216
- #defaultDragOverCoverStyles;
217
- #defaultDragOverCoverLabelStyles;
218
- onDrop(event) {
219
- if (this.fileDropDisabled())
220
- return;
221
- event.preventDefault();
222
- event.stopPropagation();
223
- this.fileOver = false;
224
- const dataTransfer = event.dataTransfer;
225
- if (dataTransfer) {
226
- if (dataTransfer?.items) {
227
- const files = [];
228
- for (let i = 0; i < dataTransfer.items.length; i++) {
229
- // If dropped items aren't files, reject them
230
- if (dataTransfer.items[i].kind === 'file') {
231
- const file = dataTransfer.items[i].getAsFile();
232
- if (file)
233
- files.push(file);
234
- }
235
- }
236
- dataTransfer.items.clear();
237
- this.fileDrop.emit(files);
317
+ this.elRef = inject(ElementRef);
318
+ this.ngZone = inject(NgZone);
319
+ this.containerHeight = output();
320
+ this.containerWidth = output();
321
+ this._resizeObserver = new ResizeObserver((entries) => {
322
+ const size = entries[0].borderBoxSize[0];
323
+ if (!this._size || size.blockSize !== this._size.blockSize) {
324
+ this._emit(size.blockSize, true);
238
325
  }
239
- else {
240
- const files = dataTransfer.files;
241
- dataTransfer.clearData();
242
- this.fileDrop.emit(Array.from(files));
326
+ if (!this._size || size.inlineSize !== this._size.inlineSize) {
327
+ this._emit(size.inlineSize);
243
328
  }
244
- }
329
+ this._size = size;
330
+ });
331
+ this._resizeObserver.observe(this.elRef.nativeElement);
245
332
  }
246
- onDragOver(event) {
247
- if (this.fileDropDisabled())
248
- return;
249
- event.stopPropagation();
250
- event.preventDefault();
251
- this.fileOver = true;
333
+ _emit(value, isHeight = false) {
334
+ // ResizeObserver callback is not covered by change detection
335
+ // so it has to be executed withing ngZone
336
+ this.ngZone.run(() => {
337
+ (isHeight ? this.containerHeight : this.containerWidth).emit(value);
338
+ });
252
339
  }
253
- onDragLeave(event) {
254
- if (this.fileDropDisabled())
255
- return;
256
- if (event.target.getAttribute('id') === this.#coverElement?.getAttribute('id')) {
257
- this.fileOver = false;
258
- }
259
- }
260
- onBodyDragOver(event) {
261
- event.preventDefault();
262
- event.stopPropagation();
263
- }
264
- onBodyDrop(event) {
265
- event.preventDefault();
266
- }
267
- #toggleCover() {
268
- const el = this.#elRef.nativeElement;
269
- if (this.#coverElement) {
270
- el.style.position = 'initial';
271
- this.#coverElement.remove();
272
- this.#coverElement = undefined;
273
- }
274
- if (this.#fileOver) {
275
- el.style.position = 'relative';
276
- this.#coverElement = this.#createCoverElement();
277
- el.append(this.#coverElement);
278
- }
279
- }
280
- #createCoverElement() {
281
- const coverElement = document.createElement('div');
282
- coverElement.setAttribute('id', Utils.uuid());
283
- coverElement.style.position = 'absolute';
284
- coverElement.style.inset = '0';
285
- const styles = this.yuvFileDropZone()?.coverStyles || this.#defaultDragOverCoverStyles;
286
- Object.keys(styles).forEach((k) => {
287
- coverElement.style[k] = styles[k];
288
- });
289
- const label = this.yuvFileDropZone()?.label;
290
- if (label) {
291
- const coverLabelElement = document.createElement('div');
292
- coverLabelElement.innerText = label;
293
- const labelStyles = this.yuvFileDropZone()?.coverLabelStyles || this.#defaultDragOverCoverLabelStyles;
294
- Object.keys(labelStyles).forEach((k) => {
295
- coverLabelElement.style[k] = labelStyles[k];
296
- });
297
- coverLabelElement.style.pointerEvents = 'none';
298
- coverElement.append(coverLabelElement);
299
- }
300
- return coverElement;
301
- }
302
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FileDropZoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
303
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: FileDropZoneDirective, isStandalone: true, selector: "[yuvFileDropZone]", inputs: { yuvFileDropZone: { classPropertyName: "yuvFileDropZone", publicName: "yuvFileDropZone", isSignal: true, isRequired: false, transformFunction: null }, fileDropDisabled: { classPropertyName: "fileDropDisabled", publicName: "fileDropDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileDrop: "fileDrop", fileDropOver: "fileDropOver" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "body:dragover": "onBodyDragOver($event)", "body:drop": "onBodyDrop($event)" } }, ngImport: i0 }); }
304
- }
305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FileDropZoneDirective, decorators: [{
306
- type: Directive,
307
- args: [{
308
- selector: '[yuvFileDropZone]',
309
- standalone: true
310
- }]
311
- }], propDecorators: { onDrop: [{
312
- type: HostListener,
313
- args: ['drop', ['$event']]
314
- }], onDragOver: [{
315
- type: HostListener,
316
- args: ['dragover', ['$event']]
317
- }], onDragLeave: [{
318
- type: HostListener,
319
- args: ['dragleave', ['$event']]
320
- }], onBodyDragOver: [{
321
- type: HostListener,
322
- args: ['body:dragover', ['$event']]
323
- }], onBodyDrop: [{
324
- type: HostListener,
325
- args: ['body:drop', ['$event']]
326
- }] } });
327
-
328
- /**
329
- * Fixes the issue of 'click' event beeing triggered on 'doubleclick' by defining new outputs that
330
- * distinguish between single and double click.
331
- */
332
- class ClickDoubleDirective {
333
- constructor() {
334
- this.debounceTime = 200;
335
- this.doubleClick = new EventEmitter();
336
- this.singleClick = new EventEmitter();
337
- this.clicksSubject = new Subject();
338
- this.clicksSubject.pipe(takeUntilDestroyed(), debounceTime(this.debounceTime)).subscribe({
339
- next: (event) => {
340
- if (event.type === 'click') {
341
- this.singleClick.emit(event);
342
- }
343
- else {
344
- this.doubleClick.emit(event);
345
- }
346
- }
347
- });
348
- }
349
- clickEvent(event) {
350
- event.preventDefault();
351
- event.stopPropagation();
352
- this.clicksSubject.next(event);
353
- }
354
- doubleClickEvent(event) {
355
- event.preventDefault();
356
- event.stopPropagation();
357
- this.clicksSubject.next(event);
340
+ ngOnDestroy() {
341
+ this._resizeObserver.unobserve(this.elRef.nativeElement);
358
342
  }
359
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClickDoubleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
360
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ClickDoubleDirective, isStandalone: true, selector: "[click.single],[click.double]", inputs: { debounceTime: "debounceTime" }, outputs: { doubleClick: "click.double", singleClick: "click.single" }, host: { listeners: { "click": "clickEvent($event)", "dblclick": "doubleClickEvent($event)" } }, ngImport: i0 }); }
343
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ContainerSizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
344
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: ContainerSizeDirective, isStandalone: true, selector: "[yuvContainerSize]", outputs: { containerHeight: "containerHeight", containerWidth: "containerWidth" }, ngImport: i0 }); }
361
345
  }
362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClickDoubleDirective, decorators: [{
346
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ContainerSizeDirective, decorators: [{
363
347
  type: Directive,
364
348
  args: [{
365
- selector: '[click.single],[click.double]',
349
+ selector: '[yuvContainerSize]',
366
350
  standalone: true
367
351
  }]
368
- }], ctorParameters: () => [], propDecorators: { debounceTime: [{
369
- type: Input
370
- }], doubleClick: [{
371
- type: Output,
372
- args: ['click.double']
373
- }], singleClick: [{
374
- type: Output,
375
- args: ['click.single']
376
- }], clickEvent: [{
377
- type: HostListener,
378
- args: ['click', ['$event']]
379
- }], doubleClickEvent: [{
380
- type: HostListener,
381
- args: ['dblclick', ['$event']]
382
- }] } });
352
+ }], ctorParameters: () => [] });
383
353
 
384
354
  /**
385
- * Directive for applying light dismiss actions. Adding this directive will trigger
386
- * the given function when the user clicks outside the component or hits escape.
355
+ * Directive for adding drag scroll behaviour to a container element. Elements that overlow will then
356
+ * be 'scrollable' by dragging the list of children.
387
357
  *
388
- * ```ts
389
- * <div class="notifications" (yuvLightDismiss)="close()">
358
+ * @example
359
+ * <div yuvDragScroll>
360
+ * <div class="tile">#1</div>
361
+ * <div class="tile">#2</div>
362
+ * <div class="tile">#3</div>
390
363
  * ...
391
364
  * </div>
392
- * ```
393
- */
394
- class LightDismissDirective {
395
- constructor() {
396
- this.elRef = inject(ElementRef);
397
- this.yuvLightDismiss = output();
398
- }
399
- onKeydownHandler(event) {
400
- if (!event.defaultPrevented) {
401
- this.yuvLightDismiss.emit();
402
- }
403
- }
404
- onMousedown(event) {
405
- if (!this.elRef.nativeElement.contains(event.target)) {
406
- this.yuvLightDismiss.emit();
407
- }
408
- }
409
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LightDismissDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
410
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: LightDismissDirective, isStandalone: true, selector: "[yuvLightDismiss]", outputs: { yuvLightDismiss: "yuvLightDismiss" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)", "document:mousedown": "onMousedown($event)" } }, ngImport: i0 }); }
411
- }
412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LightDismissDirective, decorators: [{
413
- type: Directive,
414
- args: [{
415
- selector: '[yuvLightDismiss]',
416
- standalone: true
417
- }]
418
- }], propDecorators: { onKeydownHandler: [{
419
- type: HostListener,
420
- args: ['document:keydown.escape', ['$event']]
421
- }], onMousedown: [{
422
- type: HostListener,
423
- args: ['document:mousedown', ['$event']]
424
- }] } });
425
-
426
- /**
427
- * Directive to watch the size of an element inside the DOM. Usefull for example to provide
428
- * a different layout (different components) depending on the available screen estate. You
429
- * should first try to use CSS container queries but somtimes you need a different set of
430
- * components to be loaded for a certain component size.
431
- *
432
- * Let's say you have components designed for bigger screens. You do not want to load them
433
- * if there is not enough space for them. So you rather load components that are designed to
434
- * take less space by providing the best user experience on smaller devices.
435
- *
436
- * ```html
437
- * <div yuvContainerSize (containerHeight)="onContainerResize($event)" (containerWidth)="onContainerResize($event)"></div>
438
- * ```
439
- *
440
365
  */
441
- class ContainerSizeDirective {
442
- constructor() {
443
- this.elRef = inject(ElementRef);
444
- this.ngZone = inject(NgZone);
445
- this.containerHeight = output();
446
- this.containerWidth = output();
447
- this._resizeObserver = new ResizeObserver((entries) => {
448
- const size = entries[0].borderBoxSize[0];
449
- if (!this._size || size.blockSize !== this._size.blockSize) {
450
- this._emit(size.blockSize, true);
366
+ class DragScrollDirective {
367
+ #document = inject(DOCUMENT);
368
+ #element = inject(ElementRef);
369
+ #dragging = false;
370
+ #applyDraggingStyles(el, remove) {
371
+ const draggingStyles = {
372
+ cursor: 'grabbing'
373
+ };
374
+ Object.keys(draggingStyles).forEach((property) => {
375
+ if (remove) {
376
+ el.style.removeProperty(property);
451
377
  }
452
- if (!this._size || size.inlineSize !== this._size.inlineSize) {
453
- this._emit(size.inlineSize);
378
+ else {
379
+ el.style.setProperty(property, draggingStyles[property]);
454
380
  }
455
- this._size = size;
456
- });
457
- this._resizeObserver.observe(this.elRef.nativeElement);
458
- }
459
- _emit(value, isHeight = false) {
460
- // ResizeObserver callback is not covered by change detection
461
- // so it has to be executed withing ngZone
462
- this.ngZone.run(() => {
463
- (isHeight ? this.containerHeight : this.containerWidth).emit(value);
464
381
  });
465
382
  }
466
- ngOnDestroy() {
467
- this._resizeObserver.unobserve(this.elRef.nativeElement);
468
- }
469
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContainerSizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
470
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ContainerSizeDirective, isStandalone: true, selector: "[yuvContainerSize]", outputs: { containerHeight: "containerHeight", containerWidth: "containerWidth" }, ngImport: i0 }); }
471
- }
472
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContainerSizeDirective, decorators: [{
473
- type: Directive,
474
- args: [{
475
- selector: '[yuvContainerSize]',
476
- standalone: true
477
- }]
478
- }], ctorParameters: () => [] });
479
-
480
- class LongPressDirective {
481
- constructor() {
482
- this.elRef = inject(ElementRef);
483
- this.threshold = 500;
484
- this.yuvLongPress = input({
485
- enabled: false
486
- });
487
- this.longpress = output();
488
- const mousedown = fromEvent(this.elRef.nativeElement, 'mousedown').pipe(takeUntilDestroyed(), filter((event) => event.button == 0), // Only allow left button (Primary button)
489
- map(() => true) // turn on threshold counter
490
- );
491
- const touchstart = fromEvent(this.elRef.nativeElement, 'touchstart').pipe(takeUntilDestroyed(), map(() => true));
492
- const touchEnd = fromEvent(this.elRef.nativeElement, 'touchend').pipe(takeUntilDestroyed(), map(() => false));
493
- const mouseup = fromEvent(window, 'mouseup').pipe(takeUntilDestroyed(), filter((event) => event.button == 0), // Only allow left button (Primary button)
494
- map(() => false) // reset threshold counter
495
- );
496
- merge(mousedown, mouseup, touchstart, touchEnd)
497
- .pipe(takeUntilDestroyed(), switchMap((state) => (state ? timer(this.threshold, 100) : of(null))), filter((value) => !!value))
498
- .subscribe(() => this.longpress.emit());
383
+ ngAfterViewInit() {
384
+ const nativeElement = this.#element.nativeElement;
385
+ const mouseDown$ = fromEvent(nativeElement, 'mousedown');
386
+ const mouseMove$ = fromEvent(this.#document, 'mousemove');
387
+ const mouseUp$ = fromEvent(this.#document, 'mouseup').pipe(tap((e) => {
388
+ if (this.#dragging) {
389
+ e.preventDefault();
390
+ e.stopPropagation();
391
+ this.#dragging = false;
392
+ this.#applyDraggingStyles(nativeElement, true);
393
+ }
394
+ }));
395
+ const dragMove$ = mouseDown$.pipe(filter(() =>
396
+ // only calculate new scroll position if the container is actually overflowing
397
+ nativeElement.scrollHeight > nativeElement.clientHeight || nativeElement.scrollWidth > nativeElement.clientWidth), tap((startEvent) => {
398
+ this.#applyDraggingStyles(nativeElement);
399
+ startEvent.preventDefault();
400
+ startEvent.stopPropagation();
401
+ }), switchMap((startEvent) => {
402
+ this.#dragging = true;
403
+ const scrollPos = {
404
+ left: nativeElement.scrollLeft,
405
+ top: nativeElement.scrollTop
406
+ };
407
+ return mouseMove$.pipe(map((moveEvent) => {
408
+ moveEvent.preventDefault();
409
+ moveEvent.stopPropagation();
410
+ return {
411
+ startEvent,
412
+ moveEvent,
413
+ scrollPos
414
+ };
415
+ }), takeUntil(mouseUp$));
416
+ }), tap(({ startEvent, moveEvent, scrollPos }) => {
417
+ const diffX = moveEvent.clientX - startEvent.clientX;
418
+ const diffY = moveEvent.clientY - startEvent.clientY;
419
+ nativeElement.scrollLeft = scrollPos.left - diffX;
420
+ nativeElement.scrollTop = scrollPos.top - diffY;
421
+ }));
422
+ dragMove$.subscribe();
499
423
  }
500
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LongPressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
501
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LongPressDirective, isStandalone: true, selector: "[yuvLongPress]", inputs: { yuvLongPress: { classPropertyName: "yuvLongPress", publicName: "yuvLongPress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { longpress: "longpress" }, ngImport: i0 }); }
424
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragScrollDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
425
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: DragScrollDirective, isStandalone: true, selector: "[yuvDragScroll]", ngImport: i0 }); }
502
426
  }
503
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LongPressDirective, decorators: [{
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragScrollDirective, decorators: [{
504
428
  type: Directive,
505
429
  args: [{
506
- selector: '[yuvLongPress]',
507
- standalone: true
430
+ selector: '[yuvDragScroll]'
508
431
  }]
509
- }], ctorParameters: () => [] });
432
+ }] });
510
433
 
511
434
  class DragSelectDirective {
512
435
  constructor() {
@@ -535,7 +458,7 @@ class DragSelectDirective {
535
458
  this.#selector.style.top = diffY < 0 ? this.#selectStartY + diffY + 'px' : this.#selectStartY + 'px';
536
459
  this.#selector.style.height = Math.abs(diffY) + 'px';
537
460
  this.#selector.style.width = Math.abs(diffX) + 'px';
538
- this.#selector.style.border = `1px solid ${this.yuvDragSelect()?.selectorColor || 'var(--color-accent'}`;
461
+ this.#selector.style.border = `1px solid ${this.yuvDragSelect()?.selectorColor || 'var(--ymt-primary'}`;
539
462
  this.#checkSelected();
540
463
  };
541
464
  this.#checkSelected = () => {
@@ -590,10 +513,10 @@ class DragSelectDirective {
590
513
  #resize;
591
514
  #checkSelected;
592
515
  #checkRectIntersection;
593
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DragSelectDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
594
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.13", type: DragSelectDirective, isStandalone: true, selector: "[yuvDragSelect]", inputs: { yuvDragSelect: { classPropertyName: "yuvDragSelect", publicName: "yuvDragSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dragSelectChange: "dragSelectChange", dragSelect: "dragSelect" }, host: { listeners: { "pointerdown": "onPointerDown($event)" } }, queries: [{ propertyName: "items", predicate: DragSelectItemDirective, isSignal: true }], ngImport: i0 }); }
516
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
517
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.1", type: DragSelectDirective, isStandalone: true, selector: "[yuvDragSelect]", inputs: { yuvDragSelect: { classPropertyName: "yuvDragSelect", publicName: "yuvDragSelect", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dragSelectChange: "dragSelectChange", dragSelect: "dragSelect" }, host: { listeners: { "pointerdown": "onPointerDown($event)" } }, queries: [{ propertyName: "items", predicate: DragSelectItemDirective, isSignal: true }], ngImport: i0 }); }
595
518
  }
596
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DragSelectDirective, decorators: [{
519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectDirective, decorators: [{
597
520
  type: Directive,
598
521
  args: [{
599
522
  selector: '[yuvDragSelect]',
@@ -609,10 +532,10 @@ class DragSelectItemDirective {
609
532
  this.el = this.#elRef.nativeElement;
610
533
  }
611
534
  #elRef;
612
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DragSelectItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
613
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DragSelectItemDirective, isStandalone: true, selector: "[yuvDragSelectItem]", ngImport: i0 }); }
535
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
536
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: DragSelectItemDirective, isStandalone: true, selector: "[yuvDragSelectItem]", ngImport: i0 }); }
614
537
  }
615
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DragSelectItemDirective, decorators: [{
538
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: DragSelectItemDirective, decorators: [{
616
539
  type: Directive,
617
540
  args: [{
618
541
  selector: '[yuvDragSelectItem]',
@@ -620,357 +543,306 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
620
543
  }]
621
544
  }] });
622
545
 
623
- // TODO: Move to @yuuvis/components
624
- class TokenInputComponent {
546
+ class FileDropZoneDirective {
625
547
  constructor() {
626
- this.elRef = inject(ElementRef);
627
- this.overlay = inject(YvcOverlayService);
628
- this.ngZone = inject(NgZone);
629
- this.optionsTemplate = viewChild.required('options');
630
- /**
631
- * Template to be used for rendering selected tokens
632
- */
633
- this.tokenTemplate = contentChild('tokenTemplate');
634
- /**
635
- * Template to be used for rendering autocomplete suggestion entries
636
- */
637
- this.optionTemplate = contentChild('optionTemplate');
638
- this.TEXT_TOKEN_TYPE = 'txt';
639
- this.tokens = input([]);
640
- this.caseSensitive = input(false);
641
- this.change = output();
642
- this._cleanFormTokens = [this._newTextToken()];
643
- this.formTokens = structuredClone(this._cleanFormTokens);
644
- this.autocompleteValues = [];
645
- this.autocompleteSelectedIndex = -1;
646
- this.focusedTokenIndex = -1;
647
- }
648
- onArrowUpKey(event) {
649
- event.preventDefault();
650
- event.stopPropagation();
651
- if (this.autocompleteSelectedIndex > 0)
652
- this.autocompleteSelectedIndex--;
653
- }
654
- onArrowDownKey(event) {
655
- event.preventDefault();
656
- event.stopPropagation();
657
- if (this.autocompleteValues && this.autocompleteSelectedIndex < this.autocompleteValues.length - 1)
658
- this.autocompleteSelectedIndex++;
659
- }
660
- onEnterKey(event) {
661
- if (this.autocompleteValues.length && this.autocompleteSelectedIndex >= 0) {
662
- event.preventDefault();
663
- event.stopPropagation();
664
- this.onOptionSelect(this.autocompleteValues[this.autocompleteSelectedIndex]);
665
- }
548
+ this.#elRef = inject(ElementRef);
549
+ this.#fileOver = false;
550
+ this.#defaultDragOverCoverStyles = {
551
+ outline: '2px dashed var(--ymt-primary)',
552
+ display: 'flex',
553
+ transition: 'background-color .3s ease-in-out',
554
+ 'z-index': '500',
555
+ 'align-items': 'center',
556
+ 'justify-content': 'center',
557
+ 'outline-offset': '-2px',
558
+ 'background-color': 'rgb(from var(--ymt-primary) r g b / .5)'
559
+ };
560
+ this.#defaultDragOverCoverLabelStyles = {
561
+ outline: '1px solid var(--ymt-primary)',
562
+ padding: 'var(--ymt-spacing-m, 16px)',
563
+ 'background-color': 'rgb(from var(--ymt-primary) r g b / 0.9)',
564
+ color: 'var(--ymt-on-primary)'
565
+ };
566
+ this.yuvFileDropZone = input();
567
+ this.fileDropDisabled = input(false);
568
+ this.fileDrop = output();
569
+ this.fileDropOver = output();
666
570
  }
667
- clear() {
668
- this.formTokens = structuredClone(this._cleanFormTokens);
669
- this._inputElement.innerText = '';
670
- this._emitChange(true);
671
- }
672
- onInputFocus(e) {
673
- this._inputElement = e.target;
674
- this.focusedTokenIndex = this._inputElement ? this.formTokens.findIndex((t) => t.id === this._inputElement.getAttribute('data-id')) : -1;
675
- // console.log('FIndex: ' + this.focusedTokenIndex);
676
- }
677
- onInput(e) {
678
- this._processValue();
679
- this._emitChange();
680
- }
681
- onArrowLeft(e) {
682
- const cp = this._getCaretPos(e.target);
683
- if (cp === 0) {
684
- e.stopPropagation();
685
- e.preventDefault();
686
- this._focusInput(-1);
687
- }
688
- }
689
- onArrowRight(e) {
690
- const cp = this._getCaretPos(e.target);
691
- if (cp === e.target.innerText.length) {
692
- e.stopPropagation();
693
- e.preventDefault();
694
- this._focusInput(1);
571
+ #elRef;
572
+ #coverElement;
573
+ #fileOver;
574
+ set fileOver(fo) {
575
+ if (fo !== this.#fileOver) {
576
+ this.#fileOver = fo;
577
+ this.fileDropOver.emit(fo);
578
+ this.#toggleCover();
695
579
  }
696
580
  }
697
- onDelete(e, index) {
698
- const cp = this._getCaretPos(e.target);
699
- if (cp === e.target.innerText.length) {
700
- e.stopPropagation();
701
- e.preventDefault();
702
- // remove next token
703
- if (index < this.formTokens.length - 2) {
704
- this.formTokens.splice(index + 1, 1);
705
- // if prev token is also a text token => merge
706
- const nextIdx = index + 1;
707
- if (nextIdx < this.formTokens.length && this.formTokens[nextIdx].type === this.TEXT_TOKEN_TYPE) {
708
- const content = this.formTokens[index].label;
709
- const nextContent = this.formTokens[nextIdx].label;
710
- const mergedToken = {
711
- id: this.formTokens[index + 1].id,
712
- label: `${content} ${nextContent}`,
713
- type: this.TEXT_TOKEN_TYPE
714
- };
715
- this.formTokens.splice(index + 1, 2, mergedToken);
716
- const el = this.elRef.nativeElement.querySelector(`[data-id="${this.formTokens[index + 1].id}"]`);
717
- if (el) {
718
- el.innerText = mergedToken.label;
719
- this._setCaretPos(el, content.length);
581
+ get fileOver() {
582
+ return this.#fileOver;
583
+ }
584
+ #defaultDragOverCoverStyles;
585
+ #defaultDragOverCoverLabelStyles;
586
+ onDrop(event) {
587
+ if (this.fileDropDisabled())
588
+ return;
589
+ event.preventDefault();
590
+ event.stopPropagation();
591
+ this.fileOver = false;
592
+ const dataTransfer = event.dataTransfer;
593
+ if (dataTransfer) {
594
+ if (dataTransfer?.items) {
595
+ const files = [];
596
+ for (let i = 0; i < dataTransfer.items.length; i++) {
597
+ // If dropped items aren't files, reject them
598
+ if (dataTransfer.items[i].kind === 'file') {
599
+ const file = dataTransfer.items[i].getAsFile();
600
+ if (file)
601
+ files.push(file);
720
602
  }
721
603
  }
722
- this._emitChange();
604
+ dataTransfer.items.clear();
605
+ this.fileDrop.emit(files);
606
+ }
607
+ else {
608
+ const files = dataTransfer.files;
609
+ dataTransfer.clearData();
610
+ this.fileDrop.emit(Array.from(files));
723
611
  }
724
612
  }
725
613
  }
726
- onBackspace(e, index) {
727
- const cp = this._getCaretPos(e.target);
728
- if (cp === 0) {
729
- e.stopPropagation();
730
- e.preventDefault();
731
- // remove prev token
732
- if (index > 0) {
733
- this.formTokens.splice(index - 1, 1);
734
- // if prev token is also a text token => merge
735
- const prevIdx = index - 2;
736
- if (prevIdx >= 0 && this.formTokens[prevIdx].type === this.TEXT_TOKEN_TYPE) {
737
- const content = this.formTokens[index - 1].label;
738
- const prevContent = this.formTokens[prevIdx].label;
739
- const mergedToken = {
740
- id: this.formTokens[prevIdx].id,
741
- label: `${prevContent} ${content}`,
742
- type: this.TEXT_TOKEN_TYPE
743
- };
744
- this.formTokens.splice(prevIdx, 2, mergedToken);
745
- const el = this.elRef.nativeElement.querySelector(`[data-id="${this.formTokens[prevIdx].id}"]`);
746
- if (el) {
747
- el.innerText = mergedToken.label;
748
- this._setCaretPos(el, prevContent.length);
749
- }
750
- }
751
- else {
752
- this._focusFirst();
753
- }
754
- this._emitChange();
755
- }
614
+ onDragOver(event) {
615
+ if (this.fileDropDisabled())
616
+ return;
617
+ event.stopPropagation();
618
+ event.preventDefault();
619
+ this.fileOver = true;
620
+ }
621
+ onDragLeave(event) {
622
+ if (this.fileDropDisabled())
623
+ return;
624
+ if (event.target.getAttribute('id') === this.#coverElement?.getAttribute('id')) {
625
+ this.fileOver = false;
756
626
  }
757
627
  }
758
- _focusFirst() {
759
- const el = this.elRef.nativeElement.querySelector(`[contenteditable]`);
760
- if (el)
761
- setTimeout(() => {
762
- el?.focus();
763
- });
628
+ onBodyDragOver(event) {
629
+ event.preventDefault();
630
+ event.stopPropagation();
631
+ }
632
+ onBodyDrop(event) {
633
+ event.preventDefault();
764
634
  }
765
- _focusInput(offset) {
766
- const inputs = Array.from(this.elRef.nativeElement.querySelectorAll('[contenteditable]'));
767
- let i = inputs.findIndex((i) => i === document.activeElement);
768
- i = i + offset;
769
- if (i > inputs.length - 1)
770
- i = 0;
771
- if (i < 0)
772
- i = inputs.length - 1;
773
- this.ngZone.run(() => inputs[i].focus());
774
- this._setCaretPos(inputs[i], offset > 0 || inputs[i].innerText.length === 0 ? 0 : inputs[i].innerText.length);
775
- }
776
- _setCaretPos(element, pos) {
777
- const targetNode = element.childNodes.length ? element.childNodes[0] : element;
778
- const range = document.createRange();
779
- range.selectNode(element);
780
- range.setStart(targetNode, pos);
781
- range.setEnd(targetNode, pos);
782
- const selection = window.getSelection();
783
- selection.removeAllRanges();
784
- selection.addRange(range);
785
- }
786
- _getCaretPos(node) {
787
- const selection = window.getSelection();
788
- const range = selection.getRangeAt(0);
789
- const clonedRange = range.cloneRange();
790
- clonedRange.selectNodeContents(node);
791
- clonedRange.setEnd(range.endContainer, range.endOffset);
792
- return clonedRange.toString().length;
793
- }
794
- onOptionSelect(o) {
795
- let tokensAdded = 0;
796
- let tokensRemoved = 0;
797
- const inputValue = this._getInputValue();
798
- const wordTokens = this._tokenize(inputValue);
799
- const lastWord = wordTokens[wordTokens.length - 1];
800
- if (lastWord.length === inputValue.length) {
801
- this.formTokens.pop();
802
- tokensRemoved++;
635
+ #toggleCover() {
636
+ const el = this.#elRef.nativeElement;
637
+ if (this.#coverElement) {
638
+ el.style.position = 'initial';
639
+ this.#coverElement.remove();
640
+ this.#coverElement = undefined;
803
641
  }
804
- this.formTokens.splice(this.focusedTokenIndex + 1, 0, structuredClone(o));
805
- tokensAdded++;
806
- const shadowTokens = [];
807
- // check for inbetween tokens
808
- let txtTokenCount = -1;
809
- this.formTokens.forEach((t, i) => {
810
- if (t.type === this.TEXT_TOKEN_TYPE) {
811
- txtTokenCount++;
812
- t.id = this._textTokenId(txtTokenCount);
813
- }
814
- shadowTokens.push(t);
815
- const nextToken = this.formTokens[i + 1];
816
- if (t.type !== this.TEXT_TOKEN_TYPE && nextToken && nextToken.type !== this.TEXT_TOKEN_TYPE) {
817
- // add inbetween token
818
- txtTokenCount++;
819
- shadowTokens.push(this._newTextToken(txtTokenCount));
820
- tokensAdded++;
821
- }
822
- });
823
- if (this.formTokens[this.formTokens.length - 1].type !== this.TEXT_TOKEN_TYPE) {
824
- // add empty text token at the end
825
- txtTokenCount++;
826
- shadowTokens.push(this._newTextToken(txtTokenCount));
827
- tokensAdded++;
642
+ if (this.#fileOver) {
643
+ el.style.position = 'relative';
644
+ this.#coverElement = this.#createCoverElement();
645
+ el.append(this.#coverElement);
828
646
  }
829
- this.formTokens = shadowTokens;
830
- this._inputElement.innerText = inputValue.substring(0, inputValue.length - lastWord.length).trim();
831
- this._emitChange();
832
- setTimeout(() => {
833
- // console.log(`fi: ${this.focusedTokenIndex}, ta: ${tokensAdded}, tr: ${tokensRemoved}, ne: ${this.focusedTokenIndex + (tokensAdded - tokensRemoved)}`);
834
- this._focusTokenInput(this.focusedTokenIndex + (tokensAdded - tokensRemoved));
647
+ }
648
+ #createCoverElement() {
649
+ const coverElement = document.createElement('div');
650
+ coverElement.setAttribute('id', Utils.uuid());
651
+ coverElement.style.position = 'absolute';
652
+ coverElement.style.inset = '0';
653
+ const styles = this.yuvFileDropZone()?.coverStyles || this.#defaultDragOverCoverStyles;
654
+ Object.keys(styles).forEach((k) => {
655
+ coverElement.style[k] = styles[k];
835
656
  });
836
- this.closeOptions();
837
- }
838
- _focusTokenInput(index) {
839
- const selector = index === undefined ? 'div:last-child' : `div:nth-child(${index + 1})`;
840
- console.log(selector);
841
- const lastInput = this.elRef.nativeElement.querySelector(selector);
842
- lastInput.focus();
843
- return lastInput;
844
- }
845
- // private _focusInput(): HTMLElement {
846
- // const lastInput: HTMLElement = (
847
- // this.elRef.nativeElement as HTMLElement
848
- // ).querySelector('[contenteditable]:last-child') as HTMLElement;
849
- // lastInput.focus();
850
- // return lastInput;
851
- // }
852
- openOptions() {
853
- if (this._overlayRef || !this.autocompleteValues.length)
854
- return;
855
- this._overlayRef = this.overlay.open(this.optionsTemplate(), null, {
856
- lightDismiss: true,
857
- maxHeight: '97vh'
858
- }, this.elRef);
859
- }
860
- closeOptions() {
861
- if (this._overlayRef) {
862
- this._overlayRef.close();
863
- this._overlayRef = undefined;
657
+ const label = this.yuvFileDropZone()?.label;
658
+ if (label) {
659
+ const coverLabelElement = document.createElement('div');
660
+ coverLabelElement.innerText = label;
661
+ const labelStyles = this.yuvFileDropZone()?.coverLabelStyles || this.#defaultDragOverCoverLabelStyles;
662
+ Object.keys(labelStyles).forEach((k) => {
663
+ coverLabelElement.style[k] = labelStyles[k];
664
+ });
665
+ coverLabelElement.style.pointerEvents = 'none';
666
+ coverElement.append(coverLabelElement);
864
667
  }
865
- this.autocompleteSelectedIndex = -1;
866
- this.autocompleteValues = [];
668
+ return coverElement;
867
669
  }
868
- onTokenEnter(e) {
869
- e.preventDefault();
670
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FileDropZoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
671
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.1", type: FileDropZoneDirective, isStandalone: true, selector: "[yuvFileDropZone]", inputs: { yuvFileDropZone: { classPropertyName: "yuvFileDropZone", publicName: "yuvFileDropZone", isSignal: true, isRequired: false, transformFunction: null }, fileDropDisabled: { classPropertyName: "fileDropDisabled", publicName: "fileDropDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileDrop: "fileDrop", fileDropOver: "fileDropOver" }, host: { listeners: { "drop": "onDrop($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "body:dragover": "onBodyDragOver($event)", "body:drop": "onBodyDrop($event)" } }, ngImport: i0 }); }
672
+ }
673
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FileDropZoneDirective, decorators: [{
674
+ type: Directive,
675
+ args: [{
676
+ selector: '[yuvFileDropZone]',
677
+ standalone: true
678
+ }]
679
+ }], propDecorators: { onDrop: [{
680
+ type: HostListener,
681
+ args: ['drop', ['$event']]
682
+ }], onDragOver: [{
683
+ type: HostListener,
684
+ args: ['dragover', ['$event']]
685
+ }], onDragLeave: [{
686
+ type: HostListener,
687
+ args: ['dragleave', ['$event']]
688
+ }], onBodyDragOver: [{
689
+ type: HostListener,
690
+ args: ['body:dragover', ['$event']]
691
+ }], onBodyDrop: [{
692
+ type: HostListener,
693
+ args: ['body:drop', ['$event']]
694
+ }] } });
695
+
696
+ /**
697
+ * Directive keeping track of the focus beeing within a component. Once the component or
698
+ * any of its child components gain focus, a class of `focusWithin` will be set on the
699
+ * host component in order to allow styling it while beeing focused. Furthermore you can
700
+ * register callbacks once the component gets or looses focus.
701
+ *
702
+ * @example
703
+ * // just set the css class
704
+ * <some-component yuvFocusWithin></some-component>
705
+ * // set the css class and listen to focus changes
706
+ * <some-component (yuvFocusWithin)="onFocusEnter()" (yuvFocusWithinBlur)="onFocusLeave()"></some-component>
707
+ */
708
+ class FocusWithinDirective {
709
+ onFocusIn(evt) {
710
+ const hadFocusWithin = this.hasFocusWithin;
711
+ this.hasFocusWithin = this.matchesFocusWithin();
712
+ if (!hadFocusWithin && this.hasFocusWithin) {
713
+ this.yuvFocusWithin.emit();
714
+ }
870
715
  }
871
- _emitChange(focusFirst = false) {
872
- // need to set timeout so DOM changes are applied before accessing elements
873
- setTimeout(() => {
874
- this.formTokens.forEach((t) => {
875
- if (t.type === this.TEXT_TOKEN_TYPE) {
876
- const el = this.elRef.nativeElement.querySelector(`[data-id="${t.id}"]`);
877
- if (el)
878
- t.label = el.innerText;
879
- }
880
- });
881
- this.change.emit(this.formTokens
882
- .filter((t) => t.type !== this.TEXT_TOKEN_TYPE || t.label.length > 0)
883
- .map((t) => ({
884
- id: t.id,
885
- label: t.label,
886
- type: t.type
887
- })));
888
- if (focusFirst)
889
- this._focusFirst();
890
- });
716
+ onFocusOut(evt) {
717
+ const hadFocusWithin = this.hasFocusWithin;
718
+ this.hasFocusWithin = this.matchesFocusWithin();
719
+ if (hadFocusWithin && !this.hasFocusWithin) {
720
+ this.yuvFocusWithinBlur.emit();
721
+ }
891
722
  }
892
- _newTextToken(idx) {
893
- const index = idx !== undefined ? idx : this.formTokens?.length ? this.formTokens.filter((t) => t.type === this.TEXT_TOKEN_TYPE).length : 0;
894
- return {
895
- id: this._textTokenId(index),
896
- label: '',
897
- type: this.TEXT_TOKEN_TYPE
898
- };
723
+ /**
724
+ * @ignore
725
+ */
726
+ constructor(elRef) {
727
+ this.elRef = elRef;
728
+ this.eventCount = 0;
729
+ this.hasFocusWithin = false;
730
+ /**
731
+ * Emitted once the component or any of its child components gains focus.
732
+ */
733
+ this.yuvFocusWithin = new EventEmitter();
734
+ /**
735
+ * Emitted once the component (incl. any of its child components) looses focus.
736
+ */
737
+ this.yuvFocusWithinBlur = new EventEmitter();
899
738
  }
900
- _textTokenId(i) {
901
- return `txt_${i}`;
902
- }
903
- _tokenize(value) {
904
- const wordTokens = value.split(/\W+/).filter((t) => t?.length);
905
- return wordTokens;
906
- }
907
- _getInputValue() {
908
- return this._inputElement.innerText.replaceAll('&nbsp;', '');
909
- }
910
- _processValue() {
911
- const wordTokens = this._tokenize(this._getInputValue());
912
- const lastWord = wordTokens[wordTokens.length - 1];
913
- this.autocompleteValues =
914
- !lastWord || lastWord.length < 2
915
- ? []
916
- : this.tokens().filter((t) => lastWord && new RegExp(lastWord, this.caseSensitive() ? '' : 'i').test(t.label));
917
- this.autocompleteSelectedIndex = this.autocompleteValues.length ? 0 : -1;
918
- if (this.autocompleteValues.length)
919
- this.openOptions();
920
- else
921
- this.closeOptions();
739
+ // Determine if the given node matches the given selector.
740
+ // @see: https://www.bennadel.com/blog/3476-checking-to-see-if-an-element-has-a-css-pseudo-class-in-javascript.htm
741
+ matchesFocusWithin() {
742
+ const node = this.elRef.nativeElement;
743
+ const nativeMatches = node.matches || node.msMatchesSelector;
744
+ try {
745
+ return nativeMatches.call(node, ':focus-within');
746
+ }
747
+ catch (error) {
748
+ return false;
749
+ }
922
750
  }
923
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TokenInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
924
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: TokenInputComponent, isStandalone: true, selector: "yuv-token-input", inputs: { tokens: { classPropertyName: "tokens", publicName: "tokens", isSignal: true, isRequired: false, transformFunction: null }, caseSensitive: { classPropertyName: "caseSensitive", publicName: "caseSensitive", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { listeners: { "keydown.arrowUp": "onArrowUpKey($event)", "keydown.arrowDown": "onArrowDownKey($event)", "keydown.enter": "onEnterKey($event)" } }, queries: [{ propertyName: "tokenTemplate", first: true, predicate: ["tokenTemplate"], descendants: true, isSignal: true }, { propertyName: "optionTemplate", first: true, predicate: ["optionTemplate"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsTemplate", first: true, predicate: ["options"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- fi {{focusedTokenIndex}} -->\n\n@for (ft of formTokens; let i = $index; track $index) {\n @if (ft.type === TEXT_TOKEN_TYPE) {\n <div\n contenteditable\n [attr.data-id]=\"ft.id\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus($event)\"\n (keydown.enter)=\"onTokenEnter($event)\"\n (keydown.arrowLeft)=\"onArrowLeft($event)\"\n (keydown.arrowRight)=\"onArrowRight($event)\"\n (keydown.delete)=\"onDelete($event, i)\"\n (keydown.backspace)=\"onBackspace($event, i)\"\n ></div>\n } @else {\n @if (tokenTemplate()) {\n <ng-container *ngTemplateOutlet=\"tokenTemplate()!; context: { $implicit: ft }\"></ng-container>\n } @else {\n <div class=\"chip\">{{ ft.label }}</div>\n }\n }\n}\n\n<ng-template #options>\n <yvc-autocomplete-options\n class=\"popover animateIn\"\n [values]=\"autocompleteValues\"\n [(focusedIndex)]=\"autocompleteSelectedIndex\"\n [autocompleteOptionTemplate]=\"optionTemplate() || null\"\n (optionSelect)=\"onOptionSelect($event)\"\n [field]=\"'label'\"\n ></yvc-autocomplete-options>\n</ng-template>\n", styles: [":host{--token-input-chip-border-color: var(--item-focus-border-color);--token-input-chip-background-color: var(--item-focus-background-color);--token-padding-y: .15em;display:flex;align-items:center;flex-flow:row wrap;padding:2px}:host [contenteditable],:host .chip{border:1px solid transparent;border-radius:2px}:host [contenteditable]{display:inline-block;padding:var(--token-padding-y) 2px;min-width:1px}:host [contenteditable]:focus-visible{outline:0}:host [contenteditable]:last-child{flex:1}:host .chip{padding:var(--token-padding-y) .25em;border-color:var(--token-input-chip-border-color);background-color:var(--token-input-chip-background-color)}:host .chip>span{font-size:var(--font-hint);color:var(--text-color-hint)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: YvcAutocompleteModule }, { kind: "component", type: i2.AutocompleteOptionsComponent, selector: "yvc-autocomplete-options", inputs: ["autocompleteOptionTemplate", "values", "field", "focusedIndex"], outputs: ["focusedIndexChange", "optionSelect"] }] }); }
751
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FocusWithinDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
752
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: FocusWithinDirective, isStandalone: true, selector: "[yuvFocusWithin]", outputs: { yuvFocusWithin: "yuvFocusWithin", yuvFocusWithinBlur: "yuvFocusWithinBlur" }, host: { listeners: { "focusin": "onFocusIn($event)", "focusout": "onFocusOut($event)" }, properties: { "class.focusWithin": "this.hasFocusWithin" } }, ngImport: i0 }); }
925
753
  }
926
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TokenInputComponent, decorators: [{
927
- type: Component,
928
- args: [{ selector: 'yuv-token-input', standalone: true, imports: [CommonModule, YvcAutocompleteModule], template: "<!-- fi {{focusedTokenIndex}} -->\n\n@for (ft of formTokens; let i = $index; track $index) {\n @if (ft.type === TEXT_TOKEN_TYPE) {\n <div\n contenteditable\n [attr.data-id]=\"ft.id\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus($event)\"\n (keydown.enter)=\"onTokenEnter($event)\"\n (keydown.arrowLeft)=\"onArrowLeft($event)\"\n (keydown.arrowRight)=\"onArrowRight($event)\"\n (keydown.delete)=\"onDelete($event, i)\"\n (keydown.backspace)=\"onBackspace($event, i)\"\n ></div>\n } @else {\n @if (tokenTemplate()) {\n <ng-container *ngTemplateOutlet=\"tokenTemplate()!; context: { $implicit: ft }\"></ng-container>\n } @else {\n <div class=\"chip\">{{ ft.label }}</div>\n }\n }\n}\n\n<ng-template #options>\n <yvc-autocomplete-options\n class=\"popover animateIn\"\n [values]=\"autocompleteValues\"\n [(focusedIndex)]=\"autocompleteSelectedIndex\"\n [autocompleteOptionTemplate]=\"optionTemplate() || null\"\n (optionSelect)=\"onOptionSelect($event)\"\n [field]=\"'label'\"\n ></yvc-autocomplete-options>\n</ng-template>\n", styles: [":host{--token-input-chip-border-color: var(--item-focus-border-color);--token-input-chip-background-color: var(--item-focus-background-color);--token-padding-y: .15em;display:flex;align-items:center;flex-flow:row wrap;padding:2px}:host [contenteditable],:host .chip{border:1px solid transparent;border-radius:2px}:host [contenteditable]{display:inline-block;padding:var(--token-padding-y) 2px;min-width:1px}:host [contenteditable]:focus-visible{outline:0}:host [contenteditable]:last-child{flex:1}:host .chip{padding:var(--token-padding-y) .25em;border-color:var(--token-input-chip-border-color);background-color:var(--token-input-chip-background-color)}:host .chip>span{font-size:var(--font-hint);color:var(--text-color-hint)}\n"] }]
929
- }], propDecorators: { onArrowUpKey: [{
930
- type: HostListener,
931
- args: ['keydown.arrowUp', ['$event']]
932
- }], onArrowDownKey: [{
754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FocusWithinDirective, decorators: [{
755
+ type: Directive,
756
+ args: [{
757
+ selector: '[yuvFocusWithin]',
758
+ standalone: true
759
+ }]
760
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { hasFocusWithin: [{
761
+ type: HostBinding,
762
+ args: ['class.focusWithin']
763
+ }], onFocusIn: [{
933
764
  type: HostListener,
934
- args: ['keydown.arrowDown', ['$event']]
935
- }], onEnterKey: [{
765
+ args: ['focusin', ['$event']]
766
+ }], onFocusOut: [{
936
767
  type: HostListener,
937
- args: ['keydown.enter', ['$event']]
768
+ args: ['focusout', ['$event']]
769
+ }], yuvFocusWithin: [{
770
+ type: Output
771
+ }], yuvFocusWithinBlur: [{
772
+ type: Output
938
773
  }] } });
939
774
 
940
- class FocusIndicatorComponent {
941
- #elRef = inject(ElementRef);
775
+ /**
776
+ * Directive for applying light dismiss actions. Adding this directive will trigger
777
+ * the given function when the user clicks outside the component or hits escape.
778
+ *
779
+ * ```ts
780
+ * <div class="notifications" (yuvLightDismiss)="close()">
781
+ * ...
782
+ * </div>
783
+ * ```
784
+ */
785
+ class LightDismissDirective {
942
786
  constructor() {
943
- fromEvent(document, 'keyup')
944
- .pipe(takeUntilDestroyed(), filter$1((e) => e.code === 'Tab'))
945
- .subscribe(() => this.#position());
946
- fromEvent(document, 'focusout')
947
- .pipe(takeUntilDestroyed())
948
- .subscribe(() => {
949
- const fi = this.#elRef.nativeElement;
950
- fi.classList.remove('visible');
951
- });
787
+ this.elRef = inject(ElementRef);
788
+ this.yuvLightDismiss = output();
952
789
  }
953
- #position() {
954
- setTimeout(() => {
955
- const focusedElement = document.activeElement;
956
- const fi = this.#elRef.nativeElement;
957
- if (fi && focusedElement && focusedElement.matches(':focus-visible')) {
958
- fi.classList.add('visible');
959
- const { left, top, width, height } = focusedElement.getBoundingClientRect();
960
- fi.style.translate = ` ${Math.round(left)}px ${Math.round(top)}px`;
961
- fi.style.width = `${Math.round(width)}px`;
962
- fi.style.height = `${Math.round(height)}px`;
963
- }
790
+ onKeydownHandler(event) {
791
+ if (!event.defaultPrevented) {
792
+ this.yuvLightDismiss.emit();
793
+ }
794
+ }
795
+ onMousedown(event) {
796
+ if (!this.elRef.nativeElement.contains(event.target)) {
797
+ this.yuvLightDismiss.emit();
798
+ }
799
+ }
800
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LightDismissDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
801
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: LightDismissDirective, isStandalone: true, selector: "[yuvLightDismiss]", outputs: { yuvLightDismiss: "yuvLightDismiss" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)", "document:mousedown": "onMousedown($event)" } }, ngImport: i0 }); }
802
+ }
803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LightDismissDirective, decorators: [{
804
+ type: Directive,
805
+ args: [{
806
+ selector: '[yuvLightDismiss]',
807
+ standalone: true
808
+ }]
809
+ }], propDecorators: { onKeydownHandler: [{
810
+ type: HostListener,
811
+ args: ['document:keydown.escape', ['$event']]
812
+ }], onMousedown: [{
813
+ type: HostListener,
814
+ args: ['document:mousedown', ['$event']]
815
+ }] } });
816
+
817
+ class LongPressDirective {
818
+ constructor() {
819
+ this.elRef = inject(ElementRef);
820
+ this.threshold = 500;
821
+ this.yuvLongPress = input({
822
+ enabled: false
964
823
  });
824
+ this.longpress = output();
825
+ const mousedown = fromEvent(this.elRef.nativeElement, 'mousedown').pipe(takeUntilDestroyed(), filter((event) => event.button == 0), // Only allow left button (Primary button)
826
+ map(() => true) // turn on threshold counter
827
+ );
828
+ const touchstart = fromEvent(this.elRef.nativeElement, 'touchstart').pipe(takeUntilDestroyed(), map(() => true));
829
+ const touchEnd = fromEvent(this.elRef.nativeElement, 'touchend').pipe(takeUntilDestroyed(), map(() => false));
830
+ const mouseup = fromEvent(window, 'mouseup').pipe(takeUntilDestroyed(), filter((event) => event.button == 0), // Only allow left button (Primary button)
831
+ map(() => false) // reset threshold counter
832
+ );
833
+ merge(mousedown, mouseup, touchstart, touchEnd)
834
+ .pipe(takeUntilDestroyed(), switchMap((state) => (state ? timer(this.threshold, 100) : of(null))), filter((value) => !!value))
835
+ .subscribe(() => this.longpress.emit());
965
836
  }
966
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FocusIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
967
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FocusIndicatorComponent, isStandalone: true, selector: "yuv-focus-indicator", host: { attributes: { "inert": "true" } }, ngImport: i0, template: '', isInline: true, styles: [":host{--outline-color: rgba(var(--color-accent-rgb), .4);--outline-width: 2px;--outline-offset: 1px;--border-radius: var(--outline-width);display:block;position:absolute;inset-inline-start:0;inset-block-start:0;opacity:0;outline:var(--outline-width) solid var(--outline-color);outline-offset:var(--outline-offset);border-radius:var(--border-radius);transition:all .15s ease}:host.visible{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
837
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LongPressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
838
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.1", type: LongPressDirective, isStandalone: true, selector: "[yuvLongPress]", inputs: { yuvLongPress: { classPropertyName: "yuvLongPress", publicName: "yuvLongPress", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { longpress: "longpress" }, ngImport: i0 }); }
968
839
  }
969
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FocusIndicatorComponent, decorators: [{
970
- type: Component,
971
- args: [{ selector: 'yuv-focus-indicator', standalone: true, imports: [CommonModule], template: '', host: {
972
- inert: 'true'
973
- }, styles: [":host{--outline-color: rgba(var(--color-accent-rgb), .4);--outline-width: 2px;--outline-offset: 1px;--border-radius: var(--outline-width);display:block;position:absolute;inset-inline-start:0;inset-block-start:0;opacity:0;outline:var(--outline-width) solid var(--outline-color);outline-offset:var(--outline-offset);border-radius:var(--border-radius);transition:all .15s ease}:host.visible{opacity:1}\n"] }]
840
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LongPressDirective, decorators: [{
841
+ type: Directive,
842
+ args: [{
843
+ selector: '[yuvLongPress]',
844
+ standalone: true
845
+ }]
974
846
  }], ctorParameters: () => [] });
975
847
 
976
848
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -980,16 +852,16 @@ class NoopValueAccessorDirective {
980
852
  writeValue(obj) { }
981
853
  registerOnChange(fn) { }
982
854
  registerOnTouched(fn) { }
983
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NoopValueAccessorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
984
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: NoopValueAccessorDirective, isStandalone: true, providers: [
855
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NoopValueAccessorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
856
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.1", type: NoopValueAccessorDirective, isStandalone: true, providers: [
985
857
  {
986
858
  provide: NG_VALUE_ACCESSOR,
987
859
  multi: true,
988
- useExisting: forwardRef(() => NoopValueAccessorDirective),
989
- },
860
+ useExisting: forwardRef(() => NoopValueAccessorDirective)
861
+ }
990
862
  ], ngImport: i0 }); }
991
863
  }
992
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NoopValueAccessorDirective, decorators: [{
864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NoopValueAccessorDirective, decorators: [{
993
865
  type: Directive,
994
866
  args: [{
995
867
  standalone: true,
@@ -997,80 +869,281 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
997
869
  {
998
870
  provide: NG_VALUE_ACCESSOR,
999
871
  multi: true,
1000
- useExisting: forwardRef(() => NoopValueAccessorDirective),
1001
- },
1002
- ],
872
+ useExisting: forwardRef(() => NoopValueAccessorDirective)
873
+ }
874
+ ]
1003
875
  }]
1004
876
  }] });
1005
- function injectNgControl() {
877
+ function injectNgControl(cva) {
1006
878
  const ngControl = inject(NgControl, { self: true, optional: true });
1007
879
  if (!ngControl)
1008
- throw new Error('...');
880
+ return null;
1009
881
  if (ngControl instanceof FormControlDirective || ngControl instanceof FormControlName || ngControl instanceof NgModel) {
882
+ if (cva)
883
+ ngControl.valueAccessor = cva;
1010
884
  return ngControl;
1011
885
  }
1012
886
  throw new Error('...');
1013
887
  }
1014
888
 
1015
- class ErrorMessagesService {
889
+ const directives = [
890
+ BusyOverlayDirective,
891
+ FocusWithinDirective,
892
+ FileDropZoneDirective,
893
+ ClickDoubleDirective,
894
+ LightDismissDirective,
895
+ ContainerSizeDirective,
896
+ LongPressDirective,
897
+ DragSelectDirective,
898
+ DragScrollDirective,
899
+ NoopValueAccessorDirective,
900
+ AutofocusChildDirective,
901
+ AutofocusDelayedDirective
902
+ ];
903
+ const components = [ConfirmComponent];
904
+ class YuvCommonModule {
905
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
906
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, imports: [BusyOverlayDirective,
907
+ FocusWithinDirective,
908
+ FileDropZoneDirective,
909
+ ClickDoubleDirective,
910
+ LightDismissDirective,
911
+ ContainerSizeDirective,
912
+ LongPressDirective,
913
+ DragSelectDirective,
914
+ DragScrollDirective,
915
+ NoopValueAccessorDirective,
916
+ AutofocusChildDirective,
917
+ AutofocusDelayedDirective, ConfirmComponent], exports: [BusyOverlayDirective,
918
+ FocusWithinDirective,
919
+ FileDropZoneDirective,
920
+ ClickDoubleDirective,
921
+ LightDismissDirective,
922
+ ContainerSizeDirective,
923
+ LongPressDirective,
924
+ DragSelectDirective,
925
+ DragScrollDirective,
926
+ NoopValueAccessorDirective,
927
+ AutofocusChildDirective,
928
+ AutofocusDelayedDirective, ConfirmComponent] }); }
929
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, imports: [components] }); }
930
+ }
931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: YuvCommonModule, decorators: [{
932
+ type: NgModule,
933
+ args: [{
934
+ imports: [...directives, ...components],
935
+ exports: [...directives, ...components]
936
+ }]
937
+ }] });
938
+
939
+ function getFocusableChildren(element) {
940
+ return [...Array.from(element.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])'))].filter((el) => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden'));
941
+ }
942
+ function getFirstFocusableChild(element) {
943
+ return getFocusableChildren(element)[0];
944
+ }
945
+
946
+ /**
947
+ * Service to store and retrieve layout settings. Those
948
+ * settings are stored on the users device because in
949
+ * general layout settings like panel widths are highly
950
+ * dependent on the current device.
951
+ */
952
+ class LayoutSettingsService {
953
+ #STORAGE_PREFIX = 'yuv.layout:';
954
+ saveSettings(key, settings) {
955
+ if (typeof settings === 'object') {
956
+ localStorage.setItem(this.#getKey(key), JSON.stringify(settings));
957
+ return true;
958
+ }
959
+ else
960
+ return false;
961
+ }
962
+ getSettings(key) {
963
+ try {
964
+ const v = localStorage.getItem(this.#getKey(key));
965
+ return v ? JSON.parse(v) : undefined;
966
+ }
967
+ catch (e) {
968
+ console.error('Error while parsing layout settings', e);
969
+ return undefined;
970
+ }
971
+ }
972
+ #getKey(key) {
973
+ return `${this.#STORAGE_PREFIX}${key}`;
974
+ }
975
+ /**
976
+ * Clears all layout settings.
977
+ */
978
+ clearSettings() {
979
+ Object.keys(localStorage).forEach((key) => {
980
+ if (key.startsWith(this.#STORAGE_PREFIX)) {
981
+ localStorage.removeItem(key);
982
+ }
983
+ });
984
+ }
985
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LayoutSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
986
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LayoutSettingsService, providedIn: 'root' }); }
987
+ }
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: LayoutSettingsService, decorators: [{
989
+ type: Injectable,
990
+ args: [{
991
+ providedIn: 'root'
992
+ }]
993
+ }] });
994
+
995
+ // eslint-disable-next-line @angular-eslint/component-class-suffix
996
+ class AbstractMatFormField {
1016
997
  constructor() {
1017
- this.translate = inject(TranslateService);
1018
- }
1019
- getErrorLabel(error, params) {
1020
- console.log('getErrorLabel', error, params);
1021
- switch (error) {
1022
- case 'daterange':
1023
- return this.translate.instant('yuv.object-form-element.error.daterange.invalid', params);
1024
- case 'daterangeorder':
1025
- return this.translate.instant('yuv.object-form-element.error.daterangeorder.invalid', params);
1026
- case 'numberrange':
1027
- return this.translate.instant('yuv.object-form-element.error.numberrange.invalid', params);
1028
- case 'numberrangeorder':
1029
- return this.translate.instant('yuv.object-form-element.error.numberrangeorder.invalid', params);
1030
- case 'number':
1031
- return this.translate.instant('yuv.object-form-element.error.number', params);
1032
- case 'precision':
1033
- return this.translate.instant('yuv.object-form-element.error.number.precision', params);
1034
- case 'scale':
1035
- return this.translate.instant('yuv.object-form-element.error.number.scale', params);
1036
- case 'regex':
1037
- return this.translate.instant('yuv.object-form-element.error.string.regex.nomatch', params);
1038
- case 'pattern':
1039
- return this.translate.instant('yuv.object-form-element.error.string.regex.nomatch', params);
1040
- case 'classif icationemail':
1041
- return this.translate.instant('yuv.object-form-element.error.string.classification.email', params);
1042
- case 'classificationphone':
1043
- return this.translate.instant('yuv.object-form-element.error.string.classification.phone', params);
1044
- case 'classificationurl':
1045
- return this.translate.instant('yuv.object-form-element.error.string.classification.url', params);
1046
- case 'onlyWhitespaces':
1047
- return this.translate.instant('yuv.object-form-element.error.string.whitespaces', params);
1048
- case 'datecontrol':
1049
- return this.translate.instant('yuv.object-form-element.error.date.invalid', params);
1050
- case 'required':
1051
- console.log('required', params);
1052
- return this.translate.instant('yuv.object-form-element.error.required', params);
1053
- case 'maxlength':
1054
- return this.translate.instant('yuv.object-form-element.error.maxlength', params);
1055
- case 'minlength':
1056
- return this.translate.instant('yuv.object-form-element.error.minlength', params);
1057
- case 'minmax':
1058
- return this.translate.instant('yuv.object-form-element.error.minmax', params);
1059
- case 'minvalue':
1060
- return this.translate.instant('yuv.object-form-element.error.minvalue', params);
1061
- case 'maxvalue':
1062
- return this.translate.instant('yuv.object-form-element.error.maxvalue', params);
1063
- case 'empty':
1064
- return this.translate.instant('yuv.object-form-element.recent-activities.list.empty', params);
1065
- default:
1066
- console.log('default', error, params);
1067
- return this.translate.instant(error, params);
998
+ this.stateChanges = new Subject();
999
+ this.elRef = inject(ElementRef);
1000
+ this.#value = signal(null);
1001
+ this.#id = signal('');
1002
+ this.#placeholder = signal('');
1003
+ this.ngControl = null;
1004
+ this.#focused = signal(false);
1005
+ this.#empty = signal(false);
1006
+ this.#required = signal(false);
1007
+ this.#disabled = signal(false);
1008
+ this.focusHandled = signal(false);
1009
+ this.#errorState = signal(false);
1010
+ }
1011
+ onFocusIn() {
1012
+ this.focused = true;
1013
+ }
1014
+ onFocusout() {
1015
+ this.focused = false;
1016
+ }
1017
+ #value;
1018
+ set value(v) {
1019
+ this.#value.set(v);
1020
+ this.empty = !v;
1021
+ this.stateChanges.next();
1022
+ }
1023
+ get value() {
1024
+ return this.#value();
1025
+ }
1026
+ #id;
1027
+ set id(v) {
1028
+ this.#id.set(v);
1029
+ this.stateChanges.next();
1030
+ }
1031
+ get id() {
1032
+ return this.#id();
1033
+ }
1034
+ #placeholder;
1035
+ set placeholder(v) {
1036
+ this.#placeholder.set(v);
1037
+ this.stateChanges.next();
1038
+ }
1039
+ get placeholder() {
1040
+ return this.#placeholder();
1041
+ }
1042
+ #focused;
1043
+ set focused(f) {
1044
+ this.#focused.set(f);
1045
+ this.stateChanges.next();
1046
+ }
1047
+ get focused() {
1048
+ return this.#focused();
1049
+ }
1050
+ // #shouldLabelFloat = signal<boolean>(false);
1051
+ // set shouldLabelFloat(f: boolean) {
1052
+ // this.#shouldLabelFloat.set(f);
1053
+ // this.stateChanges.next();
1054
+ // }
1055
+ get shouldLabelFloat() {
1056
+ return this.focused || !this.empty || !!this.ngControl?.invalid;
1057
+ }
1058
+ #empty;
1059
+ set empty(f) {
1060
+ this.#empty.set(f);
1061
+ this.stateChanges.next();
1062
+ }
1063
+ get empty() {
1064
+ return this.#empty();
1065
+ }
1066
+ #required;
1067
+ set required(f) {
1068
+ this.#required.set(coerceBooleanProperty(f));
1069
+ this.stateChanges.next();
1070
+ }
1071
+ get required() {
1072
+ return this.#required();
1073
+ }
1074
+ #disabled;
1075
+ set disabled(f) {
1076
+ this.#disabled.set(coerceBooleanProperty(f));
1077
+ this.stateChanges.next();
1078
+ }
1079
+ get disabled() {
1080
+ return this.#disabled();
1081
+ }
1082
+ #errorState;
1083
+ set errorState(f) {
1084
+ this.#errorState.set(coerceBooleanProperty(f));
1085
+ this.stateChanges.next();
1086
+ }
1087
+ get errorState() {
1088
+ return this.#errorState();
1089
+ }
1090
+ setDescribedByIds(ids) {
1091
+ // this.describedBy = ids.join(' ');
1092
+ }
1093
+ onContainerClick(event) {
1094
+ if (this.focusHandled())
1095
+ return;
1096
+ const fe = getFocusableChildren(this.elRef.nativeElement);
1097
+ if (!fe.includes(event.target)) {
1098
+ fe[0].focus();
1068
1099
  }
1069
1100
  }
1070
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ErrorMessagesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1071
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ErrorMessagesService, providedIn: 'root' }); }
1101
+ onNgOnDestroy() {
1102
+ this.stateChanges.complete();
1103
+ }
1104
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AbstractMatFormField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1105
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.1", type: AbstractMatFormField, isStandalone: true, selector: "ng-component", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled" }, host: { listeners: { "focusin": "onFocusIn()", "focusout": "onFocusout()" } }, ngImport: i0, template: '', isInline: true }); }
1106
+ }
1107
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AbstractMatFormField, decorators: [{
1108
+ type: Component,
1109
+ args: [{ template: '' }]
1110
+ }], propDecorators: { onFocusIn: [{
1111
+ type: HostListener,
1112
+ args: ['focusin']
1113
+ }], onFocusout: [{
1114
+ type: HostListener,
1115
+ args: ['focusout']
1116
+ }], placeholder: [{
1117
+ type: Input
1118
+ }], required: [{
1119
+ type: Input
1120
+ }], disabled: [{
1121
+ type: Input
1122
+ }] } });
1123
+
1124
+ var DialogSize;
1125
+ (function (DialogSize) {
1126
+ DialogSize["SMALL"] = "small";
1127
+ DialogSize["MEDIUM"] = "medium";
1128
+ DialogSize["LARGE"] = "large";
1129
+ DialogSize["EXTRA_LARGE"] = "extra-large";
1130
+ DialogSize["FULL_SCREEN"] = "full-screen";
1131
+ })(DialogSize || (DialogSize = {}));
1132
+
1133
+ class ConfirmService {
1134
+ #dialog = inject(MatDialog);
1135
+ confirm(data) {
1136
+ return this.#dialog
1137
+ .open(ConfirmComponent, {
1138
+ data
1139
+ })
1140
+ .afterClosed()
1141
+ .pipe(map((result) => !!result));
1142
+ }
1143
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1144
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmService, providedIn: 'root' }); }
1072
1145
  }
1073
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ErrorMessagesService, decorators: [{
1146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: ConfirmService, decorators: [{
1074
1147
  type: Injectable,
1075
1148
  args: [{
1076
1149
  providedIn: 'root'
@@ -1081,5 +1154,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1081
1154
  * Generated bundle index. Do not edit.
1082
1155
  */
1083
1156
 
1084
- export { BusyOverlayDirective, ClickDoubleDirective, ContainerSizeDirective, DragSelectDirective, DragSelectItemDirective, ErrorMessagesService, FileDropZoneDirective, FocusIndicatorComponent, FocusWithinDirective, LightDismissDirective, LongPressDirective, NoopValueAccessorDirective, TokenInputComponent, injectNgControl };
1157
+ export { AbstractMatFormField, AutofocusChildDirective, AutofocusDelayedDirective, BusyOverlayDirective, ClickDoubleDirective, ConfirmComponent, ConfirmService, ContainerSizeDirective, DialogComponent, DialogSize, DragScrollDirective, DragSelectDirective, DragSelectItemDirective, FileDropZoneDirective, FocusWithinDirective, LayoutSettingsService, LightDismissDirective, LongPressDirective, NoopValueAccessorDirective, YuvCommonModule, getFirstFocusableChild, getFocusableChildren, injectNgControl };
1085
1158
  //# sourceMappingURL=yuuvis-client-framework-common.mjs.map