@exhaustive-ui/core 3.0.0-alpha.0 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/fesm2022/exhaustive-ui-core-accordion.mjs +51 -78
  2. package/fesm2022/exhaustive-ui-core-accordion.mjs.map +1 -1
  3. package/fesm2022/exhaustive-ui-core-animateonscroll.mjs +72 -73
  4. package/fesm2022/exhaustive-ui-core-animateonscroll.mjs.map +1 -1
  5. package/fesm2022/exhaustive-ui-core-api.mjs +6 -13
  6. package/fesm2022/exhaustive-ui-core-api.mjs.map +1 -1
  7. package/fesm2022/exhaustive-ui-core-autocomplete.mjs +485 -683
  8. package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
  9. package/fesm2022/exhaustive-ui-core-autofocus.mjs +21 -31
  10. package/fesm2022/exhaustive-ui-core-autofocus.mjs.map +1 -1
  11. package/fesm2022/exhaustive-ui-core-avatar.mjs +47 -63
  12. package/fesm2022/exhaustive-ui-core-avatar.mjs.map +1 -1
  13. package/fesm2022/exhaustive-ui-core-badge.mjs +88 -115
  14. package/fesm2022/exhaustive-ui-core-badge.mjs.map +1 -1
  15. package/fesm2022/exhaustive-ui-core-blockui.mjs +58 -91
  16. package/fesm2022/exhaustive-ui-core-blockui.mjs.map +1 -1
  17. package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +155 -169
  18. package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
  19. package/fesm2022/exhaustive-ui-core-button.mjs +280 -385
  20. package/fesm2022/exhaustive-ui-core-button.mjs.map +1 -1
  21. package/fesm2022/exhaustive-ui-core-carousel.mjs +379 -451
  22. package/fesm2022/exhaustive-ui-core-carousel.mjs.map +1 -1
  23. package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +388 -507
  24. package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
  25. package/fesm2022/exhaustive-ui-core-chart.mjs +75 -91
  26. package/fesm2022/exhaustive-ui-core-chart.mjs.map +1 -1
  27. package/fesm2022/exhaustive-ui-core-checkbox.mjs +109 -160
  28. package/fesm2022/exhaustive-ui-core-checkbox.mjs.map +1 -1
  29. package/fesm2022/exhaustive-ui-core-chip.mjs +98 -137
  30. package/fesm2022/exhaustive-ui-core-chip.mjs.map +1 -1
  31. package/fesm2022/exhaustive-ui-core-colorpicker.mjs +123 -190
  32. package/fesm2022/exhaustive-ui-core-colorpicker.mjs.map +1 -1
  33. package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +157 -332
  34. package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
  35. package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +187 -210
  36. package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
  37. package/fesm2022/exhaustive-ui-core-contextmenu.mjs +315 -361
  38. package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
  39. package/fesm2022/exhaustive-ui-core-dataview.mjs +225 -272
  40. package/fesm2022/exhaustive-ui-core-dataview.mjs.map +1 -1
  41. package/fesm2022/exhaustive-ui-core-datepicker.mjs +1012 -1157
  42. package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
  43. package/fesm2022/exhaustive-ui-core-dialog.mjs +370 -507
  44. package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
  45. package/fesm2022/exhaustive-ui-core-dock.mjs +87 -115
  46. package/fesm2022/exhaustive-ui-core-dock.mjs.map +1 -1
  47. package/fesm2022/exhaustive-ui-core-dragdrop.mjs +98 -105
  48. package/fesm2022/exhaustive-ui-core-dragdrop.mjs.map +1 -1
  49. package/fesm2022/exhaustive-ui-core-drawer.mjs +174 -235
  50. package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
  51. package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs +42 -280
  52. package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs.map +1 -1
  53. package/fesm2022/exhaustive-ui-core-editor.mjs +109 -121
  54. package/fesm2022/exhaustive-ui-core-editor.mjs.map +1 -1
  55. package/fesm2022/exhaustive-ui-core-fieldset.mjs +90 -132
  56. package/fesm2022/exhaustive-ui-core-fieldset.mjs.map +1 -1
  57. package/fesm2022/exhaustive-ui-core-fileupload.mjs +486 -541
  58. package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
  59. package/fesm2022/exhaustive-ui-core-floatlabel.mjs +13 -16
  60. package/fesm2022/exhaustive-ui-core-floatlabel.mjs.map +1 -1
  61. package/fesm2022/exhaustive-ui-core-focustrap.mjs +44 -40
  62. package/fesm2022/exhaustive-ui-core-focustrap.mjs.map +1 -1
  63. package/fesm2022/exhaustive-ui-core-galleria.mjs +642 -853
  64. package/fesm2022/exhaustive-ui-core-galleria.mjs.map +1 -1
  65. package/fesm2022/exhaustive-ui-core-iconfield.mjs +15 -27
  66. package/fesm2022/exhaustive-ui-core-iconfield.mjs.map +1 -1
  67. package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs +8 -13
  68. package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs.map +1 -1
  69. package/fesm2022/exhaustive-ui-core-image.mjs +209 -251
  70. package/fesm2022/exhaustive-ui-core-image.mjs.map +1 -1
  71. package/fesm2022/exhaustive-ui-core-imagecompare.mjs +39 -48
  72. package/fesm2022/exhaustive-ui-core-imagecompare.mjs.map +1 -1
  73. package/fesm2022/exhaustive-ui-core-inplace.mjs +64 -98
  74. package/fesm2022/exhaustive-ui-core-inplace.mjs.map +1 -1
  75. package/fesm2022/exhaustive-ui-core-inputgroup.mjs +10 -20
  76. package/fesm2022/exhaustive-ui-core-inputgroup.mjs.map +1 -1
  77. package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs +15 -24
  78. package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs.map +1 -1
  79. package/fesm2022/exhaustive-ui-core-inputicon.mjs +11 -22
  80. package/fesm2022/exhaustive-ui-core-inputicon.mjs.map +1 -1
  81. package/fesm2022/exhaustive-ui-core-inputmask.mjs +423 -392
  82. package/fesm2022/exhaustive-ui-core-inputmask.mjs.map +1 -1
  83. package/fesm2022/exhaustive-ui-core-inputnumber.mjs +397 -469
  84. package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
  85. package/fesm2022/exhaustive-ui-core-inputotp.mjs +75 -95
  86. package/fesm2022/exhaustive-ui-core-inputotp.mjs.map +1 -1
  87. package/fesm2022/exhaustive-ui-core-inputtext.mjs +27 -36
  88. package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
  89. package/fesm2022/exhaustive-ui-core-keyfilter.mjs +29 -46
  90. package/fesm2022/exhaustive-ui-core-keyfilter.mjs.map +1 -1
  91. package/fesm2022/exhaustive-ui-core-knob.mjs +140 -187
  92. package/fesm2022/exhaustive-ui-core-knob.mjs.map +1 -1
  93. package/fesm2022/exhaustive-ui-core-listbox.mjs +365 -546
  94. package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
  95. package/fesm2022/exhaustive-ui-core-megamenu.mjs +320 -371
  96. package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
  97. package/fesm2022/exhaustive-ui-core-menu.mjs +298 -348
  98. package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
  99. package/fesm2022/exhaustive-ui-core-menubar.mjs +277 -372
  100. package/fesm2022/exhaustive-ui-core-menubar.mjs.map +1 -1
  101. package/fesm2022/exhaustive-ui-core-metergroup.mjs +138 -166
  102. package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
  103. package/fesm2022/exhaustive-ui-core-multiselect.mjs +647 -835
  104. package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
  105. package/fesm2022/exhaustive-ui-core-orderlist.mjs +337 -409
  106. package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
  107. package/fesm2022/exhaustive-ui-core-organizationchart.mjs +114 -175
  108. package/fesm2022/exhaustive-ui-core-organizationchart.mjs.map +1 -1
  109. package/fesm2022/exhaustive-ui-core-overlaybadge.mjs +22 -47
  110. package/fesm2022/exhaustive-ui-core-overlaybadge.mjs.map +1 -1
  111. package/fesm2022/exhaustive-ui-core-paginator.mjs +232 -320
  112. package/fesm2022/exhaustive-ui-core-paginator.mjs.map +1 -1
  113. package/fesm2022/exhaustive-ui-core-panel.mjs +114 -174
  114. package/fesm2022/exhaustive-ui-core-panel.mjs.map +1 -1
  115. package/fesm2022/exhaustive-ui-core-panelmenu.mjs +171 -282
  116. package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
  117. package/fesm2022/exhaustive-ui-core-password.mjs +317 -377
  118. package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
  119. package/fesm2022/exhaustive-ui-core-picklist.mjs +557 -655
  120. package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
  121. package/fesm2022/exhaustive-ui-core-popover.mjs +154 -181
  122. package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
  123. package/fesm2022/exhaustive-ui-core-rating.mjs +87 -119
  124. package/fesm2022/exhaustive-ui-core-rating.mjs.map +1 -1
  125. package/fesm2022/exhaustive-ui-core-scroller.mjs +465 -596
  126. package/fesm2022/exhaustive-ui-core-scroller.mjs.map +1 -1
  127. package/fesm2022/exhaustive-ui-core-scrollpanel.mjs +147 -155
  128. package/fesm2022/exhaustive-ui-core-scrollpanel.mjs.map +1 -1
  129. package/fesm2022/exhaustive-ui-core-scrolltop.mjs +81 -115
  130. package/fesm2022/exhaustive-ui-core-scrolltop.mjs.map +1 -1
  131. package/fesm2022/exhaustive-ui-core-select.mjs +581 -784
  132. package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
  133. package/fesm2022/exhaustive-ui-core-selectbutton.mjs +84 -120
  134. package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
  135. package/fesm2022/exhaustive-ui-core-slider.mjs +322 -352
  136. package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
  137. package/fesm2022/exhaustive-ui-core-speeddial.mjs +209 -268
  138. package/fesm2022/exhaustive-ui-core-speeddial.mjs.map +1 -1
  139. package/fesm2022/exhaustive-ui-core-splitbutton.mjs +153 -249
  140. package/fesm2022/exhaustive-ui-core-splitbutton.mjs.map +1 -1
  141. package/fesm2022/exhaustive-ui-core-splitter.mjs +221 -237
  142. package/fesm2022/exhaustive-ui-core-splitter.mjs.map +1 -1
  143. package/fesm2022/exhaustive-ui-core-steps.mjs +56 -72
  144. package/fesm2022/exhaustive-ui-core-steps.mjs.map +1 -1
  145. package/fesm2022/exhaustive-ui-core-styleclass.mjs +145 -146
  146. package/fesm2022/exhaustive-ui-core-styleclass.mjs.map +1 -1
  147. package/fesm2022/exhaustive-ui-core-table.mjs +2213 -2543
  148. package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
  149. package/fesm2022/exhaustive-ui-core-terminal.mjs +50 -67
  150. package/fesm2022/exhaustive-ui-core-terminal.mjs.map +1 -1
  151. package/fesm2022/exhaustive-ui-core-textarea.mjs +23 -36
  152. package/fesm2022/exhaustive-ui-core-textarea.mjs.map +1 -1
  153. package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +318 -394
  154. package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
  155. package/fesm2022/exhaustive-ui-core-timeline.mjs +56 -74
  156. package/fesm2022/exhaustive-ui-core-timeline.mjs.map +1 -1
  157. package/fesm2022/exhaustive-ui-core-togglebutton.mjs +86 -129
  158. package/fesm2022/exhaustive-ui-core-togglebutton.mjs.map +1 -1
  159. package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +57 -94
  160. package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
  161. package/fesm2022/exhaustive-ui-core-toolbar.mjs +36 -55
  162. package/fesm2022/exhaustive-ui-core-toolbar.mjs.map +1 -1
  163. package/fesm2022/exhaustive-ui-core-tooltip.mjs +264 -343
  164. package/fesm2022/exhaustive-ui-core-tooltip.mjs.map +1 -1
  165. package/fesm2022/exhaustive-ui-core-tree.mjs +508 -639
  166. package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
  167. package/fesm2022/exhaustive-ui-core-treeselect.mjs +327 -421
  168. package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
  169. package/fesm2022/exhaustive-ui-core-treetable.mjs +1267 -1473
  170. package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
  171. package/package.json +5 -5
  172. package/schematics/migrations/remove-dead-inputs/migration.js +213 -7
  173. package/schematics/migrations/renamed-inputs/migration.js +97 -0
  174. package/schematics/migrations/styleclass-to-class/migration.js +92 -1
  175. package/schematics/migrations.json +7 -2
  176. package/schematics/utils/removed-inputs.js +0 -0
  177. package/schematics/utils/renamed-inputs.js +175 -0
  178. package/schematics/utils/styleclass.js +24 -8
  179. package/schematics/utils/versions.json +8 -8
  180. package/types/exhaustive-ui-core-accordion.d.ts +8 -24
  181. package/types/exhaustive-ui-core-animateonscroll.d.ts +19 -21
  182. package/types/exhaustive-ui-core-api.d.ts +2 -3
  183. package/types/exhaustive-ui-core-autocomplete.d.ts +103 -176
  184. package/types/exhaustive-ui-core-autofocus.d.ts +4 -7
  185. package/types/exhaustive-ui-core-avatar.d.ts +18 -25
  186. package/types/exhaustive-ui-core-badge.d.ts +13 -27
  187. package/types/exhaustive-ui-core-blockui.d.ts +18 -30
  188. package/types/exhaustive-ui-core-breadcrumb.d.ts +21 -22
  189. package/types/exhaustive-ui-core-button.d.ts +57 -89
  190. package/types/exhaustive-ui-core-carousel.d.ts +56 -82
  191. package/types/exhaustive-ui-core-cascadeselect.d.ts +77 -111
  192. package/types/exhaustive-ui-core-chart.d.ts +21 -29
  193. package/types/exhaustive-ui-core-checkbox.d.ts +25 -39
  194. package/types/exhaustive-ui-core-chip.d.ts +31 -38
  195. package/types/exhaustive-ui-core-colorpicker.d.ts +23 -57
  196. package/types/exhaustive-ui-core-confirmdialog.d.ts +39 -109
  197. package/types/exhaustive-ui-core-confirmpopup.d.ts +24 -43
  198. package/types/exhaustive-ui-core-contextmenu.d.ts +54 -71
  199. package/types/exhaustive-ui-core-dataview.d.ts +42 -65
  200. package/types/exhaustive-ui-core-datepicker.d.ts +109 -191
  201. package/types/exhaustive-ui-core-dialog.d.ts +73 -123
  202. package/types/exhaustive-ui-core-dock.d.ts +16 -25
  203. package/types/exhaustive-ui-core-dragdrop.d.ts +32 -36
  204. package/types/exhaustive-ui-core-drawer.d.ts +32 -64
  205. package/types/exhaustive-ui-core-dynamicdialog.d.ts +9 -54
  206. package/types/exhaustive-ui-core-editor.d.ts +15 -25
  207. package/types/exhaustive-ui-core-fieldset.d.ts +15 -35
  208. package/types/exhaustive-ui-core-fileupload.d.ts +69 -95
  209. package/types/exhaustive-ui-core-floatlabel.d.ts +4 -6
  210. package/types/exhaustive-ui-core-focustrap.d.ts +5 -10
  211. package/types/exhaustive-ui-core-galleria.d.ts +124 -194
  212. package/types/exhaustive-ui-core-iconfield.d.ts +5 -13
  213. package/types/exhaustive-ui-core-icons-baseicon.d.ts +4 -5
  214. package/types/exhaustive-ui-core-image.d.ts +35 -68
  215. package/types/exhaustive-ui-core-imagecompare.d.ts +19 -20
  216. package/types/exhaustive-ui-core-inplace.d.ts +30 -42
  217. package/types/exhaustive-ui-core-inputgroup.d.ts +2 -9
  218. package/types/exhaustive-ui-core-inputgroupaddon.d.ts +6 -10
  219. package/types/exhaustive-ui-core-inputicon.d.ts +4 -11
  220. package/types/exhaustive-ui-core-inputmask.d.ts +53 -66
  221. package/types/exhaustive-ui-core-inputnumber.d.ts +62 -84
  222. package/types/exhaustive-ui-core-inputotp.d.ts +16 -20
  223. package/types/exhaustive-ui-core-inputtext.d.ts +5 -8
  224. package/types/exhaustive-ui-core-keyfilter.d.ts +11 -15
  225. package/types/exhaustive-ui-core-knob.d.ts +45 -60
  226. package/types/exhaustive-ui-core-listbox.d.ts +90 -126
  227. package/types/exhaustive-ui-core-megamenu.d.ts +45 -66
  228. package/types/exhaustive-ui-core-menu.d.ts +33 -53
  229. package/types/exhaustive-ui-core-menubar.d.ts +38 -85
  230. package/types/exhaustive-ui-core-metergroup.d.ts +39 -48
  231. package/types/exhaustive-ui-core-multiselect.d.ts +166 -219
  232. package/types/exhaustive-ui-core-orderlist.d.ts +58 -81
  233. package/types/exhaustive-ui-core-organizationchart.d.ts +32 -67
  234. package/types/exhaustive-ui-core-overlaybadge.d.ts +10 -20
  235. package/types/exhaustive-ui-core-paginator.d.ts +41 -69
  236. package/types/exhaustive-ui-core-panel.d.ts +18 -45
  237. package/types/exhaustive-ui-core-panelmenu.d.ts +31 -76
  238. package/types/exhaustive-ui-core-password.d.ts +56 -93
  239. package/types/exhaustive-ui-core-picklist.d.ts +107 -121
  240. package/types/exhaustive-ui-core-popover.d.ts +23 -47
  241. package/types/exhaustive-ui-core-rating.d.ts +18 -26
  242. package/types/exhaustive-ui-core-scroller.d.ts +90 -120
  243. package/types/exhaustive-ui-core-scrollpanel.d.ts +35 -46
  244. package/types/exhaustive-ui-core-scrolltop.d.ts +28 -45
  245. package/types/exhaustive-ui-core-select.d.ts +137 -188
  246. package/types/exhaustive-ui-core-selectbutton.d.ts +35 -44
  247. package/types/exhaustive-ui-core-slider.d.ts +52 -67
  248. package/types/exhaustive-ui-core-speeddial.d.ts +40 -56
  249. package/types/exhaustive-ui-core-splitbutton.d.ts +31 -71
  250. package/types/exhaustive-ui-core-splitter.d.ts +47 -59
  251. package/types/exhaustive-ui-core-steps.d.ts +24 -31
  252. package/types/exhaustive-ui-core-styleclass.d.ts +27 -33
  253. package/types/exhaustive-ui-core-table.d.ts +349 -453
  254. package/types/exhaustive-ui-core-terminal.d.ts +10 -22
  255. package/types/exhaustive-ui-core-textarea.d.ts +7 -10
  256. package/types/exhaustive-ui-core-tieredmenu.d.ts +49 -84
  257. package/types/exhaustive-ui-core-timeline.d.ts +20 -28
  258. package/types/exhaustive-ui-core-togglebutton.d.ts +32 -48
  259. package/types/exhaustive-ui-core-toggleswitch.d.ts +26 -37
  260. package/types/exhaustive-ui-core-toolbar.d.ts +17 -25
  261. package/types/exhaustive-ui-core-tooltip.d.ts +53 -88
  262. package/types/exhaustive-ui-core-tree.d.ts +82 -119
  263. package/types/exhaustive-ui-core-treeselect.d.ts +63 -92
  264. package/types/exhaustive-ui-core-treetable.d.ts +203 -280
  265. package/types/exhaustive-ui-core-types-chip.d.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  export * from '@exhaustive-ui/core/types/menubar';
