primevue 3.12.3 → 3.12.6

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 (633) hide show
  1. package/accordion/accordion.cjs.js +18 -16
  2. package/accordion/accordion.cjs.min.js +1 -1
  3. package/accordion/accordion.esm.js +20 -18
  4. package/accordion/accordion.esm.min.js +1 -1
  5. package/accordion/accordion.js +19 -17
  6. package/accordion/accordion.min.js +1 -1
  7. package/accordiontab/accordiontab.esm.js +1 -1
  8. package/accordiontab/accordiontab.esm.min.js +1 -1
  9. package/accordiontab/accordiontab.js +1 -1
  10. package/api/api.js +1 -1
  11. package/autocomplete/autocomplete.cjs.js +61 -54
  12. package/autocomplete/autocomplete.cjs.min.js +1 -1
  13. package/autocomplete/autocomplete.esm.js +59 -52
  14. package/autocomplete/autocomplete.esm.min.js +1 -1
  15. package/autocomplete/autocomplete.js +62 -55
  16. package/autocomplete/autocomplete.min.js +1 -1
  17. package/avatar/avatar.cjs.js +9 -6
  18. package/avatar/avatar.cjs.min.js +1 -1
  19. package/avatar/avatar.esm.js +11 -8
  20. package/avatar/avatar.esm.min.js +1 -1
  21. package/avatar/avatar.js +10 -7
  22. package/avatar/avatar.min.js +1 -1
  23. package/avatargroup/avatargroup.cjs.js +1 -1
  24. package/avatargroup/avatargroup.cjs.min.js +1 -1
  25. package/avatargroup/avatargroup.esm.js +3 -3
  26. package/avatargroup/avatargroup.esm.min.js +1 -1
  27. package/avatargroup/avatargroup.js +2 -2
  28. package/avatargroup/avatargroup.min.js +1 -1
  29. package/badge/badge.cjs.js +3 -1
  30. package/badge/badge.cjs.min.js +1 -1
  31. package/badge/badge.esm.js +5 -3
  32. package/badge/badge.esm.min.js +1 -1
  33. package/badge/badge.js +4 -2
  34. package/badge/badge.min.js +1 -1
  35. package/badgedirective/badgedirective.esm.js +1 -1
  36. package/badgedirective/badgedirective.esm.min.js +1 -1
  37. package/badgedirective/badgedirective.js +1 -1
  38. package/blockui/blockui.cjs.js +1 -1
  39. package/blockui/blockui.cjs.min.js +1 -1
  40. package/blockui/blockui.esm.js +3 -3
  41. package/blockui/blockui.esm.min.js +1 -1
  42. package/blockui/blockui.js +2 -2
  43. package/blockui/blockui.min.js +1 -1
  44. package/breadcrumb/breadcrumb.cjs.js +25 -23
  45. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  46. package/breadcrumb/breadcrumb.esm.js +27 -25
  47. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  48. package/breadcrumb/breadcrumb.js +26 -24
  49. package/breadcrumb/breadcrumb.min.js +1 -1
  50. package/button/button.cjs.js +13 -12
  51. package/button/button.cjs.min.js +1 -1
  52. package/button/button.esm.js +14 -13
  53. package/button/button.esm.min.js +1 -1
  54. package/button/button.js +14 -13
  55. package/button/button.min.js +1 -1
  56. package/calendar/calendar.cjs.js +232 -207
  57. package/calendar/calendar.cjs.min.js +1 -1
  58. package/calendar/calendar.esm.js +231 -206
  59. package/calendar/calendar.esm.min.js +1 -1
  60. package/calendar/calendar.js +233 -208
  61. package/calendar/calendar.min.js +1 -1
  62. package/card/card.cjs.js +7 -7
  63. package/card/card.cjs.min.js +1 -1
  64. package/card/card.esm.js +9 -9
  65. package/card/card.esm.min.js +1 -1
  66. package/card/card.js +8 -8
  67. package/card/card.min.js +1 -1
  68. package/carousel/carousel.cjs.js +56 -48
  69. package/carousel/carousel.cjs.min.js +1 -1
  70. package/carousel/carousel.esm.js +57 -49
  71. package/carousel/carousel.esm.min.js +1 -1
  72. package/carousel/carousel.js +57 -49
  73. package/carousel/carousel.min.js +1 -1
  74. package/cascadeselect/cascadeselect.cjs.js +37 -30
  75. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  76. package/cascadeselect/cascadeselect.esm.js +37 -30
  77. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  78. package/cascadeselect/cascadeselect.js +38 -31
  79. package/cascadeselect/cascadeselect.min.js +1 -1
  80. package/chart/chart.cjs.js +7 -8
  81. package/chart/chart.cjs.min.js +1 -1
  82. package/chart/chart.esm.js +7 -6
  83. package/chart/chart.esm.min.js +1 -1
  84. package/chart/chart.js +6 -5
  85. package/chart/chart.min.js +1 -1
  86. package/checkbox/checkbox.cjs.js +16 -14
  87. package/checkbox/checkbox.cjs.min.js +1 -1
  88. package/checkbox/checkbox.esm.js +18 -16
  89. package/checkbox/checkbox.esm.min.js +1 -1
  90. package/checkbox/checkbox.js +17 -15
  91. package/checkbox/checkbox.min.js +1 -1
  92. package/chip/chip.cjs.js +13 -12
  93. package/chip/chip.cjs.min.js +1 -1
  94. package/chip/chip.esm.js +15 -14
  95. package/chip/chip.esm.min.js +1 -1
  96. package/chip/chip.js +14 -13
  97. package/chip/chip.min.js +1 -1
  98. package/chips/chips.cjs.js +22 -20
  99. package/chips/chips.cjs.min.js +1 -1
  100. package/chips/chips.esm.js +24 -22
  101. package/chips/chips.esm.min.js +1 -1
  102. package/chips/chips.js +23 -21
  103. package/chips/chips.min.js +1 -1
  104. package/colorpicker/colorpicker.cjs.js +28 -27
  105. package/colorpicker/colorpicker.cjs.min.js +1 -1
  106. package/colorpicker/colorpicker.esm.js +29 -28
  107. package/colorpicker/colorpicker.esm.min.js +1 -1
  108. package/colorpicker/colorpicker.js +29 -28
  109. package/colorpicker/colorpicker.min.js +1 -1
  110. package/column/column.esm.js +1 -1
  111. package/column/column.esm.min.js +1 -1
  112. package/column/column.js +1 -1
  113. package/columngroup/columngroup.esm.js +1 -1
  114. package/columngroup/columngroup.esm.min.js +1 -1
  115. package/columngroup/columngroup.js +1 -1
  116. package/config/config.cjs.js +1 -1
  117. package/config/config.esm.js +1 -2
  118. package/config/config.esm.min.js +1 -1
  119. package/config/config.js +2 -2
  120. package/confirmationeventbus/confirmationeventbus.esm.js +1 -1
  121. package/confirmationeventbus/confirmationeventbus.esm.min.js +1 -1
  122. package/confirmationeventbus/confirmationeventbus.js +1 -1
  123. package/confirmationoptions/ConfirmationOptions.d.ts +8 -0
  124. package/confirmationservice/confirmationservice.cjs.js +2 -2
  125. package/confirmationservice/confirmationservice.esm.js +1 -1
  126. package/confirmationservice/confirmationservice.esm.min.js +1 -1
  127. package/confirmationservice/confirmationservice.js +3 -3
  128. package/confirmdialog/confirmdialog.cjs.js +15 -13
  129. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  130. package/confirmdialog/confirmdialog.esm.js +11 -9
  131. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  132. package/confirmdialog/confirmdialog.js +16 -14
  133. package/confirmdialog/confirmdialog.min.js +1 -1
  134. package/confirmpopup/confirmpopup.cjs.js +18 -16
  135. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  136. package/confirmpopup/confirmpopup.esm.js +14 -12
  137. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  138. package/confirmpopup/confirmpopup.js +19 -17
  139. package/confirmpopup/confirmpopup.min.js +1 -1
  140. package/contextmenu/contextmenu.cjs.js +33 -30
  141. package/contextmenu/contextmenu.cjs.min.js +1 -1
  142. package/contextmenu/contextmenu.esm.js +34 -31
  143. package/contextmenu/contextmenu.esm.min.js +1 -1
  144. package/contextmenu/contextmenu.js +34 -31
  145. package/contextmenu/contextmenu.min.js +1 -1
  146. package/core/core.js +405 -339
  147. package/core/core.min.js +12 -12
  148. package/datatable/DataTable.d.ts +1 -1
  149. package/datatable/datatable.cjs.js +355 -328
  150. package/datatable/datatable.cjs.min.js +1 -1
  151. package/datatable/datatable.esm.js +345 -318
  152. package/datatable/datatable.esm.min.js +1 -1
  153. package/datatable/datatable.js +356 -329
  154. package/datatable/datatable.min.js +1 -1
  155. package/dataview/dataview.cjs.js +16 -14
  156. package/dataview/dataview.cjs.min.js +1 -1
  157. package/dataview/dataview.esm.js +17 -15
  158. package/dataview/dataview.esm.min.js +1 -1
  159. package/dataview/dataview.js +17 -15
  160. package/dataview/dataview.min.js +1 -1
  161. package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.js +17 -15
  162. package/dataviewlayoutoptions/dataviewlayoutoptions.cjs.min.js +1 -1
  163. package/dataviewlayoutoptions/dataviewlayoutoptions.esm.js +19 -17
  164. package/dataviewlayoutoptions/dataviewlayoutoptions.esm.min.js +1 -1
  165. package/dataviewlayoutoptions/dataviewlayoutoptions.js +18 -16
  166. package/dataviewlayoutoptions/dataviewlayoutoptions.min.js +1 -1
  167. package/deferredcontent/deferredcontent.cjs.js +1 -1
  168. package/deferredcontent/deferredcontent.cjs.min.js +1 -1
  169. package/deferredcontent/deferredcontent.esm.js +3 -3
  170. package/deferredcontent/deferredcontent.esm.min.js +1 -1
  171. package/deferredcontent/deferredcontent.js +2 -2
  172. package/deferredcontent/deferredcontent.min.js +1 -1
  173. package/dialog/dialog.cjs.js +33 -27
  174. package/dialog/dialog.cjs.min.js +1 -1
  175. package/dialog/dialog.esm.js +34 -28
  176. package/dialog/dialog.esm.min.js +1 -1
  177. package/dialog/dialog.js +34 -28
  178. package/dialog/dialog.min.js +1 -1
  179. package/divider/divider.cjs.js +3 -3
  180. package/divider/divider.cjs.min.js +1 -1
  181. package/divider/divider.esm.js +5 -5
  182. package/divider/divider.esm.min.js +1 -1
  183. package/divider/divider.js +4 -4
  184. package/divider/divider.min.js +1 -1
  185. package/dock/dock.cjs.js +26 -23
  186. package/dock/dock.cjs.min.js +1 -1
  187. package/dock/dock.esm.js +26 -23
  188. package/dock/dock.esm.min.js +1 -1
  189. package/dock/dock.js +27 -24
  190. package/dock/dock.min.js +1 -1
  191. package/dropdown/dropdown.cjs.js +67 -59
  192. package/dropdown/dropdown.cjs.min.js +1 -1
  193. package/dropdown/dropdown.esm.js +66 -58
  194. package/dropdown/dropdown.esm.min.js +1 -1
  195. package/dropdown/dropdown.js +68 -60
  196. package/dropdown/dropdown.min.js +1 -1
  197. package/editor/editor.cjs.js +22 -22
  198. package/editor/editor.cjs.min.js +1 -1
  199. package/editor/editor.esm.js +23 -23
  200. package/editor/editor.esm.min.js +1 -1
  201. package/editor/editor.js +23 -23
  202. package/editor/editor.min.js +1 -1
  203. package/fieldset/fieldset.cjs.js +22 -17
  204. package/fieldset/fieldset.cjs.min.js +1 -1
  205. package/fieldset/fieldset.esm.js +23 -18
  206. package/fieldset/fieldset.esm.min.js +1 -1
  207. package/fieldset/fieldset.js +23 -18
  208. package/fieldset/fieldset.min.js +1 -1
  209. package/fileupload/FileUpload.d.ts +12 -0
  210. package/fileupload/FileUpload.vue +21 -7
  211. package/fileupload/fileupload.cjs.js +85 -65
  212. package/fileupload/fileupload.cjs.min.js +1 -1
  213. package/fileupload/fileupload.esm.js +83 -63
  214. package/fileupload/fileupload.esm.min.js +1 -1
  215. package/fileupload/fileupload.js +86 -66
  216. package/fileupload/fileupload.min.js +1 -1
  217. package/fullcalendar/fullcalendar.cjs.js +1 -31
  218. package/fullcalendar/fullcalendar.cjs.min.js +1 -1
  219. package/fullcalendar/fullcalendar.esm.js +3 -33
  220. package/fullcalendar/fullcalendar.esm.min.js +1 -1
  221. package/fullcalendar/fullcalendar.js +2 -32
  222. package/fullcalendar/fullcalendar.min.js +1 -1
  223. package/galleria/galleria.cjs.js +92 -78
  224. package/galleria/galleria.cjs.min.js +1 -1
  225. package/galleria/galleria.esm.js +91 -77
  226. package/galleria/galleria.esm.min.js +1 -1
  227. package/galleria/galleria.js +93 -79
  228. package/galleria/galleria.min.js +1 -1
  229. package/image/image.cjs.js +55 -47
  230. package/image/image.cjs.min.js +1 -1
  231. package/image/image.esm.js +57 -49
  232. package/image/image.esm.min.js +1 -1
  233. package/image/image.js +56 -48
  234. package/image/image.min.js +1 -1
  235. package/inlinemessage/inlinemessage.cjs.js +6 -4
  236. package/inlinemessage/inlinemessage.cjs.min.js +1 -1
  237. package/inlinemessage/inlinemessage.esm.js +8 -6
  238. package/inlinemessage/inlinemessage.esm.min.js +1 -1
  239. package/inlinemessage/inlinemessage.js +7 -5
  240. package/inlinemessage/inlinemessage.min.js +1 -1
  241. package/inplace/inplace.cjs.js +12 -9
  242. package/inplace/inplace.cjs.min.js +1 -1
  243. package/inplace/inplace.esm.js +13 -10
  244. package/inplace/inplace.esm.min.js +1 -1
  245. package/inplace/inplace.js +13 -10
  246. package/inplace/inplace.min.js +1 -1
  247. package/inputmask/inputmask.cjs.js +7 -7
  248. package/inputmask/inputmask.cjs.min.js +1 -1
  249. package/inputmask/inputmask.esm.js +9 -9
  250. package/inputmask/inputmask.esm.min.js +1 -1
  251. package/inputmask/inputmask.js +8 -8
  252. package/inputmask/inputmask.min.js +1 -1
  253. package/inputnumber/InputNumber.d.ts +4 -0
  254. package/inputnumber/InputNumber.vue +20 -2
  255. package/inputnumber/inputnumber.cjs.js +27 -8
  256. package/inputnumber/inputnumber.cjs.min.js +1 -1
  257. package/inputnumber/inputnumber.esm.js +27 -8
  258. package/inputnumber/inputnumber.esm.min.js +1 -1
  259. package/inputnumber/inputnumber.js +28 -9
  260. package/inputnumber/inputnumber.min.js +1 -1
  261. package/inputswitch/inputswitch.cjs.js +13 -12
  262. package/inputswitch/inputswitch.cjs.min.js +1 -1
  263. package/inputswitch/inputswitch.esm.js +15 -14
  264. package/inputswitch/inputswitch.esm.min.js +1 -1
  265. package/inputswitch/inputswitch.js +14 -13
  266. package/inputswitch/inputswitch.min.js +1 -1
  267. package/inputtext/inputtext.cjs.js +5 -3
  268. package/inputtext/inputtext.cjs.min.js +1 -1
  269. package/inputtext/inputtext.esm.js +7 -5
  270. package/inputtext/inputtext.esm.min.js +1 -1
  271. package/inputtext/inputtext.js +6 -4
  272. package/inputtext/inputtext.min.js +1 -1
  273. package/knob/knob.cjs.js +21 -14
  274. package/knob/knob.cjs.min.js +1 -1
  275. package/knob/knob.esm.js +23 -16
  276. package/knob/knob.esm.min.js +1 -1
  277. package/knob/knob.js +22 -15
  278. package/knob/knob.min.js +1 -1
  279. package/listbox/listbox.cjs.js +37 -34
  280. package/listbox/listbox.cjs.min.js +1 -1
  281. package/listbox/listbox.esm.js +37 -34
  282. package/listbox/listbox.esm.min.js +1 -1
  283. package/listbox/listbox.js +38 -35
  284. package/listbox/listbox.min.js +1 -1
  285. package/megamenu/megamenu.cjs.js +73 -66
  286. package/megamenu/megamenu.cjs.min.js +1 -1
  287. package/megamenu/megamenu.esm.js +74 -67
  288. package/megamenu/megamenu.esm.min.js +1 -1
  289. package/megamenu/megamenu.js +74 -67
  290. package/megamenu/megamenu.min.js +1 -1
  291. package/menu/Menu.vue +4 -1
  292. package/menu/menu.cjs.js +41 -36
  293. package/menu/menu.cjs.min.js +1 -1
  294. package/menu/menu.esm.js +41 -36
  295. package/menu/menu.esm.min.js +1 -1
  296. package/menu/menu.js +42 -37
  297. package/menu/menu.min.js +1 -1
  298. package/menubar/menubar.cjs.js +47 -40
  299. package/menubar/menubar.cjs.min.js +1 -1
  300. package/menubar/menubar.esm.js +48 -41
  301. package/menubar/menubar.esm.min.js +1 -1
  302. package/menubar/menubar.js +48 -41
  303. package/menubar/menubar.min.js +1 -1
  304. package/message/message.cjs.js +15 -12
  305. package/message/message.cjs.min.js +1 -1
  306. package/message/message.esm.js +16 -13
  307. package/message/message.esm.min.js +1 -1
  308. package/message/message.js +16 -13
  309. package/message/message.min.js +1 -1
  310. package/multiselect/multiselect.cjs.js +106 -94
  311. package/multiselect/multiselect.cjs.min.js +1 -1
  312. package/multiselect/multiselect.esm.js +105 -93
  313. package/multiselect/multiselect.esm.min.js +1 -1
  314. package/multiselect/multiselect.js +107 -95
  315. package/multiselect/multiselect.min.js +1 -1
  316. package/orderlist/orderlist.cjs.js +15 -12
  317. package/orderlist/orderlist.cjs.min.js +1 -1
  318. package/orderlist/orderlist.esm.js +15 -12
  319. package/orderlist/orderlist.esm.min.js +1 -1
  320. package/orderlist/orderlist.js +16 -13
  321. package/orderlist/orderlist.min.js +1 -1
  322. package/organizationchart/organizationchart.cjs.js +42 -37
  323. package/organizationchart/organizationchart.cjs.min.js +1 -1
  324. package/organizationchart/organizationchart.esm.js +44 -39
  325. package/organizationchart/organizationchart.esm.min.js +1 -1
  326. package/organizationchart/organizationchart.js +43 -38
  327. package/organizationchart/organizationchart.min.js +1 -1
  328. package/overlayeventbus/overlayeventbus.esm.js +1 -1
  329. package/overlayeventbus/overlayeventbus.esm.min.js +1 -1
  330. package/overlayeventbus/overlayeventbus.js +1 -1
  331. package/overlaypanel/overlaypanel.cjs.js +18 -16
  332. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  333. package/overlaypanel/overlaypanel.esm.js +15 -13
  334. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  335. package/overlaypanel/overlaypanel.js +19 -17
  336. package/overlaypanel/overlaypanel.min.js +1 -1
  337. package/package.json +1 -1
  338. package/paginator/paginator.cjs.js +59 -54
  339. package/paginator/paginator.cjs.min.js +1 -1
  340. package/paginator/paginator.esm.js +53 -48
  341. package/paginator/paginator.esm.min.js +1 -1
  342. package/paginator/paginator.js +60 -55
  343. package/paginator/paginator.min.js +1 -1
  344. package/panel/panel.cjs.js +21 -16
  345. package/panel/panel.cjs.min.js +1 -1
  346. package/panel/panel.esm.js +22 -17
  347. package/panel/panel.esm.min.js +1 -1
  348. package/panel/panel.js +22 -17
  349. package/panel/panel.min.js +1 -1
  350. package/panelmenu/panelmenu.cjs.js +62 -57
  351. package/panelmenu/panelmenu.cjs.min.js +1 -1
  352. package/panelmenu/panelmenu.esm.js +64 -59
  353. package/panelmenu/panelmenu.esm.min.js +1 -1
  354. package/panelmenu/panelmenu.js +63 -58
  355. package/panelmenu/panelmenu.min.js +1 -1
  356. package/password/Password.vue +1 -1
  357. package/password/password.cjs.js +17 -17
  358. package/password/password.cjs.min.js +1 -1
  359. package/password/password.esm.js +17 -17
  360. package/password/password.esm.min.js +1 -1
  361. package/password/password.js +18 -18
  362. package/password/password.min.js +1 -1
  363. package/picklist/picklist.cjs.js +38 -34
  364. package/picklist/picklist.cjs.min.js +1 -1
  365. package/picklist/picklist.esm.js +38 -34
  366. package/picklist/picklist.esm.min.js +1 -1
  367. package/picklist/picklist.js +39 -35
  368. package/picklist/picklist.min.js +1 -1
  369. package/progressbar/progressbar.cjs.js +14 -12
  370. package/progressbar/progressbar.cjs.min.js +1 -1
  371. package/progressbar/progressbar.esm.js +16 -14
  372. package/progressbar/progressbar.esm.min.js +1 -1
  373. package/progressbar/progressbar.js +15 -13
  374. package/progressbar/progressbar.min.js +1 -1
  375. package/progressspinner/progressspinner.cjs.js +6 -5
  376. package/progressspinner/progressspinner.cjs.min.js +1 -1
  377. package/progressspinner/progressspinner.esm.js +8 -7
  378. package/progressspinner/progressspinner.esm.min.js +1 -1
  379. package/progressspinner/progressspinner.js +7 -6
  380. package/progressspinner/progressspinner.min.js +1 -1
  381. package/radiobutton/radiobutton.cjs.js +18 -15
  382. package/radiobutton/radiobutton.cjs.min.js +1 -1
  383. package/radiobutton/radiobutton.esm.js +20 -17
  384. package/radiobutton/radiobutton.esm.min.js +1 -1
  385. package/radiobutton/radiobutton.js +19 -16
  386. package/radiobutton/radiobutton.min.js +1 -1
  387. package/rating/rating.cjs.js +13 -8
  388. package/rating/rating.cjs.min.js +1 -1
  389. package/rating/rating.esm.js +15 -10
  390. package/rating/rating.esm.min.js +1 -1
  391. package/rating/rating.js +14 -9
  392. package/rating/rating.min.js +1 -1
  393. package/resources/primevue.css +0 -4
  394. package/resources/primevue.min.css +1 -1
  395. package/resources/themes/arya-blue/theme.css +10 -0
  396. package/resources/themes/arya-green/theme.css +10 -0
  397. package/resources/themes/arya-orange/theme.css +10 -0
  398. package/resources/themes/arya-purple/theme.css +10 -0
  399. package/resources/themes/bootstrap4-dark-blue/theme.css +10 -0
  400. package/resources/themes/bootstrap4-dark-purple/theme.css +10 -0
  401. package/resources/themes/bootstrap4-light-blue/theme.css +10 -0
  402. package/resources/themes/bootstrap4-light-purple/theme.css +10 -0
  403. package/resources/themes/fluent-light/theme.css +10 -0
  404. package/resources/themes/lara-dark-blue/theme.css +10 -0
  405. package/resources/themes/lara-dark-indigo/theme.css +10 -0
  406. package/resources/themes/lara-dark-purple/theme.css +10 -0
  407. package/resources/themes/lara-dark-teal/theme.css +10 -0
  408. package/resources/themes/lara-light-blue/theme.css +10 -0
  409. package/resources/themes/lara-light-indigo/theme.css +10 -0
  410. package/resources/themes/lara-light-purple/theme.css +10 -0
  411. package/resources/themes/lara-light-teal/theme.css +10 -0
  412. package/resources/themes/luna-amber/theme.css +10 -0
  413. package/resources/themes/luna-blue/theme.css +10 -0
  414. package/resources/themes/luna-green/theme.css +10 -0
  415. package/resources/themes/luna-pink/theme.css +10 -0
  416. package/resources/themes/md-dark-deeppurple/theme.css +11 -3
  417. package/resources/themes/md-dark-indigo/theme.css +11 -3
  418. package/resources/themes/md-light-deeppurple/theme.css +11 -3
  419. package/resources/themes/md-light-indigo/theme.css +11 -3
  420. package/resources/themes/mdc-dark-deeppurple/theme.css +11 -3
  421. package/resources/themes/mdc-dark-indigo/theme.css +11 -3
  422. package/resources/themes/mdc-light-deeppurple/theme.css +11 -3
  423. package/resources/themes/mdc-light-indigo/theme.css +11 -3
  424. package/resources/themes/nova/theme.css +10 -0
  425. package/resources/themes/nova-accent/theme.css +10 -0
  426. package/resources/themes/nova-alt/theme.css +10 -0
  427. package/resources/themes/nova-vue/theme.css +10 -0
  428. package/resources/themes/rhea/theme.css +10 -0
  429. package/resources/themes/saga-blue/theme.css +10 -0
  430. package/resources/themes/saga-green/theme.css +10 -0
  431. package/resources/themes/saga-orange/theme.css +10 -0
  432. package/resources/themes/saga-purple/theme.css +10 -0
  433. package/resources/themes/tailwind-light/theme.css +10 -0
  434. package/resources/themes/vela-blue/theme.css +10 -0
  435. package/resources/themes/vela-green/theme.css +10 -0
  436. package/resources/themes/vela-orange/theme.css +10 -0
  437. package/resources/themes/vela-purple/theme.css +10 -0
  438. package/ripple/ripple.esm.js +1 -1
  439. package/ripple/ripple.esm.min.js +1 -1
  440. package/ripple/ripple.js +1 -1
  441. package/row/row.esm.js +1 -1
  442. package/row/row.esm.min.js +1 -1
  443. package/row/row.js +1 -1
  444. package/scrollpanel/scrollpanel.cjs.js +9 -9
  445. package/scrollpanel/scrollpanel.cjs.min.js +1 -1
  446. package/scrollpanel/scrollpanel.esm.js +11 -11
  447. package/scrollpanel/scrollpanel.esm.min.js +1 -1
  448. package/scrollpanel/scrollpanel.js +10 -10
  449. package/scrollpanel/scrollpanel.min.js +1 -1
  450. package/scrolltop/scrolltop.cjs.js +6 -4
  451. package/scrolltop/scrolltop.cjs.min.js +1 -1
  452. package/scrolltop/scrolltop.esm.js +8 -6
  453. package/scrolltop/scrolltop.esm.min.js +1 -1
  454. package/scrolltop/scrolltop.js +7 -5
  455. package/scrolltop/scrolltop.min.js +1 -1
  456. package/selectbutton/selectbutton.cjs.js +12 -11
  457. package/selectbutton/selectbutton.cjs.min.js +1 -1
  458. package/selectbutton/selectbutton.esm.js +13 -12
  459. package/selectbutton/selectbutton.esm.min.js +1 -1
  460. package/selectbutton/selectbutton.js +13 -12
  461. package/selectbutton/selectbutton.min.js +1 -1
  462. package/sidebar/Sidebar.d.ts +4 -0
  463. package/sidebar/Sidebar.vue +3 -0
  464. package/sidebar/sidebar.cjs.js +26 -14
  465. package/sidebar/sidebar.cjs.min.js +1 -1
  466. package/sidebar/sidebar.esm.js +27 -15
  467. package/sidebar/sidebar.esm.min.js +1 -1
  468. package/sidebar/sidebar.js +27 -15
  469. package/sidebar/sidebar.min.js +1 -1
  470. package/skeleton/skeleton.cjs.js +3 -3
  471. package/skeleton/skeleton.cjs.min.js +1 -1
  472. package/skeleton/skeleton.esm.js +5 -5
  473. package/skeleton/skeleton.esm.min.js +1 -1
  474. package/skeleton/skeleton.js +4 -4
  475. package/skeleton/skeleton.min.js +1 -1
  476. package/slider/slider.cjs.js +33 -29
  477. package/slider/slider.cjs.min.js +1 -1
  478. package/slider/slider.esm.js +35 -31
  479. package/slider/slider.esm.min.js +1 -1
  480. package/slider/slider.js +34 -30
  481. package/slider/slider.min.js +1 -1
  482. package/speeddial/speeddial.cjs.js +23 -21
  483. package/speeddial/speeddial.cjs.min.js +1 -1
  484. package/speeddial/speeddial.esm.js +22 -20
  485. package/speeddial/speeddial.esm.min.js +1 -1
  486. package/speeddial/speeddial.js +24 -22
  487. package/speeddial/speeddial.min.js +1 -1
  488. package/splitbutton/splitbutton.cjs.js +7 -9
  489. package/splitbutton/splitbutton.cjs.min.js +1 -1
  490. package/splitbutton/splitbutton.esm.js +7 -9
  491. package/splitbutton/splitbutton.esm.min.js +1 -1
  492. package/splitbutton/splitbutton.js +8 -10
  493. package/splitbutton/splitbutton.min.js +1 -1
  494. package/splitter/splitter.cjs.js +13 -9
  495. package/splitter/splitter.cjs.min.js +1 -1
  496. package/splitter/splitter.esm.js +15 -11
  497. package/splitter/splitter.esm.min.js +1 -1
  498. package/splitter/splitter.js +14 -10
  499. package/splitter/splitter.min.js +1 -1
  500. package/splitterpanel/splitterpanel.cjs.js +2 -2
  501. package/splitterpanel/splitterpanel.cjs.min.js +1 -1
  502. package/splitterpanel/splitterpanel.esm.js +4 -4
  503. package/splitterpanel/splitterpanel.esm.min.js +1 -1
  504. package/splitterpanel/splitterpanel.js +3 -3
  505. package/splitterpanel/splitterpanel.min.js +1 -1
  506. package/steps/steps.cjs.js +28 -25
  507. package/steps/steps.cjs.min.js +1 -1
  508. package/steps/steps.esm.js +30 -27
  509. package/steps/steps.esm.min.js +1 -1
  510. package/steps/steps.js +29 -26
  511. package/steps/steps.min.js +1 -1
  512. package/styleclass/styleclass.cjs.js +1 -1
  513. package/styleclass/styleclass.cjs.min.js +1 -1
  514. package/styleclass/styleclass.esm.js +2 -2
  515. package/styleclass/styleclass.esm.min.js +1 -1
  516. package/styleclass/styleclass.js +2 -2
  517. package/styleclass/styleclass.min.js +1 -1
  518. package/tabmenu/tabmenu.cjs.js +25 -23
  519. package/tabmenu/tabmenu.cjs.min.js +1 -1
  520. package/tabmenu/tabmenu.esm.js +26 -24
  521. package/tabmenu/tabmenu.esm.min.js +1 -1
  522. package/tabmenu/tabmenu.js +26 -24
  523. package/tabmenu/tabmenu.min.js +1 -1
  524. package/tabpanel/tabpanel.esm.js +1 -1
  525. package/tabpanel/tabpanel.esm.min.js +1 -1
  526. package/tabpanel/tabpanel.js +1 -1
  527. package/tabview/tabview.cjs.js +41 -36
  528. package/tabview/tabview.cjs.min.js +1 -1
  529. package/tabview/tabview.esm.js +42 -37
  530. package/tabview/tabview.esm.min.js +1 -1
  531. package/tabview/tabview.js +42 -37
  532. package/tabview/tabview.min.js +1 -1
  533. package/tag/tag.cjs.js +4 -4
  534. package/tag/tag.cjs.min.js +1 -1
  535. package/tag/tag.esm.js +6 -6
  536. package/tag/tag.esm.min.js +1 -1
  537. package/tag/tag.js +5 -5
  538. package/tag/tag.min.js +1 -1
  539. package/terminal/terminal.cjs.js +17 -17
  540. package/terminal/terminal.cjs.min.js +1 -1
  541. package/terminal/terminal.esm.js +16 -16
  542. package/terminal/terminal.esm.min.js +1 -1
  543. package/terminal/terminal.js +18 -18
  544. package/terminal/terminal.min.js +1 -1
  545. package/terminalservice/terminalservice.esm.js +1 -1
  546. package/terminalservice/terminalservice.esm.min.js +1 -1
  547. package/terminalservice/terminalservice.js +1 -1
  548. package/textarea/textarea.cjs.js +5 -3
  549. package/textarea/textarea.cjs.min.js +1 -1
  550. package/textarea/textarea.esm.js +7 -5
  551. package/textarea/textarea.esm.min.js +1 -1
  552. package/textarea/textarea.js +6 -4
  553. package/textarea/textarea.min.js +1 -1
  554. package/tieredmenu/tieredmenu.cjs.js +35 -32
  555. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  556. package/tieredmenu/tieredmenu.esm.js +35 -32
  557. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  558. package/tieredmenu/tieredmenu.js +36 -33
  559. package/tieredmenu/tieredmenu.min.js +1 -1
  560. package/timeline/Timeline.d.ts +1 -1
  561. package/timeline/timeline.cjs.js +10 -8
  562. package/timeline/timeline.cjs.min.js +1 -1
  563. package/timeline/timeline.esm.js +12 -10
  564. package/timeline/timeline.esm.min.js +1 -1
  565. package/timeline/timeline.js +11 -9
  566. package/timeline/timeline.min.js +1 -1
  567. package/toast/Toast.vue +2 -2
  568. package/toast/toast.cjs.js +29 -26
  569. package/toast/toast.cjs.min.js +1 -1
  570. package/toast/toast.esm.js +25 -22
  571. package/toast/toast.esm.min.js +1 -1
  572. package/toast/toast.js +30 -27
  573. package/toast/toast.min.js +1 -1
  574. package/toasteventbus/toasteventbus.esm.js +1 -1
  575. package/toasteventbus/toasteventbus.esm.min.js +1 -1
  576. package/toasteventbus/toasteventbus.js +1 -1
  577. package/toastservice/toastservice.cjs.js +3 -3
  578. package/toastservice/toastservice.esm.js +1 -1
  579. package/toastservice/toastservice.esm.min.js +1 -1
  580. package/toastservice/toastservice.js +4 -4
  581. package/togglebutton/togglebutton.cjs.js +10 -9
  582. package/togglebutton/togglebutton.cjs.min.js +1 -1
  583. package/togglebutton/togglebutton.esm.js +11 -10
  584. package/togglebutton/togglebutton.esm.min.js +1 -1
  585. package/togglebutton/togglebutton.js +11 -10
  586. package/togglebutton/togglebutton.min.js +1 -1
  587. package/toolbar/toolbar.cjs.js +3 -3
  588. package/toolbar/toolbar.cjs.min.js +1 -1
  589. package/toolbar/toolbar.esm.js +5 -5
  590. package/toolbar/toolbar.esm.min.js +1 -1
  591. package/toolbar/toolbar.js +4 -4
  592. package/toolbar/toolbar.min.js +1 -1
  593. package/tooltip/tooltip.esm.js +1 -1
  594. package/tooltip/tooltip.esm.min.js +1 -1
  595. package/tooltip/tooltip.js +1 -1
  596. package/tree/TreeNode.vue +1 -4
  597. package/tree/tree.cjs.js +57 -45
  598. package/tree/tree.cjs.min.js +1 -1
  599. package/tree/tree.esm.js +58 -46
  600. package/tree/tree.esm.min.js +1 -1
  601. package/tree/tree.js +58 -46
  602. package/tree/tree.min.js +1 -1
  603. package/treeselect/treeselect.cjs.js +38 -35
  604. package/treeselect/treeselect.cjs.min.js +1 -1
  605. package/treeselect/treeselect.esm.js +37 -34
  606. package/treeselect/treeselect.esm.min.js +1 -1
  607. package/treeselect/treeselect.js +39 -36
  608. package/treeselect/treeselect.min.js +1 -1
  609. package/treetable/TreeTable.d.ts +1 -1
  610. package/treetable/treetable.cjs.js +97 -88
  611. package/treetable/treetable.cjs.min.js +1 -1
  612. package/treetable/treetable.esm.js +97 -88
  613. package/treetable/treetable.esm.min.js +1 -1
  614. package/treetable/treetable.js +98 -89
  615. package/treetable/treetable.min.js +1 -1
  616. package/tristatecheckbox/tristatecheckbox.cjs.js +16 -14
  617. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  618. package/tristatecheckbox/tristatecheckbox.esm.js +18 -16
  619. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  620. package/tristatecheckbox/tristatecheckbox.js +17 -15
  621. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  622. package/useconfirm/useconfirm.js +1 -1
  623. package/usetoast/usetoast.js +1 -1
  624. package/utils/utils.js +1 -1
  625. package/vetur-attributes.json +18 -2
  626. package/vetur-tags.json +4 -0
  627. package/virtualscroller/virtualscroller.cjs.js +15 -15
  628. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  629. package/virtualscroller/virtualscroller.esm.js +17 -17
  630. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  631. package/virtualscroller/virtualscroller.js +16 -16
  632. package/virtualscroller/virtualscroller.min.js +1 -1
  633. package/web-types.json +50 -3
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/utils"),t=require("primevue/ripple"),n=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.DomHandler.hasClass(t.target,"p-tree-toggler")||e.DomHandler.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,o=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(o=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],o||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.DomHandler.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",{"pi-chevron-down":this.expanded,"pi-chevron-right":!this.expanded}]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:l(t).default}};const i={key:0,class:"p-checkbox p-component"},s={class:"p-treenode-label"},c={key:0,class:"p-treenode-children",role:"group"};o.render=function(e,t,l,o,d,r){const a=n.resolveComponent("TreeNode",!0),h=n.resolveDirective("ripple");return n.openBlock(),n.createBlock("li",{class:r.containerClass},[n.createVNode("div",{class:r.contentClass,tabindex:"0",role:"treeitem","aria-expanded":r.expanded,onClick:t[2]||(t[2]=(...e)=>r.onClick&&r.onClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onKeyDown&&r.onKeyDown(...e)),onTouchend:t[4]||(t[4]=(...e)=>r.onTouchEnd&&r.onTouchEnd(...e)),style:l.node.style},[n.withDirectives(n.createVNode("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[1]||(t[1]=(...e)=>r.toggle&&r.toggle(...e)),tabindex:"-1"},[n.createVNode("span",{class:r.toggleIcon},null,2)],512),[[h]]),r.checkboxMode?(n.openBlock(),n.createBlock("div",i,[n.createVNode("div",{class:r.checkboxClass,role:"checkbox","aria-checked":r.checked},[n.createVNode("span",{class:r.checkboxIcon},null,2)],10,["aria-checked"])])):n.createCommentVNode("",!0),n.createVNode("span",{class:r.icon},null,2),n.createVNode("span",s,[l.templates[l.node.type]||l.templates.default?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.templates[l.node.type]||l.templates.default),{key:0,node:l.node},null,8,["node"])):(n.openBlock(),n.createBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.label(l.node)),1)],64))])],46,["aria-expanded"]),r.hasChildren&&r.expanded?(n.openBlock(),n.createBlock("ul",c,[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(l.node.children,(e=>(n.openBlock(),n.createBlock(a,{key:e.key,node:e,templates:l.templates,expandedKeys:l.expandedKeys,onNodeToggle:r.onChildNodeToggle,onNodeClick:r.onChildNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:r.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):n.createCommentVNode("",!0)],2)};var d={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let o;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?o={}:(o={...this.selectionKeys},delete o[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?o={}:this.isMultipleSelectionMode()&&(o=l&&this.selectionKeys?{...this.selectionKeys}:{}),o[n.key]=!0,this.$emit("node-select",n)),o},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let o of l){let l={...o};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(t,{searchFields:n,filterText:l,strict:o}){let i=!1;for(let o of n){String(e.ObjectUtils.resolveFieldData(t,o)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(i=!0)}return(!i||o&&!this.isNodeLeaf(t))&&(i=this.findFilteredNodes(t,{searchFields:n,filterText:l,strict:o})||i),i}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let o of this.value){let i={...o},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(i,s)||this.isFilterMatched(i,s))||!l&&(this.isFilterMatched(i,s)||this.findFilteredNodes(i,s)))&&e.push(i)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:o}};const r={key:0,class:"p-tree-loading-overlay p-component-overlay"},a={key:1,class:"p-tree-filter-container"},h=n.createVNode("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),p={class:"p-tree-container",role:"tree"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),d.render=function(e,t,l,o,i,s){const c=n.resolveComponent("TreeNode");return n.openBlock(),n.createBlock("div",{class:s.containerClass},[l.loading?(n.openBlock(),n.createBlock("div",r,[n.createVNode("i",{class:s.loadingIconClass},null,2)])):n.createCommentVNode("",!0),l.filter?(n.openBlock(),n.createBlock("div",a,[n.withDirectives(n.createVNode("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onKeydown:t[1]||(t[1]=(...e)=>s.onFilterKeydown&&s.onFilterKeydown(...e)),"onUpdate:modelValue":t[2]||(t[2]=e=>i.filterValue=e)},null,40,["placeholder"]),[[n.vModelText,i.filterValue]]),h])):n.createCommentVNode("",!0),n.createVNode("div",{class:"p-tree-wrapper",style:{maxHeight:l.scrollHeight}},[n.createVNode("ul",p,[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(s.valueToRender,(t=>(n.openBlock(),n.createBlock(c,{key:t.key,node:t,templates:e.$slots,expandedKeys:i.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)},module.exports=d;
1
+ "use strict";var e=require("primevue/utils"),t=require("primevue/ripple"),n=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.DomHandler.hasClass(t.target,"p-tree-toggler")||e.DomHandler.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,o=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(o=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],o||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.DomHandler.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",this.expanded?this.node.expandedIcon||"pi-chevron-down":this.node.collapsedIcon||"pi-chevron-right"]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:l(t).default}};const i=["aria-expanded"],s={key:0,class:"p-checkbox p-component"},c=["aria-checked"],d={class:"p-treenode-label"},r={key:0,class:"p-treenode-children",role:"group"};o.render=function(e,t,l,o,a,h){const p=n.resolveComponent("TreeNode",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("li",{class:n.normalizeClass(h.containerClass)},[n.createElementVNode("div",{class:n.normalizeClass(h.contentClass),tabindex:"0",role:"treeitem","aria-expanded":h.expanded,onClick:t[1]||(t[1]=(...e)=>h.onClick&&h.onClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>h.onKeyDown&&h.onKeyDown(...e)),onTouchend:t[3]||(t[3]=(...e)=>h.onTouchEnd&&h.onTouchEnd(...e)),style:n.normalizeStyle(l.node.style)},[n.withDirectives((n.openBlock(),n.createElementBlock("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[0]||(t[0]=(...e)=>h.toggle&&h.toggle(...e)),tabindex:"-1"},[n.createElementVNode("span",{class:n.normalizeClass(h.toggleIcon)},null,2)])),[[u]]),h.checkboxMode?(n.openBlock(),n.createElementBlock("div",s,[n.createElementVNode("div",{class:n.normalizeClass(h.checkboxClass),role:"checkbox","aria-checked":h.checked},[n.createElementVNode("span",{class:n.normalizeClass(h.checkboxIcon)},null,2)],10,c)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(h.icon)},null,2),n.createElementVNode("span",d,[l.templates[l.node.type]||l.templates.default?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.templates[l.node.type]||l.templates.default),{key:0,node:l.node},null,8,["node"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(h.label(l.node)),1)],64))])],46,i),h.hasChildren&&h.expanded?(n.openBlock(),n.createElementBlock("ul",r,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.node.children,(e=>(n.openBlock(),n.createBlock(p,{key:e.key,node:e,templates:l.templates,expandedKeys:l.expandedKeys,onNodeToggle:h.onChildNodeToggle,onNodeClick:h.onChildNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:h.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):n.createCommentVNode("",!0)],2)};var a={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let o;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?o={}:(o={...this.selectionKeys},delete o[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?o={}:this.isMultipleSelectionMode()&&(o=l&&this.selectionKeys?{...this.selectionKeys}:{}),o[n.key]=!0,this.$emit("node-select",n)),o},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let o of l){let l={...o};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(t,{searchFields:n,filterText:l,strict:o}){let i=!1;for(let o of n){String(e.ObjectUtils.resolveFieldData(t,o)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(i=!0)}return(!i||o&&!this.isNodeLeaf(t))&&(i=this.findFilteredNodes(t,{searchFields:n,filterText:l,strict:o})||i),i}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let o of this.value){let i={...o},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(i,s)||this.isFilterMatched(i,s))||!l&&(this.isFilterMatched(i,s)||this.findFilteredNodes(i,s)))&&e.push(i)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:o}};const h={key:0,class:"p-tree-loading-overlay p-component-overlay"},p={key:1,class:"p-tree-filter-container"},u=["placeholder"],y=n.createElementVNode("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),k={class:"p-tree-container",role:"tree"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),a.render=function(e,t,l,o,i,s){const c=n.resolveComponent("TreeNode");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[l.loading?(n.openBlock(),n.createElementBlock("div",h,[n.createElementVNode("i",{class:n.normalizeClass(s.loadingIconClass)},null,2)])):n.createCommentVNode("",!0),l.filter?(n.openBlock(),n.createElementBlock("div",p,[n.withDirectives(n.createElementVNode("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onKeydown:t[0]||(t[0]=(...e)=>s.onFilterKeydown&&s.onFilterKeydown(...e)),"onUpdate:modelValue":t[1]||(t[1]=e=>i.filterValue=e)},null,40,u),[[n.vModelText,i.filterValue]]),y])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"p-tree-wrapper",style:n.normalizeStyle({maxHeight:l.scrollHeight})},[n.createElementVNode("ul",k,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.valueToRender,(t=>(n.openBlock(),n.createBlock(c,{key:t.key,node:t,templates:e.$slots,expandedKeys:i.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)},module.exports=a;
package/tree/tree.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DomHandler, ObjectUtils } from 'primevue/utils';
2
2
  import Ripple from 'primevue/ripple';
3
- import { resolveComponent, resolveDirective, openBlock, createBlock, createVNode, withDirectives, createCommentVNode, resolveDynamicComponent, Fragment, createTextVNode, toDisplayString, renderList, vModelText } from 'vue';
3
+ import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, withDirectives, createCommentVNode, createBlock, resolveDynamicComponent, Fragment, createTextVNode, toDisplayString, renderList, vModelText } from 'vue';
4
4
 
5
5
  var script$1 = {
6
6
  name: 'TreeNode',
@@ -242,10 +242,7 @@ var script$1 = {
242
242
  return ['p-treenode-icon', this.node.icon];
243
243
  },
244
244
  toggleIcon() {
245
- return ['p-tree-toggler-icon pi pi-fw', {
246
- 'pi-chevron-down': this.expanded,
247
- 'pi-chevron-right': !this.expanded
248
- }];
245
+ return ['p-tree-toggler-icon pi pi-fw', this.expanded ? this.node.expandedIcon || 'pi-chevron-down' : this.node.collapsedIcon || 'pi-chevron-right'];
249
246
  },
250
247
  checkboxClass() {
251
248
  return ['p-checkbox-box', {'p-highlight': this.checked, 'p-indeterminate': this.partialChecked}];
@@ -268,12 +265,14 @@ var script$1 = {
268
265
  }
269
266
  };
270
267
 
271
- const _hoisted_1$1 = {
268
+ const _hoisted_1$1 = ["aria-expanded"];
269
+ const _hoisted_2$1 = {
272
270
  key: 0,
273
271
  class: "p-checkbox p-component"
274
272
  };
275
- const _hoisted_2$1 = { class: "p-treenode-label" };
276
- const _hoisted_3$1 = {
273
+ const _hoisted_3$1 = ["aria-checked"];
274
+ const _hoisted_4$1 = { class: "p-treenode-label" };
275
+ const _hoisted_5$1 = {
277
276
  key: 0,
278
277
  class: "p-treenode-children",
279
278
  role: "group"
@@ -283,53 +282,61 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
283
282
  const _component_TreeNode = resolveComponent("TreeNode", true);
284
283
  const _directive_ripple = resolveDirective("ripple");
285
284
 
286
- return (openBlock(), createBlock("li", { class: $options.containerClass }, [
287
- createVNode("div", {
288
- class: $options.contentClass,
285
+ return (openBlock(), createElementBlock("li", {
286
+ class: normalizeClass($options.containerClass)
287
+ }, [
288
+ createElementVNode("div", {
289
+ class: normalizeClass($options.contentClass),
289
290
  tabindex: "0",
290
291
  role: "treeitem",
291
292
  "aria-expanded": $options.expanded,
292
- onClick: _cache[2] || (_cache[2] = (...args) => ($options.onClick && $options.onClick(...args))),
293
- onKeydown: _cache[3] || (_cache[3] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
294
- onTouchend: _cache[4] || (_cache[4] = (...args) => ($options.onTouchEnd && $options.onTouchEnd(...args))),
295
- style: $props.node.style
293
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.onClick && $options.onClick(...args))),
294
+ onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
295
+ onTouchend: _cache[3] || (_cache[3] = (...args) => ($options.onTouchEnd && $options.onTouchEnd(...args))),
296
+ style: normalizeStyle($props.node.style)
296
297
  }, [
297
- withDirectives(createVNode("button", {
298
+ withDirectives((openBlock(), createElementBlock("button", {
298
299
  type: "button",
299
300
  class: "p-tree-toggler p-link",
300
- onClick: _cache[1] || (_cache[1] = (...args) => ($options.toggle && $options.toggle(...args))),
301
+ onClick: _cache[0] || (_cache[0] = (...args) => ($options.toggle && $options.toggle(...args))),
301
302
  tabindex: "-1"
302
303
  }, [
303
- createVNode("span", { class: $options.toggleIcon }, null, 2)
304
- ], 512), [
304
+ createElementVNode("span", {
305
+ class: normalizeClass($options.toggleIcon)
306
+ }, null, 2)
307
+ ])), [
305
308
  [_directive_ripple]
306
309
  ]),
307
310
  ($options.checkboxMode)
308
- ? (openBlock(), createBlock("div", _hoisted_1$1, [
309
- createVNode("div", {
310
- class: $options.checkboxClass,
311
+ ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
312
+ createElementVNode("div", {
313
+ class: normalizeClass($options.checkboxClass),
311
314
  role: "checkbox",
312
315
  "aria-checked": $options.checked
313
316
  }, [
314
- createVNode("span", { class: $options.checkboxIcon }, null, 2)
315
- ], 10, ["aria-checked"])
317
+ createElementVNode("span", {
318
+ class: normalizeClass($options.checkboxIcon)
319
+ }, null, 2)
320
+ ], 10, _hoisted_3$1)
316
321
  ]))
317
322
  : createCommentVNode("", true),
318
- createVNode("span", { class: $options.icon }, null, 2),
319
- createVNode("span", _hoisted_2$1, [
323
+ createElementVNode("span", {
324
+ class: normalizeClass($options.icon)
325
+ }, null, 2),
326
+ createElementVNode("span", _hoisted_4$1, [
320
327
  ($props.templates[$props.node.type]||$props.templates['default'])
321
328
  ? (openBlock(), createBlock(resolveDynamicComponent($props.templates[$props.node.type]||$props.templates['default']), {
322
329
  key: 0,
323
330
  node: $props.node
324
331
  }, null, 8, ["node"]))
325
- : (openBlock(), createBlock(Fragment, { key: 1 }, [
332
+ : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
326
333
  createTextVNode(toDisplayString($options.label($props.node)), 1)
327
334
  ], 64))
328
335
  ])
329
- ], 46, ["aria-expanded"]),
336
+ ], 46, _hoisted_1$1),
330
337
  ($options.hasChildren && $options.expanded)
331
- ? (openBlock(), createBlock("ul", _hoisted_3$1, [
332
- (openBlock(true), createBlock(Fragment, null, renderList($props.node.children, (childNode) => {
338
+ ? (openBlock(), createElementBlock("ul", _hoisted_5$1, [
339
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.node.children, (childNode) => {
333
340
  return (openBlock(), createBlock(_component_TreeNode, {
334
341
  key: childNode.key,
335
342
  node: childNode,
@@ -619,8 +626,9 @@ const _hoisted_2 = {
619
626
  key: 1,
620
627
  class: "p-tree-filter-container"
621
628
  };
622
- const _hoisted_3 = /*#__PURE__*/createVNode("span", { class: "p-tree-filter-icon pi pi-search" }, null, -1);
623
- const _hoisted_4 = {
629
+ const _hoisted_3 = ["placeholder"];
630
+ const _hoisted_4 = /*#__PURE__*/createElementVNode("span", { class: "p-tree-filter-icon pi pi-search" }, null, -1);
631
+ const _hoisted_5 = {
624
632
  class: "p-tree-container",
625
633
  role: "tree"
626
634
  };
@@ -628,33 +636,37 @@ const _hoisted_4 = {
628
636
  function render(_ctx, _cache, $props, $setup, $data, $options) {
629
637
  const _component_TreeNode = resolveComponent("TreeNode");
630
638
 
631
- return (openBlock(), createBlock("div", { class: $options.containerClass }, [
639
+ return (openBlock(), createElementBlock("div", {
640
+ class: normalizeClass($options.containerClass)
641
+ }, [
632
642
  ($props.loading)
633
- ? (openBlock(), createBlock("div", _hoisted_1, [
634
- createVNode("i", { class: $options.loadingIconClass }, null, 2)
643
+ ? (openBlock(), createElementBlock("div", _hoisted_1, [
644
+ createElementVNode("i", {
645
+ class: normalizeClass($options.loadingIconClass)
646
+ }, null, 2)
635
647
  ]))
636
648
  : createCommentVNode("", true),
637
649
  ($props.filter)
638
- ? (openBlock(), createBlock("div", _hoisted_2, [
639
- withDirectives(createVNode("input", {
650
+ ? (openBlock(), createElementBlock("div", _hoisted_2, [
651
+ withDirectives(createElementVNode("input", {
640
652
  type: "text",
641
653
  autocomplete: "off",
642
654
  class: "p-tree-filter p-inputtext p-component",
643
655
  placeholder: $props.filterPlaceholder,
644
- onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onFilterKeydown && $options.onFilterKeydown(...args))),
645
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ($data.filterValue = $event))
646
- }, null, 40, ["placeholder"]), [
656
+ onKeydown: _cache[0] || (_cache[0] = (...args) => ($options.onFilterKeydown && $options.onFilterKeydown(...args))),
657
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.filterValue) = $event))
658
+ }, null, 40, _hoisted_3), [
647
659
  [vModelText, $data.filterValue]
648
660
  ]),
649
- _hoisted_3
661
+ _hoisted_4
650
662
  ]))
651
663
  : createCommentVNode("", true),
652
- createVNode("div", {
664
+ createElementVNode("div", {
653
665
  class: "p-tree-wrapper",
654
- style: {maxHeight: $props.scrollHeight}
666
+ style: normalizeStyle({maxHeight: $props.scrollHeight})
655
667
  }, [
656
- createVNode("ul", _hoisted_4, [
657
- (openBlock(true), createBlock(Fragment, null, renderList($options.valueToRender, (node) => {
668
+ createElementVNode("ul", _hoisted_5, [
669
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.valueToRender, (node) => {
658
670
  return (openBlock(), createBlock(_component_TreeNode, {
659
671
  key: node.key,
660
672
  node: node,
@@ -704,4 +716,4 @@ styleInject(css_248z);
704
716
 
705
717
  script.render = render;
706
718
 
707
- export default script;
719
+ export { script as default };
@@ -1 +1 @@
1
- import{DomHandler as e,ObjectUtils as t}from"primevue/utils";import n from"primevue/ripple";import{resolveComponent as l,resolveDirective as i,openBlock as o,createBlock as s,createVNode as d,withDirectives as c,createCommentVNode as r,resolveDynamicComponent as a,Fragment as h,createTextVNode as p,toDisplayString as u,renderList as y,vModelText as f}from"vue";var g={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.hasClass(t.target,"p-tree-toggler")||e.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,i=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(i=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],i||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",{"pi-chevron-down":this.expanded,"pi-chevron-right":!this.expanded}]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:n}};const k={key:0,class:"p-checkbox p-component"},x={class:"p-treenode-label"},m={key:0,class:"p-treenode-children",role:"group"};g.render=function(e,t,n,f,g,b){const K=l("TreeNode",!0),C=i("ripple");return o(),s("li",{class:b.containerClass},[d("div",{class:b.contentClass,tabindex:"0",role:"treeitem","aria-expanded":b.expanded,onClick:t[2]||(t[2]=(...e)=>b.onClick&&b.onClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>b.onKeyDown&&b.onKeyDown(...e)),onTouchend:t[4]||(t[4]=(...e)=>b.onTouchEnd&&b.onTouchEnd(...e)),style:n.node.style},[c(d("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[1]||(t[1]=(...e)=>b.toggle&&b.toggle(...e)),tabindex:"-1"},[d("span",{class:b.toggleIcon},null,2)],512),[[C]]),b.checkboxMode?(o(),s("div",k,[d("div",{class:b.checkboxClass,role:"checkbox","aria-checked":b.checked},[d("span",{class:b.checkboxIcon},null,2)],10,["aria-checked"])])):r("",!0),d("span",{class:b.icon},null,2),d("span",x,[n.templates[n.node.type]||n.templates.default?(o(),s(a(n.templates[n.node.type]||n.templates.default),{key:0,node:n.node},null,8,["node"])):(o(),s(h,{key:1},[p(u(b.label(n.node)),1)],64))])],46,["aria-expanded"]),b.hasChildren&&b.expanded?(o(),s("ul",m,[(o(!0),s(h,null,y(n.node.children,(e=>(o(),s(K,{key:e.key,node:e,templates:n.templates,expandedKeys:n.expandedKeys,onNodeToggle:b.onChildNodeToggle,onNodeClick:b.onChildNodeClick,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onCheckboxChange:b.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):r("",!0)],2)};var b={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let i;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?i={}:(i={...this.selectionKeys},delete i[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?i={}:this.isMultipleSelectionMode()&&(i=l&&this.selectionKeys?{...this.selectionKeys}:{}),i[n.key]=!0,this.$emit("node-select",n)),i},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let i of l){let l={...i};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(e,{searchFields:n,filterText:l,strict:i}){let o=!1;for(let i of n){String(t.resolveFieldData(e,i)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(o=!0)}return(!o||i&&!this.isNodeLeaf(e))&&(o=this.findFilteredNodes(e,{searchFields:n,filterText:l,strict:i})||o),o}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let i of this.value){let o={...i},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(o,s)||this.isFilterMatched(o,s))||!l&&(this.isFilterMatched(o,s)||this.findFilteredNodes(o,s)))&&e.push(o)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:g}};const K={key:0,class:"p-tree-loading-overlay p-component-overlay"},C={key:1,class:"p-tree-filter-container"},v=d("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),N={class:"p-tree-container",role:"tree"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),b.render=function(e,t,n,i,a,p){const u=l("TreeNode");return o(),s("div",{class:p.containerClass},[n.loading?(o(),s("div",K,[d("i",{class:p.loadingIconClass},null,2)])):r("",!0),n.filter?(o(),s("div",C,[c(d("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:n.filterPlaceholder,onKeydown:t[1]||(t[1]=(...e)=>p.onFilterKeydown&&p.onFilterKeydown(...e)),"onUpdate:modelValue":t[2]||(t[2]=e=>a.filterValue=e)},null,40,["placeholder"]),[[f,a.filterValue]]),v])):r("",!0),d("div",{class:"p-tree-wrapper",style:{maxHeight:n.scrollHeight}},[d("ul",N,[(o(!0),s(h,null,y(p.valueToRender,(t=>(o(),s(u,{key:t.key,node:t,templates:e.$slots,expandedKeys:a.d_expandedKeys,onNodeToggle:p.onNodeToggle,onNodeClick:p.onNodeClick,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onCheckboxChange:p.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)};export default b;
1
+ import{DomHandler as e,ObjectUtils as t}from"primevue/utils";import n from"primevue/ripple";import{resolveComponent as l,resolveDirective as i,openBlock as o,createElementBlock as s,normalizeClass as d,createElementVNode as c,normalizeStyle as r,withDirectives as a,createCommentVNode as h,createBlock as p,resolveDynamicComponent as u,Fragment as y,createTextVNode as f,toDisplayString as g,renderList as k,vModelText as x}from"vue";var m={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.hasClass(t.target,"p-tree-toggler")||e.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,i=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(i=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],i||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",this.expanded?this.node.expandedIcon||"pi-chevron-down":this.node.collapsedIcon||"pi-chevron-right"]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:n}};const b=["aria-expanded"],K={key:0,class:"p-checkbox p-component"},C=["aria-checked"],v={class:"p-treenode-label"},N={key:0,class:"p-treenode-children",role:"group"};m.render=function(e,t,n,x,m,w){const M=l("TreeNode",!0),S=i("ripple");return o(),s("li",{class:d(w.containerClass)},[c("div",{class:d(w.contentClass),tabindex:"0",role:"treeitem","aria-expanded":w.expanded,onClick:t[1]||(t[1]=(...e)=>w.onClick&&w.onClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>w.onKeyDown&&w.onKeyDown(...e)),onTouchend:t[3]||(t[3]=(...e)=>w.onTouchEnd&&w.onTouchEnd(...e)),style:r(n.node.style)},[a((o(),s("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[0]||(t[0]=(...e)=>w.toggle&&w.toggle(...e)),tabindex:"-1"},[c("span",{class:d(w.toggleIcon)},null,2)])),[[S]]),w.checkboxMode?(o(),s("div",K,[c("div",{class:d(w.checkboxClass),role:"checkbox","aria-checked":w.checked},[c("span",{class:d(w.checkboxIcon)},null,2)],10,C)])):h("",!0),c("span",{class:d(w.icon)},null,2),c("span",v,[n.templates[n.node.type]||n.templates.default?(o(),p(u(n.templates[n.node.type]||n.templates.default),{key:0,node:n.node},null,8,["node"])):(o(),s(y,{key:1},[f(g(w.label(n.node)),1)],64))])],46,b),w.hasChildren&&w.expanded?(o(),s("ul",N,[(o(!0),s(y,null,k(n.node.children,(e=>(o(),p(M,{key:e.key,node:e,templates:n.templates,expandedKeys:n.expandedKeys,onNodeToggle:w.onChildNodeToggle,onNodeClick:w.onChildNodeClick,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onCheckboxChange:w.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):h("",!0)],2)};var w={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let i;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?i={}:(i={...this.selectionKeys},delete i[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?i={}:this.isMultipleSelectionMode()&&(i=l&&this.selectionKeys?{...this.selectionKeys}:{}),i[n.key]=!0,this.$emit("node-select",n)),i},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let i of l){let l={...i};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(e,{searchFields:n,filterText:l,strict:i}){let o=!1;for(let i of n){String(t.resolveFieldData(e,i)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(o=!0)}return(!o||i&&!this.isNodeLeaf(e))&&(o=this.findFilteredNodes(e,{searchFields:n,filterText:l,strict:i})||o),o}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let i of this.value){let o={...i},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(o,s)||this.isFilterMatched(o,s))||!l&&(this.isFilterMatched(o,s)||this.findFilteredNodes(o,s)))&&e.push(o)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:m}};const M={key:0,class:"p-tree-loading-overlay p-component-overlay"},S={key:1,class:"p-tree-filter-container"},T=["placeholder"],$=c("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),E={class:"p-tree-container",role:"tree"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),w.render=function(e,t,n,i,u,f){const g=l("TreeNode");return o(),s("div",{class:d(f.containerClass)},[n.loading?(o(),s("div",M,[c("i",{class:d(f.loadingIconClass)},null,2)])):h("",!0),n.filter?(o(),s("div",S,[a(c("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:n.filterPlaceholder,onKeydown:t[0]||(t[0]=(...e)=>f.onFilterKeydown&&f.onFilterKeydown(...e)),"onUpdate:modelValue":t[1]||(t[1]=e=>u.filterValue=e)},null,40,T),[[x,u.filterValue]]),$])):h("",!0),c("div",{class:"p-tree-wrapper",style:r({maxHeight:n.scrollHeight})},[c("ul",E,[(o(!0),s(y,null,k(f.valueToRender,(t=>(o(),p(g,{key:t.key,node:t,templates:e.$slots,expandedKeys:u.d_expandedKeys,onNodeToggle:f.onNodeToggle,onNodeClick:f.onNodeClick,selectionMode:n.selectionMode,selectionKeys:n.selectionKeys,onCheckboxChange:f.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)};export{w as default};
package/tree/tree.js CHANGED
@@ -246,10 +246,7 @@ this.primevue.tree = (function (utils, Ripple, vue) {
246
246
  return ['p-treenode-icon', this.node.icon];
247
247
  },
248
248
  toggleIcon() {
249
- return ['p-tree-toggler-icon pi pi-fw', {
250
- 'pi-chevron-down': this.expanded,
251
- 'pi-chevron-right': !this.expanded
252
- }];
249
+ return ['p-tree-toggler-icon pi pi-fw', this.expanded ? this.node.expandedIcon || 'pi-chevron-down' : this.node.collapsedIcon || 'pi-chevron-right'];
253
250
  },
254
251
  checkboxClass() {
255
252
  return ['p-checkbox-box', {'p-highlight': this.checked, 'p-indeterminate': this.partialChecked}];
@@ -268,16 +265,18 @@ this.primevue.tree = (function (utils, Ripple, vue) {
268
265
  }
269
266
  },
270
267
  directives: {
271
- 'ripple': Ripple__default['default']
268
+ 'ripple': Ripple__default["default"]
272
269
  }
273
270
  };
274
271
 
275
- const _hoisted_1$1 = {
272
+ const _hoisted_1$1 = ["aria-expanded"];
273
+ const _hoisted_2$1 = {
276
274
  key: 0,
277
275
  class: "p-checkbox p-component"
278
276
  };
279
- const _hoisted_2$1 = { class: "p-treenode-label" };
280
- const _hoisted_3$1 = {
277
+ const _hoisted_3$1 = ["aria-checked"];
278
+ const _hoisted_4$1 = { class: "p-treenode-label" };
279
+ const _hoisted_5$1 = {
281
280
  key: 0,
282
281
  class: "p-treenode-children",
283
282
  role: "group"
@@ -287,53 +286,61 @@ this.primevue.tree = (function (utils, Ripple, vue) {
287
286
  const _component_TreeNode = vue.resolveComponent("TreeNode", true);
288
287
  const _directive_ripple = vue.resolveDirective("ripple");
289
288
 
290
- return (vue.openBlock(), vue.createBlock("li", { class: $options.containerClass }, [
291
- vue.createVNode("div", {
292
- class: $options.contentClass,
289
+ return (vue.openBlock(), vue.createElementBlock("li", {
290
+ class: vue.normalizeClass($options.containerClass)
291
+ }, [
292
+ vue.createElementVNode("div", {
293
+ class: vue.normalizeClass($options.contentClass),
293
294
  tabindex: "0",
294
295
  role: "treeitem",
295
296
  "aria-expanded": $options.expanded,
296
- onClick: _cache[2] || (_cache[2] = (...args) => ($options.onClick && $options.onClick(...args))),
297
- onKeydown: _cache[3] || (_cache[3] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
298
- onTouchend: _cache[4] || (_cache[4] = (...args) => ($options.onTouchEnd && $options.onTouchEnd(...args))),
299
- style: $props.node.style
297
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.onClick && $options.onClick(...args))),
298
+ onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),
299
+ onTouchend: _cache[3] || (_cache[3] = (...args) => ($options.onTouchEnd && $options.onTouchEnd(...args))),
300
+ style: vue.normalizeStyle($props.node.style)
300
301
  }, [
301
- vue.withDirectives(vue.createVNode("button", {
302
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("button", {
302
303
  type: "button",
303
304
  class: "p-tree-toggler p-link",
304
- onClick: _cache[1] || (_cache[1] = (...args) => ($options.toggle && $options.toggle(...args))),
305
+ onClick: _cache[0] || (_cache[0] = (...args) => ($options.toggle && $options.toggle(...args))),
305
306
  tabindex: "-1"
306
307
  }, [
307
- vue.createVNode("span", { class: $options.toggleIcon }, null, 2)
308
- ], 512), [
308
+ vue.createElementVNode("span", {
309
+ class: vue.normalizeClass($options.toggleIcon)
310
+ }, null, 2)
311
+ ])), [
309
312
  [_directive_ripple]
310
313
  ]),
311
314
  ($options.checkboxMode)
312
- ? (vue.openBlock(), vue.createBlock("div", _hoisted_1$1, [
313
- vue.createVNode("div", {
314
- class: $options.checkboxClass,
315
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
316
+ vue.createElementVNode("div", {
317
+ class: vue.normalizeClass($options.checkboxClass),
315
318
  role: "checkbox",
316
319
  "aria-checked": $options.checked
317
320
  }, [
318
- vue.createVNode("span", { class: $options.checkboxIcon }, null, 2)
319
- ], 10, ["aria-checked"])
321
+ vue.createElementVNode("span", {
322
+ class: vue.normalizeClass($options.checkboxIcon)
323
+ }, null, 2)
324
+ ], 10, _hoisted_3$1)
320
325
  ]))
321
326
  : vue.createCommentVNode("", true),
322
- vue.createVNode("span", { class: $options.icon }, null, 2),
323
- vue.createVNode("span", _hoisted_2$1, [
327
+ vue.createElementVNode("span", {
328
+ class: vue.normalizeClass($options.icon)
329
+ }, null, 2),
330
+ vue.createElementVNode("span", _hoisted_4$1, [
324
331
  ($props.templates[$props.node.type]||$props.templates['default'])
325
332
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates[$props.node.type]||$props.templates['default']), {
326
333
  key: 0,
327
334
  node: $props.node
328
335
  }, null, 8, ["node"]))
329
- : (vue.openBlock(), vue.createBlock(vue.Fragment, { key: 1 }, [
336
+ : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
330
337
  vue.createTextVNode(vue.toDisplayString($options.label($props.node)), 1)
331
338
  ], 64))
332
339
  ])
333
- ], 46, ["aria-expanded"]),
340
+ ], 46, _hoisted_1$1),
334
341
  ($options.hasChildren && $options.expanded)
335
- ? (vue.openBlock(), vue.createBlock("ul", _hoisted_3$1, [
336
- (vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList($props.node.children, (childNode) => {
342
+ ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_5$1, [
343
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.node.children, (childNode) => {
337
344
  return (vue.openBlock(), vue.createBlock(_component_TreeNode, {
338
345
  key: childNode.key,
339
346
  node: childNode,
@@ -623,8 +630,9 @@ this.primevue.tree = (function (utils, Ripple, vue) {
623
630
  key: 1,
624
631
  class: "p-tree-filter-container"
625
632
  };
626
- const _hoisted_3 = /*#__PURE__*/vue.createVNode("span", { class: "p-tree-filter-icon pi pi-search" }, null, -1);
627
- const _hoisted_4 = {
633
+ const _hoisted_3 = ["placeholder"];
634
+ const _hoisted_4 = /*#__PURE__*/vue.createElementVNode("span", { class: "p-tree-filter-icon pi pi-search" }, null, -1);
635
+ const _hoisted_5 = {
628
636
  class: "p-tree-container",
629
637
  role: "tree"
630
638
  };
@@ -632,33 +640,37 @@ this.primevue.tree = (function (utils, Ripple, vue) {
632
640
  function render(_ctx, _cache, $props, $setup, $data, $options) {
633
641
  const _component_TreeNode = vue.resolveComponent("TreeNode");
634
642
 
635
- return (vue.openBlock(), vue.createBlock("div", { class: $options.containerClass }, [
643
+ return (vue.openBlock(), vue.createElementBlock("div", {
644
+ class: vue.normalizeClass($options.containerClass)
645
+ }, [
636
646
  ($props.loading)
637
- ? (vue.openBlock(), vue.createBlock("div", _hoisted_1, [
638
- vue.createVNode("i", { class: $options.loadingIconClass }, null, 2)
647
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
648
+ vue.createElementVNode("i", {
649
+ class: vue.normalizeClass($options.loadingIconClass)
650
+ }, null, 2)
639
651
  ]))
640
652
  : vue.createCommentVNode("", true),
641
653
  ($props.filter)
642
- ? (vue.openBlock(), vue.createBlock("div", _hoisted_2, [
643
- vue.withDirectives(vue.createVNode("input", {
654
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
655
+ vue.withDirectives(vue.createElementVNode("input", {
644
656
  type: "text",
645
657
  autocomplete: "off",
646
658
  class: "p-tree-filter p-inputtext p-component",
647
659
  placeholder: $props.filterPlaceholder,
648
- onKeydown: _cache[1] || (_cache[1] = (...args) => ($options.onFilterKeydown && $options.onFilterKeydown(...args))),
649
- "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ($data.filterValue = $event))
650
- }, null, 40, ["placeholder"]), [
660
+ onKeydown: _cache[0] || (_cache[0] = (...args) => ($options.onFilterKeydown && $options.onFilterKeydown(...args))),
661
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.filterValue) = $event))
662
+ }, null, 40, _hoisted_3), [
651
663
  [vue.vModelText, $data.filterValue]
652
664
  ]),
653
- _hoisted_3
665
+ _hoisted_4
654
666
  ]))
655
667
  : vue.createCommentVNode("", true),
656
- vue.createVNode("div", {
668
+ vue.createElementVNode("div", {
657
669
  class: "p-tree-wrapper",
658
- style: {maxHeight: $props.scrollHeight}
670
+ style: vue.normalizeStyle({maxHeight: $props.scrollHeight})
659
671
  }, [
660
- vue.createVNode("ul", _hoisted_4, [
661
- (vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList($options.valueToRender, (node) => {
672
+ vue.createElementVNode("ul", _hoisted_5, [
673
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.valueToRender, (node) => {
662
674
  return (vue.openBlock(), vue.createBlock(_component_TreeNode, {
663
675
  key: node.key,
664
676
  node: node,
@@ -710,4 +722,4 @@ this.primevue.tree = (function (utils, Ripple, vue) {
710
722
 
711
723
  return script;
712
724
 
713
- }(primevue.utils, primevue.ripple, Vue));
725
+ })(primevue.utils, primevue.ripple, Vue);
package/tree/tree.min.js CHANGED
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.tree=function(e,t,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.DomHandler.hasClass(t.target,"p-tree-toggler")||e.DomHandler.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,i=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(i=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],i||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.DomHandler.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",{"pi-chevron-down":this.expanded,"pi-chevron-right":!this.expanded}]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:l(t).default}};const o={key:0,class:"p-checkbox p-component"},s={class:"p-treenode-label"},c={key:0,class:"p-treenode-children",role:"group"};i.render=function(e,t,l,i,d,r){const a=n.resolveComponent("TreeNode",!0),h=n.resolveDirective("ripple");return n.openBlock(),n.createBlock("li",{class:r.containerClass},[n.createVNode("div",{class:r.contentClass,tabindex:"0",role:"treeitem","aria-expanded":r.expanded,onClick:t[2]||(t[2]=(...e)=>r.onClick&&r.onClick(...e)),onKeydown:t[3]||(t[3]=(...e)=>r.onKeyDown&&r.onKeyDown(...e)),onTouchend:t[4]||(t[4]=(...e)=>r.onTouchEnd&&r.onTouchEnd(...e)),style:l.node.style},[n.withDirectives(n.createVNode("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[1]||(t[1]=(...e)=>r.toggle&&r.toggle(...e)),tabindex:"-1"},[n.createVNode("span",{class:r.toggleIcon},null,2)],512),[[h]]),r.checkboxMode?(n.openBlock(),n.createBlock("div",o,[n.createVNode("div",{class:r.checkboxClass,role:"checkbox","aria-checked":r.checked},[n.createVNode("span",{class:r.checkboxIcon},null,2)],10,["aria-checked"])])):n.createCommentVNode("",!0),n.createVNode("span",{class:r.icon},null,2),n.createVNode("span",s,[l.templates[l.node.type]||l.templates.default?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.templates[l.node.type]||l.templates.default),{key:0,node:l.node},null,8,["node"])):(n.openBlock(),n.createBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.label(l.node)),1)],64))])],46,["aria-expanded"]),r.hasChildren&&r.expanded?(n.openBlock(),n.createBlock("ul",c,[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(l.node.children,(e=>(n.openBlock(),n.createBlock(a,{key:e.key,node:e,templates:l.templates,expandedKeys:l.expandedKeys,onNodeToggle:r.onChildNodeToggle,onNodeClick:r.onChildNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:r.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):n.createCommentVNode("",!0)],2)};var d={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let i;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?i={}:(i={...this.selectionKeys},delete i[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?i={}:this.isMultipleSelectionMode()&&(i=l&&this.selectionKeys?{...this.selectionKeys}:{}),i[n.key]=!0,this.$emit("node-select",n)),i},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let i of l){let l={...i};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(t,{searchFields:n,filterText:l,strict:i}){let o=!1;for(let i of n){String(e.ObjectUtils.resolveFieldData(t,i)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(o=!0)}return(!o||i&&!this.isNodeLeaf(t))&&(o=this.findFilteredNodes(t,{searchFields:n,filterText:l,strict:i})||o),o}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let i of this.value){let o={...i},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(o,s)||this.isFilterMatched(o,s))||!l&&(this.isFilterMatched(o,s)||this.findFilteredNodes(o,s)))&&e.push(o)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:i}};const r={key:0,class:"p-tree-loading-overlay p-component-overlay"},a={key:1,class:"p-tree-filter-container"},h=n.createVNode("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),p={class:"p-tree-container",role:"tree"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),d.render=function(e,t,l,i,o,s){const c=n.resolveComponent("TreeNode");return n.openBlock(),n.createBlock("div",{class:s.containerClass},[l.loading?(n.openBlock(),n.createBlock("div",r,[n.createVNode("i",{class:s.loadingIconClass},null,2)])):n.createCommentVNode("",!0),l.filter?(n.openBlock(),n.createBlock("div",a,[n.withDirectives(n.createVNode("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onKeydown:t[1]||(t[1]=(...e)=>s.onFilterKeydown&&s.onFilterKeydown(...e)),"onUpdate:modelValue":t[2]||(t[2]=e=>o.filterValue=e)},null,40,["placeholder"]),[[n.vModelText,o.filterValue]]),h])):n.createCommentVNode("",!0),n.createVNode("div",{class:"p-tree-wrapper",style:{maxHeight:l.scrollHeight}},[n.createVNode("ul",p,[(n.openBlock(!0),n.createBlock(n.Fragment,null,n.renderList(s.valueToRender,(t=>(n.openBlock(),n.createBlock(c,{key:t.key,node:t,templates:e.$slots,expandedKeys:o.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)},d}(primevue.utils,primevue.ripple,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.tree=function(e,t,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null}},nodeTouched:!1,methods:{toggle(){this.$emit("node-toggle",this.node)},label:e=>"function"==typeof e.label?e.label():e.label,onChildNodeToggle(e){this.$emit("node-toggle",e)},onClick(t){e.DomHandler.hasClass(t.target,"p-tree-toggler")||e.DomHandler.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(e){this.$emit("node-click",e)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(e){const t=e.target.parentElement;switch(e.which){case 40:var n=t.children[1];if(n)this.focusNode(n.children[0]);else{const e=t.nextElementSibling;if(e)this.focusNode(e);else{let e=this.findNextSiblingOfAncestor(t);e&&this.focusNode(e)}}e.preventDefault();break;case 38:if(t.previousElementSibling)this.focusNode(this.findLastVisibleDescendant(t.previousElementSibling));else{let e=this.getParentNodeElement(t);e&&this.focusNode(e)}e.preventDefault();break;case 37:case 39:this.$emit("node-toggle",this.node),e.preventDefault();break;case 13:this.onClick(e),e.preventDefault()}},toggleCheckbox(){let e=this.selectionKeys?{...this.selectionKeys}:{};const t=!this.checked;this.propagateDown(this.node,t,e),this.$emit("checkbox-change",{node:this.node,check:t,selectionKeys:e})},propagateDown(e,t,n){if(t?n[e.key]={checked:!0,partialChecked:!1}:delete n[e.key],e.children&&e.children.length)for(let l of e.children)this.propagateDown(l,t,n)},propagateUp(e){let t=e.check,n={...e.selectionKeys},l=0,o=!1;for(let e of this.node.children)n[e.key]&&n[e.key].checked?l++:n[e.key]&&n[e.key].partialChecked&&(o=!0);t&&l===this.node.children.length?n[this.node.key]={checked:!0,partialChecked:!1}:(t||delete n[this.node.key],o||l>0&&l!==this.node.children.length?n[this.node.key]={checked:!1,partialChecked:!0}:delete n[this.node.key]),this.$emit("checkbox-change",{node:e.node,check:e.check,selectionKeys:n})},onChildCheckboxChange(e){this.$emit("checkbox-change",e)},findNextSiblingOfAncestor(e){let t=this.getParentNodeElement(e);return t?t.nextElementSibling?t.nextElementSibling:this.findNextSiblingOfAncestor(t):null},findLastVisibleDescendant(e){const t=e.children[1];if(t){const e=t.children[t.children.length-1];return this.findLastVisibleDescendant(e)}return e},getParentNodeElement(t){const n=t.parentElement.parentElement;return e.DomHandler.hasClass(n,"p-treenode")?n:null},focusNode(e){e.children[0].focus()},isCheckboxSelectionMode(){return"checkbox"===this.selectionMode}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&!0===this.expandedKeys[this.node.key]},leaf(){return!1!==this.node.leaf&&!(this.node.children&&this.node.children.length)},selectable(){return!1!==this.node.selectable&&null!=this.selectionMode},selected(){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[this.node.key]},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",this.expanded?this.node.expandedIcon||"pi-chevron-down":this.node.collapsedIcon||"pi-chevron-right"]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return"checkbox"===this.selectionMode&&!1!==this.node.selectable},checked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked)},partialChecked(){return!!this.selectionKeys&&(this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked)}},directives:{ripple:l(t).default}};const i=["aria-expanded"],s={key:0,class:"p-checkbox p-component"},c=["aria-checked"],d={class:"p-treenode-label"},r={key:0,class:"p-treenode-children",role:"group"};o.render=function(e,t,l,o,a,h){const p=n.resolveComponent("TreeNode",!0),u=n.resolveDirective("ripple");return n.openBlock(),n.createElementBlock("li",{class:n.normalizeClass(h.containerClass)},[n.createElementVNode("div",{class:n.normalizeClass(h.contentClass),tabindex:"0",role:"treeitem","aria-expanded":h.expanded,onClick:t[1]||(t[1]=(...e)=>h.onClick&&h.onClick(...e)),onKeydown:t[2]||(t[2]=(...e)=>h.onKeyDown&&h.onKeyDown(...e)),onTouchend:t[3]||(t[3]=(...e)=>h.onTouchEnd&&h.onTouchEnd(...e)),style:n.normalizeStyle(l.node.style)},[n.withDirectives((n.openBlock(),n.createElementBlock("button",{type:"button",class:"p-tree-toggler p-link",onClick:t[0]||(t[0]=(...e)=>h.toggle&&h.toggle(...e)),tabindex:"-1"},[n.createElementVNode("span",{class:n.normalizeClass(h.toggleIcon)},null,2)])),[[u]]),h.checkboxMode?(n.openBlock(),n.createElementBlock("div",s,[n.createElementVNode("div",{class:n.normalizeClass(h.checkboxClass),role:"checkbox","aria-checked":h.checked},[n.createElementVNode("span",{class:n.normalizeClass(h.checkboxIcon)},null,2)],10,c)])):n.createCommentVNode("",!0),n.createElementVNode("span",{class:n.normalizeClass(h.icon)},null,2),n.createElementVNode("span",d,[l.templates[l.node.type]||l.templates.default?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.templates[l.node.type]||l.templates.default),{key:0,node:l.node},null,8,["node"])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(h.label(l.node)),1)],64))])],46,i),h.hasChildren&&h.expanded?(n.openBlock(),n.createElementBlock("ul",r,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.node.children,(e=>(n.openBlock(),n.createBlock(p,{key:e.key,node:e,templates:l.templates,expandedKeys:l.expandedKeys,onNodeToggle:h.onChildNodeToggle,onNodeClick:h.onChildNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:h.propagateUp},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])):n.createCommentVNode("",!0)],2)};var a={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(e){this.d_expandedKeys=e}},methods:{onNodeToggle(e){const t=e.key;this.d_expandedKeys[t]?(delete this.d_expandedKeys[t],this.$emit("node-collapse",e)):(this.d_expandedKeys[t]=!0,this.$emit("node-expand",e)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(e){if(null!=this.selectionMode&&!1!==e.node.selectable){const t=!e.nodeTouched&&this.metaKeySelection?this.handleSelectionWithMetaKey(e):this.handleSelectionWithoutMetaKey(e);this.$emit("update:selectionKeys",t)}},onCheckboxChange(e){this.$emit("update:selectionKeys",e.selectionKeys),e.check?this.$emit("node-select",e.node):this.$emit("node-unselect",e.node)},handleSelectionWithMetaKey(e){const t=e.originalEvent,n=e.node,l=t.metaKey||t.ctrlKey;let o;return this.isNodeSelected(n)&&l?(this.isSingleSelectionMode()?o={}:(o={...this.selectionKeys},delete o[n.key]),this.$emit("node-unselect",n)):(this.isSingleSelectionMode()?o={}:this.isMultipleSelectionMode()&&(o=l&&this.selectionKeys?{...this.selectionKeys}:{}),o[n.key]=!0,this.$emit("node-select",n)),o},handleSelectionWithoutMetaKey(e){const t=e.node,n=this.isNodeSelected(t);let l;return this.isSingleSelectionMode()?n?(l={},this.$emit("node-unselect",t)):(l={},l[t.key]=!0,this.$emit("node-select",t)):n?(l={...this.selectionKeys},delete l[t.key],this.$emit("node-unselect",t)):(l=this.selectionKeys?{...this.selectionKeys}:{},l[t.key]=!0,this.$emit("node-select",t)),l},isSingleSelectionMode(){return"single"===this.selectionMode},isMultipleSelectionMode(){return"multiple"===this.selectionMode},isNodeSelected(e){return!(!this.selectionMode||!this.selectionKeys)&&!0===this.selectionKeys[e.key]},isChecked(e){return!!this.selectionKeys&&(this.selectionKeys[e.key]&&this.selectionKeys[e.key].checked)},isNodeLeaf:e=>!1!==e.leaf&&!(e.children&&e.children.length),onFilterKeydown(e){13===e.which&&e.preventDefault()},findFilteredNodes(e,t){if(e){let n=!1;if(e.children){let l=[...e.children];e.children=[];for(let o of l){let l={...o};this.isFilterMatched(l,t)&&(n=!0,e.children.push(l))}}if(n)return!0}},isFilterMatched(t,{searchFields:n,filterText:l,strict:o}){let i=!1;for(let o of n){String(e.ObjectUtils.resolveFieldData(t,o)).toLocaleLowerCase(this.filterLocale).indexOf(l)>-1&&(i=!0)}return(!i||o&&!this.isNodeLeaf(t))&&(i=this.findFilteredNodes(t,{searchFields:n,filterText:l,strict:o})||i),i}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":null!=this.selectionMode,"p-tree-loading":this.loading,"p-tree-flex-scrollable":"flex"===this.scrollHeight}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let e=[];const t=this.filterBy.split(","),n=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),l="strict"===this.filterMode;for(let o of this.value){let i={...o},s={searchFields:t,filterText:n,strict:l};(l&&(this.findFilteredNodes(i,s)||this.isFilterMatched(i,s))||!l&&(this.isFilterMatched(i,s)||this.findFilteredNodes(i,s)))&&e.push(i)}return e},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:o}};const h={key:0,class:"p-tree-loading-overlay p-component-overlay"},p={key:1,class:"p-tree-filter-container"},u=["placeholder"],y=n.createElementVNode("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),k={class:"p-tree-container",role:"tree"};return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-tree-container {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow: auto;\n}\n.p-treenode-children {\n margin: 0;\n padding: 0;\n list-style-type: none;\n}\n.p-tree-wrapper {\n overflow: auto;\n}\n.p-treenode-selectable {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.p-tree-toggler {\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n.p-treenode-leaf > .p-treenode-content .p-tree-toggler {\n visibility: hidden;\n}\n.p-treenode-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-tree-filter {\n width: 100%;\n}\n.p-tree-filter-container {\n position: relative;\n display: block;\n width: 100%;\n}\n.p-tree-filter-icon {\n position: absolute;\n top: 50%;\n margin-top: -.5rem;\n}\n.p-tree-loading {\n position: relative;\n min-height: 4rem;\n}\n.p-tree .p-tree-loading-overlay {\n position: absolute;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.p-tree-flex-scrollable {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n.p-tree-flex-scrollable .p-tree-wrapper {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n"),a.render=function(e,t,l,o,i,s){const c=n.resolveComponent("TreeNode");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.containerClass)},[l.loading?(n.openBlock(),n.createElementBlock("div",h,[n.createElementVNode("i",{class:n.normalizeClass(s.loadingIconClass)},null,2)])):n.createCommentVNode("",!0),l.filter?(n.openBlock(),n.createElementBlock("div",p,[n.withDirectives(n.createElementVNode("input",{type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:l.filterPlaceholder,onKeydown:t[0]||(t[0]=(...e)=>s.onFilterKeydown&&s.onFilterKeydown(...e)),"onUpdate:modelValue":t[1]||(t[1]=e=>i.filterValue=e)},null,40,u),[[n.vModelText,i.filterValue]]),y])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"p-tree-wrapper",style:n.normalizeStyle({maxHeight:l.scrollHeight})},[n.createElementVNode("ul",k,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.valueToRender,(t=>(n.openBlock(),n.createBlock(c,{key:t.key,node:t,templates:e.$slots,expandedKeys:i.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:l.selectionMode,selectionKeys:l.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"])))),128))])],4)],2)},a}(primevue.utils,primevue.ripple,Vue);