@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
@@ -2,23 +2,22 @@ export * from '@exhaustive-ui/core/types/organizationchart';
2
2
  import * as i1 from '@angular/common';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
- import { Injectable, InjectionToken, inject, ChangeDetectorRef, booleanAttribute, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, ElementRef, output, contentChildren, contentChild, NgModule } from '@angular/core';
5
+ import { Injectable, input, booleanAttribute, inject, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, model, output, contentChildren, contentChild, afterEveryRender, NgModule } from '@angular/core';
6
6
  import { isAttributeEquals } from '@exhaustive-ui/utils';
7
7
  import { SharedModule, PrimeTemplate } from '@exhaustive-ui/core/api';
8
8
  import { BaseComponent, PARENT_INSTANCE } from '@exhaustive-ui/core/basecomponent';
9
9
  import * as i2 from '@exhaustive-ui/core/bind';
10
10
  import { BindModule, Bind } from '@exhaustive-ui/core/bind';
11
11
  import { ChevronDownIcon, ChevronUpIcon } from '@exhaustive-ui/core/icons';
12
- import { Subject } from 'rxjs';
13
12
  import { style } from '@exhaustive-ui/styles/organizationchart';
14
13
  import { BaseStyle } from '@exhaustive-ui/core/base';
15
14
 
16
15
  const classes = {
17
- root: ({ instance }) => ['p-organizationchart p-component', { 'p-organizationchart-preservespace': instance.preserveSpace }],
16
+ root: ({ instance }) => ['p-organizationchart p-component', { 'p-organizationchart-preservespace': instance.preserveSpace() }],
18
17
  table: 'p-organizationchart-table',
19
18
  node: ({ instance }) => [
20
19
  'p-organizationchart-node',
21
- { 'p-organizationchart-node': true, 'p-organizationchart-node-selectable': instance.chart.selectionMode && instance.node.selectable !== false, 'p-organizationchart-node-selected': instance.isSelected() }
20
+ { 'p-organizationchart-node': true, 'p-organizationchart-node-selectable': instance.chart.selectionMode() && instance.node().selectable !== false, 'p-organizationchart-node-selected': instance.isSelected() }
22
21
  ],
23
22
  nodeToggleButton: 'p-organizationchart-node-toggle-button',
24
23
  nodeToggleButtonIcon: 'p-organizationchart-node-toggle-button-icon',
@@ -91,47 +90,38 @@ var OrganizationChartClasses;
91
90
  OrganizationChartClasses["nodeChildren"] = "p-organizationchart-node-children";
92
91
  })(OrganizationChartClasses || (OrganizationChartClasses = {}));
93
92
 