2
2
  import * as i1 from '@angular/common';
3
- import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
3
+ import { CommonModule, isPlatformBrowser } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { Injectable, InjectionToken, output, inject, numberAttribute, booleanAttribute, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, PLATFORM_ID, ElementRef, Renderer2, ChangeDetectorRef, viewChild, signal, effect, contentChild, contentChildren, NgModule } from '@angular/core';
5
+ import { Injectable, input, booleanAttribute, numberAttribute, output, inject, ViewEncapsulation, ChangeDetectionStrategy, Component, computed, viewChild, signal, afterEveryRender, effect, untracked, contentChild, contentChildren, NgModule } from '@angular/core';
6
6
  import * as i2 from '@angular/router';
7
7
  import { RouterModule } from '@angular/router';
8
8
  import { resolve, isNotEmpty, uuid, isEmpty, focus, isTouchDevice, findSingle, isPrintableCharacter, findLastIndex } from '@exhaustive-ui/utils';
@@ -30,7 +30,7 @@ const classes = {
30
30
  'p-menubar p-component',
31
31
  {
32
32
  'p-menubar-mobile': instance.queryMatches(),
33
- 'p-menubar-mobile-active': instance.mobileActive
33
+ 'p-menubar-mobile-active': instance.mobileActive()
34
34
  }
35
35
  ],
36
36
  start: 'p-menubar-start',
@@ -129,7 +129,6 @@ var MenubarClasses;
129
129
  MenubarClasses["end"] = "p-menubar-end";
130
130
  })(MenubarClasses || (MenubarClasses = {}));
131
131
 
132
- const MENUBAR_INSTANCE = new InjectionToken('MENUBAR_INSTANCE');
133
132
  class MenubarService {
134
133
  autoHide;
135
134
  autoHideDelay;
@@ -142,32 +141,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
142
141
  type: Injectable
143
142
  }] });
