@spartan-ng/brain 0.0.1-alpha.373 → 0.0.1-alpha.379

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 (398) hide show
  1. package/accordion/README.md +3 -0
  2. package/accordion/index.d.ts +13 -0
  3. package/accordion/lib/brn-accordion-content.component.d.ts +15 -0
  4. package/accordion/lib/brn-accordion.directive.d.ts +47 -0
  5. package/alert-dialog/README.md +3 -0
  6. package/alert-dialog/index.d.ts +25 -0
  7. package/alert-dialog/lib/brn-alert-dialog-content.directive.d.ts +6 -0
  8. package/alert-dialog/lib/brn-alert-dialog-description.directive.d.ts +6 -0
  9. package/alert-dialog/lib/brn-alert-dialog-overlay.component.d.ts +6 -0
  10. package/alert-dialog/lib/brn-alert-dialog-title.directive.d.ts +6 -0
  11. package/alert-dialog/lib/brn-alert-dialog-trigger.directive.d.ts +8 -0
  12. package/alert-dialog/lib/brn-alert-dialog.component.d.ts +7 -0
  13. package/avatar/README.md +3 -0
  14. package/avatar/index.d.ts +17 -0
  15. package/avatar/lib/brn-avatar.component.d.ts +7 -0
  16. package/avatar/lib/fallback/brn-avatar-fallback.directive.d.ts +11 -0
  17. package/avatar/lib/fallback/index.d.ts +1 -0
  18. package/avatar/lib/image/brn-avatar-image.directive.d.ts +9 -0
  19. package/avatar/lib/image/index.d.ts +1 -0
  20. package/avatar/lib/util/hex-color-for.d.ts +1 -0
  21. package/avatar/lib/util/index.d.ts +3 -0
  22. package/avatar/lib/util/initials.pipe.d.ts +7 -0
  23. package/avatar/lib/util/is-bright.d.ts +1 -0
  24. package/calendar/README.md +3 -0
  25. package/calendar/index.d.ts +36 -0
  26. package/calendar/lib/brn-calendar-cell-button.directive.d.ts +59 -0
  27. package/calendar/lib/brn-calendar-cell.directive.d.ts +5 -0
  28. package/calendar/lib/brn-calendar-grid.directive.d.ts +7 -0
  29. package/calendar/lib/brn-calendar-header.directive.d.ts +7 -0
  30. package/calendar/lib/brn-calendar-next-button.directive.d.ts +13 -0
  31. package/calendar/lib/brn-calendar-previous-button.directive.d.ts +13 -0
  32. package/calendar/lib/brn-calendar-week.directive.d.ts +25 -0
  33. package/calendar/lib/brn-calendar-weekday.directive.d.ts +25 -0
  34. package/calendar/lib/brn-calendar.directive.d.ts +55 -0
  35. package/calendar/lib/brn-calendar.token.d.ts +8 -0
  36. package/calendar/lib/i18n/calendar-i18n.d.ts +17 -0
  37. package/checkbox/lib/brn-checkbox.component.d.ts +1 -1
  38. package/collapsible/README.md +3 -0
  39. package/collapsible/index.d.ts +16 -0
  40. package/collapsible/lib/brn-collapsible-content.component.d.ts +19 -0
  41. package/collapsible/lib/brn-collapsible-trigger.directive.d.ts +12 -0
  42. package/collapsible/lib/brn-collapsible.component.d.ts +11 -0
  43. package/command/README.md +3 -0
  44. package/command/index.d.ts +33 -0
  45. package/command/lib/brn-command-empty.directive.d.ts +6 -0
  46. package/command/lib/brn-command-group.component.d.ts +6 -0
  47. package/command/lib/brn-command-input.directive.d.ts +6 -0
  48. package/command/lib/brn-command-item.directive.d.ts +6 -0
  49. package/command/lib/brn-command-list.component.d.ts +6 -0
  50. package/command/lib/brn-command-loader.directive.d.ts +6 -0
  51. package/command/lib/brn-command-separator.component.d.ts +6 -0
  52. package/command/lib/brn-command.component.d.ts +6 -0
  53. package/date-time/README.md +3 -0
  54. package/date-time/index.d.ts +2 -0
  55. package/date-time/lib/date-adapter.d.ts +176 -0
  56. package/date-time/lib/native-date-adapter.d.ts +103 -0
  57. package/date-time-luxon/README.md +3 -0
  58. package/date-time-luxon/index.d.ts +1 -0
  59. package/date-time-luxon/lib/date-adapter.d.ts +29 -0
  60. package/dialog/README.md +3 -0
  61. package/dialog/index.d.ts +33 -0
  62. package/dialog/lib/brn-dialog-close.directive.d.ts +10 -0
  63. package/dialog/lib/brn-dialog-content.directive.d.ts +12 -0
  64. package/dialog/lib/brn-dialog-description.directive.d.ts +8 -0
  65. package/dialog/lib/brn-dialog-options.d.ts +26 -0
  66. package/dialog/lib/brn-dialog-overlay.component.d.ts +8 -0
  67. package/dialog/lib/brn-dialog-ref.d.ts +24 -0
  68. package/dialog/lib/brn-dialog-state.d.ts +1 -0
  69. package/dialog/lib/brn-dialog-title.directive.d.ts +8 -0
  70. package/dialog/lib/brn-dialog-trigger.directive.d.ts +16 -0
  71. package/dialog/lib/brn-dialog-utils.d.ts +1 -0
  72. package/dialog/lib/brn-dialog.component.d.ts +56 -0
  73. package/dialog/lib/brn-dialog.service.d.ts +22 -0
  74. package/esm2022/accordion/index.mjs +31 -0
  75. package/esm2022/accordion/lib/brn-accordion-content.component.mjs +50 -0
  76. package/esm2022/accordion/lib/brn-accordion.directive.mjs +180 -0
  77. package/esm2022/accordion/spartan-ng-brain-accordion.mjs +5 -0
  78. package/esm2022/alert-dialog/index.mjs +45 -0
  79. package/esm2022/alert-dialog/lib/brn-alert-dialog-content.directive.mjs +17 -0
  80. package/esm2022/alert-dialog/lib/brn-alert-dialog-description.directive.mjs +18 -0
  81. package/esm2022/alert-dialog/lib/brn-alert-dialog-overlay.component.mjs +20 -0
  82. package/esm2022/alert-dialog/lib/brn-alert-dialog-title.directive.mjs +18 -0
  83. package/esm2022/alert-dialog/lib/brn-alert-dialog-trigger.directive.mjs +27 -0
  84. package/esm2022/alert-dialog/lib/brn-alert-dialog.component.mjs +40 -0
  85. package/esm2022/alert-dialog/spartan-ng-brain-alert-dialog.mjs +5 -0
  86. package/esm2022/avatar/index.mjs +23 -0
  87. package/esm2022/avatar/lib/brn-avatar.component.mjs +31 -0
  88. package/esm2022/avatar/lib/fallback/brn-avatar-fallback.directive.mjs +21 -0
  89. package/esm2022/avatar/lib/fallback/index.mjs +2 -0
  90. package/esm2022/avatar/lib/image/brn-avatar-image.directive.mjs +29 -0
  91. package/esm2022/avatar/lib/image/index.mjs +2 -0
  92. package/esm2022/avatar/lib/util/hex-color-for.mjs +22 -0
  93. package/esm2022/avatar/lib/util/index.mjs +4 -0
  94. package/esm2022/avatar/lib/util/initials.pipe.mjs +27 -0
  95. package/esm2022/avatar/lib/util/is-bright.mjs +12 -0
  96. package/esm2022/avatar/spartan-ng-brain-avatar.mjs +5 -0
  97. package/esm2022/calendar/index.mjs +62 -0
  98. package/esm2022/calendar/lib/brn-calendar-cell-button.directive.mjs +160 -0
  99. package/esm2022/calendar/lib/brn-calendar-cell.directive.mjs +17 -0
  100. package/esm2022/calendar/lib/brn-calendar-grid.directive.mjs +21 -0
  101. package/esm2022/calendar/lib/brn-calendar-header.directive.mjs +22 -0
  102. package/esm2022/calendar/lib/brn-calendar-next-button.directive.mjs +42 -0
  103. package/esm2022/calendar/lib/brn-calendar-previous-button.directive.mjs +42 -0
  104. package/esm2022/calendar/lib/brn-calendar-week.directive.mjs +64 -0
  105. package/esm2022/calendar/lib/brn-calendar-weekday.directive.mjs +48 -0
  106. package/esm2022/calendar/lib/brn-calendar.directive.mjs +154 -0
  107. package/esm2022/calendar/lib/brn-calendar.token.mjs +12 -0
  108. package/esm2022/calendar/lib/i18n/calendar-i18n.mjs +33 -0
  109. package/esm2022/calendar/spartan-ng-brain-calendar.mjs +5 -0
  110. package/esm2022/checkbox/lib/brn-checkbox.component.mjs +1 -1
  111. package/esm2022/collapsible/index.mjs +30 -0
  112. package/esm2022/collapsible/lib/brn-collapsible-content.component.mjs +61 -0
  113. package/esm2022/collapsible/lib/brn-collapsible-trigger.directive.mjs +35 -0
  114. package/esm2022/collapsible/lib/brn-collapsible.component.mjs +33 -0
  115. package/esm2022/collapsible/spartan-ng-brain-collapsible.mjs +5 -0
  116. package/esm2022/command/index.mjs +64 -0
  117. package/esm2022/command/lib/brn-command-empty.directive.mjs +29 -0
  118. package/esm2022/command/lib/brn-command-group.component.mjs +45 -0
  119. package/esm2022/command/lib/brn-command-input.directive.mjs +29 -0
  120. package/esm2022/command/lib/brn-command-item.directive.mjs +36 -0
  121. package/esm2022/command/lib/brn-command-list.component.mjs +35 -0
  122. package/esm2022/command/lib/brn-command-loader.directive.mjs +29 -0
  123. package/esm2022/command/lib/brn-command-separator.component.mjs +30 -0
  124. package/esm2022/command/lib/brn-command.component.mjs +21 -0
  125. package/esm2022/command/spartan-ng-brain-command.mjs +5 -0
  126. package/esm2022/date-time/index.mjs +3 -0
  127. package/esm2022/date-time/lib/date-adapter.mjs +16 -0
  128. package/esm2022/date-time/lib/native-date-adapter.mjs +155 -0
  129. package/esm2022/date-time/spartan-ng-brain-date-time.mjs +5 -0
  130. package/esm2022/date-time-luxon/index.mjs +2 -0
  131. package/esm2022/date-time-luxon/lib/date-adapter.mjs +85 -0
  132. package/esm2022/date-time-luxon/spartan-ng-brain-date-time-luxon.mjs +5 -0
  133. package/esm2022/dialog/index.mjs +55 -0
  134. package/esm2022/dialog/lib/brn-dialog-close.directive.mjs +29 -0
  135. package/esm2022/dialog/lib/brn-dialog-content.directive.mjs +41 -0
  136. package/esm2022/dialog/lib/brn-dialog-description.directive.mjs +25 -0
  137. package/esm2022/dialog/lib/brn-dialog-options.mjs +19 -0
  138. package/esm2022/dialog/lib/brn-dialog-overlay.component.mjs +29 -0
  139. package/esm2022/dialog/lib/brn-dialog-ref.mjs +53 -0
  140. package/esm2022/dialog/lib/brn-dialog-state.mjs +2 -0
  141. package/esm2022/dialog/lib/brn-dialog-title.directive.mjs +25 -0
  142. package/esm2022/dialog/lib/brn-dialog-trigger.directive.mjs +39 -0
  143. package/esm2022/dialog/lib/brn-dialog-utils.mjs +12 -0
  144. package/esm2022/dialog/lib/brn-dialog.component.mjs +208 -0
  145. package/esm2022/dialog/lib/brn-dialog.service.mjs +127 -0
  146. package/esm2022/dialog/spartan-ng-brain-dialog.mjs +5 -0
  147. package/esm2022/form-field/index.mjs +2 -0
  148. package/esm2022/form-field/lib/brn-form-field-control.mjs +14 -0
  149. package/esm2022/form-field/spartan-ng-brain-form-field.mjs +5 -0
  150. package/esm2022/forms/index.mjs +4 -0
  151. package/esm2022/forms/lib/control-value-accessor.mjs +2 -0
  152. package/esm2022/forms/lib/error-options.mjs +26 -0
  153. package/esm2022/forms/lib/error-state-tracker.mjs +29 -0
  154. package/esm2022/forms/spartan-ng-brain-forms.mjs +5 -0
  155. package/esm2022/hover-card/index.mjs +29 -0
  156. package/esm2022/hover-card/lib/brn-hover-card-content.service.mjs +205 -0
  157. package/esm2022/hover-card/lib/brn-hover-card.component.mjs +34 -0
  158. package/esm2022/hover-card/lib/createHoverObservable.mjs +19 -0
  159. package/esm2022/hover-card/spartan-ng-brain-hover-card.mjs +5 -0
  160. package/esm2022/label/index.mjs +17 -0
  161. package/esm2022/label/lib/brn-label.directive.mjs +49 -0
  162. package/esm2022/label/spartan-ng-brain-label.mjs +5 -0
  163. package/esm2022/menu/index.mjs +100 -0
  164. package/esm2022/menu/lib/brn-context-menu-trigger.directive.mjs +40 -0
  165. package/esm2022/menu/lib/brn-menu-align.mjs +15 -0
  166. package/esm2022/menu/lib/brn-menu-bar.directive.mjs +17 -0
  167. package/esm2022/menu/lib/brn-menu-group.directive.mjs +17 -0
  168. package/esm2022/menu/lib/brn-menu-item-checkbox.directive.mjs +30 -0
  169. package/esm2022/menu/lib/brn-menu-item-radio.directive.mjs +30 -0
  170. package/esm2022/menu/lib/brn-menu-item.directive.mjs +27 -0
  171. package/esm2022/menu/lib/brn-menu-trigger.directive.mjs +36 -0
  172. package/esm2022/menu/lib/brn-menu.directive.mjs +50 -0
  173. package/esm2022/menu/spartan-ng-brain-menu.mjs +5 -0
  174. package/esm2022/popover/index.mjs +35 -0
  175. package/esm2022/popover/lib/brn-popover-close.directive.mjs +15 -0
  176. package/esm2022/popover/lib/brn-popover-content.directive.mjs +17 -0
  177. package/esm2022/popover/lib/brn-popover-trigger.directive.mjs +37 -0
  178. package/esm2022/popover/lib/brn-popover.component.mjs +81 -0
  179. package/esm2022/popover/spartan-ng-brain-popover.mjs +5 -0
  180. package/esm2022/progress/index.mjs +21 -0
  181. package/esm2022/progress/lib/brn-progress-indicator.component.mjs +22 -0
  182. package/esm2022/progress/lib/brn-progress.component.mjs +61 -0
  183. package/esm2022/progress/lib/brn-progress.token.mjs +9 -0
  184. package/esm2022/progress/spartan-ng-brain-progress.mjs +5 -0
  185. package/esm2022/radio-group/index.mjs +20 -0
  186. package/esm2022/radio-group/lib/brn-radio-group.component.mjs +90 -0
  187. package/esm2022/radio-group/lib/brn-radio-group.token.mjs +9 -0
  188. package/esm2022/radio-group/lib/brn-radio.component.mjs +185 -0
  189. package/esm2022/radio-group/spartan-ng-brain-radio-group.mjs +5 -0
  190. package/esm2022/select/index.mjs +56 -0
  191. package/esm2022/select/lib/brn-select-content.component.mjs +204 -0
  192. package/esm2022/select/lib/brn-select-group.directive.mjs +19 -0
  193. package/esm2022/select/lib/brn-select-label.directive.mjs +23 -0
  194. package/esm2022/select/lib/brn-select-option.directive.mjs +65 -0
  195. package/esm2022/select/lib/brn-select-value.component.mjs +46 -0
  196. package/esm2022/select/lib/brn-select.component.mjs +358 -0
  197. package/esm2022/select/lib/brn-select.service.mjs +197 -0
  198. package/esm2022/select/spartan-ng-brain-select.mjs +5 -0
  199. package/esm2022/separator/index.mjs +17 -0
  200. package/esm2022/separator/lib/brn-separator.component.mjs +24 -0
  201. package/esm2022/separator/spartan-ng-brain-separator.mjs +5 -0
  202. package/esm2022/sheet/index.mjs +50 -0
  203. package/esm2022/sheet/lib/brn-sheet-close.directive.mjs +15 -0
  204. package/esm2022/sheet/lib/brn-sheet-content.directive.mjs +25 -0
  205. package/esm2022/sheet/lib/brn-sheet-description.directive.mjs +18 -0
  206. package/esm2022/sheet/lib/brn-sheet-overlay.component.mjs +20 -0
  207. package/esm2022/sheet/lib/brn-sheet-title.directive.mjs +18 -0
  208. package/esm2022/sheet/lib/brn-sheet-trigger.directive.mjs +26 -0
  209. package/esm2022/sheet/lib/brn-sheet.component.mjs +55 -0
  210. package/esm2022/sheet/spartan-ng-brain-sheet.mjs +5 -0
  211. package/esm2022/slider/index.mjs +13 -0
  212. package/esm2022/slider/lib/brn-slider-thumb.directive.mjs +41 -0
  213. package/esm2022/slider/lib/brn-slider-tick-mark.directive.mjs +37 -0
  214. package/esm2022/slider/lib/brn-slider-track-active-fill.directive.mjs +29 -0
  215. package/esm2022/slider/lib/brn-slider-track.directive.mjs +290 -0
  216. package/esm2022/slider/spartan-ng-brain-slider.mjs +5 -0
  217. package/esm2022/switch/index.mjs +20 -0
  218. package/esm2022/switch/lib/brn-switch-thumb.component.mjs +16 -0
  219. package/esm2022/switch/lib/brn-switch.component.mjs +236 -0
  220. package/esm2022/switch/spartan-ng-brain-switch.mjs +5 -0
  221. package/esm2022/table/index.mjs +47 -0
  222. package/esm2022/table/lib/brn-cell-def.directive.mjs +22 -0
  223. package/esm2022/table/lib/brn-column-def.component.mjs +82 -0
  224. package/esm2022/table/lib/brn-column-manager.mjs +61 -0
  225. package/esm2022/table/lib/brn-footer-def.directive.mjs +22 -0
  226. package/esm2022/table/lib/brn-header-def.directive.mjs +22 -0
  227. package/esm2022/table/lib/brn-paginator.directive.mjs +109 -0
  228. package/esm2022/table/lib/brn-table.component.mjs +169 -0
  229. package/esm2022/table/spartan-ng-brain-table.mjs +5 -0
  230. package/esm2022/tabs/index.mjs +32 -0
  231. package/esm2022/tabs/lib/brn-tabs-list.directive.mjs +65 -0
  232. package/esm2022/tabs/lib/brn-tabs-paginated-list.directive.mjs +525 -0
  233. package/esm2022/tabs/lib/brn-tabs-trigger.directive.mjs +134 -0
  234. package/esm2022/tabs/spartan-ng-brain-tabs.mjs +5 -0
  235. package/esm2022/toggle/index.mjs +31 -0
  236. package/esm2022/toggle/lib/brn-toggle-group.component.mjs +159 -0
  237. package/esm2022/toggle/lib/brn-toggle-group.token.mjs +9 -0
  238. package/esm2022/toggle/lib/brn-toggle.directive.mjs +65 -0
  239. package/esm2022/toggle/spartan-ng-brain-toggle.mjs +5 -0
  240. package/esm2022/tooltip/index.mjs +35 -0
  241. package/esm2022/tooltip/lib/brn-tooltip-content.component.mjs +228 -0
  242. package/esm2022/tooltip/lib/brn-tooltip-content.directive.mjs +22 -0
  243. package/esm2022/tooltip/lib/brn-tooltip-trigger.directive.mjs +689 -0
  244. package/esm2022/tooltip/lib/brn-tooltip.directive.mjs +15 -0
  245. package/esm2022/tooltip/spartan-ng-brain-tooltip.mjs +5 -0
  246. package/fesm2022/spartan-ng-brain-accordion.mjs +259 -0
  247. package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -0
  248. package/fesm2022/spartan-ng-brain-alert-dialog.mjs +162 -0
  249. package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -0
  250. package/fesm2022/spartan-ng-brain-avatar.mjs +156 -0
  251. package/fesm2022/spartan-ng-brain-avatar.mjs.map +1 -0
  252. package/fesm2022/spartan-ng-brain-calendar.mjs +629 -0
  253. package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -0
  254. package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
  255. package/fesm2022/spartan-ng-brain-collapsible.mjs +152 -0
  256. package/fesm2022/spartan-ng-brain-collapsible.mjs.map +1 -0
  257. package/fesm2022/spartan-ng-brain-command.mjs +284 -0
  258. package/fesm2022/spartan-ng-brain-command.mjs.map +1 -0
  259. package/fesm2022/spartan-ng-brain-date-time-luxon.mjs +92 -0
  260. package/fesm2022/spartan-ng-brain-date-time-luxon.mjs.map +1 -0
  261. package/fesm2022/spartan-ng-brain-date-time.mjs +177 -0
  262. package/fesm2022/spartan-ng-brain-date-time.mjs.map +1 -0
  263. package/fesm2022/spartan-ng-brain-dialog.mjs +617 -0
  264. package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -0
  265. package/fesm2022/spartan-ng-brain-form-field.mjs +21 -0
  266. package/fesm2022/spartan-ng-brain-form-field.mjs.map +1 -0
  267. package/fesm2022/spartan-ng-brain-forms.mjs +61 -0
  268. package/fesm2022/spartan-ng-brain-forms.mjs.map +1 -0
  269. package/fesm2022/spartan-ng-brain-hover-card.mjs +274 -0
  270. package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -0
  271. package/fesm2022/spartan-ng-brain-label.mjs +69 -0
  272. package/fesm2022/spartan-ng-brain-label.mjs.map +1 -0
  273. package/fesm2022/spartan-ng-brain-menu.mjs +316 -0
  274. package/fesm2022/spartan-ng-brain-menu.mjs.map +1 -0
  275. package/fesm2022/spartan-ng-brain-popover.mjs +173 -0
  276. package/fesm2022/spartan-ng-brain-popover.mjs.map +1 -0
  277. package/fesm2022/spartan-ng-brain-progress.mjs +108 -0
  278. package/fesm2022/spartan-ng-brain-progress.mjs.map +1 -0
  279. package/fesm2022/spartan-ng-brain-radio-group.mjs +299 -0
  280. package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -0
  281. package/fesm2022/spartan-ng-brain-select.mjs +928 -0
  282. package/fesm2022/spartan-ng-brain-select.mjs.map +1 -0
  283. package/fesm2022/spartan-ng-brain-separator.mjs +44 -0
  284. package/fesm2022/spartan-ng-brain-separator.mjs.map +1 -0
  285. package/fesm2022/spartan-ng-brain-sheet.mjs +197 -0
  286. package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -0
  287. package/fesm2022/spartan-ng-brain-slider.mjs +399 -0
  288. package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -0
  289. package/fesm2022/spartan-ng-brain-switch.mjs +271 -0
  290. package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -0
  291. package/fesm2022/spartan-ng-brain-table.mjs +506 -0
  292. package/fesm2022/spartan-ng-brain-table.mjs.map +1 -0
  293. package/fesm2022/spartan-ng-brain-tabs.mjs +748 -0
  294. package/fesm2022/spartan-ng-brain-tabs.mjs.map +1 -0
  295. package/fesm2022/spartan-ng-brain-toggle.mjs +260 -0
  296. package/fesm2022/spartan-ng-brain-toggle.mjs.map +1 -0
  297. package/fesm2022/spartan-ng-brain-tooltip.mjs +975 -0
  298. package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -0
  299. package/form-field/README.md +3 -0
  300. package/form-field/index.d.ts +1 -0
  301. package/form-field/lib/brn-form-field-control.d.ts +11 -0
  302. package/forms/README.md +3 -0
  303. package/forms/index.d.ts +3 -0
  304. package/forms/lib/control-value-accessor.d.ts +2 -0
  305. package/forms/lib/error-options.d.ts +14 -0
  306. package/forms/lib/error-state-tracker.d.ts +15 -0
  307. package/hover-card/README.md +3 -0
  308. package/hover-card/index.d.ts +14 -0
  309. package/hover-card/lib/brn-hover-card-content.service.d.ts +65 -0
  310. package/hover-card/lib/brn-hover-card.component.d.ts +9 -0
  311. package/hover-card/lib/createHoverObservable.d.ts +4 -0
  312. package/label/README.md +3 -0
  313. package/label/index.d.ts +8 -0
  314. package/label/lib/brn-label.directive.d.ts +15 -0
  315. package/menu/README.md +3 -0
  316. package/menu/index.d.ts +49 -0
  317. package/menu/lib/brn-context-menu-trigger.directive.d.ts +13 -0
  318. package/menu/lib/brn-menu-align.d.ts +3 -0
  319. package/menu/lib/brn-menu-bar.directive.d.ts +6 -0
  320. package/menu/lib/brn-menu-group.directive.d.ts +6 -0
  321. package/menu/lib/brn-menu-item-checkbox.directive.d.ts +11 -0
  322. package/menu/lib/brn-menu-item-radio.directive.d.ts +11 -0
  323. package/menu/lib/brn-menu-item.directive.d.ts +10 -0
  324. package/menu/lib/brn-menu-trigger.directive.d.ts +10 -0
  325. package/menu/lib/brn-menu.directive.d.ts +11 -0
  326. package/package.json +182 -9
  327. package/popover/README.md +3 -0
  328. package/popover/index.d.ts +19 -0
  329. package/popover/lib/brn-popover-close.directive.d.ts +6 -0
  330. package/popover/lib/brn-popover-content.directive.d.ts +6 -0
  331. package/popover/lib/brn-popover-trigger.directive.d.ts +10 -0
  332. package/popover/lib/brn-popover.component.d.ts +14 -0
  333. package/progress/README.md +3 -0
  334. package/progress/index.d.ts +14 -0
  335. package/progress/lib/brn-progress-indicator.component.d.ts +6 -0
  336. package/progress/lib/brn-progress.component.d.ts +15 -0
  337. package/progress/lib/brn-progress.token.d.ts +4 -0
  338. package/radio-group/README.md +3 -0
  339. package/radio-group/index.d.ts +13 -0
  340. package/radio-group/lib/brn-radio-group.component.d.ts +57 -0
  341. package/radio-group/lib/brn-radio-group.token.d.ts +4 -0
  342. package/radio-group/lib/brn-radio.component.d.ts +58 -0
  343. package/select/README.md +3 -0
  344. package/select/index.d.ts +28 -0
  345. package/select/lib/brn-select-content.component.d.ts +50 -0
  346. package/select/lib/brn-select-group.directive.d.ts +6 -0
  347. package/select/lib/brn-select-label.directive.d.ts +9 -0
  348. package/select/lib/brn-select-option.directive.d.ts +25 -0
  349. package/select/lib/brn-select-value.component.d.ts +11 -0
  350. package/select/lib/brn-select.component.d.ts +82 -0
  351. package/select/lib/brn-select.service.d.ts +67 -0
  352. package/separator/README.md +3 -0
  353. package/separator/index.d.ts +8 -0
  354. package/separator/lib/brn-separator.component.d.ts +11 -0
  355. package/sheet/README.md +3 -0
  356. package/sheet/index.d.ts +28 -0
  357. package/sheet/lib/brn-sheet-close.directive.d.ts +6 -0
  358. package/sheet/lib/brn-sheet-content.directive.d.ts +8 -0
  359. package/sheet/lib/brn-sheet-description.directive.d.ts +6 -0
  360. package/sheet/lib/brn-sheet-overlay.component.d.ts +6 -0
  361. package/sheet/lib/brn-sheet-title.directive.d.ts +6 -0
  362. package/sheet/lib/brn-sheet-trigger.directive.d.ts +9 -0
  363. package/sheet/lib/brn-sheet.component.d.ts +9 -0
  364. package/slider/README.md +3 -0
  365. package/slider/index.d.ts +7 -0
  366. package/slider/lib/brn-slider-thumb.directive.d.ts +17 -0
  367. package/slider/lib/brn-slider-tick-mark.directive.d.ts +15 -0
  368. package/slider/lib/brn-slider-track-active-fill.directive.d.ts +10 -0
  369. package/slider/lib/brn-slider-track.directive.d.ts +139 -0
  370. package/switch/README.md +3 -0
  371. package/switch/index.d.ts +13 -0
  372. package/switch/lib/brn-switch-thumb.component.d.ts +5 -0
  373. package/switch/lib/brn-switch.component.d.ts +58 -0
  374. package/table/README.md +3 -0
  375. package/table/index.d.ts +26 -0
  376. package/table/lib/brn-cell-def.directive.d.ts +9 -0
  377. package/table/lib/brn-column-def.component.d.ts +18 -0
  378. package/table/lib/brn-column-manager.d.ts +26 -0
  379. package/table/lib/brn-footer-def.directive.d.ts +9 -0
  380. package/table/lib/brn-header-def.directive.d.ts +9 -0
  381. package/table/lib/brn-paginator.directive.d.ts +41 -0
  382. package/table/lib/brn-table.component.d.ts +37 -0
  383. package/tabs/README.md +3 -0
  384. package/tabs/index.d.ts +14 -0
  385. package/tabs/lib/brn-tabs-list.directive.d.ts +17 -0
  386. package/tabs/lib/brn-tabs-paginated-list.directive.d.ts +196 -0
  387. package/tabs/lib/brn-tabs-trigger.directive.d.ts +61 -0
  388. package/toggle/README.md +3 -0
  389. package/toggle/index.d.ts +15 -0
  390. package/toggle/lib/brn-toggle-group.component.d.ts +68 -0
  391. package/toggle/lib/brn-toggle-group.token.d.ts +4 -0
  392. package/toggle/lib/brn-toggle.directive.d.ts +25 -0
  393. package/tooltip/README.md +3 -0
  394. package/tooltip/index.d.ts +19 -0
  395. package/tooltip/lib/brn-tooltip-content.component.d.ts +73 -0
  396. package/tooltip/lib/brn-tooltip-content.directive.d.ts +8 -0
  397. package/tooltip/lib/brn-tooltip-trigger.directive.d.ts +177 -0
  398. package/tooltip/lib/brn-tooltip.directive.d.ts +7 -0