94
- const ORGANIZATIONCHART_INSTANCE = new InjectionToken('ORGANIZATIONCHART_INSTANCE');
95
93
  class OrganizationChartNode extends BaseComponent {
96
- cd = inject(ChangeDetectorRef);
97
- node;
98
- root;
99
- first;
100
- last;
101
- collapsible;
102
- chart;
103
- subscription;
94
+ node = input(/* @ts-ignore */
95
+ ...(ngDevMode ? [undefined, { debugName: "node" }] : /* istanbul ignore next */ []));
96
+ collapsible = input(undefined, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
97
+ chart = inject(OrganizationChart);
104
98
  _componentStyle = inject(OrganizationChartStyle);
105
- constructor() {
106
- const chart = inject(OrganizationChart);
107
- super();
108
- this.chart = chart;
109
- this.subscription = this.chart.selectionSource$.subscribe(() => {
110
- this.cd.markForCheck();
111
- });
112
- }
113
- get leaf() {
114
- if (this.node) {
115
- return this.node.leaf == false ? false : !(this.node.children && this.node.children.length);
99
+ leaf = computed(() => {
100
+ const node = this.node();
101
+ if (node) {
102
+ return node.leaf == false ? false : !(node.children && node.children.length);
116
103
  }
117
- }
118
- get colspan() {
119
- if (this.node) {
120
- return this.node.children && this.node.children.length ? this.node.children.length * 2 : null;
104
+ }, /* @ts-ignore */
105
+ ...(ngDevMode ? [{ debugName: "leaf" }] : /* istanbul ignore next */ []));
106
+ colspan = computed(() => {
107
+ const node = this.node();
108
+ if (node) {
109
+ return node.children && node.children.length ? node.children.length * 2 : null;
121
110
  }
122
- }
111
+ }, /* @ts-ignore */
112
+ ...(ngDevMode ? [{ debugName: "colspan" }] : /* istanbul ignore next */ []));
123
113
  getChildStyle(node) {
124
114
  return {
125
- visibility: !this.leaf && node.expanded ? 'inherit' : 'hidden'
115
+ visibility: !this.leaf() && node.expanded ? 'inherit' : 'hidden'
126
116
  };
127
117
  }
128
118
  getPTOptions(key) {
129
119
  return this.ptm(key, {
130
120
  context: {
131
- expanded: this.node?.expanded,
132
- selectable: this.node?.selectable !== false && this.chart.selectionMode,
121
+ expanded: this.node()?.expanded,
122
+ selectable: this.node()?.selectable !== false && this.chart.selectionMode(),
133
123
  selected: this.isSelected(),
134
- toggleable: this.collapsible && !this.leaf,
124
+ toggleable: this.collapsible() && !this.leaf(),
135
125
  active: this.isSelected()
136
126
  }
137
127
  });
@@ -149,23 +139,20 @@ class OrganizationChartNode extends BaseComponent {
149
139
  toggleNode(event, node) {
150
140
  node.expanded = !node.expanded;
151
141
  if (node.expanded)
152
- this.chart.onNodeExpand.emit({ originalEvent: event, node: this.node });
142
+ this.chart.onNodeExpand.emit({ originalEvent: event, node: this.node() });
153
143
  else
154
- this.chart.onNodeCollapse.emit({ originalEvent: event, node: this.node });
144
+ this.chart.onNodeCollapse.emit({ originalEvent: event, node: this.node() });
155
145
  event.preventDefault();
156
146
  }
157
147
  isSelected() {
158
- return this.chart.isSelected(this.node);
159
- }
160
- onDestroy() {
161
- this.subscription.unsubscribe();
148
+ return this.chart.isSelected(this.node());
162
149
  }
163
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartNode, deps: [], target: i0.ɵɵFactoryTarget.Component });
164
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChartNode, isStandalone: true, selector: "[pOrganizationChartNode]", inputs: { node: "node", root: ["root", "root", booleanAttribute], first: ["first", "first", booleanAttribute], last: ["last", "last", booleanAttribute], collapsible: ["collapsible", "collapsible", booleanAttribute] }, providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChartNode }], usesInheritance: true, ngImport: i0, template: `
165
- @if (node) {
150
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartNode, deps: null, target: i0.ɵɵFactoryTarget.Component });
151
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChartNode, isStandalone: true, selector: "[pOrganizationChartNode]", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null } }, providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChartNode }], usesInheritance: true, ngImport: i0, template: `
152
+ @if (node(); as node) {
166
153
  <tbody [pBind]="ptm('body')">
167
154
  <tr [pBind]="ptm('row')">
168
- <td [attr.colspan]="colspan" [pBind]="ptm('cell')">
155
+ <td [attr.colspan]="colspan()" [pBind]="ptm('cell')">
169
156
  <div [class]="cn(cx('node'), node.styleClass)" (click)="onNodeClick($event, node)" [pBind]="getPTOptions('node')">
170
157
  @if (!chart.getTemplateForNode(node)) {
171
158
  <div>{{ node.label }}</div>
@@ -175,10 +162,10 @@ class OrganizationChartNode extends BaseComponent {
175
162
  <ng-container *ngTemplateOutlet="chart.getTemplateForNode(node); context: { $implicit: node }"></ng-container>
176
163
  </div>
177
164
  }
178
- @if (collapsible) {
179
- @if (!leaf) {
165
+ @if (collapsible()) {
166
+ @if (!leaf()) {
180
167
  <a tabindex="0" [class]="cx('nodeToggleButton')" (click)="toggleNode($event, node)" (keydown.enter)="toggleNode($event, node)" (keydown.space)="toggleNode($event, node)" [pBind]="getPTOptions('nodeToggleButton')">
181
- @if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate) {
168
+ @if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate()) {
182
169
  @if (node.expanded) {
183
170
  <svg data-p-icon="chevron-down" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
184
171
  }
@@ -186,9 +173,9 @@ class OrganizationChartNode extends BaseComponent {
186
173
  <svg data-p-icon="chevron-up" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
187
174
  }
188
175
  }
189
- @if (chart.togglerIconTemplate() || chart._togglerIconTemplate) {
176
+ @if (chart.togglerIconTemplate() || chart._togglerIconTemplate()) {
190
177
  <span [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')">
191
- <ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate; context: { $implicit: node.expanded }"></ng-template>
178
+ <ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate(); context: { $implicit: node.expanded }"></ng-template>
192
179
  </span>
193
180
  }
194
181
  </a>
@@ -198,13 +185,13 @@ class OrganizationChartNode extends BaseComponent {
198
185
  </td>
199
186
  </tr>
200
187
  <tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
201
- <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
188
+ <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
202
189
  <div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
203
190
  </td>
204
191
  </tr>
205
192
  <tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
206
193
  @if (node.children && node.children.length === 1) {
207
- <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
194
+ <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
208
195
  <div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
209
196
  </td>
210
197
  }
@@ -218,25 +205,24 @@ class OrganizationChartNode extends BaseComponent {
218
205
  <tr [ngStyle]="getChildStyle(node)" [class]="cx('nodeChildren')" [pBind]="ptm('nodeChildren')">
219
206
  @for (child of node.children; track child) {
220
207
  <td colspan="2" [pBind]="ptm('nodeCell')">
221
- <table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible"></table>
208
+ <table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt()" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible()"></table>
222
209
  </td>
223
210
  }
224
211
  </tr>
225
212
  </tbody>
226
213
  }
227
- `, isInline: true, dependencies: [{ kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "root", "first", "last", "collapsible"] }, { 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: "component", type: ChevronDownIcon, selector: "[data-p-icon=\"chevron-down\"]" }, { kind: "component", type: ChevronUpIcon, selector: "[data-p-icon=\"chevron-up\"]" }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i2.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.Eager, encapsulation: i0.ViewEncapsulation.None });
214
+ `, isInline: true, dependencies: [{ kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "collapsible"] }, { 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: "component", type: ChevronDownIcon, selector: "[data-p-icon=\"chevron-down\"]" }, { kind: "component", type: ChevronUpIcon, selector: "[data-p-icon=\"chevron-up\"]" }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i2.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
228
215
  }
229
216
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartNode, decorators: [{
230
217
  type: Component,
231
218
  args: [{
232
219
  selector: '[pOrganizationChartNode]',
233
- standalone: true,
234
220
  imports: [CommonModule, ChevronDownIcon, ChevronUpIcon, SharedModule, BindModule],
235
221
  template: `
236
- @if (node) {
222
+ @if (node(); as node) {
237
223
  <tbody [pBind]="ptm('body')">
238
224
  <tr [pBind]="ptm('row')">
239
- <td [attr.colspan]="colspan" [pBind]="ptm('cell')">
225
+ <td [attr.colspan]="colspan()" [pBind]="ptm('cell')">
240
226
  <div [class]="cn(cx('node'), node.styleClass)" (click)="onNodeClick($event, node)" [pBind]="getPTOptions('node')">
241
227
  @if (!chart.getTemplateForNode(node)) {
242
228
  <div>{{ node.label }}</div>
@@ -246,10 +232,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
246
232
  <ng-container *ngTemplateOutlet="chart.getTemplateForNode(node); context: { $implicit: node }"></ng-container>
247
233
  </div>
248
234
  }
249
- @if (collapsible) {
250
- @if (!leaf) {
235
+ @if (collapsible()) {
236
+ @if (!leaf()) {
251
237
  <a tabindex="0" [class]="cx('nodeToggleButton')" (click)="toggleNode($event, node)" (keydown.enter)="toggleNode($event, node)" (keydown.space)="toggleNode($event, node)" [pBind]="getPTOptions('nodeToggleButton')">
252
- @if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate) {
238
+ @if (!chart.togglerIconTemplate() && !chart._togglerIconTemplate()) {
253
239
  @if (node.expanded) {
254
240
  <svg data-p-icon="chevron-down" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
255
241
  }
@@ -257,9 +243,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
257
243
  <svg data-p-icon="chevron-up" [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')" />
258
244
  }
259
245
  }
260
- @if (chart.togglerIconTemplate() || chart._togglerIconTemplate) {
246
+ @if (chart.togglerIconTemplate() || chart._togglerIconTemplate()) {
261
247
  <span [class]="cx('nodeToggleButtonIcon')" [pBind]="getPTOptions('nodeToggleButtonIcon')">
262
- <ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate; context: { $implicit: node.expanded }"></ng-template>
248
+ <ng-template *ngTemplateOutlet="chart.togglerIconTemplate() || chart._togglerIconTemplate(); context: { $implicit: node.expanded }"></ng-template>
263
249
  </span>
264
250
  }
265
251
  </a>
@@ -269,13 +255,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
269
255
  </td>
270
256
  </tr>
271
257
  <tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
272
- <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
258
+ <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
273
259
  <div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
274
260
  </td>
275
261
  </tr>
276
262
  <tr [ngStyle]="getChildStyle(node)" [class]="cx('connectors')" [pBind]="ptm('connectors')">
277
263
  @if (node.children && node.children.length === 1) {
278
- <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan">
264
+ <td [pBind]="ptm('lineCell')" [attr.colspan]="colspan()">
279
265
  <div [pBind]="ptm('connectorDown')" [class]="cx('connectorDown')"></div>
280
266
  </td>
281
267
  }
@@ -289,7 +275,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
289
275
  <tr [ngStyle]="getChildStyle(node)" [class]="cx('nodeChildren')" [pBind]="ptm('nodeChildren')">
290
276
  @for (child of node.children; track child) {
291
277
  <td colspan="2" [pBind]="ptm('nodeCell')">
292
- <table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible"></table>
278
+ <table [class]="cx('table')" pOrganizationChartNode [unstyled]="unstyled()" [pt]="pt()" [node]="child" [collapsible]="node.children && node.children.length > 0 && collapsible()"></table>
293
279
  </td>
294
280
  }
295
281
  </tr>
@@ -297,77 +283,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
297
283
  }
298
284
  `,
299
285
  encapsulation: ViewEncapsulation.None,
300
- changeDetection: ChangeDetectionStrategy.Eager,
286
+ changeDetection: ChangeDetectionStrategy.OnPush,
301
287
  providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChartNode }]
302
288
  }]
303
- }], ctorParameters: () => [], propDecorators: { node: [{
304
- type: Input
305
- }], root: [{
306
- type: Input,
307
- args: [{ transform: booleanAttribute }]
308
- }], first: [{
309
- type: Input,
310
- args: [{ transform: booleanAttribute }]
311
- }], last: [{
312
- type: Input,
313
- args: [{ transform: booleanAttribute }]
314
- }], collapsible: [{
315
- type: Input,
316
- args: [{ transform: booleanAttribute }]
317
- }] } });
289
+ }], propDecorators: { node: [{ type: i0.Input, args: [{ isSignal: true, alias: "node", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }] } });
318
290
  /**
319
291
  * OrganizationChart visualizes hierarchical organization data.
320
292
  * @group Components
321
293
  */
322
294
  class OrganizationChart extends BaseComponent {
323
- el = inject(ElementRef);
324
- cd = inject(ChangeDetectorRef);
325
295
  componentName = 'OrganizationChart';
326
296
  /**
327
297
  * An array of nested TreeNodes.
328
298
  * @group Props
329
299
  */
330
- value;
331
- /**
332
- * Style class of the component.
333
- * @deprecated since v20.0.0, use `class` instead.
334
- * @group Props
335
- */
336
- styleClass;
300
+ value = input(/* @ts-ignore */
301
+ ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
337
302
  /**
338
303
  * Defines the selection mode.
339
304
  * @group Props
340
305
  */
341
- selectionMode;
306
+ selectionMode = input(/* @ts-ignore */
307
+ ...(ngDevMode ? [undefined, { debugName: "selectionMode" }] : /* istanbul ignore next */ []));
342
308
  /**
343
309
  * Whether the nodes can be expanded or toggled.
344
310
  * @group Props
345
311
  */
346
- collapsible;
312
+ collapsible = input(undefined, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
347
313
  /**
348
314
  * Whether the space allocated by a node is preserved when hidden.
349
315
  * @deprecated since v20.0.0.
350
316
  * @group Props
351
317
  */
352
- preserveSpace = true;
318
+ preserveSpace = input(true, { ...(ngDevMode ? { debugName: "preserveSpace" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
353
319
  /**
354
- * A single treenode instance or an array to refer to the selections.
320
+ * A single treenode instance or an array to refer to the selections, supports one or two-way binding as well.
321
+ * Emits `selectionChange` with the selected value on selection change.
355
322
  * @group Props
356
323
  */
357
- get selection() {
358
- return this._selection;
359
- }
360
- set selection(val) {
361
- this._selection = val;
362
- if (this.initialized)
363
- this.selectionSource.next(null);
364
- }
365
- /**
366
- * Callback to invoke on selection change.
367
- * @param {*} any - selected value.
368
- * @group Emits
369
- */
370
- selectionChange = output();
324
+ selection = model(/* @ts-ignore */
325
+ ...(ngDevMode ? [undefined, { debugName: "selection" }] : /* istanbul ignore next */ []));
371
326
  /**
372
327
  * Callback to invoke when a node is selected.
373
328
  * @param {OrganizationChartNodeSelectEvent} event - custom node select event.
@@ -395,38 +350,38 @@ class OrganizationChart extends BaseComponent {
395
350
  templates = contentChildren(PrimeTemplate, /* @ts-ignore */
396
351
  ...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
397
352
  togglerIconTemplate = contentChild('togglericon', { ...(ngDevMode ? { debugName: "togglerIconTemplate" } : /* istanbul ignore next */ {}), descendants: false });
398
- templateMap;
399
- _togglerIconTemplate;
400
- selectionSource = new Subject();
401
- _selection;
402
- initialized;
403
- selectionSource$ = this.selectionSource.asObservable();
404
- _componentStyle = inject(OrganizationChartStyle);
405
- bindDirectiveInstance = inject(Bind, { self: true });
406
- $pcOrganizationChart = inject(ORGANIZATIONCHART_INSTANCE, { optional: true, skipSelf: true }) ?? undefined;
407
- ngAfterViewChecked() {
408
- this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root']));
409
- }
410
- get root() {
411
- return this.value && this.value.length ? this.value[0] : null;
412
- }
413
- onAfterContentInit() {
414
- if (this.templates().length) {
415
- this.templateMap = {};
416
- }
417
- this.templates().forEach((item) => {
418
- if (item.getType() === 'togglericon') {
419
- this._togglerIconTemplate = item.template;
420
- }
421
- else {
422
- this.templateMap[item.getType()] = item.template;
353
+ templateMap = computed(() => {
354
+ const templates = this.templates();
355
+ if (!templates.length)
356
+ return undefined;
357
+ const templateMap = {};
358
+ templates.forEach((item) => {
359
+ if (item.getType() !== 'togglericon') {
360
+ templateMap[item.getType()] = item.template;
423
361
  }
424
362
  });
425
- this.initialized = true;
363
+ return templateMap;
364
+ }, /* @ts-ignore */
365
+ ...(ngDevMode ? [{ debugName: "templateMap" }] : /* istanbul ignore next */ []));
366
+ _togglerIconTemplate = computed(() => this.templates()
367
+ .filter((item) => item.getType() === 'togglericon')
368
+ .at(-1)?.template, /* @ts-ignore */
369
+ ...(ngDevMode ? [{ debugName: "_togglerIconTemplate" }] : /* istanbul ignore next */ []));
370
+ _componentStyle = inject(OrganizationChartStyle);
371
+ bindDirectiveInstance = inject(Bind, { self: true });
372
+ constructor() {
373
+ super();
374
+ afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptms(['host', 'root'])));
426
375
  }
376
+ root = computed(() => {
377
+ const value = this.value();
378
+ return value && value.length ? value[0] : null;
379
+ }, /* @ts-ignore */
380
+ ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
427
381
  getTemplateForNode(node) {
428
- if (this.templateMap)
429
- return node.type ? this.templateMap[node.type] : this.templateMap['default'];
382
+ const templateMap = this.templateMap();
383
+ if (templateMap)
384
+ return node.type ? templateMap[node.type] : templateMap['default'];
430
385
  else
431
386
  return null;
432
387
  }
@@ -435,45 +390,44 @@ class OrganizationChart extends BaseComponent {
435
390
  if (isAttributeEquals(eventTarget, 'data-pc-section', 'nodetogglebutton') || isAttributeEquals(eventTarget, 'data-pc-section', 'nodetogglebuttonicon')) {
436
391
  return;
437
392
  }
438
- else if (this.selectionMode) {
393
+ else if (this.selectionMode()) {
439
394
  if (node.selectable === false) {
440
395
  return;
441
396
  }
442
397
  let index = this.findIndexInSelection(node);
443
398
  let selected = index >= 0;
444
- if (this.selectionMode === 'single') {
399
+ if (this.selectionMode() === 'single') {
445
400
  if (selected) {
446
- this.selection = null;
401
+ this.selection.set(null);
447
402
  this.onNodeUnselect.emit({ originalEvent: event, node: node });
448
403
  }
449
404
  else {
450
- this.selection = node;
405
+ this.selection.set(node);
451
406
  this.onNodeSelect.emit({ originalEvent: event, node: node });
452
407
  }
453
408
  }
454
- else if (this.selectionMode === 'multiple') {
409
+ else if (this.selectionMode() === 'multiple') {
455
410
  if (selected) {
456
- this.selection = this.selection.filter((val, i) => i != index);
411
+ this.selection.set(this.selection().filter((val, i) => i != index));
457
412
  this.onNodeUnselect.emit({ originalEvent: event, node: node });
458
413
  }
459
414
  else {
460
- this.selection = [...(this.selection || []), node];
415
+ this.selection.set([...(this.selection() || []), node]);
461
416
  this.onNodeSelect.emit({ originalEvent: event, node: node });
462
417
  }
463
418
  }
464
- this.selectionChange.emit(this.selection);
465
- this.selectionSource.next(null);
466
419
  }
467
420
  }
468
421
  findIndexInSelection(node) {
469
422
  let index = -1;
470
- if (this.selectionMode && this.selection) {
471
- if (this.selectionMode === 'single') {
472
- index = this.selection == node ? 0 : -1;
423
+ const selection = this.selection();
424
+ if (this.selectionMode() && selection) {
425
+ if (this.selectionMode() === 'single') {
426
+ index = selection == node ? 0 : -1;
473
427
  }
474
- else if (this.selectionMode === 'multiple') {
475
- for (let i = 0; i < this.selection.length; i++) {
476
- if (this.selection[i] == node) {
428
+ else if (this.selectionMode() === 'multiple') {
429
+ for (let i = 0; i < selection.length; i++) {
430
+ if (selection[i] == node) {
477
431
  index = i;
478
432
  break;
479
433
  }
@@ -485,46 +439,31 @@ class OrganizationChart extends BaseComponent {
485
439
  isSelected(node) {
486
440
  return this.findIndexInSelection(node) != -1;
487
441
  }
488
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChart, deps: null, target: i0.ɵɵFactoryTarget.Component });
489
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChart, isStandalone: true, selector: "p-organizationChart, p-organization-chart, p-organizationchart", inputs: { value: "value", styleClass: "styleClass", selectionMode: "selectionMode", collapsible: ["collapsible", "collapsible", booleanAttribute], preserveSpace: ["preserveSpace", "preserveSpace", booleanAttribute], selection: "selection" }, outputs: { selectionChange: "selectionChange", onNodeSelect: "onNodeSelect", onNodeUnselect: "onNodeUnselect", onNodeExpand: "onNodeExpand", onNodeCollapse: "onNodeCollapse" }, host: { properties: { "class": "cn(cx('root'), styleClass)" } }, providers: [OrganizationChartStyle, { provide: ORGANIZATIONCHART_INSTANCE, useExisting: OrganizationChart }, { provide: PARENT_INSTANCE, useExisting: OrganizationChart }], queries: [{ propertyName: "templates", predicate: PrimeTemplate, isSignal: true }, { propertyName: "togglerIconTemplate", first: true, predicate: ["togglericon"], isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i2.Bind }], ngImport: i0, template: `
490
- @if (root) {
491
- <table [class]="cx('table')" [collapsible]="collapsible" pOrganizationChartNode [pt]="pt" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
442
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
443
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: OrganizationChart, isStandalone: true, selector: "p-organizationChart, p-organization-chart, p-organizationchart", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, preserveSpace: { classPropertyName: "preserveSpace", publicName: "preserveSpace", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", onNodeSelect: "onNodeSelect", onNodeUnselect: "onNodeUnselect", onNodeExpand: "onNodeExpand", onNodeCollapse: "onNodeCollapse" }, host: { properties: { "class": "cx('root')" } }, providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChart }], queries: [{ propertyName: "templates", predicate: PrimeTemplate, isSignal: true }, { propertyName: "togglerIconTemplate", first: true, predicate: ["togglericon"], isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i2.Bind }], ngImport: i0, template: `
444
+ @if (root(); as root) {
445
+ <table [class]="cx('table')" [collapsible]="collapsible()" pOrganizationChartNode [pt]="pt()" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
492
446
  }
493
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "root", "first", "last", "collapsible"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i2.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
447
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: OrganizationChartNode, selector: "[pOrganizationChartNode]", inputs: ["node", "collapsible"] }, { kind: "ngmodule", type: SharedModule }, { kind: "ngmodule", type: BindModule }, { kind: "directive", type: i2.Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
494
448
  }
495
449
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChart, decorators: [{
496
450
  type: Component,
497
451
  args: [{
498
452
  selector: 'p-organizationChart, p-organization-chart, p-organizationchart',
499
- standalone: true,
500
453
  imports: [CommonModule, OrganizationChartNode, SharedModule, BindModule],
501
454
  template: `
502
- @if (root) {
503
- <table [class]="cx('table')" [collapsible]="collapsible" pOrganizationChartNode [pt]="pt" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
455
+ @if (root(); as root) {
456
+ <table [class]="cx('table')" [collapsible]="collapsible()" pOrganizationChartNode [pt]="pt()" [unstyled]="unstyled()" [node]="root" [pBind]="ptm('table')"></table>
504
457
  }
505
458
  `,
506
- changeDetection: ChangeDetectionStrategy.Eager,
507
- providers: [OrganizationChartStyle, { provide: ORGANIZATIONCHART_INSTANCE, useExisting: OrganizationChart }, { provide: PARENT_INSTANCE, useExisting: OrganizationChart }],
459
+ changeDetection: ChangeDetectionStrategy.OnPush,
460
+ providers: [OrganizationChartStyle, { provide: PARENT_INSTANCE, useExisting: OrganizationChart }],
508
461
  host: {
509
- '[class]': "cn(cx('root'), styleClass)"
462
+ '[class]': "cx('root')"
510
463
  },
511
464
  hostDirectives: [Bind]
512
465
  }]
513
- }], propDecorators: { value: [{
514
- type: Input
515
- }], styleClass: [{
516
- type: Input
517
- }], selectionMode: [{
518
- type: Input
519
- }], collapsible: [{
520
- type: Input,
521
- args: [{ transform: booleanAttribute }]
522
- }], preserveSpace: [{
523
- type: Input,
524
- args: [{ transform: booleanAttribute }]
525
- }], selection: [{
526
- type: Input
527
- }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], onNodeSelect: [{ type: i0.Output, args: ["onNodeSelect"] }], onNodeUnselect: [{ type: i0.Output, args: ["onNodeUnselect"] }], onNodeExpand: [{ type: i0.Output, args: ["onNodeExpand"] }], onNodeCollapse: [{ type: i0.Output, args: ["onNodeCollapse"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }], togglerIconTemplate: [{ type: i0.ContentChild, args: ['togglericon', { ...{ descendants: false }, isSignal: true }] }] } });
466
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], preserveSpace: [{ type: i0.Input, args: [{ isSignal: true, alias: "preserveSpace", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], onNodeSelect: [{ type: i0.Output, args: ["onNodeSelect"] }], onNodeUnselect: [{ type: i0.Output, args: ["onNodeUnselect"] }], onNodeExpand: [{ type: i0.Output, args: ["onNodeExpand"] }], onNodeCollapse: [{ type: i0.Output, args: ["onNodeCollapse"] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }], togglerIconTemplate: [{ type: i0.ContentChild, args: ['togglericon', { ...{ descendants: false }, isSignal: true }] }] } });
528
467
  class OrganizationChartModule {
529
468
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
530
469
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: OrganizationChartModule, imports: [OrganizationChart, OrganizationChartNode, SharedModule], exports: [OrganizationChart, OrganizationChartNode, SharedModule] });