144
143
  class MenubarSub extends BaseComponent {
145
- items;
146
- itemTemplate;
147
- root = false;
148
- autoZIndex = true;
149
- baseZIndex = 0;
150
- mobileActive;
151
- autoDisplay;
152
- menuId;
153
- ariaLabel;
154
- ariaLabelledBy;
155
- level = 0;
156
- focusedItemId;
157
- activeItemPath;
158
- inlineStyles;
159
- submenuiconTemplate;
144
+ items = input.required(/* @ts-ignore */
145
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
146
+ itemTemplate = input(undefined, /* @ts-ignore */
147
+ ...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
148
+ root = input(false, { ...(ngDevMode ? { debugName: "root" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
149
+ autoDisplay = input(undefined, { ...(ngDevMode ? { debugName: "autoDisplay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
150
+ menuId = input(undefined, /* @ts-ignore */
151
+ ...(ngDevMode ? [{ debugName: "menuId" }] : /* istanbul ignore next */ []));
152
+ level = input(0, { ...(ngDevMode ? { debugName: "level" } : /* istanbul ignore next */ {}), transform: numberAttribute });
153
+ focusedItemId = input(undefined, /* @ts-ignore */
154
+ ...(ngDevMode ? [{ debugName: "focusedItemId" }] : /* istanbul ignore next */ []));
155
+ activeItemPath = input(/* @ts-ignore */
156
+ ...(ngDevMode ? [undefined, { debugName: "activeItemPath" }] : /* istanbul ignore next */ []));
157
+ inlineStyles = input(/* @ts-ignore */
158
+ ...(ngDevMode ? [undefined, { debugName: "inlineStyles" }] : /* istanbul ignore next */ []));
159
+ submenuiconTemplate = input(undefined, /* @ts-ignore */
160
+ ...(ngDevMode ? [{ debugName: "submenuiconTemplate" }] : /* istanbul ignore next */ []));
160
161
  itemClick = output();
161
162
  itemMouseEnter = output();
162
- mouseLeaveSubscriber;
163
- menubarService = inject(MenubarService);
164
163
  _componentStyle = inject(MenuBarStyle);
165
164
  hostName = 'Menubar';
166
- onInit() {
167
- this.mouseLeaveSubscriber = this.menubarService.mouseLeft$.subscribe(() => {
168
- this.cd.markForCheck();
169
- });
170
- }
171
165
  onItemClick(event, processedItem) {
172
166
  this.getItemProp(processedItem, 'command', { originalEvent: event, item: processedItem.item });
173
167
  this.itemClick.emit({ originalEvent: event, processedItem, isFocus: true });
@@ -176,10 +170,10 @@ class MenubarSub extends BaseComponent {
176
170
  return processedItem && processedItem.item ? resolve(processedItem.item[name], params) : undefined;
177
171
  }
178
172
  getItemId(processedItem) {
179
- return processedItem.item && processedItem.item?.id ? processedItem.item.id : `${this.menuId}_${processedItem.key}`;
173
+ return processedItem.item && processedItem.item?.id ? processedItem.item.id : `${this.menuId()}_${processedItem.key}`;
180
174
  }
181
175
  getItemLabelId(processedItem) {
182
- return `${this.menuId}_${processedItem.key}_label`;
176
+ return `${this.menuId()}_${processedItem.key}_label`;
183
177
  }
184
178
  getItemLabel(processedItem) {
185
179
  return this.getItemProp(processedItem, 'label');
@@ -188,8 +182,9 @@ class MenubarSub extends BaseComponent {
188
182
  return this.getItemProp(processedItem, 'visible') !== false;
189
183
  }
190
184
  isItemActive(processedItem) {
191
- if (this.activeItemPath) {
192
- return this.activeItemPath.some((path) => path.key === processedItem.key);
185
+ const activeItemPath = this.activeItemPath();
186
+ if (activeItemPath) {
187
+ return activeItemPath.some((path) => path.key === processedItem.key);
193
188
  }
194
189
  return false;
195
190
  }
@@ -197,19 +192,23 @@ class MenubarSub extends BaseComponent {
197
192
  return this.getItemProp(processedItem, 'disabled');
198
193
  }
199
194
  isItemFocused(processedItem) {
200
- return this.focusedItemId === this.getItemId(processedItem);
195
+ return this.focusedItemId() === this.getItemId(processedItem);
201
196
  }
202
197
  isItemGroup(processedItem) {
203
198
  return isNotEmpty(processedItem.items);
204
199
  }
205
200
  getAriaSetSize() {
206
- return this.items.filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
201
+ return this.items().filter((processedItem) => this.isItemVisible(processedItem) && !this.getItemProp(processedItem, 'separator')).length;
207
202
  }
208
203
  getAriaPosInset(index) {
209
- return index - this.items.slice(0, index).filter((processedItem) => this.isItemVisible(processedItem) && this.getItemProp(processedItem, 'separator')).length + 1;
204
+ return (index -
205
+ this.items()
206
+ .slice(0, index)
207
+ .filter((processedItem) => this.isItemVisible(processedItem) && this.getItemProp(processedItem, 'separator')).length +
208
+ 1);
210
209
  }
211
210
  onItemMouseEnter(param) {
212
- if (this.autoDisplay) {
211
+ if (this.autoDisplay()) {
213
212
  const { event, processedItem } = param;
214
213
  this.itemMouseEnter.emit({ originalEvent: event, processedItem });
215
214
  }
@@ -222,16 +221,13 @@ class MenubarSub extends BaseComponent {
222
221
  active: this.isItemActive(processedItem),
223
222
  focused: this.isItemFocused(processedItem),
224
223
  disabled: this.isItemDisabled(processedItem),
225
- level: this.level
224
+ level: this.level()
226
225
  }
227
226
  });
228
227
  }
229
- onDestroy() {
230
- this.mouseLeaveSubscriber?.unsubscribe();
231
- }
232
228
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: MenubarSub, deps: null, target: i0.ɵɵFactoryTarget.Component });
233
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: MenubarSub, isStandalone: true, selector: "p-menubarSub, p-menubarsub, [pMenubarSub]", inputs: { items: "items", itemTemplate: "itemTemplate", root: ["root", "root", booleanAttribute], autoZIndex: ["autoZIndex", "autoZIndex", booleanAttribute], baseZIndex: ["baseZIndex", "baseZIndex", numberAttribute], mobileActive: ["mobileActive", "mobileActive", booleanAttribute], autoDisplay: ["autoDisplay", "autoDisplay", booleanAttribute], menuId: "menuId", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", level: ["level", "level", numberAttribute], focusedItemId: "focusedItemId", activeItemPath: "activeItemPath", inlineStyles: "inlineStyles", submenuiconTemplate: "submenuiconTemplate" }, outputs: { itemClick: "itemClick", itemMouseEnter: "itemMouseEnter" }, host: { properties: { "attr.id": "root ? menuId : null", "attr.aria-activedescendant": "focusedItemId", "class": "level === 0 ? cx('rootList') : cx('submenu')", "attr.role": "'menubar'", "style": "inlineStyles" } }, usesInheritance: true, ngImport: i0, template: `
234
- @for (processedItem of items; track processedItem; let index = $index) {
229
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: MenubarSub, isStandalone: true, selector: "p-menubarSub, p-menubarsub, [pMenubarSub]", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, root: { classPropertyName: "root", publicName: "root", isSignal: true, isRequired: false, transformFunction: null }, autoDisplay: { classPropertyName: "autoDisplay", publicName: "autoDisplay", isSignal: true, isRequired: false, transformFunction: null }, menuId: { classPropertyName: "menuId", publicName: "menuId", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, focusedItemId: { classPropertyName: "focusedItemId", publicName: "focusedItemId", isSignal: true, isRequired: false, transformFunction: null }, activeItemPath: { classPropertyName: "activeItemPath", publicName: "activeItemPath", isSignal: true, isRequired: false, transformFunction: null }, inlineStyles: { classPropertyName: "inlineStyles", publicName: "inlineStyles", isSignal: true, isRequired: false, transformFunction: null }, submenuiconTemplate: { classPropertyName: "submenuiconTemplate", publicName: "submenuiconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", itemMouseEnter: "itemMouseEnter" }, host: { properties: { "attr.id": "root() ? menuId() : null", "attr.aria-activedescendant": "focusedItemId()", "class": "level() === 0 ? cx('rootList') : cx('submenu')", "attr.role": "'menubar'", "style": "inlineStyles()" } }, usesInheritance: true, ngImport: i0, template: `
230
+ @for (processedItem of items(); track processedItem; let index = $index) {
235
231
  @if (isItemVisible(processedItem) && getItemProp(processedItem, 'separator')) {
236
232
  <li [attr.id]="getItemId(processedItem)" [style]="getItemProp(processedItem, 'style')" [class]="cn(cx('separator'), processedItem?.styleClass)" role="separator" [pBind]="ptm('separator')"></li>
237
233
  }
@@ -257,7 +253,7 @@ class MenubarSub extends BaseComponent {
257
253
  [pTooltipUnstyled]="unstyled()"
258
254
  >
259
255
  <div [class]="cx('itemContent')" [pBind]="getPTOptions(processedItem, index, 'itemContent')" (click)="onItemClick($event, processedItem)" (mouseenter)="onItemMouseEnter({ $event, processedItem })">
260
- @if (!itemTemplate) {
256
+ @if (!itemTemplate()) {
261
257
  @if (!getItemProp(processedItem, 'routerLink')) {
262
258
  <a
263
259
  [attr.href]="getItemProp(processedItem, 'url')"
@@ -301,15 +297,15 @@ class MenubarSub extends BaseComponent {
301
297
  <p-badge [class]="getItemProp(processedItem, 'badgeStyleClass')" [value]="getItemProp(processedItem, 'badge')" [pt]="getPTOptions(processedItem, index, 'pcBadge')" [unstyled]="unstyled()" />
302
298
  }
303
299
  @if (isItemGroup(processedItem)) {
304
- @if (!submenuiconTemplate) {
305
- @if (root) {
300
+ @if (!submenuiconTemplate()) {
301
+ @if (root()) {
306
302
  <svg data-p-icon="angle-down" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
307
303
  }
308
- @if (!root) {
304
+ @if (!root()) {
309
305
  <svg data-p-icon="angle-right" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
310
306
  }
311
307
  }
312
- <ng-template *ngTemplateOutlet="submenuiconTemplate"></ng-template>
308
+ <ng-template *ngTemplateOutlet="submenuiconTemplate()"></ng-template>
313
309
  }
314
310
  </a>
315
311
  }
@@ -358,34 +354,33 @@ class MenubarSub extends BaseComponent {
358
354
  <p-badge [class]="getItemProp(processedItem, 'badgeStyleClass')" [value]="getItemProp(processedItem, 'badge')" [pt]="getPTOptions(processedItem, index, 'pcBadge')" [unstyled]="unstyled()" />
359
355
  }
360
356
  @if (isItemGroup(processedItem)) {
361
- @if (!submenuiconTemplate) {
362
- @if (root) {
357
+ @if (!submenuiconTemplate()) {
358
+ @if (root()) {
363
359
  <svg data-p-icon="angle-down" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
364
360
  }
365
- @if (!root) {
361
+ @if (!root()) {
366
362
  <svg data-p-icon="angle-right" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
367
363
  }
368
364
  }
369
- <ng-template *ngTemplateOutlet="submenuiconTemplate"></ng-template>
365
+ <ng-template *ngTemplateOutlet="submenuiconTemplate()"></ng-template>
370
366
  }
371
367
  </a>
372
368
  }
373
369
  }
374
- @if (itemTemplate) {
375
- <ng-template *ngTemplateOutlet="itemTemplate; context: { $implicit: processedItem.item, root: root }"></ng-template>
370
+ @if (itemTemplate()) {
371
+ <ng-template *ngTemplateOutlet="itemTemplate(); context: { $implicit: processedItem.item, root: root() }"></ng-template>
376
372
  }
377
373
  </div>
378
374
  @if (isItemVisible(processedItem) && isItemGroup(processedItem)) {
379
375
  <ul
380
376
  pMenubarSub
381
- [itemTemplate]="itemTemplate"
377
+ [itemTemplate]="itemTemplate()"
382
378
  [items]="processedItem.items"
383
- [mobileActive]="mobileActive"
384
- [autoDisplay]="autoDisplay"
385
- [menuId]="menuId"
386
- [activeItemPath]="activeItemPath"
387
- [focusedItemId]="focusedItemId"
388
- [level]="level + 1"
379
+ [autoDisplay]="autoDisplay()"
380
+ [menuId]="menuId()"
381
+ [activeItemPath]="activeItemPath()"
382
+ [focusedItemId]="focusedItemId()"
383
+ [level]="level() + 1"
389
384
  [attr.aria-labelledby]="getItemLabelId(processedItem)"
390
385
  (itemClick)="itemClick.emit($event)"
391
386
  (itemMouseEnter)="onItemMouseEnter($event)"
@@ -398,17 +393,16 @@ class MenubarSub extends BaseComponent {
398
393
  </li>
399
394
  }
400
395
  }
401
- `, isInline: true, dependencies: [{ kind: "component", type: MenubarSub, selector: "p-menubarSub, p-menubarsub, [pMenubarSub]", inputs: ["items", "itemTemplate", "root", "autoZIndex", "baseZIndex", "mobileActive", "autoDisplay", "menuId", "ariaLabel", "ariaLabelledBy", "level", "focusedItemId", "activeItemPath", "inlineStyles", "submenuiconTemplate"], outputs: ["itemClick", "itemMouseEnter"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: Ripple, selector: "[pRipple]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "directive", type: i4.Bind, selector: "[pBind]", inputs: ["pBind"] }, { kind: "component", type: AngleDownIcon, selector: "[data-p-icon=\"angle-down\"]" }, { kind: "component", type: AngleRightIcon, selector: "[data-p-icon=\"angle-right\"]" }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i5.Badge, selector: "p-badge", inputs: ["styleClass", "badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }], changeDetection: i0.ChangeDetectionStrategy.Eager, encapsulation: i0.ViewEncapsulation.None });
396
+ `, isInline: true, dependencies: [{ kind: "component", type: MenubarSub, selector: "p-menubarSub, p-menubarsub, [pMenubarSub]", inputs: ["items", "itemTemplate", "root", "autoDisplay", "menuId", "level", "focusedItemId", "activeItemPath", "inlineStyles", "submenuiconTemplate"], outputs: ["itemClick", "itemMouseEnter"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: Ripple, selector: "[pRipple]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "directive", type: i4.Bind, selector: "[pBind]", inputs: ["pBind"] }, { kind: "component", type: AngleDownIcon, selector: "[data-p-icon=\"angle-down\"]" }, { kind: "component", type: AngleRightIcon, selector: "[data-p-icon=\"angle-right\"]" }, { kind: "ngmodule", type: BadgeModule }, { kind: "component", type: i5.Badge, selector: "p-badge", inputs: ["badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
402
397
  }
403
398
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: MenubarSub, decorators: [{
404
399
  type: Component,
405
400
  args: [{
406
- changeDetection: ChangeDetectionStrategy.Eager,
401
+ changeDetection: ChangeDetectionStrategy.OnPush,
407
402
  selector: 'p-menubarSub, p-menubarsub, [pMenubarSub]',
408
- standalone: true,
409
403
  imports: [CommonModule, RouterModule, Ripple, TooltipModule, AngleDownIcon, AngleRightIcon, BadgeModule, SharedModule, BindModule],
410
404
  template: `
411
- @for (processedItem of items; track processedItem; let index = $index) {
405
+ @for (processedItem of items(); track processedItem; let index = $index) {
412
406
  @if (isItemVisible(processedItem) && getItemProp(processedItem, 'separator')) {
413
407
  <li [attr.id]="getItemId(processedItem)" [style]="getItemProp(processedItem, 'style')" [class]="cn(cx('separator'), processedItem?.styleClass)" role="separator" [pBind]="ptm('separator')"></li>
414
408
  }
@@ -434,7 +428,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
434
428
  [pTooltipUnstyled]="unstyled()"
435
429
  >
436
430
  <div [class]="cx('itemContent')" [pBind]="getPTOptions(processedItem, index, 'itemContent')" (click)="onItemClick($event, processedItem)" (mouseenter)="onItemMouseEnter({ $event, processedItem })">
437
- @if (!itemTemplate) {
431
+ @if (!itemTemplate()) {
438
432
  @if (!getItemProp(processedItem, 'routerLink')) {
439
433
  <a
440
434
  [attr.href]="getItemProp(processedItem, 'url')"
@@ -478,15 +472,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
478
472
  <p-badge [class]="getItemProp(processedItem, 'badgeStyleClass')" [value]="getItemProp(processedItem, 'badge')" [pt]="getPTOptions(processedItem, index, 'pcBadge')" [unstyled]="unstyled()" />
479
473
  }
480
474
  @if (isItemGroup(processedItem)) {
481
- @if (!submenuiconTemplate) {
482
- @if (root) {
475
+ @if (!submenuiconTemplate()) {
476
+ @if (root()) {
483
477
  <svg data-p-icon="angle-down" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
484
478
  }
485
- @if (!root) {
479
+ @if (!root()) {
486
480
  <svg data-p-icon="angle-right" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
487
481
  }
488
482
  }
489
- <ng-template *ngTemplateOutlet="submenuiconTemplate"></ng-template>
483
+ <ng-template *ngTemplateOutlet="submenuiconTemplate()"></ng-template>
490
484
  }
491
485
  </a>
492
486
  }
@@ -535,34 +529,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
535
529
  <p-badge [class]="getItemProp(processedItem, 'badgeStyleClass')" [value]="getItemProp(processedItem, 'badge')" [pt]="getPTOptions(processedItem, index, 'pcBadge')" [unstyled]="unstyled()" />
536
530
  }
537
531
  @if (isItemGroup(processedItem)) {
538
- @if (!submenuiconTemplate) {
539
- @if (root) {
532
+ @if (!submenuiconTemplate()) {
533
+ @if (root()) {
540
534
  <svg data-p-icon="angle-down" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
541
535
  }
542
- @if (!root) {
536
+ @if (!root()) {
543
537
  <svg data-p-icon="angle-right" [class]="cx('submenuIcon')" [pBind]="getPTOptions(processedItem, index, 'submenuIcon')" />
544
538
  }
545
539
  }
546
- <ng-template *ngTemplateOutlet="submenuiconTemplate"></ng-template>
540
+ <ng-template *ngTemplateOutlet="submenuiconTemplate()"></ng-template>
547
541
  }
548
542
  </a>
549
543
  }
550
544
  }
551
- @if (itemTemplate) {
552
- <ng-template *ngTemplateOutlet="itemTemplate; context: { $implicit: processedItem.item, root: root }"></ng-template>
545
+ @if (itemTemplate()) {
546
+ <ng-template *ngTemplateOutlet="itemTemplate(); context: { $implicit: processedItem.item, root: root() }"></ng-template>
553
547
  }
554
548
  </div>
555
549
  @if (isItemVisible(processedItem) && isItemGroup(processedItem)) {
556
550
  <ul
557
551
  pMenubarSub
558
- [itemTemplate]="itemTemplate"
552
+ [itemTemplate]="itemTemplate()"
559
553
  [items]="processedItem.items"
560
- [mobileActive]="mobileActive"
561
- [autoDisplay]="autoDisplay"
562
- [menuId]="menuId"
563
- [activeItemPath]="activeItemPath"
564
- [focusedItemId]="focusedItemId"
565
- [level]="level + 1"
554
+ [autoDisplay]="autoDisplay()"
555
+ [menuId]="menuId()"
556
+ [activeItemPath]="activeItemPath()"
557
+ [focusedItemId]="focusedItemId()"
558
+ [level]="level() + 1"
566
559
  [attr.aria-labelledby]="getItemLabelId(processedItem)"
567
560
  (itemClick)="itemClick.emit($event)"
568
561
  (itemMouseEnter)="onItemMouseEnter($event)"
@@ -578,130 +571,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
578
571
  `,
579
572
  encapsulation: ViewEncapsulation.None,
580
573
  host: {
581
- '[attr.id]': 'root ? menuId : null',
582
- '[attr.aria-activedescendant]': 'focusedItemId',
583
- '[class]': "level === 0 ? cx('rootList') : cx('submenu')",
574
+ '[attr.id]': 'root() ? menuId() : null',
575
+ '[attr.aria-activedescendant]': 'focusedItemId()',
576
+ '[class]': "level() === 0 ? cx('rootList') : cx('submenu')",
584
577
  '[attr.role]': "'menubar'",
585
- '[style]': 'inlineStyles'
578
+ '[style]': 'inlineStyles()'
586
579
  }
587
580
  }]
588
- }], propDecorators: { items: [{
589
- type: Input
590
- }], itemTemplate: [{
591
- type: Input
592
- }], root: [{
593
- type: Input,
594
- args: [{ transform: booleanAttribute }]
595
- }], autoZIndex: [{
596
- type: Input,
597
- args: [{ transform: booleanAttribute }]
598
- }], baseZIndex: [{
599
- type: Input,
600
- args: [{ transform: numberAttribute }]
601
- }], mobileActive: [{
602
- type: Input,
603
- args: [{ transform: booleanAttribute }]
604
- }], autoDisplay: [{
605
- type: Input,
606
- args: [{ transform: booleanAttribute }]
607
- }], menuId: [{
608
- type: Input
609
- }], ariaLabel: [{
610
- type: Input
611
- }], ariaLabelledBy: [{
612
- type: Input
613
- }], level: [{
614
- type: Input,
615
- args: [{ transform: numberAttribute }]
616
- }], focusedItemId: [{
617
- type: Input
618
- }], activeItemPath: [{
619
- type: Input
620
- }], inlineStyles: [{
621
- type: Input
622
- }], submenuiconTemplate: [{
623
- type: Input
624
- }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], itemMouseEnter: [{ type: i0.Output, args: ["itemMouseEnter"] }] } });
581
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], root: [{ type: i0.Input, args: [{ isSignal: true, alias: "root", required: false }] }], autoDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoDisplay", required: false }] }], menuId: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuId", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], focusedItemId: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusedItemId", required: false }] }], activeItemPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeItemPath", required: false }] }], inlineStyles: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineStyles", required: false }] }], submenuiconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenuiconTemplate", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], itemMouseEnter: [{ type: i0.Output, args: ["itemMouseEnter"] }] } });
625
582
  /**
626
583
  * Menubar is a horizontal menu component.
627
584
  * @group Components
628
585
  */
629
586
  class Menubar extends BaseComponent {
630
- document = inject(DOCUMENT);
631
- platformId = inject(PLATFORM_ID);
632
- el = inject(ElementRef);
633
- renderer = inject(Renderer2);
634
- cd = inject(ChangeDetectorRef);
635
587
  menubarService = inject(MenubarService);
636
588
  componentName = 'Menubar';
637
- $pcMenubar = inject(MENUBAR_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
638
589
  bindDirectiveInstance = inject(Bind, { self: true });
639
- onAfterViewChecked() {
640
- this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));
641
- }
642
590
  /**
643
591
  * An array of menuitems.
644
592
  * @group Props
645
593
  */
646
- set model(value) {
647
- this._model = value;
648
- this._processedItems = this.createProcessedItems(this._model || []);
649
- }
650
- get model() {
651
- return this._model;
652
- }
653
- /**
654
- * Class of the element.
655
- * @deprecated since v20.0.0, use `class` instead.
656
- * @group Props
657
- */
658
- styleClass;
659
- /**
660
- * Whether to automatically manage layering.
661
- * @group Props
662
- */
663
- autoZIndex = true;
664
- /**
665
- * Base zIndex value to use in layering.
666
- * @group Props
667
- */
668
- baseZIndex = 0;
594
+ model = input(undefined, /* @ts-ignore */
595
+ ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
669
596
  /**
670
597
  * Whether to show a root submenu on mouse over.
671
598
  * @defaultValue true
672
599
  * @group Props
673
600
  */
674
- autoDisplay = true;
601
+ autoDisplay = input(true, { ...(ngDevMode ? { debugName: "autoDisplay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
675
602
  /**
676
603
  * Whether to hide a root submenu when mouse leaves.
677
604
  * @group Props
678
605
  */
679
- autoHide;
606
+ autoHide = input(undefined, { ...(ngDevMode ? { debugName: "autoHide" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
680
607
  /**
681
608
  * The breakpoint to define the maximum width boundary.
682
609
  * @group Props
683
610
  */
684
- breakpoint = '960px';
611
+ breakpoint = input('960px', /* @ts-ignore */
612
+ ...(ngDevMode ? [{ debugName: "breakpoint" }] : /* istanbul ignore next */ []));
685
613
  /**
686
614
  * Delay to hide the root submenu in milliseconds when mouse leaves.
687
615
  * @group Props
688
616
  */
689
- autoHideDelay = 100;
617
+ autoHideDelay = input(100, { ...(ngDevMode ? { debugName: "autoHideDelay" } : /* istanbul ignore next */ {}), transform: numberAttribute });
690
618
  /**
691
619
  * Current id state as a string.
692
620
  * @group Props
693
621
  */
694
- id;
622
+ id = input(undefined, /* @ts-ignore */
623
+ ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
624
+ _id = computed(() => this.id() || uuid('pn_id_'), /* @ts-ignore */
625
+ ...(ngDevMode ? [{ debugName: "_id" }] : /* istanbul ignore next */ []));
695
626
  /**
696
627
  * Defines a string value that labels an interactive element.
697
628
  * @group Props
698
629
  */
699
- ariaLabel;
630
+ ariaLabel = input(undefined, /* @ts-ignore */
631
+ ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
700
632
  /**
701
633
  * Identifier of the underlying input element.
702
634
  * @group Props
703
635
  */
704
- ariaLabelledBy;
636
+ ariaLabelledBy = input(undefined, /* @ts-ignore */
637
+ ...(ngDevMode ? [{ debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []));
705
638
  /**
706
639
  * Callback to execute when button is focused.
707
640
  * @param {FocusEvent} event - Focus event.
@@ -718,63 +651,71 @@ class Menubar extends BaseComponent {
718
651
  ...(ngDevMode ? [{ debugName: "menubutton" }] : /* istanbul ignore next */ []));
719
652
  rootmenu = viewChild.required('rootmenu', /* @ts-ignore */
720
653
  ...(ngDevMode ? [{ debugName: "rootmenu" }] : /* istanbul ignore next */ []));
721
- mobileActive;
722
- matchMediaListener;
723
- query;
654
+ mobileActive = signal(undefined, /* @ts-ignore */
655
+ ...(ngDevMode ? [{ debugName: "mobileActive" }] : /* istanbul ignore next */ []));
656
+ matchMediaListener = signal(undefined, /* @ts-ignore */
657
+ ...(ngDevMode ? [{ debugName: "matchMediaListener" }] : /* istanbul ignore next */ []));
658
+ query = signal(undefined, /* @ts-ignore */
659
+ ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
724
660
  queryMatches = signal(false, /* @ts-ignore */
725
661
  ...(ngDevMode ? [{ debugName: "queryMatches" }] : /* istanbul ignore next */ []));
726
- outsideClickListener;
727
- resizeListener;
728
- mouseLeaveSubscriber;
729
- dirty = false;
730
- focused = false;
662
+ outsideClickListener = signal(undefined, /* @ts-ignore */
663
+ ...(ngDevMode ? [{ debugName: "outsideClickListener" }] : /* istanbul ignore next */ []));
664
+ resizeListener = signal(undefined, /* @ts-ignore */
665
+ ...(ngDevMode ? [{ debugName: "resizeListener" }] : /* istanbul ignore next */ []));
666
+ mouseLeaveSubscriber = signal(undefined, /* @ts-ignore */
667
+ ...(ngDevMode ? [{ debugName: "mouseLeaveSubscriber" }] : /* istanbul ignore next */ []));
668
+ dirty = signal(false, /* @ts-ignore */
669
+ ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
670
+ focused = signal(false, /* @ts-ignore */
671
+ ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
731
672
  activeItemPath = signal([], /* @ts-ignore */
732
673
  ...(ngDevMode ? [{ debugName: "activeItemPath" }] : /* istanbul ignore next */ []));
733
- number = signal(0, /* @ts-ignore */
734
- ...(ngDevMode ? [{ debugName: "number" }] : /* istanbul ignore next */ []));
735
674
  focusedItemInfo = signal({ index: -1, level: 0, parentKey: '', item: null }, /* @ts-ignore */
736
675
  ...(ngDevMode ? [{ debugName: "focusedItemInfo" }] : /* istanbul ignore next */ []));
737
- searchValue = '';
738
- searchTimeout;
739
- _processedItems;
676
+ searchValue = signal('', /* @ts-ignore */
677
+ ...(ngDevMode ? [{ debugName: "searchValue" }] : /* istanbul ignore next */ []));
678
+ searchTimeout = signal(undefined, /* @ts-ignore */
679
+ ...(ngDevMode ? [{ debugName: "searchTimeout" }] : /* istanbul ignore next */ []));
740
680
  _componentStyle = inject(MenuBarStyle);
741
- _model;
742
- get visibleItems() {
681
+ visibleItems = computed(() => {
743
682
  const processedItem = this.activeItemPath().find((p) => p.key === this.focusedItemInfo().parentKey);
744
- return processedItem ? processedItem.items : this.processedItems;
745
- }
746
- get processedItems() {
747
- if (!this._processedItems || !this._processedItems.length) {
748
- this._processedItems = this.createProcessedItems(this.model || []);
749
- }
750
- return this._processedItems;
751
- }
752
- get focusedItemId() {
683
+ return processedItem ? processedItem.items : this.processedItems();
684
+ }, /* @ts-ignore */
685
+ ...(ngDevMode ? [{ debugName: "visibleItems" }] : /* istanbul ignore next */ []));
686
+ processedItems = computed(() => this.createProcessedItems(this.model() || []), /* @ts-ignore */
687
+ ...(ngDevMode ? [{ debugName: "processedItems" }] : /* istanbul ignore next */ []));
688
+ focusedItemId = computed(() => {
753
689
  const focusedItem = this.focusedItemInfo();
754
- return focusedItem.item && focusedItem.item?.id ? focusedItem.item.id : focusedItem.index !== -1 ? `${this.id}${isNotEmpty(focusedItem.parentKey) ? '_' + focusedItem.parentKey : ''}_${focusedItem.index}` : null;
755
- }
690
+ return focusedItem.item && focusedItem.item?.id ? focusedItem.item.id : focusedItem.index !== -1 ? `${this._id()}${isNotEmpty(focusedItem.parentKey) ? '_' + focusedItem.parentKey : ''}_${focusedItem.index}` : null;
691
+ }, /* @ts-ignore */
692
+ ...(ngDevMode ? [{ debugName: "focusedItemId" }] : /* istanbul ignore next */ []));
756
693
  constructor() {
757
694
  super();
695
+ afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])));
758
696
  effect(() => {
759
697
  const path = this.activeItemPath();
760
- if (isNotEmpty(path)) {
761
- this.bindOutsideClickListener();
762
- this.bindResizeListener();
763
- }
764
- else {
765
- this.unbindOutsideClickListener();
766
- this.unbindResizeListener();
767
- }
698
+ untracked(() => {
699
+ if (isNotEmpty(path)) {
700
+ this.bindOutsideClickListener();
701
+ this.bindResizeListener();
702
+ }
703
+ else {
704
+ this.unbindOutsideClickListener();
705
+ this.unbindResizeListener();
706
+ }
707
+ });
708
+ });
709
+ effect(() => {
710
+ this.menubarService.autoHide = this.autoHide();
711
+ this.menubarService.autoHideDelay = this.autoHideDelay();
768
712
  });
769
713
  }
770
714
  onInit() {
771
715
  this.bindMatchMediaListener();
772
- this.menubarService.autoHide = this.autoHide;
773
- this.menubarService.autoHideDelay = this.autoHideDelay;
774
- this.mouseLeaveSubscriber = this.menubarService.mouseLeft$.subscribe(() => {
716
+ this.mouseLeaveSubscriber.set(this.menubarService.mouseLeft$.subscribe(() => {
775
717
  this.hide();
776
- });
777
- this.id = this.id || uuid('pn_id_');
718
+ }));
778
719
  }
779
720
  /**
780
721
  * Defines template option for start.
@@ -805,35 +746,26 @@ class Menubar extends BaseComponent {
805
746
  submenuIconTemplate = contentChild('submenuicon', { ...(ngDevMode ? { debugName: "submenuIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
806
747
  templates = contentChildren(PrimeTemplate, /* @ts-ignore */
807
748
  ...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
808
- _startTemplate;
809
- _endTemplate;
810
- _itemTemplate;
811
- _menuIconTemplate;
812
- _submenuIconTemplate;
813
- onAfterContentInit() {
814
- this.templates()?.forEach((item) => {
815
- switch (item.getType()) {
816
- case 'start':
817
- this._startTemplate = item.template;
818
- break;
819
- case 'end':
820
- this._endTemplate = item.template;
821
- break;
822
- case 'menuicon':
823
- this._menuIconTemplate = item.template;
824
- break;
825
- case 'submenuicon':
826
- this._submenuIconTemplate = item.template;
827
- break;
828
- case 'item':
829
- this._itemTemplate = item.template;
830
- break;
831
- default:
832
- this._itemTemplate = item.template;
833
- break;
834
- }
835
- });
836
- }
749
+ _startTemplate = computed(() => this.templates()
750
+ .filter((item) => item.getType() === 'start')
751
+ .at(-1)?.template, /* @ts-ignore */
752
+ ...(ngDevMode ? [{ debugName: "_startTemplate" }] : /* istanbul ignore next */ []));
753
+ _endTemplate = computed(() => this.templates()
754
+ .filter((item) => item.getType() === 'end')
755
+ .at(-1)?.template, /* @ts-ignore */
756
+ ...(ngDevMode ? [{ debugName: "_endTemplate" }] : /* istanbul ignore next */ []));
757
+ _itemTemplate = computed(() => this.templates()
758
+ .filter((item) => !['start', 'end', 'menuicon', 'submenuicon'].includes(item.getType()))
759
+ .at(-1)?.template, /* @ts-ignore */
760
+ ...(ngDevMode ? [{ debugName: "_itemTemplate" }] : /* istanbul ignore next */ []));
761
+ _menuIconTemplate = computed(() => this.templates()
762
+ .filter((item) => item.getType() === 'menuicon')
763
+ .at(-1)?.template, /* @ts-ignore */
764
+ ...(ngDevMode ? [{ debugName: "_menuIconTemplate" }] : /* istanbul ignore next */ []));
765
+ _submenuIconTemplate = computed(() => this.templates()
766
+ .filter((item) => item.getType() === 'submenuicon')
767
+ .at(-1)?.template, /* @ts-ignore */
768
+ ...(ngDevMode ? [{ debugName: "_submenuIconTemplate" }] : /* istanbul ignore next */ []));
837
769
  createProcessedItems(items, level = 0, parent = {}, parentKey = '') {
838
770
  const processedItems = [];
839
771
  items &&
@@ -854,23 +786,24 @@ class Menubar extends BaseComponent {
854
786
  }
855
787
  bindMatchMediaListener() {
856
788
  if (isPlatformBrowser(this.platformId)) {
857
- if (!this.matchMediaListener) {
858
- const query = window.matchMedia(`(max-width: ${this.breakpoint})`);
859
- this.query = query;
789
+ if (!this.matchMediaListener()) {
790
+ const query = window.matchMedia(`(max-width: ${this.breakpoint()})`);
791
+ this.query.set(query);
860
792
  this.queryMatches.set(query.matches);
861
- this.matchMediaListener = () => {
793
+ const matchMediaListener = () => {
862
794
  this.queryMatches.set(query.matches);
863
- this.mobileActive = false;
864
- this.cd.markForCheck();
795
+ this.mobileActive.set(false);
865
796
  };
866
- query.addEventListener('change', this.matchMediaListener);
797
+ this.matchMediaListener.set(matchMediaListener);
798
+ query.addEventListener('change', matchMediaListener);
867
799
  }
868
800
  }
869
801
  }
870
802
  unbindMatchMediaListener() {
871
- if (this.matchMediaListener) {
872
- this.query.removeEventListener('change', this.matchMediaListener);
873
- this.matchMediaListener = null;
803
+ const matchMediaListener = this.matchMediaListener();
804
+ if (matchMediaListener) {
805
+ this.query()?.removeEventListener('change', matchMediaListener);
806
+ this.matchMediaListener.set(null);
874
807
  }
875
808
  }
876
809
  getItemProp(item, name) {
@@ -883,7 +816,7 @@ class Menubar extends BaseComponent {
883
816
  (event.code === 'Enter' || event.code === 'Space') && this.menuButtonClick(event);
884
817
  }
885
818
  onItemClick(event) {
886
- this.dirty = true;
819
+ this.dirty.set(true);
887
820
  const { originalEvent, processedItem } = event;
888
821
  const grouped = this.isProcessedItemGroup(processedItem);
889
822
  const root = isEmpty(processedItem.parent);
@@ -892,7 +825,7 @@ class Menubar extends BaseComponent {
892
825
  const { index, key, level, parentKey, item } = processedItem;
893
826
  this.activeItemPath.set(this.activeItemPath().filter((p) => key !== p.key && key.startsWith(p.key)));
894
827
  this.focusedItemInfo.set({ index, level, parentKey, item });
895
- this.dirty = !root;
828
+ this.dirty.set(!root);
896
829
  focus(this.rootmenu().el.nativeElement);
897
830
  }
898
831
  else {
@@ -903,19 +836,19 @@ class Menubar extends BaseComponent {
903
836
  const rootProcessedItem = root ? processedItem : this.activeItemPath().find((p) => p.parentKey === '');
904
837
  this.hide(originalEvent);
905
838
  this.changeFocusedItemIndex(originalEvent, rootProcessedItem ? rootProcessedItem.index : -1);
906
- this.mobileActive = false;
839
+ this.mobileActive.set(false);
907
840
  focus(this.rootmenu().el.nativeElement);
908
841
  }
909
842
  }
910
843
  }
911
844
  onItemMouseEnter(event) {
912
845
  if (!isTouchDevice()) {
913
- if (this.dirty) {
846
+ if (this.dirty()) {
914
847
  this.onItemChange(event, 'hover');
915
848
  }
916
849
  }
917
850
  else {
918
- this.onItemChange({ event, processedItem: event.processedItem, focus: this.autoDisplay }, 'hover');
851
+ this.onItemChange({ event, processedItem: event.processedItem, focus: this.autoDisplay() }, 'hover');
919
852
  }
920
853
  }
921
854
  onMouseLeave(event) {
@@ -936,7 +869,7 @@ class Menubar extends BaseComponent {
936
869
  }
937
870
  }
938
871
  scrollInView(index = -1) {
939
- const id = index !== -1 ? `${this.id}_${index}` : this.focusedItemId;
872
+ const id = index !== -1 ? `${this._id()}_${index}` : this.focusedItemId();
940
873
  const element = findSingle(this.rootmenu().el.nativeElement, `li[id="${id}"]`);
941
874
  if (element) {
942
875
  element.scrollIntoView && element.scrollIntoView({ block: 'nearest', inline: 'nearest' });
@@ -951,7 +884,7 @@ class Menubar extends BaseComponent {
951
884
  const activeItemPath = this.activeItemPath().filter((p) => p.parentKey !== parentKey && p.parentKey !== key);
952
885
  grouped && activeItemPath.push(processedItem);
953
886
  this.focusedItemInfo.set({ index, level, parentKey, item });
954
- grouped && (this.dirty = true);
887
+ grouped && this.dirty.set(true);
955
888
  isFocus && focus(this.rootmenu().el.nativeElement);
956
889
  if (type === 'hover' && this.queryMatches()) {
957
890
  return;
@@ -959,13 +892,13 @@ class Menubar extends BaseComponent {
959
892
  this.activeItemPath.set(activeItemPath);
960
893
  }
961
894
  toggle(event) {
962
- if (this.mobileActive) {
963
- this.mobileActive = false;
895
+ if (this.mobileActive()) {
896
+ this.mobileActive.set(false);
964
897
  ZIndexUtils.clear(this.rootmenu().el.nativeElement);
965
898
  this.hide();
966
899
  }
967
900
  else {
968
- this.mobileActive = true;
901
+ this.mobileActive.set(true);
969
902
  ZIndexUtils.set('menu', this.rootmenu().el.nativeElement, this.config.zIndex.menu);
970
903
  setTimeout(() => {
971
904
  this.show();
@@ -975,7 +908,7 @@ class Menubar extends BaseComponent {
975
908
  event.preventDefault();
976
909
  }
977
910
  hide(event, isFocus) {
978
- if (this.mobileActive) {
911
+ if (this.mobileActive()) {
979
912
  setTimeout(() => {
980
913
  focus(this.menubutton()?.nativeElement);
981
914
  }, 0);
@@ -983,7 +916,7 @@ class Menubar extends BaseComponent {
983
916
  this.activeItemPath.set([]);
984
917
  this.focusedItemInfo.set({ index: -1, level: 0, parentKey: '', item: null });
985
918
  isFocus && focus(this.rootmenu().el.nativeElement);
986
- this.dirty = false;
919
+ this.dirty.set(false);
987
920
  }
988
921
  show() {
989
922
  const processedItem = this.findVisibleItem(this.findFirstFocusedItemIndex());
@@ -991,13 +924,13 @@ class Menubar extends BaseComponent {
991
924
  focus(this.rootmenu().el.nativeElement);
992
925
  }
993
926
  onMenuMouseDown(event) {
994
- this.dirty = true;
927
+ this.dirty.set(true);
995
928
  }
996
929
  onMenuFocus(event) {
997
- this.focused = true;
930
+ this.focused.set(true);
998
931
  const relatedTarget = event.relatedTarget;
999
932
  const isFromOutside = !relatedTarget || !this.el.nativeElement.contains(relatedTarget);
1000
- if (isFromOutside && this.focusedItemInfo().index === -1 && !this.activeItemPath().length && !this.dirty) {
933
+ if (isFromOutside && this.focusedItemInfo().index === -1 && !this.activeItemPath().length && !this.dirty()) {
1001
934
  const processedItem = this.findVisibleItem(this.findFirstFocusedItemIndex());
1002
935
  this.focusedItemInfo.set({ index: this.findFirstFocusedItemIndex(), level: 0, parentKey: '', item: processedItem?.item });
1003
936
  }
@@ -1013,10 +946,10 @@ class Menubar extends BaseComponent {
1013
946
  if (activeElement && this.el.nativeElement.contains(activeElement)) {
1014
947
  return;
1015
948
  }
1016
- this.focused = false;
949
+ this.focused.set(false);
1017
950
  this.focusedItemInfo.set({ index: -1, level: 0, parentKey: '', item: null });
1018
- this.searchValue = '';
1019
- this.dirty = false;
951
+ this.searchValue.set('');
952
+ this.dirty.set(false);
1020
953
  this.onBlur.emit(event);
1021
954
  });
1022
955
  }
@@ -1068,17 +1001,18 @@ class Menubar extends BaseComponent {
1068
1001
  }
1069
1002
  }
1070
1003
  findVisibleItem(index) {
1071
- return isNotEmpty(this.visibleItems) ? this.visibleItems[index] : null;
1004
+ const visibleItems = this.visibleItems();
1005
+ return isNotEmpty(visibleItems) ? visibleItems[index] : null;
1072
1006
  }
1073
1007
  findFirstFocusedItemIndex() {
1074
1008
  const selectedIndex = this.findSelectedItemIndex();
1075
1009
  return selectedIndex < 0 ? this.findFirstItemIndex() : selectedIndex;
1076
1010
  }
1077
1011
  findFirstItemIndex() {
1078
- return this.visibleItems.findIndex((processedItem) => this.isValidItem(processedItem));
1012
+ return this.visibleItems().findIndex((processedItem) => this.isValidItem(processedItem));
1079
1013
  }
1080
1014
  findSelectedItemIndex() {
1081
- return this.visibleItems.findIndex((processedItem) => this.isValidSelectedItem(processedItem));
1015
+ return this.visibleItems().findIndex((processedItem) => this.isValidSelectedItem(processedItem));
1082
1016
  }
1083
1017
  isProcessedItemGroup(processedItem) {
1084
1018
  return processedItem && isNotEmpty(processedItem.items);
@@ -1099,21 +1033,22 @@ class Menubar extends BaseComponent {
1099
1033
  return this.getItemProp(item, 'separator');
1100
1034
  }
1101
1035
  isItemMatched(processedItem) {
1102
- return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase());
1036
+ return this.isValidItem(processedItem) && this.getProccessedItemLabel(processedItem).toLocaleLowerCase().startsWith(this.searchValue().toLocaleLowerCase());
1103
1037
  }
1104
1038
  isProccessedItemGroup(processedItem) {
1105
1039
  return processedItem && isNotEmpty(processedItem.items);
1106
1040
  }
1107
1041
  searchItems(event, char) {
1108
- this.searchValue = (this.searchValue || '') + char;
1042
+ this.searchValue.update((searchValue) => (searchValue || '') + char);
1109
1043
  let itemIndex = -1;
1110
1044
  let matched = false;
1045
+ const visibleItems = this.visibleItems();
1111
1046
  if (this.focusedItemInfo().index !== -1) {
1112
- itemIndex = this.visibleItems.slice(this.focusedItemInfo().index).findIndex((processedItem) => this.isItemMatched(processedItem));
1113
- itemIndex = itemIndex === -1 ? this.visibleItems.slice(0, this.focusedItemInfo().index).findIndex((processedItem) => this.isItemMatched(processedItem)) : itemIndex + this.focusedItemInfo().index;
1047
+ itemIndex = visibleItems.slice(this.focusedItemInfo().index).findIndex((processedItem) => this.isItemMatched(processedItem));
1048
+ itemIndex = itemIndex === -1 ? visibleItems.slice(0, this.focusedItemInfo().index).findIndex((processedItem) => this.isItemMatched(processedItem)) : itemIndex + this.focusedItemInfo().index;
1114
1049
  }
1115
1050
  else {
1116
- itemIndex = this.visibleItems.findIndex((processedItem) => this.isItemMatched(processedItem));
1051
+ itemIndex = visibleItems.findIndex((processedItem) => this.isItemMatched(processedItem));
1117
1052
  }
1118
1053
  if (itemIndex !== -1) {
1119
1054
  matched = true;
@@ -1124,13 +1059,13 @@ class Menubar extends BaseComponent {
1124
1059
  if (itemIndex !== -1) {
1125
1060
  this.changeFocusedItemIndex(event, itemIndex);
1126
1061
  }
1127
- if (this.searchTimeout) {
1128
- clearTimeout(this.searchTimeout);
1062
+ if (this.searchTimeout()) {
1063
+ clearTimeout(this.searchTimeout());
1129
1064
  }
1130
- this.searchTimeout = setTimeout(() => {
1131
- this.searchValue = '';
1132
- this.searchTimeout = null;
1133
- }, 500);
1065
+ this.searchTimeout.set(setTimeout(() => {
1066
+ this.searchValue.set('');
1067
+ this.searchTimeout.set(null);
1068
+ }, 500));
1134
1069
  return matched;
1135
1070
  }
1136
1071
  getProccessedItemLabel(processedItem) {
@@ -1140,7 +1075,7 @@ class Menubar extends BaseComponent {
1140
1075
  return this.getItemProp(item, 'label');
1141
1076
  }
1142
1077
  onArrowDownKey(event) {
1143
- const processedItem = this.visibleItems[this.focusedItemInfo().index];
1078
+ const processedItem = this.visibleItems()[this.focusedItemInfo().index];
1144
1079
  const root = processedItem ? isEmpty(processedItem.parent) : null;
1145
1080
  if (root) {
1146
1081
  const grouped = this.isProccessedItemGroup(processedItem);
@@ -1157,7 +1092,7 @@ class Menubar extends BaseComponent {
1157
1092
  }
1158
1093
  }
1159
1094
  onArrowRightKey(event) {
1160
- const processedItem = this.visibleItems[this.focusedItemInfo().index];
1095
+ const processedItem = this.visibleItems()[this.focusedItemInfo().index];
1161
1096
  const parentItem = processedItem ? this.activeItemPath().find((p) => p.key === processedItem.parentKey) : null;
1162
1097
  if (parentItem) {
1163
1098
  const grouped = this.isProccessedItemGroup(processedItem);
@@ -1174,7 +1109,7 @@ class Menubar extends BaseComponent {
1174
1109
  }
1175
1110
  }
1176
1111
  onArrowUpKey(event) {
1177
- const processedItem = this.visibleItems[this.focusedItemInfo().index];
1112
+ const processedItem = this.visibleItems()[this.focusedItemInfo().index];
1178
1113
  const root = isEmpty(processedItem.parent);
1179
1114
  if (root) {
1180
1115
  const grouped = this.isProccessedItemGroup(processedItem);
@@ -1189,7 +1124,7 @@ class Menubar extends BaseComponent {
1189
1124
  const parentItem = this.activeItemPath().find((p) => p.key === processedItem.parentKey);
1190
1125
  if (this.focusedItemInfo().index === 0) {
1191
1126
  this.focusedItemInfo.set({ index: -1, parentKey: parentItem ? parentItem.parentKey : '', item: processedItem.item });
1192
- this.searchValue = '';
1127
+ this.searchValue.set('');
1193
1128
  this.onArrowLeftKey(event);
1194
1129
  const activeItemPath = this.activeItemPath().filter((p) => p.parentKey !== this.focusedItemInfo().parentKey);
1195
1130
  this.activeItemPath.set(activeItemPath);
@@ -1202,7 +1137,7 @@ class Menubar extends BaseComponent {
1202
1137
  event.preventDefault();
1203
1138
  }
1204
1139
  onArrowLeftKey(event) {
1205
- const processedItem = this.visibleItems[this.focusedItemInfo().index];
1140
+ const processedItem = this.visibleItems()[this.focusedItemInfo().index];
1206
1141
  const parentItem = processedItem ? this.activeItemPath().find((p) => p.key === processedItem.parentKey) : null;
1207
1142
  if (parentItem) {
1208
1143
  this.onItemChange({ originalEvent: event, processedItem: parentItem });
@@ -1229,12 +1164,13 @@ class Menubar extends BaseComponent {
1229
1164
  }
1230
1165
  onEscapeKey(event) {
1231
1166
  this.hide(event, true);
1232
- this.focusedItemInfo().index = this.findFirstFocusedItemIndex();
1167
+ const index = this.findFirstFocusedItemIndex();
1168
+ this.focusedItemInfo.update((focusedItemInfo) => ({ ...focusedItemInfo, index }));
1233
1169
  event.preventDefault();
1234
1170
  }
1235
1171
  onTabKey(event) {
1236
1172
  if (this.focusedItemInfo().index !== -1) {
1237
- const processedItem = this.visibleItems[this.focusedItemInfo().index];
1173
+ const processedItem = this.visibleItems()[this.focusedItemInfo().index];
1238
1174
  const grouped = this.isProccessedItemGroup(processedItem);
1239
1175
  !grouped && this.onItemChange({ originalEvent: event, processedItem });
1240
1176
  }
@@ -1242,7 +1178,7 @@ class Menubar extends BaseComponent {
1242
1178
  }
1243
1179
  onEnterKey(event) {
1244
1180
  if (this.focusedItemInfo().index !== -1) {
1245
- const element = findSingle(this.rootmenu().el.nativeElement, `li[id="${`${this.focusedItemId}`}"]`);
1181
+ const element = findSingle(this.rootmenu().el.nativeElement, `li[id="${`${this.focusedItemId()}`}"]`);
1246
1182
  const anchorElement = element && (findSingle(element, '[data-pc-section="itemlink"]') || findSingle(element, 'a,button'));
1247
1183
  anchorElement ? anchorElement.click() : element && element.click();
1248
1184
  }
@@ -1253,104 +1189,104 @@ class Menubar extends BaseComponent {
1253
1189
  return selectedIndex < 0 ? this.findLastItemIndex() : selectedIndex;
1254
1190
  }
1255
1191
  findLastItemIndex() {
1256
- return findLastIndex(this.visibleItems, (processedItem) => this.isValidItem(processedItem));
1192
+ return findLastIndex(this.visibleItems(), (processedItem) => this.isValidItem(processedItem));
1257
1193
  }
1258
1194
  findPrevItemIndex(index) {
1259
- const matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems.slice(0, index), (processedItem) => this.isValidItem(processedItem)) : -1;
1195
+ const matchedItemIndex = index > 0 ? findLastIndex(this.visibleItems().slice(0, index), (processedItem) => this.isValidItem(processedItem)) : -1;
1260
1196
  return matchedItemIndex > -1 ? matchedItemIndex : index;
1261
1197
  }
1262
1198
  findNextItemIndex(index) {
1263
- const matchedItemIndex = index < this.visibleItems.length - 1 ? this.visibleItems.slice(index + 1).findIndex((processedItem) => this.isValidItem(processedItem)) : -1;
1199
+ const visibleItems = this.visibleItems();
1200
+ const matchedItemIndex = index < visibleItems.length - 1 ? visibleItems.slice(index + 1).findIndex((processedItem) => this.isValidItem(processedItem)) : -1;
1264
1201
  return matchedItemIndex > -1 ? matchedItemIndex + index + 1 : index;
1265
1202
  }
1266
1203
  bindResizeListener() {
1267
1204
  if (isPlatformBrowser(this.platformId)) {
1268
- if (!this.resizeListener) {
1269
- this.resizeListener = this.renderer.listen(this.document.defaultView, 'resize', (event) => {
1205
+ if (!this.resizeListener()) {
1206
+ this.resizeListener.set(this.renderer.listen(this.document.defaultView, 'resize', (event) => {
1270
1207
  if (!isTouchDevice()) {
1271
1208
  this.hide(event, true);
1272
1209
  }
1273
- this.mobileActive = false;
1274
- });
1210
+ this.mobileActive.set(false);
1211
+ }));
1275
1212
  }
1276
1213
  }
1277
1214
  }
1278
1215
  bindOutsideClickListener() {
1279
1216
  if (isPlatformBrowser(this.platformId)) {
1280
- if (!this.outsideClickListener) {
1281
- this.outsideClickListener = this.renderer.listen(this.document, 'click', (event) => {
1217
+ if (!this.outsideClickListener()) {
1218
+ this.outsideClickListener.set(this.renderer.listen(this.document, 'click', (event) => {
1282
1219
  const rootmenu = this.rootmenu();
1283
1220
  const isOutsideContainer = rootmenu.el.nativeElement !== event.target && !rootmenu.el.nativeElement?.contains(event.target);
1284
1221
  const menubutton = this.menubutton();
1285
- const isOutsideMenuButton = this.mobileActive && menubutton?.nativeElement !== event.target && !menubutton?.nativeElement?.contains(event.target);
1222
+ const isOutsideMenuButton = this.mobileActive() && menubutton?.nativeElement !== event.target && !menubutton?.nativeElement?.contains(event.target);
1286
1223
  if (isOutsideContainer) {
1287
- isOutsideMenuButton ? (this.mobileActive = false) : this.hide();
1224
+ isOutsideMenuButton ? this.mobileActive.set(false) : this.hide();
1288
1225
  }
1289
- });
1226
+ }));
1290
1227
  }
1291
1228
  }
1292
1229
  }
1293
1230
  unbindOutsideClickListener() {
1294
- if (this.outsideClickListener) {
1295
- this.outsideClickListener();
1296
- this.outsideClickListener = null;
1231
+ const outsideClickListener = this.outsideClickListener();
1232
+ if (outsideClickListener) {
1233
+ outsideClickListener();
1234
+ this.outsideClickListener.set(null);
1297
1235
  }
1298
1236
  }
1299
1237
  unbindResizeListener() {
1300
- if (this.resizeListener) {
1301
- this.resizeListener();
1302
- this.resizeListener = null;
1238
+ const resizeListener = this.resizeListener();
1239
+ if (resizeListener) {
1240
+ resizeListener();
1241
+ this.resizeListener.set(null);
1303
1242
  }
1304
1243
  }
1305
1244
  onDestroy() {
1306
- this.mouseLeaveSubscriber?.unsubscribe();
1245
+ this.mouseLeaveSubscriber()?.unsubscribe();
1307
1246
  this.unbindOutsideClickListener();
1308
1247
  this.unbindResizeListener();
1309
1248
  this.unbindMatchMediaListener();
1310
1249
  }
1311
1250
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Menubar, deps: [], target: i0.ɵɵFactoryTarget.Component });
1312
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Menubar, isStandalone: true, selector: "p-menubar", inputs: { model: "model", styleClass: "styleClass", autoZIndex: ["autoZIndex", "autoZIndex", booleanAttribute], baseZIndex: ["baseZIndex", "baseZIndex", numberAttribute], autoDisplay: ["autoDisplay", "autoDisplay", booleanAttribute], autoHide: ["autoHide", "autoHide", booleanAttribute], breakpoint: "breakpoint", autoHideDelay: ["autoHideDelay", "autoHideDelay", numberAttribute], id: "id", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy" }, outputs: { onFocus: "onFocus", onBlur: "onBlur" }, host: { properties: { "class": "cn(cx(\"root\"), styleClass)" } }, providers: [MenubarService, MenuBarStyle, { provide: MENUBAR_INSTANCE, useExisting: Menubar }, { provide: PARENT_INSTANCE, useExisting: Menubar }], queries: [{ propertyName: "startTemplate", first: true, predicate: ["start"], isSignal: true }, { propertyName: "endTemplate", first: true, predicate: ["end"], isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], isSignal: true }, { propertyName: "menuIconTemplate", first: true, predicate: ["menuicon"], isSignal: true }, { propertyName: "submenuIconTemplate", first: true, predicate: ["submenuicon"], isSignal: true }, { propertyName: "templates", predicate: PrimeTemplate, isSignal: true }], viewQueries: [{ propertyName: "menubutton", first: true, predicate: ["menubutton"], descendants: true, isSignal: true }, { propertyName: "rootmenu", first: true, predicate: ["rootmenu"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i4.Bind }], ngImport: i0, template: `
1313
- @if (startTemplate() || _startTemplate) {
1251
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: Menubar, isStandalone: true, selector: "p-menubar", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, autoDisplay: { classPropertyName: "autoDisplay", publicName: "autoDisplay", isSignal: true, isRequired: false, transformFunction: null }, autoHide: { classPropertyName: "autoHide", publicName: "autoHide", isSignal: true, isRequired: false, transformFunction: null }, breakpoint: { classPropertyName: "breakpoint", publicName: "breakpoint", isSignal: true, isRequired: false, transformFunction: null }, autoHideDelay: { classPropertyName: "autoHideDelay", publicName: "autoHideDelay", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onFocus: "onFocus", onBlur: "onBlur" }, host: { properties: { "class": "cx('root')" } }, providers: [MenubarService, MenuBarStyle, { provide: PARENT_INSTANCE, useExisting: Menubar }], queries: [{ propertyName: "startTemplate", first: true, predicate: ["start"], isSignal: true }, { propertyName: "endTemplate", first: true, predicate: ["end"], isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ["item"], isSignal: true }, { propertyName: "menuIconTemplate", first: true, predicate: ["menuicon"], isSignal: true }, { propertyName: "submenuIconTemplate", first: true, predicate: ["submenuicon"], isSignal: true }, { propertyName: "templates", predicate: PrimeTemplate, isSignal: true }], viewQueries: [{ propertyName: "menubutton", first: true, predicate: ["menubutton"], descendants: true, isSignal: true }, { propertyName: "rootmenu", first: true, predicate: ["rootmenu"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i4.Bind }], ngImport: i0, template: `
1252
+ @if (startTemplate() || _startTemplate()) {
1314
1253
  <div [class]="cx('start')" [pBind]="ptm('start')">
1315
- <ng-container *ngTemplateOutlet="startTemplate() || _startTemplate"></ng-container>
1254
+ <ng-container *ngTemplateOutlet="startTemplate() || _startTemplate()"></ng-container>
1316
1255
  </div>
1317
1256
  }
1318
- @if (model && model.length > 0) {
1257
+ @if (model() && model()!.length > 0) {
1319
1258
  <a
1320
1259
  #menubutton
1321
1260
  tabindex="0"
1322
1261
  role="button"
1323
- [attr.aria-haspopup]="model.length && model.length > 0 ? true : false"
1324
- [attr.aria-expanded]="mobileActive"
1325
- [attr.aria-controls]="id"
1262
+ [attr.aria-haspopup]="model()!.length > 0 ? true : false"
1263
+ [attr.aria-expanded]="mobileActive()"
1264
+ [attr.aria-controls]="_id()"
1326
1265
  [attr.aria-label]="config.translation.aria.navigation"
1327
1266
  [class]="cx('button')"
1328
1267
  [pBind]="ptm('button')"
1329
1268
  (click)="menuButtonClick($event)"
1330
1269
  (keydown)="menuButtonKeydown($event)"
1331
1270
  >
1332
- @if (!menuIconTemplate() && !_menuIconTemplate) {
1271
+ @if (!menuIconTemplate() && !_menuIconTemplate()) {
1333
1272
  <svg data-p-icon="bars" [pBind]="ptm('buttonIcon')" />
1334
1273
  }
1335
- <ng-template *ngTemplateOutlet="menuIconTemplate() || _menuIconTemplate"></ng-template>
1274
+ <ng-template *ngTemplateOutlet="menuIconTemplate() || _menuIconTemplate()"></ng-template>
1336
1275
  </a>
1337
1276
  }
1338
1277
  <ul
1339
1278
  pMenubarSub
1340
1279
  #rootmenu
1341
- [items]="processedItems"
1342
- [itemTemplate]="itemTemplate()"
1280
+ [items]="processedItems()"
1281
+ [itemTemplate]="itemTemplate() || _itemTemplate()"
1343
1282
  tabindex="0"
1344
- [menuId]="id"
1283
+ [menuId]="_id()"
1345
1284
  [root]="true"
1346
- [baseZIndex]="baseZIndex"
1347
- [autoZIndex]="autoZIndex"
1348
- [mobileActive]="mobileActive"
1349
- [autoDisplay]="autoDisplay"
1350
- [attr.aria-label]="ariaLabel"
1351
- [attr.aria-labelledby]="ariaLabelledBy"
1352
- [focusedItemId]="focused ? focusedItemId : undefined"
1353
- [submenuiconTemplate]="submenuIconTemplate() || _submenuIconTemplate"
1285
+ [autoDisplay]="autoDisplay()"
1286
+ [attr.aria-label]="ariaLabel()"
1287
+ [attr.aria-labelledby]="ariaLabelledBy()"
1288
+ [focusedItemId]="focused() ? focusedItemId() : undefined"
1289
+ [submenuiconTemplate]="submenuIconTemplate() || _submenuIconTemplate()"
1354
1290
  [activeItemPath]="activeItemPath()"
1355
1291
  (itemClick)="onItemClick($event)"
1356
1292
  (mousedown)="onMenuMouseDown($event)"
@@ -1363,65 +1299,61 @@ class Menubar extends BaseComponent {
1363
1299
  [pBind]="ptm('rootList')"
1364
1300
  [unstyled]="unstyled()"
1365
1301
  ></ul>
1366
- @if (endTemplate() || _endTemplate) {
1302
+ @if (endTemplate() || _endTemplate()) {
1367
1303
  <div [class]="cx('end')" [pBind]="ptm('end')">
1368
- <ng-container *ngTemplateOutlet="endTemplate() || _endTemplate"></ng-container>
1304
+ <ng-container *ngTemplateOutlet="endTemplate() || _endTemplate()"></ng-container>
1369
1305
  </div>
1370
1306
  } @else {
1371
1307
  <div [class]="cx('end')">
1372
1308
  <ng-content></ng-content>
1373
1309
  </div>
1374
1310
  }
1375
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: MenubarSub, selector: "p-menubarSub, p-menubarsub, [pMenubarSub]", inputs: ["items", "itemTemplate", "root", "autoZIndex", "baseZIndex", "mobileActive", "autoDisplay", "menuId", "ariaLabel", "ariaLabelledBy", "level", "focusedItemId", "activeItemPath", "inlineStyles", "submenuiconTemplate"], outputs: ["itemClick", "itemMouseEnter"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4.Bind, selector: "[pBind]", inputs: ["pBind"] }, { kind: "component", type: BarsIcon, selector: "[data-p-icon=\"bars\"]" }, { kind: "ngmodule", type: BadgeModule }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1311
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: MenubarSub, selector: "p-menubarSub, p-menubarsub, [pMenubarSub]", inputs: ["items", "itemTemplate", "root", "autoDisplay", "menuId", "level", "focusedItemId", "activeItemPath", "inlineStyles", "submenuiconTemplate"], outputs: ["itemClick", "itemMouseEnter"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4.Bind, selector: "[pBind]", inputs: ["pBind"] }, { kind: "component", type: BarsIcon, selector: "[data-p-icon=\"bars\"]" }, { kind: "ngmodule", type: BadgeModule }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1376
1312
  }
1377
1313
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: Menubar, decorators: [{
1378
1314
  type: Component,
1379
1315
  args: [{
1380
1316
  selector: 'p-menubar',
1381
- standalone: true,
1382
1317
  imports: [CommonModule, RouterModule, MenubarSub, TooltipModule, BarsIcon, BadgeModule, SharedModule, BindModule],
1383
1318
  template: `
1384
- @if (startTemplate() || _startTemplate) {
1319
+ @if (startTemplate() || _startTemplate()) {
1385
1320
  <div [class]="cx('start')" [pBind]="ptm('start')">
1386
- <ng-container *ngTemplateOutlet="startTemplate() || _startTemplate"></ng-container>
1321
+ <ng-container *ngTemplateOutlet="startTemplate() || _startTemplate()"></ng-container>
1387
1322
  </div>
1388
1323
  }
1389
- @if (model && model.length > 0) {
1324
+ @if (model() && model()!.length > 0) {
1390
1325
  <a
1391
1326
  #menubutton
1392
1327
  tabindex="0"
1393
1328
  role="button"
1394
- [attr.aria-haspopup]="model.length && model.length > 0 ? true : false"
1395
- [attr.aria-expanded]="mobileActive"
1396
- [attr.aria-controls]="id"
1329
+ [attr.aria-haspopup]="model()!.length > 0 ? true : false"
1330
+ [attr.aria-expanded]="mobileActive()"
1331
+ [attr.aria-controls]="_id()"
1397
1332
  [attr.aria-label]="config.translation.aria.navigation"
1398
1333
  [class]="cx('button')"
1399
1334
  [pBind]="ptm('button')"
1400
1335
  (click)="menuButtonClick($event)"
1401
1336
  (keydown)="menuButtonKeydown($event)"
1402
1337
  >
1403
- @if (!menuIconTemplate() && !_menuIconTemplate) {
1338
+ @if (!menuIconTemplate() && !_menuIconTemplate()) {
1404
1339
  <svg data-p-icon="bars" [pBind]="ptm('buttonIcon')" />
1405
1340
  }
1406
- <ng-template *ngTemplateOutlet="menuIconTemplate() || _menuIconTemplate"></ng-template>
1341
+ <ng-template *ngTemplateOutlet="menuIconTemplate() || _menuIconTemplate()"></ng-template>
1407
1342
  </a>
1408
1343
  }
1409
1344
  <ul
1410
1345
  pMenubarSub
1411
1346
  #rootmenu
1412
- [items]="processedItems"
1413
- [itemTemplate]="itemTemplate()"
1347
+ [items]="processedItems()"
1348
+ [itemTemplate]="itemTemplate() || _itemTemplate()"
1414
1349
  tabindex="0"
1415
- [menuId]="id"
1350
+ [menuId]="_id()"
1416
1351
  [root]="true"
1417
- [baseZIndex]="baseZIndex"
1418
- [autoZIndex]="autoZIndex"
1419
- [mobileActive]="mobileActive"
1420
- [autoDisplay]="autoDisplay"
1421
- [attr.aria-label]="ariaLabel"
1422
- [attr.aria-labelledby]="ariaLabelledBy"
1423
- [focusedItemId]="focused ? focusedItemId : undefined"
1424
- [submenuiconTemplate]="submenuIconTemplate() || _submenuIconTemplate"
1352
+ [autoDisplay]="autoDisplay()"
1353
+ [attr.aria-label]="ariaLabel()"
1354
+ [attr.aria-labelledby]="ariaLabelledBy()"
1355
+ [focusedItemId]="focused() ? focusedItemId() : undefined"
1356
+ [submenuiconTemplate]="submenuIconTemplate() || _submenuIconTemplate()"
1425
1357
  [activeItemPath]="activeItemPath()"
1426
1358
  (itemClick)="onItemClick($event)"
1427
1359
  (mousedown)="onMenuMouseDown($event)"
@@ -1434,9 +1366,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
1434
1366
  [pBind]="ptm('rootList')"
1435
1367
  [unstyled]="unstyled()"
1436
1368
  ></ul>
1437
- @if (endTemplate() || _endTemplate) {
1369
+ @if (endTemplate() || _endTemplate()) {
1438
1370
  <div [class]="cx('end')" [pBind]="ptm('end')">
1439
- <ng-container *ngTemplateOutlet="endTemplate() || _endTemplate"></ng-container>
1371
+ <ng-container *ngTemplateOutlet="endTemplate() || _endTemplate()"></ng-container>
1440
1372
  </div>
1441
1373
  } @else {
1442
1374
  <div [class]="cx('end')">
@@ -1446,40 +1378,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
1446
1378
  `,
1447
1379
  changeDetection: ChangeDetectionStrategy.OnPush,
1448
1380
  encapsulation: ViewEncapsulation.None,
1449
- providers: [MenubarService, MenuBarStyle, { provide: MENUBAR_INSTANCE, useExisting: Menubar }, { provide: PARENT_INSTANCE, useExisting: Menubar }],
1381
+ providers: [MenubarService, MenuBarStyle, { provide: PARENT_INSTANCE, useExisting: Menubar }],
1450
1382
  host: {
1451
- '[class]': 'cn(cx("root"), styleClass)'
1383
+ '[class]': "cx('root')"
1452
1384
  },
1453
1385
  hostDirectives: [Bind]
1454
1386
  }]
1455
- }], ctorParameters: () => [], propDecorators: { model: [{
1456
- type: Input
1457
- }], styleClass: [{
1458
- type: Input
1459
- }], autoZIndex: [{
1460
- type: Input,
1461
- args: [{ transform: booleanAttribute }]
1462
- }], baseZIndex: [{
1463
- type: Input,
1464
- args: [{ transform: numberAttribute }]
1465
- }], autoDisplay: [{
1466
- type: Input,
1467
- args: [{ transform: booleanAttribute }]
1468
- }], autoHide: [{
1469
- type: Input,
1470
- args: [{ transform: booleanAttribute }]
1471
- }], breakpoint: [{
1472
- type: Input
1473
- }], autoHideDelay: [{
1474
- type: Input,
1475
- args: [{ transform: numberAttribute }]
1476
- }], id: [{
1477
- type: Input
1478
- }], ariaLabel: [{
1479
- type: Input
1480
- }], ariaLabelledBy: [{
1481
- type: Input
1482
- }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], menubutton: [{ type: i0.ViewChild, args: ['menubutton', { isSignal: true }] }], rootmenu: [{ type: i0.ViewChild, args: ['rootmenu', { isSignal: true }] }], startTemplate: [{ type: i0.ContentChild, args: ['start', { ...{ descendants: false }, isSignal: true }] }], endTemplate: [{ type: i0.ContentChild, args: ['end', { ...{ descendants: false }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: ['item', { ...{ descendants: false }, isSignal: true }] }], menuIconTemplate: [{ type: i0.ContentChild, args: ['menuicon', { ...{ descendants: false }, isSignal: true }] }], submenuIconTemplate: [{ type: i0.ContentChild, args: ['submenuicon', { ...{ descendants: false }, isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
1387
+ }], ctorParameters: () => [], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], autoDisplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoDisplay", required: false }] }], autoHide: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHide", required: false }] }], breakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "breakpoint", required: false }] }], autoHideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoHideDelay", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], menubutton: [{ type: i0.ViewChild, args: ['menubutton', { isSignal: true }] }], rootmenu: [{ type: i0.ViewChild, args: ['rootmenu', { isSignal: true }] }], startTemplate: [{ type: i0.ContentChild, args: ['start', { ...{ descendants: false }, isSignal: true }] }], endTemplate: [{ type: i0.ContentChild, args: ['end', { ...{ descendants: false }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: ['item', { ...{ descendants: false }, isSignal: true }] }], menuIconTemplate: [{ type: i0.ContentChild, args: ['menuicon', { ...{ descendants: false }, isSignal: true }] }], submenuIconTemplate: [{ type: i0.ContentChild, args: ['submenuicon', { ...{ descendants: false }, isSignal: true }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
1483
1388
  class MenubarModule {
1484
1389
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: MenubarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1485
1390
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: MenubarModule, imports: [Menubar, SharedModule], exports: [Menubar, SharedModule] });