@@ -0,0 +1,748 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ElementRef, input, computed, effect, Directive, model, output, signal, Input, contentChildren, booleanAttribute, Injector, ChangeDetectorRef, NgZone, ANIMATION_MODULE_TYPE, afterNextRender, NgModule } from '@angular/core';
3
+ import { FocusKeyManager } from '@angular/cdk/a11y';
4
+ import { fromEvent, take, Subject, of, merge, EMPTY, Observable, timer } from 'rxjs';
5
+ import { Directionality } from '@angular/cdk/bidi';
6
+ import { hasModifierKey, SPACE, ENTER } from '@angular/cdk/keycodes';
7
+ import { SharedResizeObserver } from '@angular/cdk/observers/private';
8
+ import { normalizePassiveListenerOptions, Platform } from '@angular/cdk/platform';
9
+ import { ViewportRuler } from '@angular/cdk/scrolling';
10
+ import { takeUntil, debounceTime, startWith, switchMap, skip, filter } from 'rxjs/operators';
11
+
12
+ class BrnTabsContentDirective {
13
+ _root = inject(BrnTabsDirective);
14
+ _elementRef = inject(ElementRef);
15
+ contentFor = input.required({ alias: 'brnTabsContent' });
16
+ _isSelected = computed(() => this._root.$activeTab() === this.contentFor());
17
+ contentId = computed(() => `brn-tabs-content-${this.contentFor()}`);
18
+ labelId = computed(() => `brn-tabs-label-${this.contentFor()}`);
19
+ constructor() {
20
+ effect(() => {
21
+ this._root.registerContent(this.contentFor(), this);
22
+ }, { allowSignalWrites: true });
23
+ }
24
+ focus() {
25
+ this._elementRef.nativeElement.focus();
26
+ }
27
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
28
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnTabsContentDirective, isStandalone: true, selector: "[brnTabsContent]", inputs: { contentFor: { classPropertyName: "contentFor", publicName: "brnTabsContent", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "tabpanel", "tabindex": "0" }, properties: { "id": "contentId()", "attr.aria-labelledby": "labelId()", "hidden": "_isSelected() === false" } }, exportAs: ["brnTabsContent"], ngImport: i0 });
29
+ }
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsContentDirective, decorators: [{
31
+ type: Directive,
32
+ args: [{
33
+ selector: '[brnTabsContent]',
34
+ standalone: true,
35
+ host: {
36
+ role: 'tabpanel',
37
+ tabindex: '0',
38
+ '[id]': 'contentId()',
39
+ '[attr.aria-labelledby]': 'labelId()',
40
+ '[hidden]': '_isSelected() === false',
41
+ },
42
+ exportAs: 'brnTabsContent',
43
+ }]
44
+ }], ctorParameters: () => [] });
45
+ class BrnTabsDirective {
46
+ orientation = input('horizontal');
47
+ /** internal **/
48
+ $orientation = this.orientation;
49
+ direction = input('ltr');
50
+ /** internal **/
51
+ $direction = this.direction;
52
+ _activeTab = model(undefined, { alias: 'brnTabs' });
53
+ /** internal **/
54
+ $activeTab = this._activeTab.asReadonly();
55
+ activationMode = input('automatic');
56
+ /** internal **/
57
+ $activationMode = this.activationMode;
58
+ tabActivated = output();
59
+ _tabs = signal({});
60
+ $tabs = this._tabs.asReadonly();
61
+ registerTrigger(key, trigger) {
62
+ this._tabs.update((tabs) => ({ ...tabs, [key]: { trigger, content: tabs[key]?.content } }));
63
+ }
64
+ registerContent(key, content) {
65
+ this._tabs.update((tabs) => ({ ...tabs, [key]: { trigger: tabs[key]?.trigger, content } }));
66
+ }
67
+ emitTabActivated(key) {
68
+ this.tabActivated.emit(key);
69
+ }
70
+ setActiveTab(key) {
71
+ this._activeTab.set(key);
72
+ }
73
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
74
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnTabsDirective, isStandalone: true, selector: "[brnTabs]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, _activeTab: { classPropertyName: "_activeTab", publicName: "brnTabs", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { _activeTab: "brnTabsChange", tabActivated: "tabActivated" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.dir": "direction()" } }, exportAs: ["brnTabs"], ngImport: i0 });
75
+ }
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsDirective, decorators: [{
77
+ type: Directive,
78
+ args: [{
79
+ selector: '[brnTabs]',
80
+ standalone: true,
81
+ host: {
82
+ '[attr.data-orientation]': 'orientation()',
83
+ '[attr.dir]': 'direction()',
84
+ },
85
+ exportAs: 'brnTabs',
86
+ }]
87
+ }] });
88
+ class BrnTabsTriggerDirective {
89
+ elementRef = inject(ElementRef);
90
+ _root = inject(BrnTabsDirective);
91
+ _orientation = this._root.$orientation;
92
+ triggerFor = input.required({ alias: 'brnTabsTrigger' });
93
+ selected = computed(() => this._root.$activeTab() === this.triggerFor());
94
+ contentId = computed(() => `brn-tabs-content-${this.triggerFor()}`);
95
+ labelId = computed(() => `brn-tabs-label-${this.triggerFor()}`);
96
+ // leaving this as an @input to be compatible with the `FocusKeyManager` used in the `BrnTabsListDirective`
97
+ disabled = false;
98
+ constructor() {
99
+ effect(() => {
100
+ this._root.registerTrigger(this.triggerFor(), this);
101
+ }, { allowSignalWrites: true });
102
+ }
103
+ focus() {
104
+ this.elementRef.nativeElement.focus();
105
+ if (this._root.$activationMode() === 'automatic') {
106
+ this.activate();
107
+ }
108
+ }
109
+ activate() {
110
+ if (!this.triggerFor())
111
+ return;
112
+ this._root.setActiveTab(this.triggerFor());
113
+ this._root.emitTabActivated(this.triggerFor());
114
+ }
115
+ get key() {
116
+ return this.triggerFor();
117
+ }
118
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
119
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnTabsTriggerDirective, isStandalone: true, selector: "button[brnTabsTrigger]", inputs: { triggerFor: { classPropertyName: "triggerFor", publicName: "brnTabsTrigger", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "tab" }, listeners: { "click": "activate()" }, properties: { "id": "labelId()", "tabindex": "selected() ? \"0\": \"-1\"", "attr.aria-selected": "selected()", "attr.aria-controls": "contentId()", "attr.data-state": "selected() ? 'active' : 'inactive'", "attr.data-orientation": "_orientation()", "attr.data-disabled": "disabled ? '' : undefined" } }, exportAs: ["brnTabsTrigger"], ngImport: i0 });
120
+ }
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsTriggerDirective, decorators: [{
122
+ type: Directive,
123
+ args: [{
124
+ selector: 'button[brnTabsTrigger]',
125
+ standalone: true,
126
+ host: {
127
+ '[id]': 'labelId()',
128
+ type: 'button',
129
+ role: 'tab',
130
+ '[tabindex]': 'selected() ? "0": "-1"',
131
+ '[attr.aria-selected]': 'selected()',
132
+ '[attr.aria-controls]': 'contentId()',
133
+ '[attr.data-state]': "selected() ? 'active' : 'inactive'",
134
+ '[attr.data-orientation]': '_orientation()',
135
+ '[attr.data-disabled]': "disabled ? '' : undefined",
136
+ '(click)': 'activate()',
137
+ },
138
+ exportAs: 'brnTabsTrigger',
139
+ }]
140
+ }], ctorParameters: () => [], propDecorators: { disabled: [{
141
+ type: Input
142
+ }] } });
143
+
144
+ class BrnTabsListDirective {
145
+ _root = inject(BrnTabsDirective);
146
+ _orientation = this._root.$orientation;
147
+ _direction = this._root.$direction;
148
+ _activeTab = this._root.$activeTab;
149
+ _tabs = this._root.$tabs;
150
+ _elementRef = inject(ElementRef);
151
+ _keyDownListener = fromEvent(this._elementRef.nativeElement, 'keydown');
152
+ _keyManager;
153
+ triggers = contentChildren(BrnTabsTriggerDirective, { descendants: true });
154
+ ngAfterContentInit() {
155
+ this._keyManager = new FocusKeyManager(this.triggers())
156
+ .withHorizontalOrientation(this._direction())
157
+ .withHomeAndEnd()
158
+ .withPageUpDown()
159
+ .withWrap();
160
+ // needed because by default the index is set to -1, which means first interaction is skipped
161
+ this._keyDownListener.pipe(take(1)).subscribe(() => {
162
+ const currentTabKey = this._activeTab();
163
+ const tabs = this._tabs();
164
+ let activeIndex = 0;
165
+ if (currentTabKey) {
166
+ const currentTab = tabs[currentTabKey];
167
+ if (currentTab) {
168
+ activeIndex = this.triggers().indexOf(currentTab.trigger);
169
+ }
170
+ }
171
+ this._keyManager?.setActiveItem(activeIndex);
172
+ });
173
+ this._keyDownListener.subscribe((event) => {
174
+ if ('key' in event) {
175
+ if (this._orientation() === 'horizontal') {
176
+ if (event.key === 'ArrowUp' || event.key === 'ArrowDown')
177
+ return;
178
+ }
179
+ if (this._orientation() === 'vertical') {
180
+ if (event.key === 'ArrowLeft' || event.key === 'ArrowRight')
181
+ return;
182
+ }
183
+ }
184
+ this._keyManager?.onKeydown(event);
185
+ });
186
+ }
187
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
188
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.5", type: BrnTabsListDirective, isStandalone: true, selector: "[brnTabsList]", host: { attributes: { "role": "tablist" }, properties: { "attr.aria-orientation": "_orientation()", "attr.data-orientation": "_orientation()" } }, queries: [{ propertyName: "triggers", predicate: BrnTabsTriggerDirective, descendants: true, isSignal: true }], exportAs: ["brnTabsList"], ngImport: i0 });
189
+ }
190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsListDirective, decorators: [{
191
+ type: Directive,
192
+ args: [{
193
+ selector: '[brnTabsList]',
194
+ standalone: true,
195
+ host: {
196
+ role: 'tablist',
197
+ '[attr.aria-orientation]': '_orientation()',
198
+ '[attr.data-orientation]': '_orientation()',
199
+ },
200
+ exportAs: 'brnTabsList',
201
+ }]
202
+ }] });
203
+
204
+ /**
205
+ * We are building on shoulders of giants here and adapt the implementation provided by the incredible Angular
206
+ * team: https://github.com/angular/components/blob/main/src/material/tabs/paginated-tab-header.ts
207
+ * Check them out! Give them a try! Leave a star! Their work is incredible!
208
+ */
209
+ /**
210
+ * @license
211
+ * Copyright Google LLC All Rights Reserved.
212
+ *
213
+ * Use of this source code is governed by an MIT-style license that can be
214
+ * found in the LICENSE file at https://angular.io/license
215
+ */
216
+ /** Config used to bind passive event listeners */
217
+ const passiveEventListenerOptions = normalizePassiveListenerOptions({
218
+ passive: true,
219
+ });
220
+ /**
221
+ * Amount of milliseconds to wait before starting to scroll the header automatically.
222
+ * Set a little conservatively in order to handle fake events dispatched on touch devices.
223
+ */
224
+ const HEADER_SCROLL_DELAY = 650;
225
+ /**
226
+ * Interval in milliseconds at which to scroll the header
227
+ * while the user is holding their pointer.
228
+ */
229
+ const HEADER_SCROLL_INTERVAL = 100;
230
+ /**
231
+ * Base class for a tab header that supported pagination.
232
+ * @docs-private
233
+ */
234
+ class BrnTabsPaginatedListDirective {
235
+ /** The distance in pixels that the tab labels should be translated to the left. */
236
+ _scrollDistance = 0;
237
+ /** Whether the header should scroll to the selected index after the view has been checked. */
238
+ _selectedIndexChanged = false;
239
+ _root = inject(BrnTabsDirective);
240
+ _activeTab = this._root.$activeTab;
241
+ _tabs = this._root.$tabs;
242
+ /** Emits when the component is destroyed. */
243
+ _destroyed = new Subject();
244
+ /** Whether the controls for pagination should be displayed */
245
+ _showPaginationControls = signal(false);
246
+ /** Whether the tab list can be scrolled more towards the end of the tab label list. */
247
+ _disableScrollAfter = true;
248
+ /** Whether the tab list can be scrolled more towards the beginning of the tab label list. */
249
+ _disableScrollBefore = true;
250
+ /**
251
+ * The number of tab labels that are displayed on the header. When this changes, the header
252
+ * should re-evaluate the scroll position.
253
+ */
254
+ _tabLabelCount;
255
+ /** Whether the scroll distance has changed and should be applied after the view is checked. */
256
+ _scrollDistanceChanged;
257
+ /** Used to manage focus between the tabs. */
258
+ _keyManager;
259
+ /** Cached text content of the header. */
260
+ _currentTextContent;
261
+ /** Stream that will stop the automated scrolling. */
262
+ _stopScrolling = new Subject();
263
+ /**
264
+ * Whether pagination should be disabled. This can be used to avoid unnecessary
265
+ * layout recalculations if it's known that pagination won't be required.
266
+ */
267
+ disablePagination = input(false, { transform: booleanAttribute });
268
+ /** The index of the active tab. */
269
+ _selectedIndex = computed(() => {
270
+ const currentTabKey = this._activeTab();
271
+ const tabs = this._tabs();
272
+ let activeIndex = 0;
273
+ if (currentTabKey && this._items()) {
274
+ const currentTab = tabs[currentTabKey];
275
+ if (currentTab) {
276
+ activeIndex = this._items().indexOf(currentTab.trigger);
277
+ }
278
+ }
279
+ return activeIndex;
280
+ });
281
+ /** Event emitted when the option is selected. */
282
+ selectFocusedIndex = output();
283
+ /** Event emitted when a label is focused. */
284
+ indexFocused = output();
285
+ _sharedResizeObserver = inject(SharedResizeObserver);
286
+ _injector = inject(Injector);
287
+ _elementRef = inject(ElementRef);
288
+ _changeDetectorRef = inject(ChangeDetectorRef);
289
+ _viewportRuler = inject(ViewportRuler);
290
+ _dir = inject(Directionality, { optional: true });
291
+ _ngZone = inject(NgZone);
292
+ _platform = inject(Platform);
293
+ _animationMode = inject(ANIMATION_MODULE_TYPE, { optional: true });
294
+ constructor() {
295
+ // Bind the `mouseleave` event on the outside since it doesn't change anything in the view.
296
+ this._ngZone.runOutsideAngular(() => {
297
+ fromEvent(this._elementRef.nativeElement, 'mouseleave')
298
+ .pipe(takeUntil(this._destroyed))
299
+ .subscribe(() => {
300
+ this._stopInterval();
301
+ });
302
+ });
303
+ effect(() => {
304
+ const selectedIndex = this._selectedIndex();
305
+ if (selectedIndex !== 0) {
306
+ this._selectedIndexChanged = true;
307
+ if (this._keyManager) {
308
+ this._keyManager.updateActiveItem(selectedIndex);
309
+ }
310
+ }
311
+ });
312
+ }
313
+ ngAfterViewInit() {
314
+ // We need to handle these events manually, because we want to bind passive event listeners.
315
+ fromEvent(this._previousPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)
316
+ .pipe(takeUntil(this._destroyed))
317
+ .subscribe(() => {
318
+ this._handlePaginatorPress('before');
319
+ });
320
+ fromEvent(this._nextPaginator().nativeElement, 'touchstart', passiveEventListenerOptions)
321
+ .pipe(takeUntil(this._destroyed))
322
+ .subscribe(() => {
323
+ this._handlePaginatorPress('after');
324
+ });
325
+ }
326
+ ngAfterContentInit() {
327
+ const dirChange = this._dir ? this._dir.change : of('ltr');
328
+ // We need to debounce resize events because the alignment logic is expensive.
329
+ // If someone animates the width of tabs, we don't want to realign on every animation frame.
330
+ // Once we haven't seen any more resize events in the last 32ms (~2 animaion frames) we can
331
+ // re-align.
332
+ const resize = this._sharedResizeObserver
333
+ .observe(this._elementRef.nativeElement)
334
+ .pipe(debounceTime(32), takeUntil(this._destroyed));
335
+ // Note: We do not actually need to watch these events for proper functioning of the tabs,
336
+ // the resize events above should capture any viewport resize that we care about. However,
337
+ // removing this is fairly breaking for screenshot tests, so we're leaving it here for now.
338
+ const viewportResize = this._viewportRuler.change(150).pipe(takeUntil(this._destroyed));
339
+ const realign = () => {
340
+ this.updatePagination();
341
+ };
342
+ this._keyManager = new FocusKeyManager(this._items())
343
+ .withHorizontalOrientation(this._getLayoutDirection())
344
+ .withHomeAndEnd()
345
+ .withWrap()
346
+ // Allow focus to land on disabled tabs, as per https://w3c.github.io/aria-practices/#kbd_disabled_controls
347
+ .skipPredicate(() => false);
348
+ this._keyManager.updateActiveItem(this._selectedIndex());
349
+ // Note: We do not need to realign after the first render for proper functioning of the tabs
350
+ // the resize events above should fire when we first start observing the element. However,
351
+ // removing this is fairly breaking for screenshot tests, so we're leaving it here for now.
352
+ afterNextRender(realign, { injector: this._injector });
353
+ // On dir change or resize, realign the ink bar and update the orientation of
354
+ // the key manager if the direction has changed.
355
+ merge(dirChange, viewportResize, resize, this._itemsChanges, this._itemsResized())
356
+ .pipe(takeUntil(this._destroyed))
357
+ .subscribe(() => {
358
+ // We need to defer this to give the browser some time to recalculate
359
+ // the element dimensions. The call has to be wrapped in `NgZone.run`,
360
+ // because the viewport change handler runs outside of Angular.
361
+ this._ngZone.run(() => {
362
+ Promise.resolve().then(() => {
363
+ // Clamp the scroll distance, because it can change with the number of tabs.
364
+ this._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), this._scrollDistance));
365
+ realign();
366
+ });
367
+ });
368
+ this._keyManager.withHorizontalOrientation(this._getLayoutDirection());
369
+ });
370
+ // If there is a change in the focus key manager we need to emit the `indexFocused`
371
+ // event in order to provide a public event that notifies about focus changes. Also we realign
372
+ // the tabs container by scrolling the new focused tab into the visible section.
373
+ this._keyManager.change.subscribe((newFocusIndex) => {
374
+ this.indexFocused.emit(newFocusIndex);
375
+ this._setTabFocus(newFocusIndex);
376
+ });
377
+ }
378
+ /** Sends any changes that could affect the layout of the items. */
379
+ _itemsResized() {
380
+ if (typeof ResizeObserver !== 'function') {
381
+ return EMPTY;
382
+ }
383
+ return this._itemsChanges.pipe(startWith(this._items()), switchMap((tabItems) => new Observable((observer) => this._ngZone.runOutsideAngular(() => {
384
+ const resizeObserver = new ResizeObserver((entries) => observer.next(entries));
385
+ for (const tabItem of tabItems) {
386
+ resizeObserver.observe(tabItem.elementRef.nativeElement);
387
+ }
388
+ return () => {
389
+ resizeObserver.disconnect();
390
+ };
391
+ }))),
392
+ // Skip the first emit since the resize observer emits when an item
393
+ // is observed for new items when the tab is already inserted
394
+ skip(1),
395
+ // Skip emissions where all the elements are invisible since we don't want
396
+ // the header to try and re-render with invalid measurements. See #25574.
397
+ filter((entries) => entries.some((e) => e.contentRect.width > 0 && e.contentRect.height > 0)));
398
+ }
399
+ ngAfterContentChecked() {
400
+ // If the number of tab labels have changed, check if scrolling should be enabled
401
+ if (this._tabLabelCount !== this._items().length) {
402
+ this.updatePagination();
403
+ this._tabLabelCount = this._items().length;
404
+ this._changeDetectorRef.markForCheck();
405
+ }
406
+ // If the selected index has changed, scroll to the label and check if the scrolling controls
407
+ // should be disabled.
408
+ if (this._selectedIndexChanged) {
409
+ this._scrollToLabel(this._selectedIndex());
410
+ this._checkScrollingControls();
411
+ this._selectedIndexChanged = false;
412
+ this._changeDetectorRef.markForCheck();
413
+ }
414
+ // If the scroll distance has been changed (tab selected, focused, scroll controls activated),
415
+ // then translate the header to reflect this.
416
+ if (this._scrollDistanceChanged) {
417
+ this._updateTabScrollPosition();
418
+ this._scrollDistanceChanged = false;
419
+ this._changeDetectorRef.markForCheck();
420
+ }
421
+ }
422
+ ngOnDestroy() {
423
+ this._keyManager?.destroy();
424
+ this._destroyed.next();
425
+ this._destroyed.complete();
426
+ this._stopScrolling.complete();
427
+ }
428
+ /** Handles keyboard events on the header. */
429
+ _handleKeydown(event) {
430
+ // We don't handle any key bindings with a modifier key.
431
+ if (hasModifierKey(event)) {
432
+ return;
433
+ }
434
+ switch (event.keyCode) {
435
+ case ENTER:
436
+ case SPACE:
437
+ if (this.focusIndex !== this._selectedIndex()) {
438
+ const item = this._items()[this.focusIndex];
439
+ if (item && !item.disabled) {
440
+ this.selectFocusedIndex.emit(this.focusIndex);
441
+ this._itemSelected(event);
442
+ }
443
+ }
444
+ break;
445
+ default:
446
+ this._keyManager.onKeydown(event);
447
+ }
448
+ }
449
+ /**
450
+ * Callback for when the MutationObserver detects that the content has changed.
451
+ */
452
+ _onContentChanges() {
453
+ const textContent = this._elementRef.nativeElement.textContent;
454
+ // We need to diff the text content of the header, because the MutationObserver callback
455
+ // will fire even if the text content didn't change which is inefficient and is prone
456
+ // to infinite loops if a poorly constructed expression is passed in (see #14249).
457
+ if (textContent !== this._currentTextContent) {
458
+ this._currentTextContent = textContent || '';
459
+ // The content observer runs outside the `NgZone` by default, which
460
+ // means that we need to bring the callback back in ourselves.
461
+ this._ngZone.run(() => {
462
+ this.updatePagination();
463
+ this._changeDetectorRef.markForCheck();
464
+ });
465
+ }
466
+ }
467
+ /**
468
+ * Updates the view whether pagination should be enabled or not.
469
+ *
470
+ * WARNING: Calling this method can be very costly in terms of performance. It should be called
471
+ * as infrequently as possible from outside of the Tabs component as it causes a reflow of the
472
+ * page.
473
+ */
474
+ updatePagination() {
475
+ this._checkPaginationEnabled();
476
+ this._checkScrollingControls();
477
+ this._updateTabScrollPosition();
478
+ }
479
+ /** Tracks which element has focus; used for keyboard navigation */
480
+ get focusIndex() {
481
+ return this._keyManager ? (this._keyManager.activeItemIndex ?? 0) : 0;
482
+ }
483
+ /** When the focus index is set, we must manually send focus to the correct label */
484
+ set focusIndex(value) {
485
+ if (!this._isValidIndex(value) || this.focusIndex === value || !this._keyManager) {
486
+ return;
487
+ }
488
+ this._keyManager.setActiveItem(value);
489
+ }
490
+ /**
491
+ * Determines if an index is valid. If the tabs are not ready yet, we assume that the user is
492
+ * providing a valid index and return true.
493
+ */
494
+ _isValidIndex(index) {
495
+ return this._items() ? !!this._items()[index] : true;
496
+ }
497
+ /**
498
+ * Sets focus on the HTML element for the label wrapper and scrolls it into the view if
499
+ * scrolling is enabled.
500
+ */
501
+ _setTabFocus(tabIndex) {
502
+ if (this._showPaginationControls()) {
503
+ this._scrollToLabel(tabIndex);
504
+ }
505
+ if (this._items()?.length) {
506
+ this._items()[tabIndex].focus();
507
+ // Do not let the browser manage scrolling to focus the element, this will be handled
508
+ // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width
509
+ // should be the full width minus the offset width.
510
+ const containerEl = this._tabListContainer().nativeElement;
511
+ const dir = this._getLayoutDirection();
512
+ if (dir === 'ltr') {
513
+ containerEl.scrollLeft = 0;
514
+ }
515
+ else {
516
+ containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth;
517
+ }
518
+ }
519
+ }
520
+ /** The layout direction of the containing app. */
521
+ _getLayoutDirection() {
522
+ return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
523
+ }
524
+ /** Performs the CSS transformation on the tab list that will cause the list to scroll. */
525
+ _updateTabScrollPosition() {
526
+ if (this.disablePagination()) {
527
+ return;
528
+ }
529
+ const scrollDistance = this.scrollDistance;
530
+ const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
531
+ // Don't use `translate3d` here because we don't want to create a new layer. A new layer
532
+ // seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
533
+ // and ripples will exceed the boundaries of the visible tab bar.
534
+ // See: https://github.com/angular/components/issues/10276
535
+ // We round the `transform` here, because transforms with sub-pixel precision cause some
536
+ // browsers to blur the content of the element.
537
+ this._tabList().nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
538
+ // Setting the `transform` on IE will change the scroll offset of the parent, causing the
539
+ // position to be thrown off in some cases. We have to reset it ourselves to ensure that
540
+ // it doesn't get thrown off. Note that we scope it only to IE and Edge, because messing
541
+ // with the scroll position throws off Chrome 71+ in RTL mode (see #14689).
542
+ if (this._platform.TRIDENT || this._platform.EDGE) {
543
+ this._tabListContainer().nativeElement.scrollLeft = 0;
544
+ }
545
+ }
546
+ /** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
547
+ get scrollDistance() {
548
+ return this._scrollDistance;
549
+ }
550
+ set scrollDistance(value) {
551
+ this._scrollTo(value);
552
+ }
553
+ /**
554
+ * Moves the tab list in the 'before' or 'after' direction (towards the beginning of the list or
555
+ * the end of the list, respectively). The distance to scroll is computed to be a third of the
556
+ * length of the tab list view window.
557
+ *
558
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
559
+ * should be called sparingly.
560
+ */
561
+ _scrollHeader(direction) {
562
+ const viewLength = this._tabListContainer().nativeElement.offsetWidth;
563
+ // Move the scroll distance one-third the length of the tab list's viewport.
564
+ const scrollAmount = ((direction === 'before' ? -1 : 1) * viewLength) / 3;
565
+ return this._scrollTo(this._scrollDistance + scrollAmount);
566
+ }
567
+ /** Handles click events on the pagination arrows. */
568
+ _handlePaginatorClick(direction) {
569
+ this._stopInterval();
570
+ this._scrollHeader(direction);
571
+ }
572
+ /**
573
+ * Moves the tab list such that the desired tab label (marked by index) is moved into view.
574
+ *
575
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
576
+ * should be called sparingly.
577
+ */
578
+ _scrollToLabel(labelIndex) {
579
+ if (this.disablePagination()) {
580
+ return;
581
+ }
582
+ const selectedLabel = this._items() ? this._items()[labelIndex] : null;
583
+ if (!selectedLabel) {
584
+ return;
585
+ }
586
+ // The view length is the visible width of the tab labels.
587
+ const viewLength = this._tabListContainer().nativeElement.offsetWidth;
588
+ const { offsetLeft, offsetWidth } = selectedLabel.elementRef.nativeElement;
589
+ let labelBeforePos;
590
+ let labelAfterPos;
591
+ if (this._getLayoutDirection() === 'ltr') {
592
+ labelBeforePos = offsetLeft;
593
+ labelAfterPos = labelBeforePos + offsetWidth;
594
+ }
595
+ else {
596
+ labelAfterPos = this._tabListInner().nativeElement.offsetWidth - offsetLeft;
597
+ labelBeforePos = labelAfterPos - offsetWidth;
598
+ }
599
+ const beforeVisiblePos = this.scrollDistance;
600
+ const afterVisiblePos = this.scrollDistance + viewLength;
601
+ if (labelBeforePos < beforeVisiblePos) {
602
+ // Scroll header to move label to the before direction
603
+ this.scrollDistance -= beforeVisiblePos - labelBeforePos;
604
+ }
605
+ else if (labelAfterPos > afterVisiblePos) {
606
+ // Scroll header to move label to the after direction
607
+ this.scrollDistance += Math.min(labelAfterPos - afterVisiblePos, labelBeforePos - beforeVisiblePos);
608
+ }
609
+ }
610
+ /**
611
+ * Evaluate whether the pagination controls should be displayed. If the scroll width of the
612
+ * tab list is wider than the size of the header container, then the pagination controls should
613
+ * be shown.
614
+ *
615
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
616
+ * should be called sparingly.
617
+ */
618
+ _checkPaginationEnabled() {
619
+ if (this.disablePagination()) {
620
+ this._showPaginationControls.set(false);
621
+ }
622
+ else {
623
+ const isEnabled = this._tabListInner().nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;
624
+ if (!isEnabled) {
625
+ this.scrollDistance = 0;
626
+ }
627
+ if (isEnabled !== this._showPaginationControls()) {
628
+ this._changeDetectorRef.markForCheck();
629
+ }
630
+ this._showPaginationControls.set(isEnabled);
631
+ }
632
+ }
633
+ /**
634
+ * Evaluate whether the before and after controls should be enabled or disabled.
635
+ * If the header is at the beginning of the list (scroll distance is equal to 0) then disable the
636
+ * before button. If the header is at the end of the list (scroll distance is equal to the
637
+ * maximum distance we can scroll), then disable the after button.
638
+ *
639
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
640
+ * should be called sparingly.
641
+ */
642
+ _checkScrollingControls() {
643
+ if (this.disablePagination()) {
644
+ this._disableScrollAfter = this._disableScrollBefore = true;
645
+ }
646
+ else {
647
+ // Check if the pagination arrows should be activated.
648
+ this._disableScrollBefore = this.scrollDistance === 0;
649
+ this._disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();
650
+ this._changeDetectorRef.markForCheck();
651
+ }
652
+ }
653
+ /**
654
+ * Determines what is the maximum length in pixels that can be set for the scroll distance. This
655
+ * is equal to the difference in width between the tab list container and tab header container.
656
+ *
657
+ * This is an expensive call that forces a layout reflow to compute box and scroll metrics and
658
+ * should be called sparingly.
659
+ */
660
+ _getMaxScrollDistance() {
661
+ const lengthOfTabList = this._tabListInner().nativeElement.scrollWidth;
662
+ const viewLength = this._tabListContainer().nativeElement.offsetWidth;
663
+ return lengthOfTabList - viewLength || 0;
664
+ }
665
+ /** Stops the currently-running paginator interval. */
666
+ _stopInterval() {
667
+ this._stopScrolling.next();
668
+ }
669
+ /**
670
+ * Handles the user pressing down on one of the paginators.
671
+ * Starts scrolling the header after a certain amount of time.
672
+ * @param direction In which direction the paginator should be scrolled.
673
+ */
674
+ _handlePaginatorPress(direction, mouseEvent) {
675
+ // Don't start auto scrolling for right mouse button clicks. Note that we shouldn't have to
676
+ // null check the `button`, but we do it so we don't break tests that use fake events.
677
+ if (mouseEvent && mouseEvent.button !== null && mouseEvent.button !== 0) {
678
+ return;
679
+ }
680
+ // Avoid overlapping timers.
681
+ this._stopInterval();
682
+ // Start a timer after the delay and keep firing based on the interval.
683
+ timer(HEADER_SCROLL_DELAY, HEADER_SCROLL_INTERVAL)
684
+ // Keep the timer going until something tells it to stop or the component is destroyed.
685
+ .pipe(takeUntil(merge(this._stopScrolling, this._destroyed)))
686
+ .subscribe(() => {
687
+ const { maxScrollDistance, distance } = this._scrollHeader(direction);
688
+ // Stop the timer if we've reached the start or the end.
689
+ if (distance === 0 || distance >= maxScrollDistance) {
690
+ this._stopInterval();
691
+ }
692
+ });
693
+ }
694
+ /**
695
+ * Scrolls the header to a given position.
696
+ * @param position Position to which to scroll.
697
+ * @returns Information on the current scroll distance and the maximum.
698
+ */
699
+ _scrollTo(position) {
700
+ if (this.disablePagination()) {
701
+ return { maxScrollDistance: 0, distance: 0 };
702
+ }
703
+ const maxScrollDistance = this._getMaxScrollDistance();
704
+ this._scrollDistance = Math.max(0, Math.min(maxScrollDistance, position));
705
+ // Mark that the scroll distance has changed so that after the view is checked, the CSS
706
+ // transformation can move the header.
707
+ this._scrollDistanceChanged = true;
708
+ this._checkScrollingControls();
709
+ return { maxScrollDistance, distance: this._scrollDistance };
710
+ }
711
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsPaginatedListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
712
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnTabsPaginatedListDirective, inputs: { disablePagination: { classPropertyName: "disablePagination", publicName: "disablePagination", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectFocusedIndex: "selectFocusedIndex", indexFocused: "indexFocused" }, ngImport: i0 });
713
+ }
714
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsPaginatedListDirective, decorators: [{
715
+ type: Directive
716
+ }], ctorParameters: () => [] });
717
+
718
+ const BrnTabsImports = [
719
+ BrnTabsDirective,
720
+ BrnTabsListDirective,
721
+ BrnTabsTriggerDirective,
722
+ BrnTabsContentDirective,
723
+ ];
724
+ class BrnTabsModule {
725
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
726
+ /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsModule, imports: [BrnTabsDirective,
727
+ BrnTabsListDirective,
728
+ BrnTabsTriggerDirective,
729
+ BrnTabsContentDirective], exports: [BrnTabsDirective,
730
+ BrnTabsListDirective,
731
+ BrnTabsTriggerDirective,
732
+ BrnTabsContentDirective] });
733
+ /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsModule });
734
+ }
735
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnTabsModule, decorators: [{
736
+ type: NgModule,
737
+ args: [{
738
+ imports: [...BrnTabsImports],
739
+ exports: [...BrnTabsImports],
740
+ }]
741
+ }] });
742
+
743
+ /**
744
+ * Generated bundle index. Do not edit.
745
+ */
746
+
747
+ export { BrnTabsContentDirective, BrnTabsDirective, BrnTabsImports, BrnTabsListDirective, BrnTabsModule, BrnTabsPaginatedListDirective, BrnTabsTriggerDirective };
748
+ //# sourceMappingURL=spartan-ng-brain-tabs.mjs.map